summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TSRM/TSRM.c27
-rw-r--r--TSRM/TSRM.h46
-rw-r--r--TSRM/config.w321
-rw-r--r--TSRM/tsrm_win32.c36
-rw-r--r--TSRM/tsrm_win32.h9
-rw-r--r--UPGRADING.INTERNALS42
-rw-r--r--Zend/Makefile.am1
-rw-r--r--Zend/zend.c263
-rw-r--r--Zend/zend.h98
-rw-r--r--Zend/zend_API.c561
-rw-r--r--Zend/zend_API.h316
-rw-r--r--Zend/zend_alloc.c68
-rw-r--r--Zend/zend_alloc.h22
-rw-r--r--Zend/zend_ast.c100
-rw-r--r--Zend/zend_ast.h6
-rw-r--r--Zend/zend_builtin_functions.c192
-rw-r--r--Zend/zend_builtin_functions.h4
-rw-r--r--Zend/zend_closures.c74
-rw-r--r--Zend/zend_closures.h10
-rw-r--r--Zend/zend_compile.c1645
-rw-r--r--Zend/zend_compile.h142
-rw-r--r--Zend/zend_constants.c82
-rw-r--r--Zend/zend_constants.h68
-rw-r--r--Zend/zend_default_classes.c12
-rw-r--r--Zend/zend_dtrace.c28
-rw-r--r--Zend/zend_dtrace.h12
-rw-r--r--Zend/zend_exceptions.c150
-rw-r--r--Zend/zend_exceptions.h30
-rw-r--r--Zend/zend_execute.c314
-rw-r--r--Zend/zend_execute.h108
-rw-r--r--Zend/zend_execute_API.c227
-rw-r--r--Zend/zend_extensions.c20
-rw-r--r--Zend/zend_extensions.h8
-rw-r--r--Zend/zend_float.c6
-rw-r--r--Zend/zend_float.h6
-rw-r--r--Zend/zend_gc.c98
-rw-r--r--Zend/zend_gc.h24
-rw-r--r--Zend/zend_generators.c128
-rw-r--r--Zend/zend_generators.h8
-rw-r--r--Zend/zend_globals_macros.h11
-rw-r--r--Zend/zend_hash.c49
-rw-r--r--Zend/zend_hash.h24
-rw-r--r--Zend/zend_highlight.c18
-rw-r--r--Zend/zend_highlight.h10
-rw-r--r--Zend/zend_indent.c4
-rw-r--r--Zend/zend_indent.h2
-rw-r--r--Zend/zend_inheritance.c163
-rw-r--r--Zend/zend_inheritance.h12
-rw-r--r--Zend/zend_ini.c78
-rw-r--r--Zend/zend_ini.h35
-rw-r--r--Zend/zend_ini_parser.y51
-rw-r--r--Zend/zend_ini_scanner.c66
-rw-r--r--Zend/zend_ini_scanner.h12
-rw-r--r--Zend/zend_ini_scanner.l56
-rw-r--r--Zend/zend_interfaces.c78
-rw-r--r--Zend/zend_interfaces.h34
-rw-r--r--Zend/zend_iterators.c22
-rw-r--r--Zend/zend_iterators.h22
-rw-r--r--Zend/zend_language_parser.y15
-rw-r--r--Zend/zend_language_scanner.c240
-rw-r--r--Zend/zend_language_scanner.h10
-rw-r--r--Zend/zend_language_scanner.l224
-rw-r--r--Zend/zend_list.c72
-rw-r--r--Zend/zend_list.h44
-rw-r--r--Zend/zend_llist.c16
-rw-r--r--Zend/zend_llist.h16
-rw-r--r--Zend/zend_modules.h24
-rw-r--r--Zend/zend_multibyte.c64
-rw-r--r--Zend/zend_multibyte.h36
-rw-r--r--Zend/zend_object_handlers.c138
-rw-r--r--Zend/zend_object_handlers.h74
-rw-r--r--Zend/zend_objects.c26
-rw-r--r--Zend/zend_objects.h12
-rw-r--r--Zend/zend_objects_API.c24
-rw-r--r--Zend/zend_objects_API.h26
-rw-r--r--Zend/zend_opcode.c93
-rw-r--r--Zend/zend_operators.c252
-rw-r--r--Zend/zend_operators.h166
-rw-r--r--Zend/zend_qsort.c10
-rw-r--r--Zend/zend_qsort.h6
-rw-r--r--Zend/zend_signal.c35
-rw-r--r--Zend/zend_signal.h16
-rw-r--r--Zend/zend_stream.c50
-rw-r--r--Zend/zend_stream.h12
-rw-r--r--Zend/zend_string.c24
-rw-r--r--Zend/zend_string.h16
-rw-r--r--Zend/zend_ts_hash.c28
-rw-r--r--Zend/zend_ts_hash.h14
-rw-r--r--Zend/zend_types.h8
-rw-r--r--Zend/zend_variables.c48
-rw-r--r--Zend/zend_variables.h6
-rw-r--r--Zend/zend_virtual_cwd.c162
-rw-r--r--Zend/zend_virtual_cwd.h112
-rw-r--r--Zend/zend_vm_def.h508
-rw-r--r--Zend/zend_vm_execute.h3066
-rw-r--r--Zend/zend_vm_execute.skl12
-rw-r--r--Zend/zend_vm_gen.php50
-rw-r--r--acinclude.m42
-rw-r--r--configure.in19
-rw-r--r--ext/bcmath/bcmath.c138
-rw-r--r--ext/bcmath/config.m42
-rw-r--r--ext/bcmath/config.w322
-rw-r--r--ext/bcmath/libbcmath/src/bcmath.h24
-rw-r--r--ext/bcmath/libbcmath/src/debug.c4
-rw-r--r--ext/bcmath/libbcmath/src/div.c6
-rw-r--r--ext/bcmath/libbcmath/src/divmod.c14
-rw-r--r--ext/bcmath/libbcmath/src/init.c4
-rw-r--r--ext/bcmath/libbcmath/src/output.c32
-rw-r--r--ext/bcmath/libbcmath/src/raise.c10
-rw-r--r--ext/bcmath/libbcmath/src/raisemod.c22
-rw-r--r--ext/bcmath/libbcmath/src/recmul.c24
-rw-r--r--ext/bcmath/libbcmath/src/sqrt.c18
-rw-r--r--ext/bcmath/libbcmath/src/str2num.c2
-rw-r--r--ext/bcmath/libbcmath/src/zero.c2
-rw-r--r--ext/bcmath/php_bcmath.h5
-rw-r--r--ext/bz2/bz2.c52
-rw-r--r--ext/bz2/bz2_filter.c56
-rw-r--r--ext/bz2/php_bz2.h8
-rw-r--r--ext/calendar/cal_unix.c4
-rw-r--r--ext/calendar/calendar.c40
-rw-r--r--ext/calendar/easter.c4
-rw-r--r--ext/com_dotnet/com_com.c124
-rw-r--r--ext/com_dotnet/com_dotnet.c26
-rw-r--r--ext/com_dotnet/com_extension.c24
-rw-r--r--ext/com_dotnet/com_handlers.c104
-rw-r--r--ext/com_dotnet/com_iterator.c30
-rw-r--r--ext/com_dotnet/com_misc.c20
-rw-r--r--ext/com_dotnet/com_olechar.c8
-rw-r--r--ext/com_dotnet/com_persist.c103
-rw-r--r--ext/com_dotnet/com_saproxy.c92
-rw-r--r--ext/com_dotnet/com_typeinfo.c50
-rw-r--r--ext/com_dotnet/com_variant.c128
-rw-r--r--ext/com_dotnet/com_wrapper.c45
-rw-r--r--ext/com_dotnet/config.w323
-rw-r--r--ext/com_dotnet/php_com_dotnet.h5
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h68
-rw-r--r--ext/ctype/ctype.c2
-rw-r--r--ext/curl/curl_file.c28
-rw-r--r--ext/curl/interface.c194
-rw-r--r--ext/curl/multi.c35
-rw-r--r--ext/curl/php_curl.h9
-rw-r--r--ext/curl/share.c12
-rwxr-xr-xext/date/config.w322
-rw-r--r--ext/date/config0.m42
-rw-r--r--ext/date/php_date.c685
-rw-r--r--ext/date/php_date.h12
-rw-r--r--ext/dba/dba.c124
-rw-r--r--ext/dba/dba_cdb.c22
-rw-r--r--ext/dba/dba_db2.c2
-rw-r--r--ext/dba/dba_db3.c5
-rw-r--r--ext/dba/dba_db4.c7
-rw-r--r--ext/dba/dba_dbm.c2
-rw-r--r--ext/dba/dba_flatfile.c16
-rw-r--r--ext/dba/dba_gdbm.c4
-rw-r--r--ext/dba/dba_inifile.c20
-rw-r--r--ext/dba/dba_qdbm.c2
-rw-r--r--ext/dba/dba_tcadb.c2
-rw-r--r--ext/dba/libcdb/cdb.c32
-rw-r--r--ext/dba/libcdb/cdb.h12
-rw-r--r--ext/dba/libcdb/cdb_make.c28
-rw-r--r--ext/dba/libcdb/cdb_make.h10
-rw-r--r--ext/dba/libflatfile/flatfile.c26
-rw-r--r--ext/dba/libflatfile/flatfile.h12
-rw-r--r--ext/dba/libinifile/inifile.c100
-rw-r--r--ext/dba/libinifile/inifile.h18
-rw-r--r--ext/dba/php_dba.h44
-rw-r--r--ext/dom/attr.c44
-rw-r--r--ext/dom/cdatasection.c14
-rw-r--r--ext/dom/characterdata.c30
-rw-r--r--ext/dom/comment.c14
-rw-r--r--ext/dom/document.c278
-rw-r--r--ext/dom/documentfragment.c20
-rw-r--r--ext/dom/documenttype.c32
-rw-r--r--ext/dom/dom_iterators.c20
-rw-r--r--ext/dom/dom_properties.h196
-rw-r--r--ext/dom/domerror.c12
-rw-r--r--ext/dom/domexception.c10
-rw-r--r--ext/dom/domimplementation.c24
-rw-r--r--ext/dom/domimplementationlist.c2
-rw-r--r--ext/dom/domlocator.c10
-rw-r--r--ext/dom/domstringlist.c2
-rw-r--r--ext/dom/element.c130
-rw-r--r--ext/dom/entity.c24
-rw-r--r--ext/dom/entityreference.c16
-rw-r--r--ext/dom/namednodemap.c8
-rw-r--r--ext/dom/namelist.c2
-rw-r--r--ext/dom/node.c204
-rw-r--r--ext/dom/nodelist.c4
-rw-r--r--ext/dom/notation.c8
-rw-r--r--ext/dom/php_dom.c364
-rw-r--r--ext/dom/php_dom.h34
-rw-r--r--ext/dom/processinginstruction.c28
-rw-r--r--ext/dom/text.c24
-rw-r--r--ext/dom/typeinfo.c4
-rw-r--r--ext/dom/xml_common.h10
-rw-r--r--ext/dom/xpath.c57
-rw-r--r--ext/enchant/enchant.c54
-rw-r--r--ext/ereg/config.w322
-rw-r--r--ext/ereg/config0.m41
-rw-r--r--ext/ereg/ereg.c42
-rw-r--r--ext/ereg/php_ereg.h4
-rw-r--r--ext/exif/config.m42
-rw-r--r--ext/exif/config.w322
-rw-r--r--ext/exif/exif.c368
-rwxr-xr-xext/ext_skel4
-rw-r--r--ext/fileinfo/fileinfo.c52
-rw-r--r--ext/fileinfo/libmagic.patch48
-rw-r--r--ext/fileinfo/libmagic/apprentice.c5
-rw-r--r--ext/fileinfo/libmagic/fsmagic.c1
-rw-r--r--ext/fileinfo/libmagic/funcs.c8
-rw-r--r--ext/fileinfo/libmagic/magic.c1
-rw-r--r--ext/fileinfo/libmagic/print.c3
-rw-r--r--ext/fileinfo/libmagic/softmagic.c10
-rw-r--r--ext/filter/callback_filter.c6
-rw-r--r--ext/filter/config.m42
-rw-r--r--ext/filter/config.w322
-rw-r--r--ext/filter/filter.c88
-rw-r--r--ext/filter/logical_filters.c34
-rw-r--r--ext/filter/php_filter.h5
-rw-r--r--ext/filter/sanitizing_filters.c4
-rw-r--r--ext/ftp/ftp.c91
-rw-r--r--ext/ftp/ftp.h20
-rw-r--r--ext/ftp/php_ftp.c162
-rw-r--r--ext/gd/gd.c408
-rw-r--r--ext/gd/gd_compat.c5
-rw-r--r--ext/gd/gd_ctx.c19
-rw-r--r--ext/gd/libgd/gd.c6
-rw-r--r--ext/gd/libgd/gdft.c3
-rw-r--r--ext/gd/libgd/gdkanji.c3
-rw-r--r--ext/gd/php_gd.h4
-rw-r--r--ext/gettext/gettext.c22
-rw-r--r--ext/gmp/config.m42
-rw-r--r--ext/gmp/config.w322
-rw-r--r--ext/gmp/gmp.c316
-rw-r--r--ext/gmp/php_gmp.h5
-rw-r--r--ext/hash/hash.c56
-rw-r--r--ext/hash/hash_md.c4
-rw-r--r--ext/hash/hash_sha.c4
-rw-r--r--ext/iconv/config.m42
-rw-r--r--ext/iconv/config.w322
-rw-r--r--ext/iconv/iconv.c234
-rw-r--r--ext/iconv/php_iconv.h5
-rw-r--r--ext/imap/php_imap.c354
-rw-r--r--ext/interbase/ibase_blobs.c66
-rw-r--r--ext/interbase/ibase_events.c28
-rw-r--r--ext/interbase/ibase_query.c176
-rw-r--r--ext/interbase/ibase_service.c28
-rw-r--r--ext/interbase/interbase.c79
-rw-r--r--ext/interbase/php_ibase_includes.h14
-rw-r--r--ext/interbase/php_ibase_udf.c14
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp62
-rw-r--r--ext/intl/breakiterator/breakiterator_class.h8
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.cpp62
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.h6
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.cpp64
-rw-r--r--ext/intl/breakiterator/codepointiterator_methods.cpp2
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp34
-rw-r--r--ext/intl/calendar/calendar_class.cpp66
-rw-r--r--ext/intl/calendar/calendar_class.h10
-rw-r--r--ext/intl/calendar/calendar_methods.cpp272
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.cpp48
-rw-r--r--ext/intl/collator/collator.c4
-rw-r--r--ext/intl/collator/collator_attr.c16
-rw-r--r--ext/intl/collator/collator_class.c28
-rw-r--r--ext/intl/collator/collator_class.h12
-rw-r--r--ext/intl/collator/collator_compare.c18
-rw-r--r--ext/intl/collator/collator_convert.c11
-rw-r--r--ext/intl/collator/collator_convert.h2
-rw-r--r--ext/intl/collator/collator_create.c10
-rw-r--r--ext/intl/collator/collator_error.c10
-rw-r--r--ext/intl/collator/collator_locale.c10
-rw-r--r--ext/intl/collator/collator_sort.c62
-rw-r--r--ext/intl/collator/collator_sort.h2
-rw-r--r--ext/intl/common/common_date.cpp36
-rw-r--r--ext/intl/common/common_date.h6
-rw-r--r--ext/intl/common/common_enum.cpp84
-rw-r--r--ext/intl/common/common_enum.h16
-rw-r--r--ext/intl/common/common_error.c12
-rw-r--r--ext/intl/config.m42
-rw-r--r--ext/intl/config.w322
-rw-r--r--ext/intl/converter/converter.c212
-rw-r--r--ext/intl/dateformat/dateformat.c16
-rw-r--r--ext/intl/dateformat/dateformat_attr.c28
-rw-r--r--ext/intl/dateformat/dateformat_attrcpp.cpp42
-rw-r--r--ext/intl/dateformat/dateformat_class.c32
-rw-r--r--ext/intl/dateformat/dateformat_class.h4
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp22
-rw-r--r--ext/intl/dateformat/dateformat_data.c12
-rw-r--r--ext/intl/dateformat/dateformat_data.h6
-rw-r--r--ext/intl/dateformat/dateformat_format.c24
-rw-r--r--ext/intl/dateformat/dateformat_format_object.cpp36
-rw-r--r--ext/intl/dateformat/dateformat_helpers.cpp14
-rw-r--r--ext/intl/dateformat/dateformat_helpers.h2
-rw-r--r--ext/intl/dateformat/dateformat_parse.c34
-rw-r--r--ext/intl/formatter/formatter.c4
-rw-r--r--ext/intl/formatter/formatter_attr.c40
-rw-r--r--ext/intl/formatter/formatter_class.c34
-rw-r--r--ext/intl/formatter/formatter_class.h4
-rw-r--r--ext/intl/formatter/formatter_data.c12
-rw-r--r--ext/intl/formatter/formatter_data.h6
-rw-r--r--ext/intl/formatter/formatter_format.c24
-rw-r--r--ext/intl/formatter/formatter_main.c18
-rw-r--r--ext/intl/formatter/formatter_parse.c10
-rw-r--r--ext/intl/grapheme/grapheme.h2
-rw-r--r--ext/intl/grapheme/grapheme_string.c106
-rw-r--r--ext/intl/grapheme/grapheme_util.c16
-rw-r--r--ext/intl/grapheme/grapheme_util.h10
-rw-r--r--ext/intl/idn/idn.c42
-rw-r--r--ext/intl/intl_data.h20
-rw-r--r--ext/intl/intl_error.c78
-rw-r--r--ext/intl/intl_error.h26
-rw-r--r--ext/intl/locale/locale.c6
-rw-r--r--ext/intl/locale/locale_class.c4
-rw-r--r--ext/intl/locale/locale_class.h4
-rw-r--r--ext/intl/locale/locale_methods.c146
-rw-r--r--ext/intl/msgformat/msgformat.c22
-rw-r--r--ext/intl/msgformat/msgformat_attr.c14
-rw-r--r--ext/intl/msgformat/msgformat_class.c32
-rw-r--r--ext/intl/msgformat/msgformat_class.h4
-rw-r--r--ext/intl/msgformat/msgformat_data.c12
-rw-r--r--ext/intl/msgformat/msgformat_data.h6
-rw-r--r--ext/intl/msgformat/msgformat_format.c26
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp70
-rw-r--r--ext/intl/msgformat/msgformat_helpers.h2
-rw-r--r--ext/intl/msgformat/msgformat_parse.c24
-rw-r--r--ext/intl/normalizer/normalizer.c4
-rw-r--r--ext/intl/normalizer/normalizer_class.c4
-rw-r--r--ext/intl/normalizer/normalizer_class.h2
-rw-r--r--ext/intl/normalizer/normalizer_normalize.c30
-rw-r--r--ext/intl/php_intl.c44
-rw-r--r--ext/intl/php_intl.h7
-rw-r--r--ext/intl/resourcebundle/resourcebundle.c6
-rw-r--r--ext/intl/resourcebundle/resourcebundle.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c80
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.h4
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.c34
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c40
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.h14
-rw-r--r--ext/intl/spoofchecker/spoofchecker_main.c16
-rw-r--r--ext/intl/timezone/timezone_class.cpp86
-rw-r--r--ext/intl/timezone/timezone_class.h10
-rw-r--r--ext/intl/timezone/timezone_methods.cpp154
-rw-r--r--ext/intl/transliterator/transliterator.c4
-rw-r--r--ext/intl/transliterator/transliterator_class.c76
-rw-r--r--ext/intl/transliterator/transliterator_class.h6
-rw-r--r--ext/intl/transliterator/transliterator_methods.c96
-rw-r--r--ext/json/JSON_parser.c26
-rw-r--r--ext/json/JSON_parser.h6
-rw-r--r--ext/json/config.m42
-rw-r--r--ext/json/config.w322
-rw-r--r--ext/json/json.c84
-rw-r--r--ext/json/php_json.h13
-rw-r--r--ext/ldap/ldap.c223
-rw-r--r--ext/libxml/config.w322
-rw-r--r--ext/libxml/config0.m42
-rw-r--r--ext/libxml/libxml.c124
-rw-r--r--ext/libxml/php_libxml.h27
-rw-r--r--ext/mbstring/config.m42
-rw-r--r--ext/mbstring/config.w324
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_htmlent.c8
-rw-r--r--ext/mbstring/mb_gpc.c22
-rw-r--r--ext/mbstring/mb_gpc.h2
-rw-r--r--ext/mbstring/mbstring.c361
-rw-r--r--ext/mbstring/mbstring.h19
-rw-r--r--ext/mbstring/php_mbregex.c96
-rw-r--r--ext/mbstring/php_mbregex.h12
-rw-r--r--ext/mbstring/php_unicode.c22
-rw-r--r--ext/mbstring/php_unicode.h2
-rw-r--r--ext/mcrypt/mcrypt.c118
-rw-r--r--ext/mcrypt/mcrypt_filter.c42
-rw-r--r--ext/mssql/php_mssql.c169
-rw-r--r--ext/mssql/php_mssql.h2
-rw-r--r--ext/mysql/config.m42
-rw-r--r--ext/mysql/config.w324
-rw-r--r--ext/mysql/php_mysql.c220
-rw-r--r--ext/mysql/php_mysql_structs.h5
-rw-r--r--ext/mysqli/config.m42
-rw-r--r--ext/mysqli/config.w324
-rw-r--r--ext/mysqli/mysqli.c246
-rw-r--r--ext/mysqli/mysqli_api.c232
-rw-r--r--ext/mysqli/mysqli_driver.c24
-rw-r--r--ext/mysqli/mysqli_embedded.c2
-rw-r--r--ext/mysqli/mysqli_exception.c14
-rw-r--r--ext/mysqli/mysqli_nonapi.c140
-rw-r--r--ext/mysqli/mysqli_priv.h20
-rw-r--r--ext/mysqli/mysqli_prop.c36
-rw-r--r--ext/mysqli/mysqli_report.c12
-rw-r--r--ext/mysqli/mysqli_result_iterator.c22
-rw-r--r--ext/mysqli/mysqli_warning.c46
-rw-r--r--ext/mysqli/php_mysqli_structs.h35
-rw-r--r--ext/mysqlnd/config.w322
-rw-r--r--ext/mysqlnd/config9.m42
-rw-r--r--ext/mysqlnd/mysqlnd.c568
-rw-r--r--ext/mysqlnd/mysqlnd.h267
-rw-r--r--ext/mysqlnd/mysqlnd_alloc.c6
-rw-r--r--ext/mysqlnd/mysqlnd_alloc.h4
-rw-r--r--ext/mysqlnd/mysqlnd_auth.c50
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c14
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.h4
-rw-r--r--ext/mysqlnd/mysqlnd_charset.c8
-rw-r--r--ext/mysqlnd/mysqlnd_charset.h10
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c33
-rw-r--r--ext/mysqlnd/mysqlnd_debug.h9
-rw-r--r--ext/mysqlnd/mysqlnd_driver.c54
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.c18
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.h36
-rw-r--r--ext/mysqlnd/mysqlnd_loaddata.c34
-rw-r--r--ext/mysqlnd/mysqlnd_net.c142
-rw-r--r--ext/mysqlnd/mysqlnd_net.h4
-rw-r--r--ext/mysqlnd/mysqlnd_plugin.c33
-rw-r--r--ext/mysqlnd/mysqlnd_priv.h26
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c278
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c72
-rw-r--r--ext/mysqlnd/mysqlnd_result.c232
-rw-r--r--ext/mysqlnd/mysqlnd_result.h10
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.c32
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.h4
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.c18
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.h12
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.c10
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.h8
-rw-r--r--ext/mysqlnd/mysqlnd_structs.h482
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c200
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.h22
-rw-r--r--ext/mysqlnd/php_mysqlnd.c26
-rw-r--r--ext/oci8/oci8.c352
-rw-r--r--ext/oci8/oci8_collection.c104
-rw-r--r--ext/oci8/oci8_interface.c430
-rw-r--r--ext/oci8/oci8_lob.c133
-rw-r--r--ext/oci8/oci8_statement.c183
-rw-r--r--ext/oci8/php_oci8_int.h130
-rw-r--r--ext/odbc/birdstep.c72
-rw-r--r--ext/odbc/php_odbc.c232
-rw-r--r--ext/odbc/php_odbc_includes.h2
-rw-r--r--ext/opcache/Optimizer/block_pass.c46
-rw-r--r--ext/opcache/Optimizer/compact_literals.c6
-rw-r--r--ext/opcache/Optimizer/optimize_func_calls.c2
-rw-r--r--ext/opcache/Optimizer/pass1_5.c48
-rw-r--r--ext/opcache/Optimizer/pass2.c12
-rw-r--r--ext/opcache/Optimizer/pass3.c2
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c56
-rw-r--r--ext/opcache/Optimizer/zend_optimizer_internal.h26
-rw-r--r--ext/opcache/ZendAccelerator.c410
-rw-r--r--ext/opcache/ZendAccelerator.h27
-rw-r--r--ext/opcache/config.m42
-rw-r--r--ext/opcache/config.w322
-rw-r--r--ext/opcache/shared_alloc_win32.c1
-rw-r--r--ext/opcache/zend_accelerator_blacklist.c9
-rw-r--r--ext/opcache/zend_accelerator_blacklist.h4
-rw-r--r--ext/opcache/zend_accelerator_debug.c1
-rw-r--r--ext/opcache/zend_accelerator_module.c64
-rw-r--r--ext/opcache/zend_accelerator_module.h4
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c101
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.h8
-rw-r--r--ext/opcache/zend_persist.c92
-rw-r--r--ext/opcache/zend_persist.h4
-rw-r--r--ext/opcache/zend_persist_calc.c60
-rw-r--r--ext/opcache/zend_shared_alloc.c14
-rw-r--r--ext/opcache/zend_shared_alloc.h10
-rw-r--r--ext/openssl/openssl.c617
-rw-r--r--ext/openssl/xp_ssl.c311
-rw-r--r--ext/pcntl/pcntl.c86
-rw-r--r--ext/pcntl/php_signal.c3
-rw-r--r--ext/pcre/config.w322
-rw-r--r--ext/pcre/config0.m44
-rw-r--r--ext/pcre/php_pcre.c150
-rw-r--r--ext/pcre/php_pcre.h18
-rw-r--r--ext/pdo/pdo.c14
-rw-r--r--ext/pdo/pdo_dbh.c240
-rw-r--r--ext/pdo/pdo_sql_parser.c22
-rw-r--r--ext/pdo/pdo_sql_parser.re22
-rw-r--r--ext/pdo/pdo_stmt.c467
-rw-r--r--ext/pdo/php_pdo.h8
-rw-r--r--ext/pdo/php_pdo_driver.h66
-rw-r--r--ext/pdo/php_pdo_error.h6
-rw-r--r--ext/pdo/php_pdo_int.h24
-rw-r--r--ext/pdo_dblib/dblib_driver.c40
-rw-r--r--ext/pdo_dblib/dblib_stmt.c26
-rw-r--r--ext/pdo_dblib/pdo_dblib.c2
-rw-r--r--ext/pdo_firebird/firebird_driver.c42
-rw-r--r--ext/pdo_firebird/firebird_statement.c32
-rw-r--r--ext/pdo_firebird/php_pdo_firebird_int.h2
-rwxr-xr-xext/pdo_mysql/config.m42
-rw-r--r--ext/pdo_mysql/config.w322
-rw-r--r--ext/pdo_mysql/mysql_driver.c92
-rw-r--r--ext/pdo_mysql/mysql_statement.c42
-rw-r--r--ext/pdo_mysql/pdo_mysql.c18
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h11
-rw-r--r--ext/pdo_oci/oci_driver.c38
-rw-r--r--ext/pdo_oci/oci_statement.c49
-rw-r--r--ext/pdo_oci/php_pdo_oci_int.h8
-rw-r--r--ext/pdo_odbc/odbc_driver.c32
-rw-r--r--ext/pdo_odbc/odbc_stmt.c24
-rw-r--r--ext/pdo_odbc/pdo_odbc.c2
-rw-r--r--ext/pdo_odbc/php_pdo_odbc.h4
-rw-r--r--ext/pdo_odbc/php_pdo_odbc_int.h8
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c96
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c20
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h12
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite.h4
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite_int.h6
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c102
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c18
-rw-r--r--ext/pgsql/config.m42
-rw-r--r--ext/pgsql/config.w322
-rw-r--r--ext/pgsql/pgsql.c660
-rw-r--r--ext/pgsql/php_pgsql.h33
-rw-r--r--ext/phar/config.m42
-rw-r--r--ext/phar/config.w322
-rw-r--r--ext/phar/dirstream.c118
-rw-r--r--ext/phar/dirstream.h18
-rw-r--r--ext/phar/func_interceptors.c110
-rw-r--r--ext/phar/func_interceptors.h12
-rw-r--r--ext/phar/phar.c293
-rw-r--r--ext/phar/phar_internal.h127
-rw-r--r--ext/phar/phar_object.c988
-rw-r--r--ext/phar/php_phar.h2
-rw-r--r--ext/phar/stream.c182
-rw-r--r--ext/phar/stream.h24
-rw-r--r--ext/phar/stub.h2
-rw-r--r--ext/phar/tar.c106
-rw-r--r--ext/phar/util.c242
-rw-r--r--ext/phar/zip.c76
-rw-r--r--ext/posix/posix.c68
-rw-r--r--ext/pspell/pspell.c74
-rw-r--r--ext/readline/readline.c32
-rw-r--r--ext/readline/readline_cli.c81
-rw-r--r--ext/recode/recode.c16
-rwxr-xr-xext/reflection/config.m42
-rwxr-xr-xext/reflection/config.w324
-rw-r--r--ext/reflection/php_reflection.c660
-rw-r--r--ext/reflection/php_reflection.h2
-rw-r--r--ext/session/config.m42
-rw-r--r--ext/session/config.w322
-rw-r--r--ext/session/mod_files.c46
-rw-r--r--ext/session/mod_mm.c19
-rw-r--r--ext/session/mod_user.c28
-rw-r--r--ext/session/mod_user_class.c28
-rw-r--r--ext/session/php_session.h47
-rw-r--r--ext/session/session.c395
-rw-r--r--ext/shmop/shmop.c36
-rw-r--r--ext/simplexml/php_simplexml_exports.h4
-rw-r--r--ext/simplexml/simplexml.c438
-rw-r--r--ext/simplexml/sxe.c10
-rw-r--r--ext/skeleton/php_skeleton.h14
-rw-r--r--ext/skeleton/skeleton.c8
-rw-r--r--ext/snmp/php_snmp.h6
-rw-r--r--ext/snmp/snmp.c244
-rw-r--r--ext/soap/config.m42
-rw-r--r--ext/soap/config.w322
-rw-r--r--ext/soap/php_encoding.c493
-rw-r--r--ext/soap/php_encoding.h16
-rw-r--r--ext/soap/php_http.c76
-rw-r--r--ext/soap/php_http.h8
-rw-r--r--ext/soap/php_packet_soap.c54
-rw-r--r--ext/soap/php_packet_soap.h2
-rw-r--r--ext/soap/php_schema.c18
-rw-r--r--ext/soap/php_schema.h2
-rw-r--r--ext/soap/php_sdl.c63
-rw-r--r--ext/soap/php_sdl.h6
-rw-r--r--ext/soap/php_soap.h7
-rw-r--r--ext/soap/php_xml.c11
-rw-r--r--ext/soap/php_xml.h2
-rw-r--r--ext/soap/soap.c553
-rw-r--r--ext/sockets/config.m42
-rw-r--r--ext/sockets/config.w322
-rw-r--r--ext/sockets/conversions.c20
-rw-r--r--ext/sockets/conversions.h2
-rw-r--r--ext/sockets/multicast.c130
-rw-r--r--ext/sockets/multicast.h22
-rw-r--r--ext/sockets/php_sockets.h10
-rw-r--r--ext/sockets/sendrecvmsg.c34
-rw-r--r--ext/sockets/sendrecvmsg.h4
-rw-r--r--ext/sockets/sockaddr_conv.c22
-rw-r--r--ext/sockets/sockaddr_conv.h6
-rw-r--r--ext/sockets/sockets.c173
-rwxr-xr-xext/spl/config.m42
-rw-r--r--ext/spl/config.w322
-rw-r--r--ext/spl/php_spl.c102
-rw-r--r--ext/spl/php_spl.h4
-rw-r--r--ext/spl/spl_array.c430
-rw-r--r--ext/spl/spl_array.h4
-rw-r--r--ext/spl/spl_directory.c554
-rw-r--r--ext/spl/spl_directory.h12
-rw-r--r--ext/spl/spl_dllist.c196
-rw-r--r--ext/spl/spl_engine.c4
-rw-r--r--ext/spl/spl_engine.h22
-rw-r--r--ext/spl/spl_exceptions.c2
-rw-r--r--ext/spl/spl_fixedarray.c172
-rw-r--r--ext/spl/spl_functions.c36
-rw-r--r--ext/spl/spl_functions.h36
-rw-r--r--ext/spl/spl_heap.c182
-rw-r--r--ext/spl/spl_iterators.c652
-rw-r--r--ext/spl/spl_iterators.h4
-rw-r--r--ext/spl/spl_observer.c168
-rw-r--r--ext/sqlite3/config.w322
-rw-r--r--ext/sqlite3/config0.m42
-rw-r--r--ext/sqlite3/php_sqlite3.h3
-rw-r--r--ext/sqlite3/sqlite3.c172
-rw-r--r--ext/standard/array.c500
-rw-r--r--ext/standard/assert.c42
-rw-r--r--ext/standard/base64.c6
-rw-r--r--ext/standard/basic_functions.c337
-rw-r--r--ext/standard/basic_functions.h18
-rw-r--r--ext/standard/browscap.c36
-rw-r--r--ext/standard/config.m43
-rw-r--r--ext/standard/config.w323
-rw-r--r--ext/standard/crc32.c2
-rw-r--r--ext/standard/credits.c4
-rw-r--r--ext/standard/credits.h2
-rw-r--r--ext/standard/crypt.c6
-rw-r--r--ext/standard/css.c2
-rw-r--r--ext/standard/css.h2
-rw-r--r--ext/standard/cyr_convert.c12
-rw-r--r--ext/standard/datetime.c6
-rw-r--r--ext/standard/datetime.h2
-rw-r--r--ext/standard/dir.c54
-rw-r--r--ext/standard/dl.c46
-rw-r--r--ext/standard/dl.h4
-rw-r--r--ext/standard/dns.c34
-rw-r--r--ext/standard/dns_win32.c16
-rw-r--r--ext/standard/exec.c32
-rw-r--r--ext/standard/exec.h2
-rw-r--r--ext/standard/file.c238
-rw-r--r--ext/standard/file.h22
-rw-r--r--ext/standard/filestat.c136
-rw-r--r--ext/standard/filters.c130
-rw-r--r--ext/standard/formatted_print.c46
-rw-r--r--ext/standard/fsock.c4
-rw-r--r--ext/standard/ftok.c10
-rw-r--r--ext/standard/ftp_fopen_wrapper.c158
-rw-r--r--ext/standard/head.c40
-rw-r--r--ext/standard/head.h4
-rw-r--r--ext/standard/html.c42
-rw-r--r--ext/standard/html.h6
-rw-r--r--ext/standard/http.c12
-rw-r--r--ext/standard/http_fopen_wrapper.c58
-rw-r--r--ext/standard/image.c154
-rw-r--r--ext/standard/incomplete_class.c40
-rw-r--r--ext/standard/info.c103
-rw-r--r--ext/standard/info.h12
-rw-r--r--ext/standard/iptc.c60
-rw-r--r--ext/standard/lcg.c12
-rw-r--r--ext/standard/levenshtein.c14
-rw-r--r--ext/standard/link.c52
-rw-r--r--ext/standard/link_win32.c46
-rw-r--r--ext/standard/mail.c40
-rw-r--r--ext/standard/math.c111
-rw-r--r--ext/standard/md5.c4
-rw-r--r--ext/standard/metaphone.c2
-rw-r--r--ext/standard/microtime.c6
-rw-r--r--ext/standard/pack.c38
-rw-r--r--ext/standard/pageinfo.c24
-rw-r--r--ext/standard/pageinfo.h8
-rw-r--r--ext/standard/password.c30
-rw-r--r--ext/standard/php_array.h14
-rw-r--r--ext/standard/php_filestat.h4
-rw-r--r--ext/standard/php_fopen_wrapper.c56
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_http.h4
-rw-r--r--ext/standard/php_image.h2
-rw-r--r--ext/standard/php_incomplete_class.h2
-rw-r--r--ext/standard/php_lcg.h4
-rw-r--r--ext/standard/php_mail.h2
-rw-r--r--ext/standard/php_math.h4
-rw-r--r--ext/standard/php_rand.h12
-rw-r--r--ext/standard/php_string.h18
-rw-r--r--ext/standard/php_var.h18
-rw-r--r--ext/standard/proc_open.c48
-rw-r--r--ext/standard/quot_print.c4
-rw-r--r--ext/standard/rand.c36
-rw-r--r--ext/standard/scanf.c21
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/sha1.c4
-rw-r--r--ext/standard/soundex.c2
-rw-r--r--ext/standard/streamsfuncs.c230
-rw-r--r--ext/standard/string.c313
-rw-r--r--ext/standard/syslog.c4
-rw-r--r--ext/standard/type.c36
-rw-r--r--ext/standard/uniqid.c6
-rw-r--r--ext/standard/url.c16
-rw-r--r--ext/standard/url_scanner_ex.c34
-rw-r--r--ext/standard/url_scanner_ex.h6
-rw-r--r--ext/standard/url_scanner_ex.re34
-rw-r--r--ext/standard/user_filters.c72
-rw-r--r--ext/standard/uuencode.c6
-rw-r--r--ext/standard/var.c136
-rw-r--r--ext/standard/var_unserializer.c26
-rw-r--r--ext/standard/var_unserializer.re26
-rw-r--r--ext/standard/versioning.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.c206
-rw-r--r--ext/sysvmsg/sysvmsg.c34
-rw-r--r--ext/sysvsem/sysvsem.c32
-rw-r--r--ext/sysvshm/sysvshm.c40
-rw-r--r--ext/tidy/config.m42
-rw-r--r--ext/tidy/config.w321
-rw-r--r--ext/tidy/php_tidy.h5
-rw-r--r--ext/tidy/tidy.c218
-rw-r--r--ext/tokenizer/tokenizer.c18
-rw-r--r--ext/wddx/php_wddx_api.h2
-rw-r--r--ext/wddx/wddx.c68
-rw-r--r--ext/xml/config.m42
-rw-r--r--ext/xml/config.w322
-rw-r--r--ext/xml/php_xml.h5
-rw-r--r--ext/xml/xml.c81
-rw-r--r--ext/xmlreader/php_xmlreader.c150
-rw-r--r--ext/xmlreader/php_xmlreader.h2
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c3
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c80
-rw-r--r--ext/xmlwriter/php_xmlwriter.c120
-rw-r--r--ext/xsl/php_xsl.c20
-rw-r--r--ext/xsl/php_xsl.h16
-rw-r--r--ext/xsl/xsltprocessor.c107
-rw-r--r--ext/zip/php_zip.c264
-rw-r--r--ext/zip/php_zip.h8
-rw-r--r--ext/zip/zip_stream.c20
-rw-r--r--ext/zlib/config.w322
-rw-r--r--ext/zlib/config0.m42
-rw-r--r--ext/zlib/php_zlib.h4
-rw-r--r--ext/zlib/zlib.c145
-rw-r--r--ext/zlib/zlib_filter.c56
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c18
-rw-r--r--main/SAPI.c199
-rw-r--r--main/SAPI.h124
-rw-r--r--main/fopen_wrappers.c80
-rw-r--r--main/fopen_wrappers.h24
-rw-r--r--main/internal_functions.c.in4
-rw-r--r--main/internal_functions_nw.c4
-rw-r--r--main/internal_functions_win32.c4
-rw-r--r--main/main.c380
-rw-r--r--main/mergesort.c40
-rw-r--r--main/network.c61
-rw-r--r--main/output.c392
-rw-r--r--main/php.h28
-rw-r--r--main/php_content_types.c14
-rw-r--r--main/php_content_types.h4
-rw-r--r--main/php_globals.h2
-rw-r--r--main/php_ini.c67
-rw-r--r--main/php_ini.h12
-rw-r--r--main/php_main.h22
-rw-r--r--main/php_memory_streams.h28
-rw-r--r--main/php_network.h30
-rw-r--r--main/php_open_temporary_file.c24
-rw-r--r--main/php_open_temporary_file.h8
-rw-r--r--main/php_output.h134
-rw-r--r--main/php_streams.h244
-rw-r--r--main/php_ticks.c16
-rw-r--r--main/php_ticks.h12
-rw-r--r--main/php_variables.c126
-rw-r--r--main/php_variables.h12
-rw-r--r--main/rfc1867.c170
-rw-r--r--main/rfc1867.h18
-rw-r--r--main/snprintf.c5
-rw-r--r--main/spprintf.c5
-rw-r--r--main/streams/cast.c33
-rw-r--r--main/streams/filter.c92
-rw-r--r--main/streams/glob_wrapper.c24
-rw-r--r--main/streams/memory.c66
-rw-r--r--main/streams/mmap.c6
-rw-r--r--main/streams/php_stream_context.h20
-rw-r--r--main/streams/php_stream_filter_api.h54
-rw-r--r--main/streams/php_stream_glob_wrapper.h12
-rw-r--r--main/streams/php_stream_mmap.h14
-rw-r--r--main/streams/php_stream_plain_wrapper.h32
-rw-r--r--main/streams/php_stream_transport.h30
-rw-r--r--main/streams/php_streams_int.h4
-rw-r--r--main/streams/plain_wrapper.c178
-rw-r--r--main/streams/streams.c278
-rw-r--r--main/streams/transports.c52
-rw-r--r--main/streams/userspace.c222
-rw-r--r--main/streams/xp_socket.c90
-rw-r--r--sapi/aolserver/aolserver.c31
-rw-r--r--sapi/apache/mod_php7.c95
-rw-r--r--sapi/apache/php_apache.c32
-rw-r--r--sapi/apache/sapi_apache.c8
-rw-r--r--sapi/apache2filter/php_apache.h4
-rw-r--r--sapi/apache2filter/php_functions.c26
-rw-r--r--sapi/apache2filter/sapi_apache2.c68
-rw-r--r--sapi/apache2handler/config.m42
-rw-r--r--sapi/apache2handler/config.w326
-rw-r--r--sapi/apache2handler/php_apache.h3
-rw-r--r--sapi/apache2handler/php_functions.c30
-rw-r--r--sapi/apache2handler/sapi_apache2.c82
-rw-r--r--sapi/apache_hooks/mod_php7.c95
-rw-r--r--sapi/apache_hooks/php_apache.c78
-rw-r--r--sapi/apache_hooks/php_apache_http.h2
-rw-r--r--sapi/apache_hooks/sapi_apache.c22
-rw-r--r--sapi/caudium/caudium.c57
-rw-r--r--sapi/cgi/cgi_main.c179
-rw-r--r--sapi/cgi/config.w322
-rw-r--r--sapi/cgi/config9.m42
-rw-r--r--sapi/cgi/fastcgi.c8
-rw-r--r--sapi/cgi/fastcgi.h4
-rw-r--r--sapi/cli/cli.h8
-rw-r--r--sapi/cli/config.m42
-rw-r--r--sapi/cli/config.w324
-rw-r--r--sapi/cli/php_cli.c165
-rw-r--r--sapi/cli/php_cli_process_title.c6
-rw-r--r--sapi/cli/php_cli_server.c247
-rw-r--r--sapi/cli/php_cli_server.h5
-rw-r--r--sapi/continuity/capi.c77
-rw-r--r--sapi/embed/config.m42
-rw-r--r--sapi/embed/config.w322
-rw-r--r--sapi/embed/php_embed.c39
-rw-r--r--sapi/embed/php_embed.h29
-rw-r--r--sapi/fpm/fpm/fpm_conf.c37
-rw-r--r--sapi/fpm/fpm/fpm_log.c2
-rw-r--r--sapi/fpm/fpm/fpm_log.h2
-rw-r--r--sapi/fpm/fpm/fpm_main.c251
-rw-r--r--sapi/fpm/fpm/fpm_php.c38
-rw-r--r--sapi/fpm/fpm/fpm_php.h14
-rw-r--r--sapi/fpm/fpm/fpm_php_trace.c5
-rw-r--r--sapi/fpm/fpm/fpm_request.c17
-rw-r--r--sapi/fpm/fpm/fpm_request.h2
-rw-r--r--sapi/fpm/fpm/fpm_status.c48
-rw-r--r--sapi/fpm/fpm/fpm_status.h2
-rw-r--r--sapi/isapi/php7isapi.c124
-rw-r--r--sapi/litespeed/lsapi_main.c102
-rw-r--r--sapi/milter/php_milter.c101
-rw-r--r--sapi/nsapi/nsapi.c95
-rw-r--r--sapi/phpdbg/phpdbg.c195
-rw-r--r--sapi/phpdbg/phpdbg.h6
-rw-r--r--sapi/phpdbg/phpdbg_bp.c198
-rw-r--r--sapi/phpdbg/phpdbg_bp.h62
-rw-r--r--sapi/phpdbg/phpdbg_break.c4
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c66
-rw-r--r--sapi/phpdbg/phpdbg_cmd.h32
-rw-r--r--sapi/phpdbg/phpdbg_eol.c4
-rw-r--r--sapi/phpdbg/phpdbg_eol.h4
-rw-r--r--sapi/phpdbg/phpdbg_frame.c24
-rw-r--r--sapi/phpdbg/phpdbg_frame.h6
-rw-r--r--sapi/phpdbg/phpdbg_help.c36
-rw-r--r--sapi/phpdbg/phpdbg_info.c58
-rw-r--r--sapi/phpdbg/phpdbg_io.c18
-rw-r--r--sapi/phpdbg/phpdbg_io.h12
-rw-r--r--sapi/phpdbg/phpdbg_lexer.c3
-rw-r--r--sapi/phpdbg/phpdbg_lexer.h2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.l3
-rw-r--r--sapi/phpdbg/phpdbg_list.c40
-rw-r--r--sapi/phpdbg/phpdbg_list.h8
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c26
-rw-r--r--sapi/phpdbg/phpdbg_opcode.h6
-rw-r--r--sapi/phpdbg/phpdbg_out.c120
-rw-r--r--sapi/phpdbg/phpdbg_out.h60
-rw-r--r--sapi/phpdbg/phpdbg_parser.c922
-rw-r--r--sapi/phpdbg/phpdbg_parser.h62
-rw-r--r--sapi/phpdbg/phpdbg_parser.y16
-rw-r--r--sapi/phpdbg/phpdbg_print.c22
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c258
-rw-r--r--sapi/phpdbg/phpdbg_prompt.h18
-rw-r--r--sapi/phpdbg/phpdbg_rinit_hook.c6
-rw-r--r--sapi/phpdbg/phpdbg_set.c24
-rw-r--r--sapi/phpdbg/phpdbg_sigio_win32.c23
-rw-r--r--sapi/phpdbg/phpdbg_sigio_win32.h4
-rw-r--r--sapi/phpdbg/phpdbg_sigsafe.c13
-rw-r--r--sapi/phpdbg/phpdbg_sigsafe.h8
-rw-r--r--sapi/phpdbg/phpdbg_utils.c82
-rw-r--r--sapi/phpdbg/phpdbg_utils.h44
-rw-r--r--sapi/phpdbg/phpdbg_wait.c44
-rw-r--r--sapi/phpdbg/phpdbg_wait.h2
-rw-r--r--sapi/phpdbg/phpdbg_watch.c177
-rw-r--r--sapi/phpdbg/phpdbg_watch.h14
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.c16
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.h2
-rw-r--r--sapi/phpdbg/phpdbg_win.c5
-rw-r--r--sapi/phttpd/phttpd.c29
-rw-r--r--sapi/pi3web/pi3web_sapi.c53
-rw-r--r--sapi/roxen/roxen.c37
-rw-r--r--sapi/thttpd/thttpd.c83
-rw-r--r--sapi/tux/php_tux.c56
-rw-r--r--sapi/webjames/webjames.c27
-rw-r--r--win32/build/config.w326
-rw-r--r--win32/globals.c4
-rw-r--r--win32/php_registry.h2
-rw-r--r--win32/php_win32_globals.h6
-rw-r--r--win32/readdir.c1
-rw-r--r--win32/registry.c2
-rw-r--r--win32/sendmail.c24
-rw-r--r--win32/sendmail.h6
-rw-r--r--win32/wsyslog.c3
882 files changed, 28323 insertions, 28512 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index efdea5c880..8235b489b6 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -22,6 +22,10 @@
typedef struct _tsrm_tls_entry tsrm_tls_entry;
+#if defined(TSRM_WIN32)
+/* TSRMLS_CACHE_DEFINE; is already done in Zend, this is being always compiled statically. */
+#endif
+
struct _tsrm_tls_entry {
void **storage;
int count;
@@ -177,7 +181,7 @@ TSRM_API void tsrm_shutdown(void)
for (j=0; j<p->count; j++) {
if (p->storage[j]) {
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
- resource_types_table[j].dtor(p->storage[j], &p->storage);
+ resource_types_table[j].dtor(p->storage[j]);
}
free(p->storage[j]);
}
@@ -252,7 +256,7 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
for (j=p->count; j<id_count; j++) {
p->storage[j] = (void *) malloc(resource_types_table[j].size);
if (resource_types_table[j].ctor) {
- resource_types_table[j].ctor(p->storage[j], &p->storage);
+ resource_types_table[j].ctor(p->storage[j]);
}
}
p->count = id_count;
@@ -282,7 +286,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
tsrm_tls_set(*thread_resources_ptr);
if (tsrm_new_thread_begin_handler) {
- tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
+ tsrm_new_thread_begin_handler(thread_id);
}
for (i=0; i<id_count; i++) {
if (resource_types_table[i].done) {
@@ -291,13 +295,13 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
{
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
if (resource_types_table[i].ctor) {
- resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
+ resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
}
}
}
if (tsrm_new_thread_end_handler) {
- tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage));
+ tsrm_new_thread_end_handler(thread_id);
}
tsrm_mutex_unlock(tsmm_mutex);
@@ -390,7 +394,7 @@ void tsrm_free_interpreter_context(void *context)
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ resource_types_table[i].dtor(thread_resources->storage[i]);
}
}
for (i=0; i<thread_resources->count; i++) {
@@ -455,7 +459,7 @@ void ts_free_thread(void)
if (thread_resources->thread_id == thread_id) {
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ resource_types_table[i].dtor(thread_resources->storage[i]);
}
}
for (i=0; i<thread_resources->count; i++) {
@@ -497,7 +501,7 @@ void ts_free_worker_threads(void)
if (thread_resources->thread_id != thread_id) {
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ resource_types_table[i].dtor(thread_resources->storage[i]);
}
}
for (i=0; i<thread_resources->count; i++) {
@@ -543,7 +547,7 @@ void ts_free_id(ts_rsrc_id id)
while (p) {
if (p->count > j && p->storage[j]) {
if (resource_types_table && resource_types_table[j].dtor) {
- resource_types_table[j].dtor(p->storage[j], &p->storage);
+ resource_types_table[j].dtor(p->storage[j]);
}
free(p->storage[j]);
p->storage[j] = NULL;
@@ -791,4 +795,9 @@ void tsrm_error_set(int level, char *debug_filename)
#endif
}
+TSRM_API inline void *tsrm_get_ls_cache(void)
+{
+ return tsrm_tls_get();
+}
+
#endif /* ZTS */
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index b232429d4d..d3891b7c51 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -94,8 +94,8 @@ typedef struct {
#include <signal.h>
#endif
-typedef void (*ts_allocate_ctor)(void *, void ***);
-typedef void (*ts_allocate_dtor)(void *, void ***);
+typedef void (*ts_allocate_ctor)(void *);
+typedef void (*ts_allocate_dtor)(void *);
#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts
@@ -129,8 +129,8 @@ TSRM_API void ts_free_id(ts_rsrc_id id);
#define TSRM_ERROR_LEVEL_CORE 2
#define TSRM_ERROR_LEVEL_INFO 3
-typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls);
-typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls);
+typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id);
+typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id);
TSRM_API int tsrm_error(int level, const char *format, ...);
@@ -155,17 +155,33 @@ TSRM_API void *tsrm_new_interpreter_context(void);
TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
TSRM_API void tsrm_free_interpreter_context(void *context);
+TSRM_API inline void *tsrm_get_ls_cache(void);
+
+#ifdef TSRM_WIN32
+# define TSRM_TLS __declspec(thread)
+#else
+# define TSRM_TLS __thread
+#endif
+
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
-#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL)
#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
-#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
-#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
-#define TSRMLS_D void ***tsrm_ls
-#define TSRMLS_DC , TSRMLS_D
-#define TSRMLS_C tsrm_ls
-#define TSRMLS_CC , TSRMLS_C
+#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache()
+#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
+
+#define TSRMG_STATIC(id, type, element) (((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
+#define TSRMLS_CACHE_EXTERN extern TSRM_TLS void *TSRMLS_CACHE
+#define TSRMLS_CACHE_DEFINE TSRM_TLS void *TSRMLS_CACHE = NULL
+#define TSRMLS_CACHE_UPDATE if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache()
+#define TSRMLS_CACHE _tsrm_ls_cache
+
+/* BC only */
+#define TSRMLS_D void
+#define TSRMLS_DC
+#define TSRMLS_C
+#define TSRMLS_CC
+#define TSRMLS_FETCH()
#ifdef __cplusplus
}
@@ -176,6 +192,14 @@ TSRM_API void tsrm_free_interpreter_context(void *context);
#define TSRMLS_FETCH()
#define TSRMLS_FETCH_FROM_CTX(ctx)
#define TSRMLS_SET_CTX(ctx)
+
+#define TSRMG_STATIC(id, type, element)
+#define TSRMLS_CACHE_EXTERN
+#define TSRMLS_CACHE_DEFINE
+#define TSRMLS_CACHE_UPDATE
+#define TSRMLS_CACHE
+
+/* BC only */
#define TSRMLS_D void
#define TSRMLS_DC
#define TSRMLS_C
diff --git a/TSRM/config.w32 b/TSRM/config.w32
index 91b4eead2a..e7d3f3b976 100644
--- a/TSRM/config.w32
+++ b/TSRM/config.w32
@@ -2,4 +2,5 @@
// $Id$
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
+ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 9765874448..bc2ea51724 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -40,8 +40,11 @@ static ts_rsrc_id win32_globals_id;
static tsrm_win32_globals win32_globals;
#endif
-static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
+static void tsrm_win32_ctor(tsrm_win32_globals *globals)
{
+#ifdef ZTS
+TSRMLS_CACHE_UPDATE;
+#endif
globals->process = NULL;
globals->shm = NULL;
globals->process_size = 0;
@@ -59,7 +62,7 @@ static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
globals->impersonation_token_sid = NULL;
}
-static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
+static void tsrm_win32_dtor(tsrm_win32_globals *globals)
{
shm_pair *ptr;
@@ -92,18 +95,18 @@ TSRM_API void tsrm_win32_startup(void)
#ifdef ZTS
ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor);
#else
- tsrm_win32_ctor(&win32_globals TSRMLS_CC);
+ tsrm_win32_ctor(&win32_globals);
#endif
}
TSRM_API void tsrm_win32_shutdown(void)
{
#ifndef ZTS
- tsrm_win32_dtor(&win32_globals TSRMLS_CC);
+ tsrm_win32_dtor(&win32_globals);
#endif
}
-char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
+char * tsrm_win32_get_path_sid_key(const char *pathname)
{
PSID pSid = TWG(impersonation_token_sid);
TCHAR *ptcSid = NULL;
@@ -191,7 +194,7 @@ Finished:
return NULL;
}
-TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
+TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
time_t t;
HANDLE thread_token = NULL;
@@ -214,7 +217,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
} else {
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
real_path = (char *)malloc(MAX_PATH);
- if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
+ if(tsrm_realpath(pathname, real_path) == NULL) {
goto Finished;
}
pathname = real_path;
@@ -278,14 +281,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
if (CWDG(realpath_cache_size_limit)) {
t = time(0);
- bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t TSRMLS_CC);
+ bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
if(bucket == NULL && real_path == NULL) {
/* We used the pathname directly. Call tsrm_realpath */
/* so that entry is created in realpath cache */
real_path = (char *)malloc(MAX_PATH);
- if(tsrm_realpath(pathname, real_path TSRMLS_CC) != NULL) {
+ if(tsrm_realpath(pathname, real_path) != NULL) {
pathname = real_path;
- bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t TSRMLS_CC);
+ bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
}
}
}
@@ -380,7 +383,7 @@ Finished:
}
-static process_pair *process_get(FILE *stream TSRMLS_DC)
+static process_pair *process_get(FILE *stream)
{
process_pair *ptr;
process_pair *newptr;
@@ -410,7 +413,6 @@ static shm_pair *shm_get(int key, void *addr)
{
shm_pair *ptr;
shm_pair *newptr;
- TSRMLS_FETCH();
for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
if (!ptr->descriptor) {
@@ -448,12 +450,11 @@ static HANDLE dupHandle(HANDLE fh, BOOL inherit) {
TSRM_API FILE *popen(const char *command, const char *type)
{
- TSRMLS_FETCH();
- return popen_ex(command, type, NULL, NULL TSRMLS_CC);
+ return popen_ex(command, type, NULL, NULL);
}
-TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC)
+TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
{
FILE *stream = NULL;
int fno, type_len, read, mode;
@@ -550,7 +551,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
}
CloseHandle(process.hThread);
- proc = process_get(NULL TSRMLS_CC);
+ proc = process_get(NULL);
if (read) {
fno = _open_osfhandle((tsrm_intptr_t)in, _O_RDONLY | mode);
@@ -570,9 +571,8 @@ TSRM_API int pclose(FILE *stream)
{
DWORD termstat = 0;
process_pair *process;
- TSRMLS_FETCH();
- if ((process = process_get(stream TSRMLS_CC)) == NULL) {
+ if ((process = process_get(stream)) == NULL) {
return 0;
}
diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h
index beff1e88cf..8cefb664be 100644
--- a/TSRM/tsrm_win32.h
+++ b/TSRM/tsrm_win32.h
@@ -71,7 +71,8 @@ typedef struct {
} tsrm_win32_globals;
#ifdef ZTS
-# define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v)
+# define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v)
+TSRMLS_CACHE_EXTERN;
#else
# define TWG(v) (win32_globals.v)
#endif
@@ -93,15 +94,15 @@ typedef struct {
#define SHM_RND FILE_MAP_WRITE
#define SHM_REMAP FILE_MAP_COPY
-char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
+char * tsrm_win32_get_path_sid_key(const char *pathname );
TSRM_API void tsrm_win32_startup(void);
TSRM_API void tsrm_win32_shutdown(void);
-TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
+TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env);
TSRM_API FILE *popen(const char *command, const char *type);
TSRM_API int pclose(FILE *stream);
-TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC);
+TSRM_API int tsrm_win32_access(const char *pathname, int mode);
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
TSRM_API int shmget(int key, int size, int flags);
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 3b80f295e2..900ec41170 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -14,6 +14,7 @@ PHP 7.0 INTERNALS UPGRADE NOTES
m. Other portable macros info
n. ZEND_ENGINE_2 removal
o. Updated final class modifier
+ p. TSRM changes
2. Build system changes
a. Unix build system changes
@@ -128,6 +129,47 @@ PHP 7.0 INTERNALS UPGRADE NOTES
o. Removed ZEND_ACC_FINAL_CLASS in favour of ZEND_ACC_FINAL, turning final class
modifier now a different class entry flag. Update your extensions.
+ p. TSRM changes
+
+ The TSRM layer undergone significant changes. It is not necessary anymore to
+ pass the tsrm_ls pointer explicitly. The TSRMLS_* macros should not be used
+ in any new developments.
+
+ The recommended way accessing globals in TS builds is by implementing it
+ to use a local thread unique pointer to the corresponding data pool. These
+ are the new macros that serve to achieve this goal:
+
+ - ZEND_TSRMG - based on TSRMG and if static pointer for data pool access is
+ implemented, will use it
+ - ZEND_TSRMLS_CACHE_EXTERN - to be used in a header shared across multiple
+ C/C++ files
+ - ZEND_TSRMLS_CACHE_DEFINE - to be used in the main extension C/C++ file
+ - ZEND_TSRMLS_CACHE_UPDATE - to be integrated at the top of the globals
+ ctor or RINIT function
+ - ZEND_ENABLE_STATIC_TSRMLS_CACHE - to be used in the config.[m4|w32] for
+ enabling the globals access per thread unique pointer
+ - TSRMLS_CACHE - expands to the variable name which links to the thread
+ unique data pool
+
+ Note that usually it will work without implementing the globals access per
+ a thread unique pointer, however it might cause a slowdown. The reason is
+ that the access model to the extension/SAPI own globals as well as the
+ access to the core globals is determined in the compilation phase depending
+ on whether ZEND_ENABLE_STATIC_TSRMLS_CACHE macro is defined.
+
+ Due to the current compiler evolution state, the TSRMLS_CACHE pointer
+ (when implemented) has to be present and updated in every binary unit which
+ is not compiled statically into PHP. So any DLL, DSO, EXE, etc. has to take
+ care about defining and updating it's TSRMLS cache. An update should happen
+ before any globals was accessed.
+
+ Porting an extension or SAPI is usually as easy as removing all the TSRMLS_*
+ ocurrences and integrating the macros mentioned above. However if tsrm_ls
+ is used explicitly, its usage can considered obsolete in most cases.
+ Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't
+ be passed to that threads directly.
+
+
========================
2. Build system changes
========================
diff --git a/Zend/Makefile.am b/Zend/Makefile.am
index 2a76db36b1..09018a0d3d 100644
--- a/Zend/Makefile.am
+++ b/Zend/Makefile.am
@@ -20,6 +20,7 @@ libZend_la_SOURCES=\
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
zend_generators.c zend_virtual_cwd.c zend_ast.c
+libZend_la_CFLAGS = -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
libZend_la_LDFLAGS =
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
diff --git a/Zend/zend.c b/Zend/zend.c
index 89977e7734..ad05f3b5dd 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -48,20 +48,20 @@
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
ZEND_API size_t (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
-ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
-ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
+ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
+ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
-ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
+ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
-ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
-ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
+ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len);
-void (*zend_on_timeout)(int seconds TSRMLS_DC);
+void (*zend_on_timeout)(int seconds);
-static void (*zend_message_dispatcher_p)(zend_long message, const void *data TSRMLS_DC);
+static void (*zend_message_dispatcher_p)(zend_long message, const void *data);
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
@@ -77,10 +77,10 @@ static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
{
- OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
if (GC_G(gc_enabled)) {
- gc_init(TSRMLS_C);
+ gc_init();
}
return SUCCESS;
@@ -92,10 +92,10 @@ static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */
if (!CG(multibyte)) {
return FAILURE;
}
- if (!zend_multibyte_get_functions(TSRMLS_C)) {
+ if (!zend_multibyte_get_functions()) {
return SUCCESS;
}
- return zend_multibyte_set_script_encoding_by_string(new_value->val, new_value->len TSRMLS_CC);
+ return zend_multibyte_set_script_encoding_by_string(new_value->val, new_value->len);
}
/* }}} */
@@ -120,6 +120,7 @@ static HashTable *global_class_table = NULL;
static HashTable *global_constants_table = NULL;
static HashTable *global_auto_globals_table = NULL;
static HashTable *global_persistent_list = NULL;
+ZEND_TSRMLS_CACHE_DEFINE;
#endif
ZEND_API zend_utility_values zend_uv;
@@ -130,7 +131,7 @@ static uint zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2014 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
-static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
+static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
{
zval *tmp;
zend_string *string_key;
@@ -178,7 +179,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
ZEND_PUTS_EX(key);
}
ZEND_PUTS_EX("] => ");
- zend_print_zval_r_ex(write_func, tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
+ zend_print_zval_r_ex(write_func, tmp, indent+PRINT_ZVAL_INDENT);
ZEND_PUTS_EX("\n");
} ZEND_HASH_FOREACH_END();
indent -= PRINT_ZVAL_INDENT;
@@ -189,7 +190,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
}
/* }}} */
-static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
+static void print_flat_hash(HashTable *ht) /* {{{ */
{
zval *tmp;
zend_string *string_key;
@@ -207,29 +208,29 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
zend_printf(ZEND_ULONG_FMT, num_key);
}
ZEND_PUTS("] => ");
- zend_print_flat_zval_r(tmp TSRMLS_CC);
+ zend_print_flat_zval_r(tmp);
} ZEND_HASH_FOREACH_END();
}
/* }}} */
-ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC) /* {{{ */
+ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy) /* {{{ */
{
if (Z_TYPE_P(expr) == IS_STRING) {
return 0;
} else {
- ZVAL_STR(expr_copy, _zval_get_string_func(expr TSRMLS_CC));
+ ZVAL_STR(expr_copy, _zval_get_string_func(expr));
return 1;
}
}
/* }}} */
-ZEND_API size_t zend_print_zval(zval *expr, int indent TSRMLS_DC) /* {{{ */
+ZEND_API size_t zend_print_zval(zval *expr, int indent) /* {{{ */
{
- return zend_print_zval_ex(zend_write, expr, indent TSRMLS_CC);
+ return zend_print_zval_ex(zend_write, expr, indent);
}
/* }}} */
-ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC) /* {{{ */
+ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
{
zend_string *str = zval_get_string(expr);
size_t len = str->len;
@@ -243,7 +244,7 @@ ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int
}
/* }}} */
-ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
+ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
{
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
@@ -254,7 +255,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
return;
}
- print_flat_hash(Z_ARRVAL_P(expr) TSRMLS_CC);
+ print_flat_hash(Z_ARRVAL_P(expr));
ZEND_PUTS(")");
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
@@ -263,7 +264,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
case IS_OBJECT:
{
HashTable *properties = NULL;
- zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr) TSRMLS_CC);
+ zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
zend_printf("%s Object (", class_name->val);
zend_string_release(class_name);
@@ -276,26 +277,26 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
properties->u.v.nApplyCount--;
return;
}
- print_flat_hash(properties TSRMLS_CC);
+ print_flat_hash(properties);
properties->u.v.nApplyCount--;
}
ZEND_PUTS(")");
break;
}
default:
- zend_print_variable(expr TSRMLS_CC);
+ zend_print_variable(expr);
break;
}
}
/* }}} */
-ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC) /* {{{ */
+ZEND_API void zend_print_zval_r(zval *expr, int indent) /* {{{ */
{
- zend_print_zval_r_ex(zend_write, expr, indent TSRMLS_CC);
+ zend_print_zval_r_ex(zend_write, expr, indent);
}
/* }}} */
-ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC) /* {{{ */
+ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
{
ZVAL_DEREF(expr);
switch (Z_TYPE_P(expr)) {
@@ -307,7 +308,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
return;
}
- print_hash(write_func, Z_ARRVAL_P(expr), indent, 0 TSRMLS_CC);
+ print_hash(write_func, Z_ARRVAL_P(expr), indent, 0);
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
}
@@ -317,7 +318,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
HashTable *properties;
int is_temp;
- zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr) TSRMLS_CC);
+ zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr));
ZEND_PUTS_EX(class_name->val);
zend_string_release(class_name);
@@ -330,7 +331,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
properties->u.v.nApplyCount--;
return;
}
- print_hash(write_func, properties, indent, 1 TSRMLS_CC);
+ print_hash(write_func, properties, indent, 1);
properties->u.v.nApplyCount--;
if (is_temp) {
zend_hash_destroy(properties);
@@ -339,13 +340,13 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
break;
}
default:
- zend_print_zval_ex(write_func, expr, indent TSRMLS_CC);
+ zend_print_zval_ex(write_func, expr, indent);
break;
}
}
/* }}} */
-static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_DC) /* {{{ */
+static FILE *zend_fopen_wrapper(const char *filename, char **opened_path) /* {{{ */
{
if (opened_path) {
*opened_path = estrdup(filename);
@@ -362,7 +363,7 @@ static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
# define compiler_options_default ZEND_COMPILE_DEFAULT
#endif
-static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */
+static void zend_set_default_compile_time_values(void) /* {{{ */
{
/* default compile-time values */
CG(short_tags) = short_tags_default;
@@ -370,7 +371,7 @@ static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void zend_init_exception_op(TSRMLS_D) /* {{{ */
+static void zend_init_exception_op(void) /* {{{ */
{
memset(EG(exception_op), 0, sizeof(EG(exception_op)));
EG(exception_op)[0].opcode = ZEND_HANDLE_EXCEPTION;
@@ -400,7 +401,7 @@ static void function_copy_ctor(zval *zv)
function_add_ref(Z_FUNC_P(zv));
}
-static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */
+static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{{ */
{
compiler_globals->compiled_filename = NULL;
@@ -412,7 +413,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
zend_hash_init_ex(compiler_globals->class_table, 64, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_copy(compiler_globals->class_table, global_class_table, zend_class_add_ref);
- zend_set_default_compile_time_values(TSRMLS_C);
+ zend_set_default_compile_time_values();
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0);
@@ -427,14 +428,14 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->script_encoding_list = NULL;
#ifdef ZTS
- zend_interned_empty_string_init(&compiler_globals->empty_string TSRMLS_CC);
+ zend_interned_empty_string_init(&compiler_globals->empty_string);
memset(compiler_globals->one_char_string, 0, sizeof(compiler_globals->one_char_string));
#endif
}
/* }}} */
-static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */
+static void compiler_globals_dtor(zend_compiler_globals *compiler_globals) /* {{{ */
{
if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) {
zend_hash_destroy(compiler_globals->function_table);
@@ -457,17 +458,18 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->last_static_member = 0;
#ifdef ZTS
- zend_interned_empty_string_free(&compiler_globals->empty_string TSRMLS_CC);
+ zend_interned_empty_string_free(&compiler_globals->empty_string);
#endif
}
/* }}} */
-static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS_DC) /* {{{ */
+static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{{ */
{
- zend_startup_constants(TSRMLS_C);
+ ZEND_TSRMLS_CACHE_UPDATE;
+ zend_startup_constants();
zend_copy_constants(EG(zend_constants), GLOBAL_CONSTANTS_TABLE);
- zend_init_rsrc_plist(TSRMLS_C);
- zend_init_exception_op(TSRMLS_C);
+ zend_init_rsrc_plist();
+ zend_init_exception_op();
EG(lambda_count) = 0;
ZVAL_UNDEF(&EG(user_error_handler));
ZVAL_UNDEF(&EG(user_exception_handler));
@@ -483,11 +485,15 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
}
/* }}} */
-static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS_DC) /* {{{ */
+static void executor_globals_dtor(zend_executor_globals *executor_globals) /* {{{ */
{
- zend_ini_shutdown(TSRMLS_C);
+#ifdef ZTS
+ zend_ini_dtor(executor_globals->ini_directives);
+#else
+ zend_ini_shutdown();
+#endif
if (&executor_globals->persistent_list != global_persistent_list) {
- zend_destroy_rsrc_list(&executor_globals->persistent_list TSRMLS_CC);
+ zend_destroy_rsrc_list(&executor_globals->persistent_list);
}
if (executor_globals->zend_constants != GLOBAL_CONSTANTS_TABLE) {
zend_hash_destroy(executor_globals->zend_constants);
@@ -496,10 +502,10 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS
}
/* }}} */
-static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC) /* {{{ */
+static void zend_new_thread_end_handler(THREAD_T thread_id) /* {{{ */
{
- if (zend_copy_ini_directives(TSRMLS_C) == SUCCESS) {
- zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+ if (zend_copy_ini_directives() == SUCCESS) {
+ zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP);
}
}
/* }}} */
@@ -510,13 +516,13 @@ static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC) /* {{{ */
#include <floatingpoint.h>
#endif
-static void ini_scanner_globals_ctor(zend_ini_scanner_globals *scanner_globals_p TSRMLS_DC) /* {{{ */
+static void ini_scanner_globals_ctor(zend_ini_scanner_globals *scanner_globals_p) /* {{{ */
{
memset(scanner_globals_p, 0, sizeof(*scanner_globals_p));
}
/* }}} */
-static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p TSRMLS_DC) /* {{{ */
+static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p) /* {{{ */
{
memset(scanner_globals_p, 0, sizeof(*scanner_globals_p));
}
@@ -539,7 +545,7 @@ static void auto_global_dtor(zval *zv) /* {{{ */
}
/* }}} */
-static zend_bool php_auto_globals_create_globals(zend_string *name TSRMLS_DC) /* {{{ */
+static zend_bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
{
zval globals;
@@ -550,19 +556,20 @@ static zend_bool php_auto_globals_create_globals(zend_string *name TSRMLS_DC) /*
}
/* }}} */
-int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC) /* {{{ */
+int 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(TSRMLS_C);
+ start_memory_manager();
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
@@ -636,7 +643,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
compiler_globals = ts_resource(compiler_globals_id);
executor_globals = ts_resource(executor_globals_id);
- compiler_globals_dtor(compiler_globals TSRMLS_CC);
+ 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));
@@ -648,24 +655,24 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
zend_hash_destroy(executor_globals->zend_constants);
*executor_globals->zend_constants = *GLOBAL_CONSTANTS_TABLE;
#else
- ini_scanner_globals_ctor(&ini_scanner_globals TSRMLS_CC);
- php_scanner_globals_ctor(&language_scanner_globals TSRMLS_CC);
- zend_set_default_compile_time_values(TSRMLS_C);
+ ini_scanner_globals_ctor(&ini_scanner_globals);
+ php_scanner_globals_ctor(&language_scanner_globals);
+ zend_set_default_compile_time_values();
ZVAL_UNDEF(&EG(user_error_handler));
ZVAL_UNDEF(&EG(user_exception_handler));
#endif
- zend_interned_strings_init(TSRMLS_C);
- zend_startup_builtin_functions(TSRMLS_C);
- zend_register_standard_constants(TSRMLS_C);
- zend_register_auto_global(zend_string_init("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals TSRMLS_CC);
+ zend_interned_strings_init();
+ zend_startup_builtin_functions();
+ zend_register_standard_constants();
+ zend_register_auto_global(zend_string_init("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals);
#ifndef ZTS
- zend_init_rsrc_plist(TSRMLS_C);
- zend_init_exception_op(TSRMLS_C);
+ zend_init_rsrc_plist();
+ zend_init_exception_op();
#endif
- zend_ini_startup(TSRMLS_C);
+ zend_ini_startup();
#ifdef ZTS
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
@@ -675,7 +682,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
}
/* }}} */
-void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
+void zend_register_standard_ini_entries(void) /* {{{ */
{
int module_number = 0;
@@ -686,7 +693,7 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
/* Unlink the global (r/o) copies of the class, function and constant tables,
* and use a fresh r/w copy for the startup thread
*/
-void zend_post_startup(TSRMLS_D) /* {{{ */
+void zend_post_startup(void) /* {{{ */
{
#ifdef ZTS
zend_encoding **script_encoding_list;
@@ -701,34 +708,34 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
short_tags_default = CG(short_tags);
compiler_options_default = CG(compiler_options);
- zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
+ zend_destroy_rsrc_list(&EG(persistent_list));
free(compiler_globals->function_table);
free(compiler_globals->class_table);
if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {
- compiler_globals_ctor(compiler_globals, tsrm_ls);
+ compiler_globals_ctor(compiler_globals);
compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;
} else {
- compiler_globals_ctor(compiler_globals, tsrm_ls);
+ compiler_globals_ctor(compiler_globals);
}
free(EG(zend_constants));
- virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_deactivate();
- executor_globals_ctor(executor_globals, tsrm_ls);
+ executor_globals_ctor(executor_globals);
global_persistent_list = &EG(persistent_list);
- zend_copy_ini_directives(TSRMLS_C);
+ zend_copy_ini_directives();
#else
- virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_deactivate();
#endif
}
/* }}} */
-void zend_shutdown(TSRMLS_D) /* {{{ */
+void zend_shutdown(void) /* {{{ */
{
#ifdef ZEND_SIGNALS
- zend_signal_shutdown(TSRMLS_C);
+ zend_signal_shutdown();
#endif
- zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
+ zend_destroy_rsrc_list(&EG(persistent_list));
if (EG(active))
{
/*
@@ -745,18 +752,18 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
} 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 TSRMLS_CC);
+ zend_cleanup_user_class_data(ce);
} else {
break;
}
} ZEND_HASH_FOREACH_END();
- zend_cleanup_internal_classes(TSRMLS_C);
- zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
- zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
+ 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(TSRMLS_C);
+ virtual_cwd_deactivate();
virtual_cwd_shutdown();
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
@@ -765,7 +772,7 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE);
free(GLOBAL_AUTO_GLOBALS_TABLE);
- zend_shutdown_extensions(TSRMLS_C);
+ zend_shutdown_extensions();
free(zend_version_info);
free(GLOBAL_FUNCTION_TABLE);
@@ -783,7 +790,7 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
#endif
zend_destroy_rsrc_list_dtors();
- zend_interned_strings_dtor(TSRMLS_C);
+ zend_interned_strings_dtor();
}
/* }}} */
@@ -804,7 +811,6 @@ void zenderror(const char *error) /* {{{ */
BEGIN_EXTERN_C()
ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
{
- TSRMLS_FETCH();
if (!EG(bailout)) {
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
@@ -847,47 +853,47 @@ ZEND_API char *get_zend_version(void) /* {{{ */
}
/* }}} */
-ZEND_API void zend_activate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate(void) /* {{{ */
{
#ifdef ZTS
- virtual_cwd_activate(TSRMLS_C);
+ virtual_cwd_activate();
#endif
- gc_reset(TSRMLS_C);
- init_compiler(TSRMLS_C);
- init_executor(TSRMLS_C);
- startup_scanner(TSRMLS_C);
+ gc_reset();
+ init_compiler();
+ init_executor();
+ startup_scanner();
}
/* }}} */
-void zend_call_destructors(TSRMLS_D) /* {{{ */
+void zend_call_destructors(void) /* {{{ */
{
zend_try {
- shutdown_destructors(TSRMLS_C);
+ shutdown_destructors();
} zend_end_try();
}
/* }}} */
-ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_deactivate(void) /* {{{ */
{
/* we're no longer executing anything */
EG(current_execute_data) = NULL;
zend_try {
- shutdown_scanner(TSRMLS_C);
+ shutdown_scanner();
} zend_end_try();
/* shutdown_executor() takes care of its own bailout handling */
- shutdown_executor(TSRMLS_C);
+ shutdown_executor();
zend_try {
- shutdown_compiler(TSRMLS_C);
+ shutdown_compiler();
} zend_end_try();
- zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
+ zend_destroy_rsrc_list(&EG(regular_list));
#if ZEND_DEBUG
if (GC_G(gc_enabled) && !CG(unclean_shutdown)) {
- gc_collect_cycles(TSRMLS_C);
+ gc_collect_cycles();
}
#endif
@@ -906,16 +912,16 @@ ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
#endif
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
}
/* }}} */
BEGIN_EXTERN_C()
-ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC) /* {{{ */
+ZEND_API void zend_message_dispatcher(zend_long message, const void *data) /* {{{ */
{
if (zend_message_dispatcher_p) {
- zend_message_dispatcher_p(message, data TSRMLS_CC);
+ zend_message_dispatcher_p(message, data);
}
}
/* }}} */
@@ -971,7 +977,6 @@ static void zend_error_va_list(int type, const char *format, va_list args)
zend_stack delayed_oplines_stack;
zend_stack context_stack;
zend_array *symbol_table;
- TSRMLS_FETCH();
/* Report about uncaught exception in case of fatal errors */
if (EG(exception)) {
@@ -994,7 +999,7 @@ static void zend_error_va_list(int type, const char *format, va_list args)
EG(opline_before_exception)) {
opline = EG(opline_before_exception);
}
- zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+ zend_exception_error(EG(exception), E_WARNING);
EG(exception) = NULL;
if (opline) {
ex->opline = opline;
@@ -1025,16 +1030,16 @@ static void zend_error_va_list(int type, const char *format, va_list args)
case E_USER_NOTICE:
case E_USER_DEPRECATED:
case E_RECOVERABLE_ERROR:
- if (zend_is_compiling(TSRMLS_C)) {
- error_filename = zend_get_compiled_filename(TSRMLS_C)->val;
- error_lineno = zend_get_compiled_lineno(TSRMLS_C);
- } else if (zend_is_executing(TSRMLS_C)) {
- error_filename = zend_get_executed_filename(TSRMLS_C);
+ if (zend_is_compiling()) {
+ error_filename = zend_get_compiled_filename()->val;
+ error_lineno = zend_get_compiled_lineno();
+ } else if (zend_is_executing()) {
+ error_filename = zend_get_executed_filename();
if (error_filename[0] == '[') { /* [no active file] */
error_filename = NULL;
error_lineno = 0;
} else {
- error_lineno = zend_get_executed_lineno(TSRMLS_C);
+ error_lineno = zend_get_executed_lineno();
}
} else {
error_filename = NULL;
@@ -1111,7 +1116,7 @@ static void zend_error_va_list(int type, const char *format, va_list args)
ZVAL_LONG(&params[3], error_lineno);
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
/* during shutdown the symbol table table can be still null */
if (!symbol_table) {
@@ -1140,7 +1145,7 @@ static void zend_error_va_list(int type, const char *format, va_list args)
}
ZVAL_UNDEF(&retval);
- if (call_user_function_ex(CG(function_table), NULL, &orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &orig_user_error_handler, &retval, 5, params, 1, NULL) == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
zend_error_cb(type, error_filename, error_lineno, format, args);
@@ -1240,7 +1245,7 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *form
}
/* }}} */
-ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_count, ...) /* {{{ */
+ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...) /* {{{ */
{
va_list files;
int i;
@@ -1254,14 +1259,14 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
continue;
}
- op_array = zend_compile_file(file_handle, type TSRMLS_CC);
+ op_array = zend_compile_file(file_handle, type);
if (file_handle->opened_path) {
zend_hash_str_add_empty_element(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path));
}
- zend_destroy_file_handle(file_handle TSRMLS_CC);
+ zend_destroy_file_handle(file_handle);
if (op_array) {
- zend_execute(op_array, retval TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_execute(op_array, retval);
+ zend_exception_restore();
if (EG(exception)) {
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
zval orig_user_exception_handler;
@@ -1272,7 +1277,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
ZVAL_OBJ(&params[0], old_exception);
ZVAL_COPY_VALUE(&orig_user_exception_handler, &EG(user_exception_handler));
ZVAL_UNDEF(&retval2);
- if (call_user_function_ex(CG(function_table), NULL, &orig_user_exception_handler, &retval2, 1, params, 1, NULL TSRMLS_CC) == SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &orig_user_exception_handler, &retval2, 1, params, 1, NULL) == SUCCESS) {
zval_ptr_dtor(&retval2);
if (EG(exception)) {
OBJ_RELEASE(EG(exception));
@@ -1281,13 +1286,13 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
OBJ_RELEASE(old_exception);
} else {
EG(exception) = old_exception;
- zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR);
}
} else {
- zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR);
}
}
- destroy_op_array(op_array TSRMLS_CC);
+ destroy_op_array(op_array);
efree_size(op_array, sizeof(zend_op_array));
} else if (type==ZEND_REQUIRE) {
va_end(files);
@@ -1302,18 +1307,18 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
#define COMPILED_STRING_DESCRIPTION_FORMAT "%s(%d) : %s"
-ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC) /* {{{ */
+ZEND_API char *zend_make_compiled_string_description(const char *name) /* {{{ */
{
const char *cur_filename;
int cur_lineno;
char *compiled_string_description;
- if (zend_is_compiling(TSRMLS_C)) {
- cur_filename = zend_get_compiled_filename(TSRMLS_C)->val;
- cur_lineno = zend_get_compiled_lineno(TSRMLS_C);
- } else if (zend_is_executing(TSRMLS_C)) {
- cur_filename = zend_get_executed_filename(TSRMLS_C);
- cur_lineno = zend_get_executed_lineno(TSRMLS_C);
+ if (zend_is_compiling()) {
+ cur_filename = zend_get_compiled_filename()->val;
+ cur_lineno = zend_get_compiled_lineno();
+ } else if (zend_is_executing()) {
+ cur_filename = zend_get_executed_filename();
+ cur_lineno = zend_get_executed_lineno();
} else {
cur_filename = "Unknown";
cur_lineno = 0;
diff --git a/Zend/zend.h b/Zend/zend.h
index b254b2974b..dd04aab63e 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -52,14 +52,30 @@
# define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
#endif
-#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value TSRMLS_DC
-#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value TSRMLS_CC
+#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value
+#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value
#define USED_RET() \
(!EX(prev_execute_data) || \
!ZEND_USER_CODE(EX(prev_execute_data)->func->common.type) || \
!(EX(prev_execute_data)->opline->result_type & EXT_TYPE_UNUSED))
+#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE
+#define ZEND_TSRMG TSRMG_STATIC
+#define ZEND_TSRMLS_CACHE_EXTERN TSRMLS_CACHE_EXTERN
+#define ZEND_TSRMLS_CACHE_DEFINE TSRMLS_CACHE_DEFINE
+#define ZEND_TSRMLS_CACHE_UPDATE TSRMLS_CACHE_UPDATE
+#define ZEND_TSRMLS_CACHE TSRMLS_CACHE
+#else
+#define ZEND_TSRMG TSRMG
+#define ZEND_TSRMLS_CACHE_EXTERN
+#define ZEND_TSRMLS_CACHE_DEFINE
+#define ZEND_TSRMLS_CACHE_UPDATE
+#define ZEND_TSRMLS_CACHE
+#endif
+
+ZEND_TSRMLS_CACHE_EXTERN;
+
#ifdef HAVE_NORETURN
# if defined(ZEND_WIN32)
ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
@@ -142,14 +158,14 @@ struct _zend_class_entry {
zend_class_iterator_funcs iterator_funcs;
/* handlers */
- zend_object* (*create_object)(zend_class_entry *class_type TSRMLS_DC);
- zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
- int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
- union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method TSRMLS_DC);
+ zend_object* (*create_object)(zend_class_entry *class_type);
+ zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref);
+ int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
+ union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method);
/* serializer callbacks */
- int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
- int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
+ int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data);
uint32_t num_interfaces;
uint32_t num_traits;
@@ -177,18 +193,18 @@ typedef struct _zend_utility_functions {
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
size_t (*write_function)(const char *str, size_t str_length);
- FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
- void (*message_handler)(zend_long message, const void *data TSRMLS_DC);
+ FILE *(*fopen_function)(const char *filename, char **opened_path);
+ void (*message_handler)(zend_long message, const void *data);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
zval *(*get_configuration_directive)(zend_string *name);
- void (*ticks_function)(int ticks TSRMLS_DC);
- void (*on_timeout)(int seconds TSRMLS_DC);
- int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
+ void (*ticks_function)(int ticks);
+ void (*on_timeout)(int seconds);
+ int (*stream_open_function)(const char *filename, zend_file_handle *handle);
size_t (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*vstrpprintf_function)(size_t max_len, const char *format, va_list ap);
- char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
- char *(*resolve_path_function)(const char *filename, int filename_len TSRMLS_DC);
+ char *(*getenv_function)(char *name, size_t name_len);
+ char *(*resolve_path_function)(const char *filename, int filename_len);
} zend_utility_functions;
typedef struct _zend_utility_values {
@@ -218,29 +234,29 @@ typedef int (*zend_write_func_t)(const char *str, size_t str_length);
#define zend_first_try EG(bailout)=NULL; zend_try
BEGIN_EXTERN_C()
-int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
-void zend_shutdown(TSRMLS_D);
-void zend_register_standard_ini_entries(TSRMLS_D);
-void zend_post_startup(TSRMLS_D);
+int zend_startup(zend_utility_functions *utility_functions, char **extensions);
+void zend_shutdown(void);
+void zend_register_standard_ini_entries(void);
+void zend_post_startup(void);
void zend_set_utility_values(zend_utility_values *utility_values);
ZEND_API void _zend_bailout(char *filename, uint lineno);
ZEND_API char *get_zend_version(void);
-ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC);
-ZEND_API size_t zend_print_zval(zval *expr, int indent TSRMLS_DC);
-ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
-ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
-ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
-ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
+ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy);
+ZEND_API size_t zend_print_zval(zval *expr, int indent);
+ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
+ZEND_API void zend_print_zval_r(zval *expr, int indent);
+ZEND_API void zend_print_flat_zval_r(zval *expr);
+ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-ZEND_API void zend_activate(TSRMLS_D);
-ZEND_API void zend_deactivate(TSRMLS_D);
-ZEND_API void zend_call_destructors(TSRMLS_D);
-ZEND_API void zend_activate_modules(TSRMLS_D);
-ZEND_API void zend_deactivate_modules(TSRMLS_D);
-ZEND_API void zend_post_deactivate_modules(TSRMLS_D);
+ZEND_API void zend_activate(void);
+ZEND_API void zend_deactivate(void);
+ZEND_API void zend_call_destructors(void);
+ZEND_API void zend_activate_modules(void);
+ZEND_API void zend_deactivate_modules(void);
+ZEND_API void zend_post_deactivate_modules(void);
ZEND_API void free_estring(char **str_p);
ZEND_API void free_string_zval(zval *zv);
@@ -256,17 +272,17 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
extern ZEND_API size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_write_func_t zend_write;
-extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
+extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
-extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
+extern ZEND_API void (*zend_ticks_function)(int ticks);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
-extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
-extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
+extern ZEND_API void (*zend_on_timeout)(int seconds);
+extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle);
extern size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
extern zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
-extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
-extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
+extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len);
ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
@@ -283,7 +299,7 @@ END_EXTERN_C()
#define ZEND_UV(name) (zend_uv.name)
BEGIN_EXTERN_C()
-ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC);
+ZEND_API void zend_message_dispatcher(zend_long message, const void *data);
ZEND_API zval *zend_get_configuration_directive(zend_string *name);
END_EXTERN_C()
@@ -309,9 +325,9 @@ typedef struct {
zval user_handler;
} zend_error_handling;
-ZEND_API void zend_save_error_handling(zend_error_handling *current TSRMLS_DC);
-ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current TSRMLS_DC);
-ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC);
+ZEND_API void zend_save_error_handling(zend_error_handling *current);
+ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current);
+ZEND_API void zend_restore_error_handling(zend_error_handling *saved);
#define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0)
#define DEBUG_BACKTRACE_IGNORE_ARGS (1<<1)
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 74679c4f04..f62fab1b87 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -48,7 +48,6 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */
int arg_count;
va_list ptr;
zval **param, *param_ptr;
- TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
@@ -84,7 +83,6 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
int arg_count;
va_list ptr;
zval **param, *param_ptr;
- TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
@@ -105,7 +103,7 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
}
/* }}} */
-ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array TSRMLS_DC) /* {{{ */
+ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array) /* {{{ */
{
zval *param_ptr;
int arg_count;
@@ -127,7 +125,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array
}
/* }}} */
-ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TSRMLS_DC) /* {{{ */
+ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array) /* {{{ */
{
zval *param_ptr;
int arg_count;
@@ -151,12 +149,12 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
}
/* }}} */
-ZEND_API void zend_wrong_param_count(TSRMLS_D) /* {{{ */
+ZEND_API void zend_wrong_param_count(void) /* {{{ */
{
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
- zend_error(E_WARNING, "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name(TSRMLS_C));
+ zend_error(E_WARNING, "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
}
/* }}} */
@@ -196,11 +194,11 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
}
/* }}} */
-static int parse_arg_object_to_string(zval *arg, char **p, size_t *pl, int type TSRMLS_DC) /* {{{ */
+static int parse_arg_object_to_string(zval *arg, char **p, size_t *pl, int type) /* {{{ */
{
if (Z_OBJ_HANDLER_P(arg, cast_object)) {
zval obj;
- if (Z_OBJ_HANDLER_P(arg, cast_object)(arg, &obj, type TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HANDLER_P(arg, cast_object)(arg, &obj, type) == SUCCESS) {
zval_ptr_dtor(arg);
ZVAL_COPY_VALUE(arg, &obj);
*pl = Z_STRLEN_P(arg);
@@ -211,7 +209,7 @@ static int parse_arg_object_to_string(zval *arg, char **p, size_t *pl, int type
/* Standard PHP objects */
if (Z_OBJ_HT_P(arg) == &std_object_handlers || !Z_OBJ_HANDLER_P(arg, cast_object)) {
SEPARATE_ZVAL_NOREF(arg);
- if (zend_std_cast_object_tostring(arg, arg, type TSRMLS_CC) == SUCCESS) {
+ if (zend_std_cast_object_tostring(arg, arg, type) == SUCCESS) {
*pl = Z_STRLEN_P(arg);
*p = Z_STRVAL_P(arg);
return SUCCESS;
@@ -219,12 +217,12 @@ static int parse_arg_object_to_string(zval *arg, char **p, size_t *pl, int type
}
if (!Z_OBJ_HANDLER_P(arg, cast_object) && Z_OBJ_HANDLER_P(arg, get)) {
zval rv;
- zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);
Z_ADDREF_P(z);
if(Z_TYPE_P(z) != IS_OBJECT) {
zval_dtor(arg);
ZVAL_NULL(arg);
- if (!zend_make_printable_zval(z, arg TSRMLS_CC)) {
+ if (!zend_make_printable_zval(z, arg)) {
ZVAL_ZVAL(arg, z, 1, 1);
}
*pl = Z_STRLEN_P(arg);
@@ -237,11 +235,11 @@ static int parse_arg_object_to_string(zval *arg, char **p, size_t *pl, int type
}
/* }}} */
-ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type TSRMLS_DC) /* {{{ */
+ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type) /* {{{ */
{
if (Z_OBJ_HANDLER_P(arg, cast_object)) {
zval obj;
- if (Z_OBJ_HANDLER_P(arg, cast_object)(arg, &obj, type TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HANDLER_P(arg, cast_object)(arg, &obj, type) == SUCCESS) {
zval_ptr_dtor(arg);
ZVAL_COPY_VALUE(arg, &obj);
*str = Z_STR_P(arg);
@@ -251,19 +249,19 @@ ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type TSRM
/* Standard PHP objects */
if (Z_OBJ_HT_P(arg) == &std_object_handlers || !Z_OBJ_HANDLER_P(arg, cast_object)) {
SEPARATE_ZVAL_NOREF(arg);
- if (zend_std_cast_object_tostring(arg, arg, type TSRMLS_CC) == SUCCESS) {
+ if (zend_std_cast_object_tostring(arg, arg, type) == SUCCESS) {
*str = Z_STR_P(arg);
return SUCCESS;
}
}
if (!Z_OBJ_HANDLER_P(arg, cast_object) && Z_OBJ_HANDLER_P(arg, get)) {
zval rv;
- zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);
Z_ADDREF_P(z);
if(Z_TYPE_P(z) != IS_OBJECT) {
zval_dtor(arg);
ZVAL_NULL(arg);
- if (!zend_make_printable_zval(z, arg TSRMLS_CC)) {
+ if (!zend_make_printable_zval(z, arg)) {
ZVAL_ZVAL(arg, z, 1, 1);
}
*str = Z_STR_P(arg);
@@ -276,7 +274,7 @@ ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type TSRM
/* }}} */
#ifdef FAST_ZPP
-ZEND_API void zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args TSRMLS_DC) /* {{{ */
+ZEND_API void zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
{
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? active_function->common.scope->name->val : "";
@@ -292,42 +290,42 @@ ZEND_API void zend_wrong_paramers_count_error(int num_args, int min_num_args, in
}
/* }}} */
-ZEND_API void zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg TSRMLS_DC) /* {{{ */
+ZEND_API void zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
{
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
static const char * const expected_error[] = {
Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR)
NULL
};
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be %s, %s given",
- class_name, space, get_active_function_name(TSRMLS_C), num, expected_error[expected_type], zend_zval_type_name(arg));
+ class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg));
}
/* }}} */
-ZEND_API void zend_wrong_paramer_class_error(int num, char *name, zval *arg TSRMLS_DC) /* {{{ */
+ZEND_API void zend_wrong_paramer_class_error(int num, char *name, zval *arg) /* {{{ */
{
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be %s, %s given",
- class_name, space, get_active_function_name(TSRMLS_C), num, name, zend_zval_type_name(arg));
+ class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg));
}
/* }}} */
-ZEND_API void zend_wrong_callback_error(int severity, int num, char *error TSRMLS_DC) /* {{{ */
+ZEND_API void zend_wrong_callback_error(int severity, int num, char *error) /* {{{ */
{
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
zend_error(severity, "%s%s%s() expects parameter %d to be a valid callback, %s",
- class_name, space, get_active_function_name(TSRMLS_C), num, error);
+ class_name, space, get_active_function_name(), num, error);
efree(error);
}
/* }}} */
-ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int check_null TSRMLS_DC) /* {{{ */
+ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int check_null) /* {{{ */
{
zend_class_entry *ce_base = *pce;
@@ -336,14 +334,14 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
return 1;
}
convert_to_string_ex(arg);
- *pce = zend_lookup_class(Z_STR_P(arg) TSRMLS_CC);
+ *pce = zend_lookup_class(Z_STR_P(arg));
if (ce_base) {
- if ((!*pce || !instanceof_function(*pce, ce_base TSRMLS_CC))) {
+ if ((!*pce || !instanceof_function(*pce, ce_base))) {
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given",
- class_name, space, get_active_function_name(TSRMLS_C), num,
+ class_name, space, get_active_function_name(), num,
ce_base->name->val, Z_STRVAL_P(arg));
*pce = NULL;
return 0;
@@ -351,10 +349,10 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
}
if (!*pce) {
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be a valid class name, '%s' given",
- class_name, space, get_active_function_name(TSRMLS_C), num,
+ class_name, space, get_active_function_name(), num,
Z_STRVAL_P(arg));
return 0;
}
@@ -363,7 +361,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* }}} */
#endif
-static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error, int *severity TSRMLS_DC) /* {{{ */
+static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, const char **spec, char **error, int *severity) /* {{{ */
{
const char *spec_walk = *spec;
char c = *spec_walk++;
@@ -519,7 +517,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
case IS_OBJECT:
- if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (parse_arg_object_to_string(arg, p, pl, IS_STRING) == SUCCESS) {
if (c == 'p' && CHECK_ZVAL_NULL_PATH(arg)) {
return "a valid path";
}
@@ -559,7 +557,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
case IS_OBJECT: {
- if (parse_arg_object_to_str(arg, str, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (parse_arg_object_to_str(arg, str, IS_STRING) == SUCCESS) {
if (c == 'P' && CHECK_ZVAL_NULL_PATH(arg)) {
return "a valid path";
}
@@ -678,7 +676,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
}
if (Z_TYPE_P(arg) == IS_OBJECT &&
- (!ce || instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC))) {
+ (!ce || instanceof_function(Z_OBJCE_P(arg), ce))) {
*p = arg;
} else {
if (ce) {
@@ -700,13 +698,13 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
}
convert_to_string_ex(arg);
- if ((lookup = zend_lookup_class(Z_STR_P(arg) TSRMLS_CC)) == NULL) {
+ if ((lookup = zend_lookup_class(Z_STR_P(arg))) == NULL) {
*pce = NULL;
} else {
*pce = lookup;
}
if (ce_base) {
- if ((!*pce || !instanceof_function(*pce, ce_base TSRMLS_CC))) {
+ if ((!*pce || !instanceof_function(*pce, ce_base))) {
zend_spprintf(error, 0, "to be a class name derived from %s, '%s' given",
ce_base->name->val, Z_STRVAL_P(arg));
*pce = NULL;
@@ -735,7 +733,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
}
- if (zend_fcall_info_init(arg, 0, fci, fcc, NULL, &is_callable_error TSRMLS_CC) == SUCCESS) {
+ if (zend_fcall_info_init(arg, 0, fci, fcc, NULL, &is_callable_error) == SUCCESS) {
if (is_callable_error) {
*severity = E_STRICT;
zend_spprintf(error, 0, "to be a valid callback, %s", is_callable_error);
@@ -780,25 +778,25 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
}
/* }}} */
-static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec, int quiet TSRMLS_DC) /* {{{ */
+static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec, int quiet) /* {{{ */
{
const char *expected_type = NULL;
char *error = NULL;
int severity = E_WARNING;
- expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity TSRMLS_CC);
+ expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity);
if (expected_type) {
if (!quiet && (*expected_type || error)) {
const char *space;
- const char *class_name = get_active_class_name(&space TSRMLS_CC);
+ const char *class_name = get_active_class_name(&space);
if (error) {
zend_error(severity, "%s%s%s() expects parameter %d %s",
- class_name, space, get_active_function_name(TSRMLS_C), arg_num, error);
+ class_name, space, get_active_function_name(), arg_num, error);
efree(error);
} else {
zend_error(severity, "%s%s%s() expects parameter %d to be %s, %s given",
- class_name, space, get_active_function_name(TSRMLS_C), arg_num, expected_type,
+ class_name, space, get_active_function_name(), arg_num, expected_type,
zend_zval_type_name(arg));
}
}
@@ -811,20 +809,20 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
}
/* }}} */
-ZEND_API int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval *arg, const char *spec, ...)
+ZEND_API int zend_parse_parameter(int flags, int arg_num, zval *arg, const char *spec, ...)
{
va_list va;
int ret;
int quiet = flags & ZEND_PARSE_PARAMS_QUIET;
va_start(va, spec);
- ret = zend_parse_arg(arg_num, arg, &va, &spec, quiet TSRMLS_CC);
+ ret = zend_parse_arg(arg_num, arg, &va, &spec, quiet);
va_end(va);
return ret;
}
-static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va, int flags TSRMLS_DC) /* {{{ */
+static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va, int flags) /* {{{ */
{
const char *spec_walk;
int c, i;
@@ -928,7 +926,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
if (num_args > arg_count) {
zend_error(E_WARNING, "%s(): could not obtain parameters for parsing",
- get_active_function_name(TSRMLS_C));
+ get_active_function_name());
return FAILURE;
}
@@ -961,7 +959,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
arg = ZEND_CALL_ARG(EG(current_execute_data), i + 1);
- if (zend_parse_arg(i+1, arg, va, &type_spec, quiet TSRMLS_CC) == FAILURE) {
+ if (zend_parse_arg(i+1, arg, va, &type_spec, quiet) == FAILURE) {
/* clean up varargs array if it was used */
if (varargs && *varargs) {
*varargs = NULL;
@@ -980,15 +978,15 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
\
if (0 == (type_spec)[0] && 0 != __num_args && !(quiet)) { \
const char *__space; \
- const char * __class_name = get_active_class_name(&__space TSRMLS_CC); \
+ const char * __class_name = get_active_class_name(&__space); \
zend_error(E_WARNING, "%s%s%s() expects exactly 0 parameters, %d given", \
__class_name, __space, \
- get_active_function_name(TSRMLS_C), __num_args); \
+ get_active_function_name(), __num_args); \
return FAILURE; \
}\
}
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, const char *type_spec, ...) /* {{{ */
+ZEND_API int zend_parse_parameters_ex(int flags, int num_args, const char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
@@ -996,14 +994,14 @@ ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, const c
RETURN_IF_ZERO_ARGS(num_args, type_spec, flags & ZEND_PARSE_PARAMS_QUIET);
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, type_spec, &va, flags);
va_end(va);
return retval;
}
/* }}} */
-ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, const char *type_spec, ...) /* {{{ */
+ZEND_API int zend_parse_parameters(int num_args, const char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
@@ -1011,14 +1009,14 @@ ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, const char *type_spec
RETURN_IF_ZERO_ARGS(num_args, type_spec, 0);
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, type_spec, &va, 0);
va_end(va);
return retval;
}
/* }}} */
-ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, const char *type_spec, ...) /* {{{ */
+ZEND_API int zend_parse_method_parameters(int num_args, zval *this_ptr, const char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
@@ -1035,7 +1033,7 @@ ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr
RETURN_IF_ZERO_ARGS(num_args, p, 0);
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, type_spec, &va, 0);
va_end(va);
} else {
p++;
@@ -1047,19 +1045,19 @@ ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr
ce = va_arg(va, zend_class_entry *);
*object = this_ptr;
- if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {
+ if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce)) {
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
- Z_OBJCE_P(this_ptr)->name->val, get_active_function_name(TSRMLS_C), ce->name->val, get_active_function_name(TSRMLS_C));
+ Z_OBJCE_P(this_ptr)->name->val, get_active_function_name(), ce->name->val, get_active_function_name());
}
- retval = zend_parse_va_args(num_args, p, &va, 0 TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, p, &va, 0);
va_end(va);
}
return retval;
}
/* }}} */
-ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, const char *type_spec, ...) /* {{{ */
+ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args, zval *this_ptr, const char *type_spec, ...) /* {{{ */
{
va_list va;
int retval;
@@ -1072,7 +1070,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
RETURN_IF_ZERO_ARGS(num_args, p, quiet);
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, type_spec, &va, flags);
va_end(va);
} else {
p++;
@@ -1084,16 +1082,16 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
ce = va_arg(va, zend_class_entry *);
*object = this_ptr;
- if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {
+ if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce)) {
if (!quiet) {
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
- ce->name->val, get_active_function_name(TSRMLS_C), Z_OBJCE_P(this_ptr)->name->val, get_active_function_name(TSRMLS_C));
+ ce->name->val, get_active_function_name(), Z_OBJCE_P(this_ptr)->name->val, get_active_function_name());
}
va_end(va);
return FAILURE;
}
- retval = zend_parse_va_args(num_args, p, &va, flags TSRMLS_CC);
+ retval = zend_parse_va_args(num_args, p, &va, flags);
va_end(va);
}
return retval;
@@ -1111,7 +1109,7 @@ ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC) /* {{{ */
/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
-ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC) /* {{{ */
+ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
{
const zend_object_handlers *obj_ht = Z_OBJ_HT_P(obj);
zend_class_entry *old_scope = EG(scope);
@@ -1124,14 +1122,14 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC)
zval member;
ZVAL_STR(&member, key);
- obj_ht->write_property(obj, &member, value, NULL TSRMLS_CC);
+ obj_ht->write_property(obj, &member, value, NULL);
}
} ZEND_HASH_FOREACH_END();
EG(scope) = old_scope;
}
/* }}} */
-static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset TSRMLS_DC) /* {{{ */
+static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset) /* {{{ */
{
ZVAL_DEREF(pp);
if (Z_CONSTANT_P(pp)) {
@@ -1148,7 +1146,7 @@ static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset T
int ret;
zend_class_entry *old_scope = *scope;
*scope = prop_info->ce;
- ret = zval_update_constant(pp, 1 TSRMLS_CC);
+ ret = zval_update_constant(pp, 1);
*scope = old_scope;
return ret;
}
@@ -1157,13 +1155,13 @@ static int zval_update_class_constant(zval *pp, int is_static, uint32_t offset T
} while (ce);
}
- return zval_update_constant(pp, 1 TSRMLS_CC);
+ return zval_update_constant(pp, 1);
}
return 0;
}
/* }}} */
-ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
{
int i;
@@ -1172,7 +1170,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zval *p;
if (class_type->parent) {
- zend_update_class_constants(class_type->parent TSRMLS_CC);
+ zend_update_class_constants(class_type->parent);
}
#if ZTS
CG(static_members_table)[(zend_intptr_t)(class_type->static_members_table)] = emalloc(sizeof(zval*) * class_type->default_static_members_count);
@@ -1206,17 +1204,17 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
*scope = class_type;
ZEND_HASH_FOREACH_VAL(&class_type->constants_table, val) {
- zval_update_constant(val, 1 TSRMLS_CC);
+ zval_update_constant(val, 1);
} ZEND_HASH_FOREACH_END();
for (i = 0; i < class_type->default_properties_count; i++) {
if (Z_TYPE(class_type->default_properties_table[i]) != IS_UNDEF) {
- zval_update_class_constant(&class_type->default_properties_table[i], 0, OBJ_PROP_TO_OFFSET(i) TSRMLS_CC);
+ zval_update_class_constant(&class_type->default_properties_table[i], 0, OBJ_PROP_TO_OFFSET(i));
}
}
for (i = 0; i < class_type->default_static_members_count; i++) {
- zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i TSRMLS_CC);
+ zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i);
}
*scope = old_scope;
@@ -1242,7 +1240,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
}
/* }}} */
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties) /* {{{ */
{
object->properties = properties;
if (object->ce->default_properties_count) {
@@ -1251,7 +1249,7 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1);
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0) {
@@ -1264,14 +1262,14 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
}
/* }}} */
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */
{
zval *prop, tmp;
zend_string *key;
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1);
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0) {
@@ -1298,7 +1296,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
-ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
+ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC) /* {{{ */
{
if (class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
char *what = (class_type->ce_flags & ZEND_ACC_INTERFACE) ? "interface"
@@ -1307,31 +1305,31 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name->val);
}
- zend_update_class_constants(class_type TSRMLS_CC);
+ zend_update_class_constants(class_type);
if (class_type->create_object == NULL) {
- ZVAL_OBJ(arg, zend_objects_new(class_type TSRMLS_CC));
+ ZVAL_OBJ(arg, zend_objects_new(class_type));
if (properties) {
- object_properties_init_ex(Z_OBJ_P(arg), properties TSRMLS_CC);
+ object_properties_init_ex(Z_OBJ_P(arg), properties);
} else {
object_properties_init(Z_OBJ_P(arg), class_type);
}
} else {
- ZVAL_OBJ(arg, class_type->create_object(class_type TSRMLS_CC));
+ ZVAL_OBJ(arg, class_type->create_object(class_type));
}
return SUCCESS;
}
/* }}} */
-ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
+ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC) /* {{{ */
{
- return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+ return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC);
}
/* }}} */
-ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
+ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC) /* {{{ */
{
- return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+ return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC);
}
/* }}} */
@@ -1652,7 +1650,7 @@ ZEND_API zval *add_get_index_stringl(zval *arg, zend_ulong index, const char *st
}
/* }}} */
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
{
zval *result;
@@ -1695,130 +1693,130 @@ ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC)
}
/* }}} */
-ZEND_API int add_property_long_ex(zval *arg, const char *key, size_t key_len, zend_long n TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_long_ex(zval *arg, const char *key, size_t key_len, zend_long n) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_LONG(&tmp, n);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_bool_ex(zval *arg, const char *key, size_t key_len, zend_long b TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_bool_ex(zval *arg, const char *key, size_t key_len, zend_long b) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_BOOL(&tmp, b);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_null_ex(zval *arg, const char *key, size_t key_len TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_null_ex(zval *arg, const char *key, size_t key_len) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_NULL(&tmp);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_RES(&tmp, r);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_double_ex(zval *arg, const char *key, size_t key_len, double d TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_double_ex(zval *arg, const char *key, size_t key_len, double d) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_DOUBLE(&tmp, d);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_STR(&tmp, str);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_STRING(&tmp, str);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length) /* {{{ */
{
zval tmp;
zval z_key;
ZVAL_STRINGL(&tmp, str, length);
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, &tmp, NULL);
zval_ptr_dtor(&tmp); /* write_property will add 1 to refcount */
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value) /* {{{ */
{
zval z_key;
ZVAL_STRINGL(&z_key, key, key_len);
- Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, value, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(arg, write_property)(arg, &z_key, value, NULL);
zval_ptr_dtor(&z_key);
return SUCCESS;
}
/* }}} */
-ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{ */
+ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */
{
size_t name_len;
zend_string *lcname;
@@ -1859,13 +1857,13 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{
ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ctor, (ts_allocate_dtor) module->globals_dtor);
#else
if (module->globals_ctor) {
- module->globals_ctor(module->globals_ptr TSRMLS_CC);
+ module->globals_ctor(module->globals_ptr);
}
#endif
}
if (module->module_startup_func) {
EG(current_module) = module;
- if (module->module_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) {
+ if (module->module_startup_func(module->type, module->module_number)==FAILURE) {
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
EG(current_module) = NULL;
return FAILURE;
@@ -1876,15 +1874,15 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{
}
/* }}} */
-static int zend_startup_module_zval(zval *zv TSRMLS_DC) /* {{{ */
+static int zend_startup_module_zval(zval *zv) /* {{{ */
{
zend_module_entry *module = Z_PTR_P(zv);
- return zend_startup_module_ex(module TSRMLS_CC);
+ return zend_startup_module_ex(module);
}
/* }}} */
-static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func_t compare TSRMLS_DC) /* {{{ */
+static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func_t compare) /* {{{ */
{
Bucket *b1 = base;
Bucket *b2;
@@ -1919,7 +1917,7 @@ try_again:
}
/* }}} */
-ZEND_API void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
+ZEND_API void zend_collect_module_handlers(void) /* {{{ */
{
zend_module_entry *module;
int startup_count = 0;
@@ -1988,10 +1986,10 @@ ZEND_API void zend_collect_module_handlers(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API int zend_startup_modules(TSRMLS_D) /* {{{ */
+ZEND_API int zend_startup_modules(void) /* {{{ */
{
- zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0 TSRMLS_CC);
- zend_hash_apply(&module_registry, zend_startup_module_zval TSRMLS_CC);
+ zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0);
+ zend_hash_apply(&module_registry, zend_startup_module_zval);
return SUCCESS;
}
/* }}} */
@@ -2004,7 +2002,7 @@ ZEND_API void zend_destroy_modules(void) /* {{{ */
}
/* }}} */
-ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC) /* {{{ */
+ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */
{
size_t name_len;
zend_string *lcname;
@@ -2053,7 +2051,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
module = module_ptr;
EG(current_module) = module;
- if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
+ if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
EG(current_module) = NULL;
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return NULL;
@@ -2064,15 +2062,15 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
}
/* }}} */
-ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
+ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */
{
module->module_number = zend_next_free_module();
module->type = MODULE_PERSISTENT;
- return zend_register_module_ex(module TSRMLS_CC);
+ return zend_register_module_ex(module);
}
/* }}} */
-ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC) /* {{{ */
+ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type) /* {{{ */
{
char lcname[16];
size_t name_len;
@@ -2137,7 +2135,7 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
/* }}} */
/* registers all functions in *library_functions in the function hash */
-ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type) /* {{{ */
{
const zend_function_entry *ptr = functions;
zend_function function, *reg_function;
@@ -2177,7 +2175,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
while (ptr->fname) {
fname_len = strlen(ptr->fname);
internal_function->handler = ptr->handler;
- internal_function->function_name = zend_new_interned_string(zend_string_init(ptr->fname, fname_len, 1) TSRMLS_CC);
+ internal_function->function_name = zend_new_interned_string(zend_string_init(ptr->fname, fname_len, 1));
internal_function->scope = scope;
internal_function->prototype = NULL;
if (ptr->flags) {
@@ -2239,13 +2237,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
efree((char*)lc_class_name);
}
zend_error(error_type, "Method %s%s%s() cannot be a NULL function", scope ? scope->name->val : "", scope ? "::" : "", ptr->fname);
- zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
+ zend_unregister_functions(functions, count, target_function_table);
return FAILURE;
}
}
lowercase_name = zend_string_alloc(fname_len, 1);
zend_str_tolower_copy(lowercase_name->val, ptr->fname, fname_len);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ lowercase_name = zend_new_interned_string(lowercase_name);
reg_function = malloc(sizeof(zend_internal_function));
memcpy(reg_function, &function, sizeof(zend_internal_function));
if (zend_hash_add_ptr(target_function_table, lowercase_name, reg_function) == NULL) {
@@ -2303,7 +2301,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
reg_function = NULL;
}
if (reg_function) {
- zend_check_magic_method_implementation(scope, reg_function, error_type TSRMLS_CC);
+ zend_check_magic_method_implementation(scope, reg_function, error_type);
}
}
ptr++;
@@ -2324,7 +2322,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
zend_string_free(lowercase_name);
ptr++;
}
- zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
+ zend_unregister_functions(functions, count, target_function_table);
return FAILURE;
}
if (scope) {
@@ -2416,7 +2414,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
-ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC) /* {{{ */
+ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table) /* {{{ */
{
const zend_function_entry *ptr = functions;
int i=0;
@@ -2442,9 +2440,9 @@ ZEND_API void zend_unregister_functions(const zend_function_entry *functions, in
}
/* }}} */
-ZEND_API int zend_startup_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
+ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */
{
- if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) {
+ if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == SUCCESS) {
return SUCCESS;
}
return FAILURE;
@@ -2460,7 +2458,7 @@ ZEND_API int zend_get_module_started(const char *module_name) /* {{{ */
}
/* }}} */
-static int clean_module_class(zval *el, void *arg TSRMLS_DC) /* {{{ */
+static int clean_module_class(zval *el, void *arg) /* {{{ */
{
zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el);
int module_number = *(int *)arg;
@@ -2472,27 +2470,26 @@ static int clean_module_class(zval *el, void *arg TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void clean_module_classes(int module_number TSRMLS_DC) /* {{{ */
+static void clean_module_classes(int module_number) /* {{{ */
{
- zend_hash_apply_with_argument(EG(class_table), clean_module_class, (void *) &module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(class_table), clean_module_class, (void *) &module_number);
}
/* }}} */
void module_destructor(zend_module_entry *module) /* {{{ */
{
- TSRMLS_FETCH();
if (module->type == MODULE_TEMPORARY) {
- zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
- clean_module_constants(module->module_number TSRMLS_CC);
- clean_module_classes(module->module_number TSRMLS_CC);
+ zend_clean_module_rsrc_dtors(module->module_number);
+ clean_module_constants(module->module_number);
+ clean_module_classes(module->module_number);
}
if (module->module_started && module->module_shutdown_func) {
#if 0
zend_printf("%s: Module shutdown\n", module->name);
#endif
- module->module_shutdown_func(module->type, module->module_number TSRMLS_CC);
+ module->module_shutdown_func(module->type, module->module_number);
}
/* Deinitilaise module globals */
@@ -2503,14 +2500,14 @@ void module_destructor(zend_module_entry *module) /* {{{ */
}
#else
if (module->globals_dtor) {
- module->globals_dtor(module->globals_ptr TSRMLS_CC);
+ module->globals_dtor(module->globals_ptr);
}
#endif
}
module->module_started=0;
if (module->functions) {
- zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC);
+ zend_unregister_functions(module->functions, -1, NULL);
}
#if HAVE_LIBDL
@@ -2523,14 +2520,14 @@ void module_destructor(zend_module_entry *module) /* {{{ */
}
/* }}} */
-ZEND_API void zend_activate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate_modules(void) /* {{{ */
{
zend_module_entry **p = module_request_startup_handlers;
while (*p) {
zend_module_entry *module = *p;
- if (module->request_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) {
+ if (module->request_startup_func(module->type, module->module_number)==FAILURE) {
zend_error(E_WARNING, "request_startup() for %s module failed", module->name);
exit(1);
}
@@ -2540,7 +2537,7 @@ ZEND_API void zend_activate_modules(TSRMLS_D) /* {{{ */
/* }}} */
/* call request shutdown for all modules */
-static int module_registry_cleanup(zval *zv TSRMLS_DC) /* {{{ */
+static int module_registry_cleanup(zval *zv) /* {{{ */
{
zend_module_entry *module = Z_PTR_P(zv);
@@ -2548,26 +2545,26 @@ static int module_registry_cleanup(zval *zv TSRMLS_DC) /* {{{ */
#if 0
zend_printf("%s: Request shutdown\n", module->name);
#endif
- module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
+ module->request_shutdown_func(module->type, module->module_number);
}
return 0;
}
/* }}} */
-ZEND_API void zend_deactivate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_deactivate_modules(void) /* {{{ */
{
EG(current_execute_data) = NULL; /* we're no longer executing anything */
zend_try {
if (EG(full_tables_cleanup)) {
- zend_hash_reverse_apply(&module_registry, module_registry_cleanup TSRMLS_CC);
+ zend_hash_reverse_apply(&module_registry, module_registry_cleanup);
} else {
zend_module_entry **p = module_request_shutdown_handlers;
while (*p) {
zend_module_entry *module = *p;
- module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
+ module->request_shutdown_func(module->type, module->module_number);
p++;
}
}
@@ -2575,31 +2572,31 @@ ZEND_API void zend_deactivate_modules(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_cleanup_internal_classes(TSRMLS_D) /* {{{ */
+ZEND_API void zend_cleanup_internal_classes(void) /* {{{ */
{
zend_class_entry **p = class_cleanup_handlers;
while (*p) {
- zend_cleanup_internal_class_data(*p TSRMLS_CC);
+ zend_cleanup_internal_class_data(*p);
p++;
}
}
/* }}} */
-int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC) /* {{{ */
+int module_registry_unload_temp(const zend_module_entry *module) /* {{{ */
{
return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP;
}
/* }}} */
-static int module_registry_unload_temp_wrapper(zval *el TSRMLS_DC) /* {{{ */
+static int module_registry_unload_temp_wrapper(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el);
- return module_registry_unload_temp((const zend_module_entry *)module TSRMLS_CC);
+ return module_registry_unload_temp((const zend_module_entry *)module);
}
/* }}} */
-static int exec_done_cb(zval *el TSRMLS_DC) /* {{{ */
+static int exec_done_cb(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el);
if (module->post_deactivate_func) {
@@ -2609,11 +2606,11 @@ static int exec_done_cb(zval *el TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
+ZEND_API void zend_post_deactivate_modules(void) /* {{{ */
{
if (EG(full_tables_cleanup)) {
- zend_hash_apply(&module_registry, exec_done_cb TSRMLS_CC);
- zend_hash_reverse_apply(&module_registry, module_registry_unload_temp_wrapper TSRMLS_CC);
+ zend_hash_apply(&module_registry, exec_done_cb);
+ zend_hash_reverse_apply(&module_registry, module_registry_unload_temp_wrapper);
} else {
zend_module_entry **p = module_post_deactivate_handlers;
@@ -2634,23 +2631,23 @@ ZEND_API int zend_next_free_module(void) /* {{{ */
}
/* }}} */
-static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, uint32_t ce_flags TSRMLS_DC) /* {{{ */
+static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, uint32_t ce_flags) /* {{{ */
{
zend_class_entry *class_entry = malloc(sizeof(zend_class_entry));
zend_string *lowercase_name = zend_string_alloc(orig_class_entry->name->len, 1);
*class_entry = *orig_class_entry;
class_entry->type = ZEND_INTERNAL_CLASS;
- zend_initialize_class_data(class_entry, 0 TSRMLS_CC);
+ zend_initialize_class_data(class_entry, 0);
class_entry->ce_flags = ce_flags | ZEND_ACC_CONSTANTS_UPDATED;
class_entry->info.internal.module = EG(current_module);
if (class_entry->info.internal.builtin_functions) {
- zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC);
+ zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, MODULE_PERSISTENT);
}
zend_str_tolower_copy(lowercase_name->val, orig_class_entry->name->val, class_entry->name->len);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ lowercase_name = zend_new_interned_string(lowercase_name);
zend_hash_update_ptr(CG(class_table), lowercase_name, class_entry);
zend_string_release(lowercase_name);
return class_entry;
@@ -2662,20 +2659,20 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
* If both parent_ce and parent_name are NULL it does a regular class registration
* If parent_name is specified but not found NULL is returned
*/
-ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce) /* {{{ */
{
zend_class_entry *register_class;
- register_class = zend_register_internal_class(class_entry TSRMLS_CC);
+ register_class = zend_register_internal_class(class_entry);
if (parent_ce) {
- zend_do_inheritance(register_class, parent_ce TSRMLS_CC);
+ zend_do_inheritance(register_class, parent_ce);
}
return register_class;
}
/* }}} */
-ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...) /* {{{ */
+ZEND_API void zend_class_implements(zend_class_entry *class_entry, int num_interfaces, ...) /* {{{ */
{
zend_class_entry *interface_entry;
va_list interface_list;
@@ -2683,7 +2680,7 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
while (num_interfaces--) {
interface_entry = va_arg(interface_list, zend_class_entry *);
- zend_do_implement_interface(class_entry, interface_entry TSRMLS_CC);
+ zend_do_implement_interface(class_entry, interface_entry);
}
va_end(interface_list);
@@ -2692,19 +2689,19 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
/* A class that contains at least one abstract method automatically becomes an abstract class.
*/
-ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry) /* {{{ */
{
- return do_register_internal_class(orig_class_entry, 0 TSRMLS_CC);
+ return do_register_internal_class(orig_class_entry, 0);
}
/* }}} */
-ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry) /* {{{ */
{
- return do_register_internal_class(orig_class_entry, ZEND_ACC_INTERFACE TSRMLS_CC);
+ return do_register_internal_class(orig_class_entry, ZEND_ACC_INTERFACE);
}
/* }}} */
-ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce) /* {{{ */
{
zend_string *lcname;
@@ -2755,11 +2752,11 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_lengt
Dummy function which displays an error when a disabled function is called. */
ZEND_API ZEND_FUNCTION(display_disabled_function)
{
- zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name(TSRMLS_C));
+ zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name());
}
/* }}} */
-ZEND_API int zend_disable_function(char *function_name, size_t function_name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_disable_function(char *function_name, size_t function_name_length) /* {{{ */
{
zend_internal_function *func;
if ((func = zend_hash_str_find_ptr(CG(function_table), function_name, function_name_length))) {
@@ -2774,11 +2771,11 @@ ZEND_API int zend_disable_function(char *function_name, size_t function_name_len
#ifdef ZEND_WIN32
#pragma optimize("", off)
#endif
-static zend_object *display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{ */
{
zend_object *intern;
- intern = zend_objects_new(class_type TSRMLS_CC);
+ intern = zend_objects_new(class_type);
zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name->val);
return intern;
}
@@ -2791,7 +2788,7 @@ static const zend_function_entry disabled_class_new[] = {
ZEND_FE_END
};
-ZEND_API int zend_disable_class(char *class_name, size_t class_name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {{{ */
{
zend_class_entry *disabled_class;
zend_string *key;
@@ -2809,7 +2806,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length TSRML
}
/* }}} */
-static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache *fcc, int *strict_class, char **error TSRMLS_DC) /* {{{ */
+static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache *fcc, int *strict_class, char **error) /* {{{ */
{
int ret = 0;
zend_class_entry *ce;
@@ -2858,7 +2855,7 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
*strict_class = 1;
ret = 1;
}
- } else if ((ce = zend_lookup_class_ex(name, NULL, 1 TSRMLS_CC)) != NULL) {
+ } else if ((ce = zend_lookup_class_ex(name, NULL, 1)) != NULL) {
zend_class_entry *scope;
zend_execute_data *ex = EG(current_execute_data);
@@ -2868,8 +2865,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
scope = ex ? ex->func->common.scope : NULL;
fcc->calling_scope = ce;
if (scope && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
- instanceof_function(Z_OBJCE(EG(current_execute_data)->This), scope TSRMLS_CC) &&
- instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(EG(current_execute_data)->This), scope) &&
+ instanceof_function(scope, fcc->calling_scope)) {
fcc->object = Z_OBJ(EG(current_execute_data)->This);
fcc->called_scope = Z_OBJCE(EG(current_execute_data)->This);
} else {
@@ -2885,7 +2882,7 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
}
/* }}} */
-static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
+static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error) /* {{{ */
{
zend_class_entry *ce_org = fcc->calling_scope;
int retval = 0;
@@ -2960,7 +2957,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
}
cname = zend_string_init(Z_STRVAL_P(callable), clen, 0);
- if (!zend_is_callable_check_class(cname, fcc, &strict_class, error TSRMLS_CC)) {
+ if (!zend_is_callable_check_class(cname, fcc, &strict_class, error)) {
zend_string_release(cname);
EG(scope) = last_scope;
return 0;
@@ -2969,7 +2966,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
EG(scope) = last_scope;
ftable = &fcc->calling_scope->function_table;
- if (ce_org && !instanceof_function(ce_org, fcc->calling_scope TSRMLS_CC)) {
+ if (ce_org && !instanceof_function(ce_org, fcc->calling_scope)) {
if (error) zend_spprintf(error, 0, "class '%s' is not a subclass of '%s'", ce_org->name->val, fcc->calling_scope->name->val);
return 0;
}
@@ -3002,7 +2999,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
retval = 1;
if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) &&
!strict_class && EG(scope) &&
- instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) {
+ instanceof_function(fcc->function_handler->common.scope, EG(scope))) {
zend_function *priv_fbc;
if ((priv_fbc = zend_hash_find_ptr(&EG(scope)->function_table, lmname)) != NULL
@@ -3016,7 +3013,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
((fcc->object && fcc->calling_scope->__call) ||
(!fcc->object && fcc->calling_scope->__callstatic)))) {
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
- if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname TSRMLS_CC)) {
+ if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname)) {
retval = 0;
fcc->function_handler = NULL;
goto get_function_via_handler;
@@ -3046,11 +3043,11 @@ get_function_via_handler:
call_via_handler = 1;
retval = 1;
} else if (fcc->object->handlers->get_method) {
- fcc->function_handler = fcc->object->handlers->get_method(&fcc->object, mname, NULL TSRMLS_CC);
+ fcc->function_handler = fcc->object->handlers->get_method(&fcc->object, mname, NULL);
if (fcc->function_handler) {
if (strict_class &&
(!fcc->function_handler->common.scope ||
- !instanceof_function(ce_org, fcc->function_handler->common.scope TSRMLS_CC))) {
+ !instanceof_function(ce_org, fcc->function_handler->common.scope))) {
if ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
zend_string_release(fcc->function_handler->common.function_name);
@@ -3065,15 +3062,15 @@ get_function_via_handler:
}
} else if (fcc->calling_scope) {
if (fcc->calling_scope->get_static_method) {
- fcc->function_handler = fcc->calling_scope->get_static_method(fcc->calling_scope, mname TSRMLS_CC);
+ fcc->function_handler = fcc->calling_scope->get_static_method(fcc->calling_scope, mname);
} else {
- fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, NULL TSRMLS_CC);
+ fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, NULL);
}
if (fcc->function_handler) {
retval = 1;
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
if (call_via_handler && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
- instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope)) {
fcc->object = Z_OBJ(EG(current_execute_data)->This);
}
}
@@ -3103,7 +3100,7 @@ get_function_via_handler:
if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) {
retval = 0;
}
- if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+ if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope)) {
fcc->object = Z_OBJ(EG(current_execute_data)->This);
if (error) {
zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val);
@@ -3126,7 +3123,7 @@ get_function_via_handler:
}
if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) {
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
- if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname TSRMLS_CC)) {
+ if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname)) {
if (error) {
if (*error) {
efree(*error);
@@ -3168,7 +3165,7 @@ get_function_via_handler:
}
/* }}} */
-ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
{
zend_bool ret;
zend_fcall_info_cache fcc_local;
@@ -3220,7 +3217,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
return 1;
}
- ret = zend_is_callable_check_func(check_flags, callable, fcc, 0, error TSRMLS_CC);
+ ret = zend_is_callable_check_func(check_flags, callable, fcc, 0, error);
if (fcc == &fcc_local &&
fcc->function_handler &&
((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION &&
@@ -3274,7 +3271,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
return 1;
}
- if (!zend_is_callable_check_class(Z_STR_P(obj), fcc, &strict_class, error TSRMLS_CC)) {
+ if (!zend_is_callable_check_class(Z_STR_P(obj), fcc, &strict_class, error)) {
return 0;
}
@@ -3308,7 +3305,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
break;
}
- ret = zend_is_callable_check_func(check_flags, method, fcc, strict_class, error TSRMLS_CC);
+ ret = zend_is_callable_check_func(check_flags, method, fcc, strict_class, error);
if (fcc == &fcc_local &&
fcc->function_handler &&
((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION &&
@@ -3341,7 +3338,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
return 0;
case IS_OBJECT:
- if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(callable, &fcc->calling_scope, &fcc->function_handler, &fcc->object TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(callable, &fcc->calling_scope, &fcc->function_handler, &fcc->object) == SUCCESS) {
fcc->called_scope = fcc->calling_scope;
if (callable_name) {
zend_class_entry *ce = Z_OBJCE_P(callable); /* TBFixed: what if it's overloaded? */
@@ -3364,17 +3361,17 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint
}
/* }}} */
-ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zend_string **callable_name TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zend_string **callable_name) /* {{{ */
{
- return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL TSRMLS_CC);
+ return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
}
/* }}} */
-ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
{
zend_fcall_info_cache fcc;
- if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_STRICT, callable_name, &fcc, NULL TSRMLS_CC)) {
+ if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_STRICT, callable_name, &fcc, NULL)) {
if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) {
zval_dtor(callable);
array_init(callable);
@@ -3397,9 +3394,9 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_nam
}
/* }}} */
-ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error TSRMLS_DC) /* {{{ */
+ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
{
- if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error TSRMLS_CC)) {
+ if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) {
return FAILURE;
}
@@ -3451,7 +3448,7 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count
}
/* }}} */
-ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC) /* {{{ */
+ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args) /* {{{ */
{
zval *arg, *params;
uint32_t n = 1;
@@ -3486,13 +3483,13 @@ ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func,
}
/* }}} */
-ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /* {{{ */
+ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args) /* {{{ */
{
- return zend_fcall_info_args_ex(fci, NULL, args TSRMLS_CC);
+ return zend_fcall_info_args_ex(fci, NULL, args);
}
/* }}} */
-ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval *argv) /* {{{ */
+ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci, int argc, zval *argv) /* {{{ */
{
int i;
@@ -3515,7 +3512,7 @@ ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval
}
/* }}} */
-ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv) /* {{{ */
+ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci, int argc, va_list *argv) /* {{{ */
{
int i;
zval *arg;
@@ -3540,20 +3537,20 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
}
/* }}} */
-ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...) /* {{{ */
+ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci, int argc, ...) /* {{{ */
{
int ret;
va_list argv;
va_start(argv, argc);
- ret = zend_fcall_info_argv(fci TSRMLS_CC, argc, &argv);
+ ret = zend_fcall_info_argv(fci, argc, &argv);
va_end(argv);
return ret;
}
/* }}} */
-ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval_ptr, zval *args TSRMLS_DC) /* {{{ */
+ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval_ptr, zval *args) /* {{{ */
{
zval retval, *org_params = NULL;
int result, org_count = 0;
@@ -3561,9 +3558,9 @@ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *f
fci->retval = retval_ptr ? retval_ptr : &retval;
if (args) {
zend_fcall_info_args_save(fci, &org_count, &org_params);
- zend_fcall_info_args(fci, args TSRMLS_CC);
+ zend_fcall_info_args(fci, args);
}
- result = zend_call_function(fci, fcc TSRMLS_CC);
+ result = zend_call_function(fci, fcc);
if (!retval_ptr && Z_TYPE(retval) != IS_UNDEF) {
zval_ptr_dtor(&retval);
@@ -3589,7 +3586,7 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
}
/* }}} */
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment) /* {{{ */
{
zend_property_info *property_info, *property_info_ptr;
@@ -3657,7 +3654,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
break;
}
- property_info->name = zend_new_interned_string(property_info->name TSRMLS_CC);
+ property_info->name = zend_new_interned_string(property_info->name);
property_info->flags = access_type;
property_info->doc_comment = doc_comment;
property_info->ce = ce;
@@ -3667,70 +3664,70 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
}
/* }}} */
-ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS);
- int ret = zend_declare_property_ex(ce, key, property, access_type, NULL TSRMLS_CC);
+ int ret = zend_declare_property_ex(ce, key, property, access_type, NULL);
zend_string_release(key);
return ret;
}
/* }}} */
-ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, size_t name_length, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, size_t name_length, int access_type) /* {{{ */
{
zval property;
ZVAL_NULL(&property);
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type) /* {{{ */
{
zval property;
ZVAL_BOOL(&property, value);
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type) /* {{{ */
{
zval property;
ZVAL_LONG(&property, value);
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, size_t name_length, double value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, size_t name_length, double value, int access_type) /* {{{ */
{
zval property;
ZVAL_DOUBLE(&property, value);
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value, int access_type) /* {{{ */
{
zval property;
ZVAL_NEW_STR(&property, zend_string_init(value, strlen(value), ce->type & ZEND_INTERNAL_CLASS));
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_len, int access_type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_len, int access_type) /* {{{ */
{
zval property;
ZVAL_NEW_STR(&property, zend_string_init(value, value_len, ce->type & ZEND_INTERNAL_CLASS));
- return zend_declare_property(ce, name, name_length, &property, access_type TSRMLS_CC);
+ return zend_declare_property(ce, name, name_length, &property, access_type);
}
/* }}} */
-ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value) /* {{{ */
{
if (Z_CONSTANT_P(value)) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
@@ -3740,58 +3737,58 @@ ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name,
}
/* }}} */
-ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length) /* {{{ */
{
zval constant;
ZVAL_NULL(&constant);
- return zend_declare_class_constant(ce, name, name_length, &constant TSRMLS_CC);
+ return zend_declare_class_constant(ce, name, name_length, &constant);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval constant;
ZVAL_LONG(&constant, value);
- return zend_declare_class_constant(ce, name, name_length, &constant TSRMLS_CC);
+ return zend_declare_class_constant(ce, name, name_length, &constant);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value) /* {{{ */
{
zval constant;
ZVAL_BOOL(&constant, value);
- return zend_declare_class_constant(ce, name, name_length, &constant TSRMLS_CC);
+ return zend_declare_class_constant(ce, name, name_length, &constant);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value) /* {{{ */
{
zval constant;
ZVAL_DOUBLE(&constant, value);
- return zend_declare_class_constant(ce, name, name_length, &constant TSRMLS_CC);
+ return zend_declare_class_constant(ce, name, name_length, &constant);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length) /* {{{ */
{
zval constant;
ZVAL_NEW_STR(&constant, zend_string_init(value, value_length, ce->type & ZEND_INTERNAL_CLASS));
- return zend_declare_class_constant(ce, name, name_length, &constant TSRMLS_CC);
+ return zend_declare_class_constant(ce, name, name_length, &constant);
}
/* }}} */
-ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value) /* {{{ */
{
- return zend_declare_class_constant_stringl(ce, name, name_length, value, strlen(value) TSRMLS_CC);
+ return zend_declare_class_constant_stringl(ce, name, name_length, value, strlen(value));
}
/* }}} */
-ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value) /* {{{ */
{
zval property;
zend_class_entry *old_scope = EG(scope);
@@ -3802,86 +3799,86 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, Z_OBJCE_P(object)->name->val);
}
ZVAL_STRINGL(&property, name, name_length);
- Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL);
zval_ptr_dtor(&property);
EG(scope) = old_scope;
}
/* }}} */
-ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
{
zval tmp;
ZVAL_NULL(&tmp);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;
ZVAL_BOOL(&tmp, value);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;
ZVAL_LONG(&tmp, value);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, size_t name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, size_t name_length, double value) /* {{{ */
{
zval tmp;
ZVAL_DOUBLE(&tmp, value);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value) /* {{{ */
{
zval tmp;
ZVAL_STR(&tmp, value);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value) /* {{{ */
{
zval tmp;
ZVAL_STRING(&tmp, value);
Z_SET_REFCOUNT(tmp, 0);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_len TSRMLS_DC) /* {{{ */
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
{
zval tmp;
ZVAL_STRINGL(&tmp, value, value_len);
Z_SET_REFCOUNT(tmp, 0);
- zend_update_property(scope, object, name, name_length, &tmp TSRMLS_CC);
+ zend_update_property(scope, object, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(scope);
zend_string *key = zend_string_init(name, name_length, 0);
EG(scope) = scope;
- property = zend_std_get_static_property(scope, key, 0, NULL TSRMLS_CC);
+ property = zend_std_get_static_property(scope, key, 0, NULL);
EG(scope) = old_scope;
zend_string_free(key);
if (!property) {
@@ -3913,63 +3910,63 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
}
/* }}} */
-ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length) /* {{{ */
{
zval tmp;
ZVAL_NULL(&tmp);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;
ZVAL_BOOL(&tmp, value);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;
ZVAL_LONG(&tmp, value);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value) /* {{{ */
{
zval tmp;
ZVAL_DOUBLE(&tmp, value);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value) /* {{{ */
{
zval tmp;
ZVAL_STRING(&tmp, value);
Z_SET_REFCOUNT(tmp, 0);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
{
zval tmp;
ZVAL_STRINGL(&tmp, value, value_len);
Z_SET_REFCOUNT(tmp, 0);
- return zend_update_static_property(scope, name, name_length, &tmp TSRMLS_CC);
+ return zend_update_static_property(scope, name, name_length, &tmp);
}
/* }}} */
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent TSRMLS_DC) /* {{{ */
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent) /* {{{ */
{
zval property, *value;
zend_class_entry *old_scope = EG(scope);
@@ -3982,7 +3979,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c
}
ZVAL_STRINGL(&property, name, name_length);
- value = Z_OBJ_HT_P(object)->read_property(object, &property, silent?BP_VAR_IS:BP_VAR_R, NULL, &rv TSRMLS_CC);
+ value = Z_OBJ_HT_P(object)->read_property(object, &property, silent?BP_VAR_IS:BP_VAR_R, NULL, &rv);
zval_ptr_dtor(&property);
EG(scope) = old_scope;
@@ -3990,14 +3987,14 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c
}
/* }}} */
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent TSRMLS_DC) /* {{{ */
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(scope);
zend_string *key = zend_string_init(name, name_length, 0);
EG(scope) = scope;
- property = zend_std_get_static_property(scope, key, silent, NULL TSRMLS_CC);
+ property = zend_std_get_static_property(scope, key, silent, NULL);
EG(scope) = old_scope;
zend_string_free(key);
@@ -4005,7 +4002,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *na
}
/* }}} */
-ZEND_API void zend_save_error_handling(zend_error_handling *current TSRMLS_DC) /* {{{ */
+ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */
{
current->handling = EG(error_handling);
current->exception = EG(exception_class);
@@ -4013,10 +4010,10 @@ ZEND_API void zend_save_error_handling(zend_error_handling *current TSRMLS_DC) /
}
/* }}} */
-ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current TSRMLS_DC) /* {{{ */
+ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current) /* {{{ */
{
if (current) {
- zend_save_error_handling(current TSRMLS_CC);
+ zend_save_error_handling(current);
if (error_handling != EH_NORMAL && Z_TYPE(EG(user_error_handler)) != IS_UNDEF) {
zval_ptr_dtor(&EG(user_error_handler));
ZVAL_UNDEF(&EG(user_error_handler));
@@ -4053,7 +4050,7 @@ static int same_zval(zval *zv1, zval *zv2) /* {{{ */
}
/* }}} */
-ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC) /* {{{ */
+ZEND_API void zend_restore_error_handling(zend_error_handling *saved) /* {{{ */
{
EG(error_handling) = saved->handling;
EG(exception_class) = saved->handling == EH_THROW ? saved->exception : NULL;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 1e031ca844..9442724ec1 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -129,8 +129,8 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void)
#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
-#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
-#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
+#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals)
+#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals)
#define ZEND_GET_MODULE(name) \
BEGIN_EXTERN_C()\
@@ -172,7 +172,7 @@ typedef struct _zend_fcall_info_cache {
{ \
zend_string *cl_name; \
cl_name = zend_string_init(class_name, class_name_len, 1); \
- class_container.name = zend_new_interned_string(cl_name TSRMLS_CC); \
+ class_container.name = zend_new_interned_string(cl_name); \
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
}
@@ -234,59 +234,59 @@ ZEND_API int zend_next_free_module(void);
BEGIN_EXTERN_C()
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
ZEND_API ZEND_ATTRIBUTE_DEPRECATED int zend_get_parameters_ex(int param_count, ...);
-ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array TSRMLS_DC);
+ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array);
/* internal function to efficiently copy parameters when executing __call() */
-ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TSRMLS_DC);
+ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array);
#define zend_get_parameters_array(ht, param_count, argument_array) \
- _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC)
+ _zend_get_parameters_array_ex(param_count, argument_array)
#define zend_get_parameters_array_ex(param_count, argument_array) \
- _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC)
+ _zend_get_parameters_array_ex(param_count, argument_array)
#define zend_parse_parameters_none() \
- zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
+ zend_parse_parameters(ZEND_NUM_ARGS(), "")
/* Parameter parsing API -- andrei */
#define ZEND_PARSE_PARAMS_QUIET (1<<1)
-ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, const char *type_spec, ...);
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, const char *type_spec, ...);
+ZEND_API int zend_parse_parameters(int num_args, const char *type_spec, ...);
+ZEND_API int zend_parse_parameters_ex(int flags, int num_args, const char *type_spec, ...);
ZEND_API char *zend_zval_type_name(const zval *arg);
-ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, const char *type_spec, ...);
-ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, const char *type_spec, ...);
+ZEND_API int zend_parse_method_parameters(int num_args, zval *this_ptr, const char *type_spec, ...);
+ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args, zval *this_ptr, const char *type_spec, ...);
-ZEND_API int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval *arg, const char *spec, ...);
+ZEND_API int zend_parse_parameter(int flags, int arg_num, zval *arg, const char *spec, ...);
/* End of parameter parsing API -- andrei */
-ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
-ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
-ZEND_API int zend_startup_module(zend_module_entry *module_entry TSRMLS_DC);
-ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC);
-ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
-ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
-ZEND_API int zend_startup_modules(TSRMLS_D);
-ZEND_API void zend_collect_module_handlers(TSRMLS_D);
+ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type);
+ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table);
+ZEND_API int zend_startup_module(zend_module_entry *module_entry);
+ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry);
+ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module);
+ZEND_API int zend_startup_module_ex(zend_module_entry *module);
+ZEND_API int zend_startup_modules(void);
+ZEND_API void zend_collect_module_handlers(void);
ZEND_API void zend_destroy_modules(void);
-ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC);
+ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type);
-ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
-ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce TSRMLS_DC);
-ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC);
-ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...);
+ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry);
+ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce);
+ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry);
+ZEND_API void zend_class_implements(zend_class_entry *class_entry, int num_interfaces, ...);
-ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce TSRMLS_DC);
+ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce);
#define zend_register_class_alias(name, ce) \
- zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
+ zend_register_class_alias_ex(name, sizeof(name)-1, ce)
#define zend_register_ns_class_alias(ns, name, ce) \
- zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
+ zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce)
-ZEND_API int zend_disable_function(char *function_name, size_t function_name_length TSRMLS_DC);
-ZEND_API int zend_disable_class(char *class_name, size_t class_name_length TSRMLS_DC);
+ZEND_API int zend_disable_function(char *function_name, size_t function_name_length);
+ZEND_API int zend_disable_class(char *class_name, size_t class_name_length);
-ZEND_API void zend_wrong_param_count(TSRMLS_D);
+ZEND_API void zend_wrong_param_count(void);
#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
#define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
@@ -295,49 +295,49 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
#define IS_CALLABLE_STRICT (IS_CALLABLE_CHECK_IS_STATIC)
-ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error TSRMLS_DC);
-ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zend_string **callable_name TSRMLS_DC);
-ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name TSRMLS_DC);
+ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
+ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zend_string **callable_name);
+ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name);
ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API int zend_get_module_started(const char *module_name);
-ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment TSRMLS_DC);
-ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, size_t name_length, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, size_t name_length, double value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value, int access_type TSRMLS_DC);
-ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_len, int access_type TSRMLS_DC);
-
-ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
-ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC);
-
-ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
-ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value TSRMLS_DC);
-ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, size_t name_length TSRMLS_DC);
-ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value TSRMLS_DC);
-ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value TSRMLS_DC);
-ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, size_t name_length, double value TSRMLS_DC);
-ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value TSRMLS_DC);
-ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value TSRMLS_DC);
-ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
-
-ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value TSRMLS_DC);
-ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length TSRMLS_DC);
-ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value TSRMLS_DC);
-ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value TSRMLS_DC);
-ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value TSRMLS_DC);
-ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value TSRMLS_DC);
-ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
-
-ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent TSRMLS_DC);
-
-ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent TSRMLS_DC);
+ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment);
+ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type);
+ZEND_API int zend_declare_property_null(zend_class_entry *ce, const char *name, size_t name_length, int access_type);
+ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type);
+ZEND_API int zend_declare_property_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value, int access_type);
+ZEND_API int zend_declare_property_double(zend_class_entry *ce, const char *name, size_t name_length, double value, int access_type);
+ZEND_API int zend_declare_property_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value, int access_type);
+ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_len, int access_type);
+
+ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value);
+ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length);
+ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value);
+ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value);
+ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value);
+ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length);
+ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value);
+
+ZEND_API void zend_update_class_constants(zend_class_entry *class_type);
+ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value);
+ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
+ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
+ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
+ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, size_t name_length, double value);
+ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
+ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
+ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
+
+ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
+ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
+ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value);
+ZEND_API int zend_update_static_property_long(zend_class_entry *scope, const char *name, size_t name_length, zend_long value);
+ZEND_API int zend_update_static_property_double(zend_class_entry *scope, const char *name, size_t name_length, double value);
+ZEND_API int zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value);
+ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length);
+
+ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent);
+
+ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent);
ZEND_API char *zend_get_type_by_const(int type);
@@ -348,8 +348,8 @@ ZEND_API char *zend_get_type_by_const(int type);
#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
#define ARG_COUNT(dummy) EX_NUM_ARGS()
#define ZEND_NUM_ARGS() EX_NUM_ARGS()
-#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(TSRMLS_C); return; }
-#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { zend_wrong_param_count(TSRMLS_C); return ret; }
+#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(); return; }
+#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { zend_wrong_param_count(); return ret; }
#ifndef ZEND_WIN32
#define DLEXPORT
@@ -357,18 +357,18 @@ ZEND_API char *zend_get_type_by_const(int type);
#define array_init(arg) _array_init((arg), 0 ZEND_FILE_LINE_CC)
#define array_init_size(arg, size) _array_init((arg), (size) ZEND_FILE_LINE_CC)
-#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC)
-#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC)
-#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC TSRMLS_CC)
+#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
+#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
+#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC)
ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC);
-ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
-ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
-ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC);
+ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
+ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
+ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC);
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type);
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC);
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC);
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties);
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties);
-ZEND_API void zend_merge_properties(zval *obj, HashTable *properties TSRMLS_DC);
+ZEND_API void zend_merge_properties(zval *obj, HashTable *properties);
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
@@ -431,31 +431,31 @@ ZEND_API zval *add_get_index_str(zval *arg, zend_ulong index, zend_string *str);
ZEND_API zval *add_get_index_string(zval *arg, zend_ulong idx, const char *str);
ZEND_API zval *add_get_index_stringl(zval *arg, zend_ulong idx, const char *str, size_t length);
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC);
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
-ZEND_API int add_property_long_ex(zval *arg, const char *key, size_t key_len, zend_long l TSRMLS_DC);
-ZEND_API int add_property_null_ex(zval *arg, const char *key, size_t key_len TSRMLS_DC);
-ZEND_API int add_property_bool_ex(zval *arg, const char *key, size_t key_len, zend_long b TSRMLS_DC);
-ZEND_API int add_property_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r TSRMLS_DC);
-ZEND_API int add_property_double_ex(zval *arg, const char *key, size_t key_len, double d TSRMLS_DC);
-ZEND_API int add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str TSRMLS_DC);
-ZEND_API int add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str TSRMLS_DC);
-ZEND_API int add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length TSRMLS_DC);
-ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value TSRMLS_DC);
+ZEND_API int add_property_long_ex(zval *arg, const char *key, size_t key_len, zend_long l);
+ZEND_API int add_property_null_ex(zval *arg, const char *key, size_t key_len);
+ZEND_API int add_property_bool_ex(zval *arg, const char *key, size_t key_len, zend_long b);
+ZEND_API int add_property_resource_ex(zval *arg, const char *key, size_t key_len, zend_resource *r);
+ZEND_API int add_property_double_ex(zval *arg, const char *key, size_t key_len, double d);
+ZEND_API int add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str);
+ZEND_API int add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str);
+ZEND_API int add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length);
+ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value);
-#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key), __n TSRMLS_CC)
-#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) TSRMLS_CC)
-#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key), __b TSRMLS_CC)
-#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key), __r TSRMLS_CC)
-#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key), __d TSRMLS_CC)
-#define add_property_str(__arg, __key, __str) add_property_str_ex(__arg, __key, strlen(__key), __str TSRMLS_CC)
-#define add_property_string(__arg, __key, __str) add_property_string_ex(__arg, __key, strlen(__key), __str TSRMLS_CC)
-#define add_property_stringl(__arg, __key, __str, __length) add_property_stringl_ex(__arg, __key, strlen(__key), __str, __length TSRMLS_CC)
-#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value TSRMLS_CC)
+#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key), __n)
+#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key))
+#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key), __b)
+#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key), __r)
+#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key), __d)
+#define add_property_str(__arg, __key, __str) add_property_str_ex(__arg, __key, strlen(__key), __str)
+#define add_property_string(__arg, __key, __str) add_property_string_ex(__arg, __key, strlen(__key), __str)
+#define add_property_stringl(__arg, __key, __str, __length) add_property_stringl_ex(__arg, __key, strlen(__key), __str, __length)
+#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value)
-ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[] TSRMLS_DC);
-ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC);
+ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]);
+ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table);
ZEND_API extern const zend_fcall_info empty_fcall_info;
ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
@@ -470,7 +470,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
* The callable_name argument may be NULL.
* Set check_flags to IS_CALLABLE_STRICT for every new usage!
*/
-ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error TSRMLS_DC);
+ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
/** Clear arguments connected with zend_fcall_info *fci
* If free_mem is not zero then the params array gets free'd as well
@@ -489,43 +489,43 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count
/** Set or clear the arguments in the zend_call_info struct taking care of
* refcount. If args is NULL and arguments are set then those are cleared.
*/
-ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
-ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC);
+ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args);
+ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args);
/** Set arguments in the zend_fcall_info struct taking care of refcount.
* If argc is 0 the arguments which are set will be cleared, else pass
* a variable amount of zval** arguments.
*/
-ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval *argv);
+ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci, int argc, zval *argv);
/** Set arguments in the zend_fcall_info struct taking care of refcount.
* If argc is 0 the arguments which are set will be cleared, else pass
* a variable amount of zval** arguments.
*/
-ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv);
+ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci, int argc, va_list *argv);
/** Set arguments in the zend_fcall_info struct taking care of refcount.
* If argc is 0 the arguments which are set will be cleared, else pass
* a variable amount of zval** arguments.
*/
-ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
+ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci, int argc, ...);
/** Call a function using information created by zend_fcall_info_init()/args().
* If args is given then those replace the argument info in fci is temporarily.
*/
-ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval, zval *args TSRMLS_DC);
+ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *retval, zval *args);
-ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
+ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache);
ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
-ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC);
+ZEND_API int zend_delete_global_variable(zend_string *name);
-ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D);
+ZEND_API zend_array *zend_rebuild_symbol_table(void);
ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data);
ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data);
-ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS_DC);
-ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC);
+ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force);
+ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force);
ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name);
ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
@@ -645,7 +645,7 @@ END_EXTERN_C()
#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; }
-#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
+#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p)) : NULL)))
#define ZVAL_IS_NULL(z) (Z_TYPE_P(z) == IS_NULL)
/* For compatibility */
@@ -654,8 +654,8 @@ END_EXTERN_C()
#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N
#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
#define ZEND_MINFO ZEND_MODULE_INFO_N
-#define ZEND_GINIT(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_CTOR_N(module)))
-#define ZEND_GSHUTDOWN(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_DTOR_N(module)))
+#define ZEND_GINIT(module) ((void (*)(void*))(ZEND_MODULE_GLOBALS_CTOR_N(module)))
+#define ZEND_GSHUTDOWN(module) ((void (*)(void*))(ZEND_MODULE_GLOBALS_DTOR_N(module)))
#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D
#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D
@@ -694,12 +694,12 @@ typedef enum _zend_expected_type {
Z_EXPECTED_LAST
} zend_expected_type;
-ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type TSRMLS_DC);
-ZEND_API void zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args TSRMLS_DC);
-ZEND_API void zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg TSRMLS_DC);
-ZEND_API void zend_wrong_paramer_class_error(int num, char *name, zval *arg TSRMLS_DC);
-ZEND_API void zend_wrong_callback_error(int severity, int num, char *error TSRMLS_DC);
-ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int check_null TSRMLS_DC);
+ZEND_API int parse_arg_object_to_str(zval *arg, zend_string **str, int type);
+ZEND_API void zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args);
+ZEND_API void zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg);
+ZEND_API void zend_wrong_paramer_class_error(int num, char *name, zval *arg);
+ZEND_API void zend_wrong_callback_error(int severity, int num, char *error);
+ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int check_null);
#define ZPP_ERROR_OK 0
#define ZPP_ERROR_FAILURE 1
@@ -733,7 +733,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
(UNEXPECTED(_num_args > _max_num_args) && \
EXPECTED(_max_num_args >= 0))) { \
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
- zend_wrong_paramers_count_error(_num_args, _min_num_args, _max_num_args TSRMLS_CC); \
+ zend_wrong_paramers_count_error(_num_args, _min_num_args, _max_num_args); \
} \
error_code = ZPP_ERROR_FAILURE; \
break; \
@@ -749,11 +749,11 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
if (UNEXPECTED(error_code != ZPP_ERROR_OK)) { \
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
if (error_code == ZPP_ERROR_WRONG_CALLBACK) { \
- zend_wrong_callback_error(E_WARNING, _i, _error TSRMLS_CC); \
+ zend_wrong_callback_error(E_WARNING, _i, _error); \
} else if (error_code == ZPP_ERROR_WRONG_CLASS) { \
- zend_wrong_paramer_class_error(_i, _error, _arg TSRMLS_CC); \
+ zend_wrong_paramer_class_error(_i, _error, _arg); \
} else if (error_code == ZPP_ERROR_WRONG_ARG) { \
- zend_wrong_paramer_type_error(_i, _expected_type, _arg TSRMLS_CC); \
+ zend_wrong_paramer_type_error(_i, _expected_type, _arg); \
} \
} \
failure; \
@@ -806,7 +806,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "b" */
#define Z_PARAM_BOOL_EX(dest, is_null, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_bool(_arg, &dest, &is_null, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_bool(_arg, &dest, &is_null, check_null))) { \
_expected_type = Z_EXPECTED_BOOL; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -818,7 +818,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "C" */
#define Z_PARAM_CLASS_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_class(_arg, &dest, _i, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_class(_arg, &dest, _i, check_null))) { \
error_code = ZPP_ERROR_FAILURE; \
break; \
}
@@ -841,7 +841,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "f" */
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_func(_arg, &dest_fci, &dest_fcc, check_null, &_error TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \
if (!_error) { \
_expected_type = Z_EXPECTED_FUNC; \
error_code = ZPP_ERROR_WRONG_ARG; \
@@ -851,7 +851,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
break; \
} \
} else if (UNEXPECTED(_error != NULL)) { \
- zend_wrong_callback_error(E_STRICT, _i, _error TSRMLS_CC); \
+ zend_wrong_callback_error(E_STRICT, _i, _error); \
}
#define Z_PARAM_FUNC(dest_fci, dest_fcc) \
@@ -860,7 +860,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "h" */
#define Z_PARAM_ARRAY_HT_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_array_ht(_arg, &dest, check_null, 0 TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_array_ht(_arg, &dest, check_null, 0))) { \
_expected_type = Z_EXPECTED_ARRAY; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -872,7 +872,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "H" */
#define Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_array_ht(_arg, &dest, check_null, 1 TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_array_ht(_arg, &dest, check_null, 1))) { \
_expected_type = Z_EXPECTED_ARRAY; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -908,7 +908,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "o" */
#define Z_PARAM_OBJECT_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_object(_arg, &dest, NULL, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_object(_arg, &dest, NULL, check_null))) { \
_expected_type = Z_EXPECTED_OBJECT; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -920,7 +920,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "O" */
#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_object(_arg, &dest, _ce, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_object(_arg, &dest, _ce, check_null))) { \
if (_ce) { \
_error = (_ce)->name->val; \
error_code = ZPP_ERROR_WRONG_CLASS; \
@@ -938,7 +938,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "p" */
#define Z_PARAM_PATH_EX(dest, dest_len, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_path(_arg, &dest, &dest_len, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_path(_arg, &dest, &dest_len, check_null))) { \
_expected_type = Z_EXPECTED_PATH; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -950,7 +950,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "P" */
#define Z_PARAM_PATH_STR_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_path_str(_arg, &dest, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_path_str(_arg, &dest, check_null))) { \
_expected_type = Z_EXPECTED_PATH; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -974,7 +974,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "s" */
#define Z_PARAM_STRING_EX(dest, dest_len, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_string(_arg, &dest, &dest_len, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_string(_arg, &dest, &dest_len, check_null))) { \
_expected_type = Z_EXPECTED_STRING; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -986,7 +986,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* old "S" */
#define Z_PARAM_STR_EX(dest, check_null, separate) \
Z_PARAM_PROLOGUE(separate); \
- if (UNEXPECTED(!_z_param_str(_arg, &dest, check_null TSRMLS_CC))) { \
+ if (UNEXPECTED(!_z_param_str(_arg, &dest, check_null))) { \
_expected_type = Z_EXPECTED_STRING; \
error_code = ZPP_ERROR_WRONG_ARG; \
break; \
@@ -1036,7 +1036,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
/* Private part of new parameter parsing API */
-static zend_always_inline int _z_param_bool(zval *arg, zend_bool *dest, zend_bool *is_null, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_bool(zval *arg, zend_bool *dest, zend_bool *is_null, int check_null)
{
if (check_null) {
*is_null = 0;
@@ -1049,7 +1049,7 @@ static zend_always_inline int _z_param_bool(zval *arg, zend_bool *dest, zend_boo
}
*dest = 0;
} else if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
- *dest = zend_is_true(arg TSRMLS_CC);
+ *dest = zend_is_true(arg);
} else {
return 0;
}
@@ -1145,7 +1145,7 @@ static zend_always_inline int _z_param_double(zval *arg, double *dest, zend_bool
return 1;
}
-static zend_always_inline int _z_param_str(zval *arg, zend_string **dest, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_str(zval *arg, zend_string **dest, int check_null)
{
if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
*dest = Z_STR_P(arg);
@@ -1161,17 +1161,17 @@ static zend_always_inline int _z_param_str(zval *arg, zend_string **dest, int ch
*dest = Z_STR_P(arg);
}
} else if (UNEXPECTED(Z_TYPE_P(arg) != IS_OBJECT) ||
- UNEXPECTED(parse_arg_object_to_str(arg, dest, IS_STRING TSRMLS_CC) != SUCCESS)) {
+ UNEXPECTED(parse_arg_object_to_str(arg, dest, IS_STRING) != SUCCESS)) {
return 0;
}
return 1;
}
-static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t *dest_len, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t *dest_len, int check_null)
{
zend_string *str;
- if (!_z_param_str(arg, &str, check_null TSRMLS_CC)) {
+ if (!_z_param_str(arg, &str, check_null)) {
return 0;
}
if (check_null && UNEXPECTED(!str)) {
@@ -1184,9 +1184,9 @@ static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t *de
return 1;
}
-static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, int check_null)
{
- if (!_z_param_str(arg, dest, check_null TSRMLS_CC) ||
+ if (!_z_param_str(arg, dest, check_null) ||
(check_null && UNEXPECTED(!(*dest)->val[0])) ||
UNEXPECTED(CHECK_NULL_PATH((*dest)->val, (*dest)->len))) {
return 0;
@@ -1194,11 +1194,11 @@ static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, i
return 1;
}
-static zend_always_inline int _z_param_path(zval *arg, char **dest, size_t *dest_len, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_path(zval *arg, char **dest, size_t *dest_len, int check_null)
{
zend_string *str;
- if (!_z_param_path_str(arg, &str, check_null TSRMLS_CC)) {
+ if (!_z_param_path_str(arg, &str, check_null)) {
return 0;
}
if (check_null && UNEXPECTED(!str)) {
@@ -1224,12 +1224,12 @@ static zend_always_inline int _z_param_array(zval *arg, zval **dest, int check_n
return 1;
}
-static zend_always_inline int _z_param_array_ht(zval *arg, HashTable **dest, int check_null, int or_object TSRMLS_DC)
+static zend_always_inline int _z_param_array_ht(zval *arg, HashTable **dest, int check_null, int or_object)
{
if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) {
*dest = Z_ARRVAL_P(arg);
} else if (or_object && EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
- *dest = Z_OBJ_HT_P(arg)->get_properties(arg TSRMLS_CC);
+ *dest = Z_OBJ_HT_P(arg)->get_properties(arg);
} else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
*dest = NULL;
} else {
@@ -1238,10 +1238,10 @@ static zend_always_inline int _z_param_array_ht(zval *arg, HashTable **dest, int
return 1;
}
-static zend_always_inline int _z_param_object(zval *arg, zval **dest, zend_class_entry *ce, int check_null TSRMLS_DC)
+static zend_always_inline int _z_param_object(zval *arg, zval **dest, zend_class_entry *ce, int check_null)
{
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) &&
- (!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC) != 0))) {
+ (!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0))) {
*dest = arg;
} else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
*dest = NULL;
@@ -1263,13 +1263,13 @@ static zend_always_inline int _z_param_resource(zval *arg, zval **dest, int chec
return 1;
}
-static zend_always_inline int _z_param_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, int check_null, char **error TSRMLS_DC)
+static zend_always_inline int _z_param_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, int check_null, char **error)
{
if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
dest_fci->size = 0;
dest_fcc->initialized = 0;
*error = NULL;
- } else if (UNEXPECTED(zend_fcall_info_init(arg, 0, dest_fci, dest_fcc, NULL, error TSRMLS_CC) != SUCCESS)) {
+ } else if (UNEXPECTED(zend_fcall_info_init(arg, 0, dest_fci, dest_fcc, NULL, error) != SUCCESS)) {
return 0;
}
return 1;
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index a1af2fcc7f..6ee516176f 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -368,7 +368,6 @@ static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
#endif
size_t size)
{
- TSRMLS_FETCH();
heap->overflow = 1;
zend_try {
@@ -1836,7 +1835,7 @@ static zend_long zend_mm_find_leaks(zend_mm_heap *heap, zend_mm_chunk *p, int i,
return count;
}
-static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
+static void zend_mm_check_leaks(zend_mm_heap *heap)
{
zend_mm_huge_list *list;
zend_mm_chunk *p;
@@ -1859,12 +1858,12 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
leak.lineno = list->dbg.lineno;
leak.orig_lineno = list->dbg.orig_lineno;
- zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC);
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak);
//??? repeated = zend_mm_find_leaks_huge(segment, p);
total += 1 + repeated;
if (repeated) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
}
list = list->next;
@@ -1892,8 +1891,8 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
leak.lineno = dbg->lineno;
leak.orig_lineno = dbg->orig_lineno;
- zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC);
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak);
dbg->size = 0;
dbg->filename = NULL;
@@ -1903,7 +1902,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
zend_mm_find_leaks(heap, p, i + bin_pages[bin_num], &leak);
total += 1 + repeated;
if (repeated) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
}
}
dbg = (zend_mm_debug_info*)((char*)dbg + bin_data_size[bin_num]);
@@ -1921,15 +1920,15 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
leak.lineno = dbg->lineno;
leak.orig_lineno = dbg->orig_lineno;
- zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC);
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak);
zend_mm_bitset_reset_range(p->free_map, i, pages_count);
repeated = zend_mm_find_leaks(heap, p, i + pages_count, &leak);
total += 1 + repeated;
if (repeated) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated);
}
i += pages_count;
}
@@ -1940,12 +1939,12 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
p = p->next;
} while (p != heap->main_chunk);
if (total) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &total TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &total);
}
}
#endif
-void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent TSRMLS_DC)
+void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent)
{
zend_mm_chunk *p;
zend_mm_huge_list *list;
@@ -1958,7 +1957,7 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent TSRMLS_DC)
#if ZEND_DEBUG
if (!silent) {
- zend_mm_check_leaks(heap TSRMLS_CC);
+ zend_mm_check_leaks(heap);
}
#endif
@@ -2080,13 +2079,13 @@ typedef struct _zend_alloc_globals {
#ifdef ZTS
static int alloc_globals_id;
-# define AG(v) TSRMG(alloc_globals_id, zend_alloc_globals *, v)
+# define AG(v) ZEND_TSRMG(alloc_globals_id, zend_alloc_globals *, v)
#else
# define AG(v) (alloc_globals.v)
static zend_alloc_globals alloc_globals;
#endif
-ZEND_API int is_zend_mm(TSRMLS_D)
+ZEND_API int is_zend_mm(void)
{
#if ZEND_MM_CUSTOM
return !AG(mm_heap)->use_custom_heap;
@@ -2117,7 +2116,6 @@ ZEND_API int is_zend_mm(TSRMLS_D)
# define _ZEND_BIN_ALLOCATOR(_num, _size, _elements, _pages, x, y) \
ZEND_API void* ZEND_FASTCALL _emalloc_ ## _size(void) { \
- TSRMLS_FETCH(); \
ZEND_MM_CUSTOM_ALLOCATOR(_size); \
return zend_mm_alloc_small(AG(mm_heap), _size, _num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); \
}
@@ -2126,7 +2124,6 @@ ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR, x, y)
ZEND_API void* ZEND_FASTCALL _emalloc_large(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- TSRMLS_FETCH();
ZEND_MM_CUSTOM_ALLOCATOR(size);
return zend_mm_alloc_large(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -2134,7 +2131,6 @@ ZEND_API void* ZEND_FASTCALL _emalloc_large(size_t size ZEND_FILE_LINE_DC ZEND_F
ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
{
- TSRMLS_FETCH();
ZEND_MM_CUSTOM_ALLOCATOR(size);
return zend_mm_alloc_huge(AG(mm_heap), size);
@@ -2143,7 +2139,6 @@ ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
#if ZEND_DEBUG
# define _ZEND_BIN_FREE(_num, _size, _elements, _pages, x, y) \
ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
- TSRMLS_FETCH(); \
ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
{ \
size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE); \
@@ -2158,7 +2153,6 @@ ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
#else
# define _ZEND_BIN_FREE(_num, _size, _elements, _pages, x, y) \
ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
- TSRMLS_FETCH(); \
ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
{ \
zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE); \
@@ -2172,7 +2166,6 @@ ZEND_MM_BINS_INFO(_ZEND_BIN_FREE, x, y)
ZEND_API void ZEND_FASTCALL _efree_large(void *ptr, size_t size)
{
- TSRMLS_FETCH();
ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
{
@@ -2190,7 +2183,6 @@ ZEND_API void ZEND_FASTCALL _efree_large(void *ptr, size_t size)
ZEND_API void ZEND_FASTCALL _efree_huge(void *ptr, size_t size)
{
- TSRMLS_FETCH();
ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
// TODO: use size???
@@ -2200,7 +2192,6 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *ptr, size_t size)
ZEND_API void* ZEND_FASTCALL _emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- TSRMLS_FETCH();
#if ZEND_MM_CUSTOM
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
@@ -2212,7 +2203,6 @@ ZEND_API void* ZEND_FASTCALL _emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- TSRMLS_FETCH();
#if ZEND_MM_CUSTOM
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
@@ -2225,7 +2215,6 @@ ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR
ZEND_API void* ZEND_FASTCALL _erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- TSRMLS_FETCH();
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
return AG(mm_heap)->_realloc(ptr, size);
@@ -2233,7 +2222,7 @@ ZEND_API void* ZEND_FASTCALL _erealloc(void *ptr, size_t size, int allow_failure
return zend_mm_realloc_heap(AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
-ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
return 0;
@@ -2279,7 +2268,6 @@ ZEND_API void* ZEND_FASTCALL _ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_D
{
void *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -2298,7 +2286,6 @@ ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_
size_t length;
char *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -2318,7 +2305,6 @@ ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LI
{
char *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -2339,7 +2325,6 @@ ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
{
char *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -2358,7 +2343,7 @@ ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
}
-ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC)
+ZEND_API int zend_set_memory_limit(size_t memory_limit)
{
#if ZEND_MM_LIMIT
AG(mm_heap)->limit = (memory_limit >= ZEND_MM_CHUNK_SIZE) ? memory_limit : ZEND_MM_CHUNK_SIZE;
@@ -2366,7 +2351,7 @@ ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC)
return SUCCESS;
}
-ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
+ZEND_API size_t zend_memory_usage(int real_usage)
{
#if ZEND_MM_STAT
if (real_usage) {
@@ -2379,7 +2364,7 @@ ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
return 0;
}
-ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
+ZEND_API size_t zend_memory_peak_usage(int real_usage)
{
#if ZEND_MM_STAT
if (real_usage) {
@@ -2391,12 +2376,12 @@ ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
return 0;
}
-ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
+ZEND_API void shutdown_memory_manager(int silent, int full_shutdown)
{
- zend_mm_shutdown(AG(mm_heap), full_shutdown, silent TSRMLS_CC);
+ zend_mm_shutdown(AG(mm_heap), full_shutdown, silent);
}
-static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
{
#if ZEND_MM_CUSTOM
char *tmp = getenv("USE_ZEND_ALLOC");
@@ -2411,17 +2396,18 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
return;
}
#endif
+ ZEND_TSRMLS_CACHE_UPDATE;
alloc_globals->mm_heap = zend_mm_init();
}
#ifdef ZTS
-static void alloc_globals_dtor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+static void alloc_globals_dtor(zend_alloc_globals *alloc_globals)
{
- shutdown_memory_manager(1, 1 TSRMLS_CC);
+ zend_mm_shutdown(alloc_globals->mm_heap, 1, 1);
}
#endif
-ZEND_API void start_memory_manager(TSRMLS_D)
+ZEND_API void start_memory_manager(void)
{
#ifdef ZTS
ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
@@ -2437,7 +2423,7 @@ ZEND_API void start_memory_manager(TSRMLS_D)
#endif
}
-ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC)
+ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap)
{
zend_mm_heap *old_heap;
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index c9918955ab..fddade0d1e 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -64,7 +64,7 @@ ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t siz
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset);
ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
-ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
#include "zend_alloc_sizes.h"
@@ -150,7 +150,7 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *, size_t size);
#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
/* Relay wrapper macros */
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
@@ -162,7 +162,7 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *, size_t size);
#define safe_erealloc_rel(ptr, nmemb, size, offset) _safe_erealloc((ptr), (nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
zend_always_inline static void * __zend_malloc(size_t len)
{
@@ -211,14 +211,14 @@ zend_always_inline static void * __zend_realloc(void *p, size_t len)
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
-ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC);
+ZEND_API int zend_set_memory_limit(size_t memory_limit);
-ZEND_API void start_memory_manager(TSRMLS_D);
-ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
-ZEND_API int is_zend_mm(TSRMLS_D);
+ZEND_API void start_memory_manager(void);
+ZEND_API void shutdown_memory_manager(int silent, int full_shutdown);
+ZEND_API int is_zend_mm(void);
-ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC);
-ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
+ZEND_API size_t zend_memory_usage(int real_usage);
+ZEND_API size_t zend_memory_peak_usage(int real_usage);
/* fast cache for HashTables */
#define ALLOC_HASHTABLE(ht) \
@@ -237,7 +237,7 @@ ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
typedef struct _zend_mm_heap zend_mm_heap;
ZEND_API zend_mm_heap *zend_mm_startup(void);
-ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC);
+ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent);
ZEND_API void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
@@ -253,7 +253,7 @@ ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *p ZE
#define zend_mm_realloc_rel(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
#define zend_mm_block_size_rel(heap, p) _zend_mm_block_size((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC);
+ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap);
ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap,
void* (*_malloc)(size_t),
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 9604079a9e..ac10fe24e0 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -23,12 +23,12 @@
#include "zend_API.h"
#include "zend_operators.h"
-static inline void *zend_ast_alloc(size_t size TSRMLS_DC) {
+static inline void *zend_ast_alloc(size_t size) {
return zend_arena_alloc(&CG(ast_arena), size);
}
-static inline void *zend_ast_realloc(void *old, size_t old_size, size_t new_size TSRMLS_DC) {
- void *new = zend_ast_alloc(new_size TSRMLS_CC);
+static inline void *zend_ast_realloc(void *old, size_t old_size, size_t new_size) {
+ void *new = zend_ast_alloc(new_size);
memcpy(new, old, old_size);
return new;
}
@@ -43,9 +43,8 @@ static inline size_t zend_ast_list_size(uint32_t children) {
ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
zend_ast_znode *ast;
- TSRMLS_FETCH();
- ast = zend_ast_alloc(sizeof(zend_ast_znode) TSRMLS_CC);
+ ast = zend_ast_alloc(sizeof(zend_ast_znode));
ast->kind = ZEND_AST_ZNODE;
ast->attr = 0;
ast->lineno = CG(zend_lineno);
@@ -55,9 +54,8 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
zend_ast_zval *ast;
- TSRMLS_FETCH();
- ast = zend_ast_alloc(sizeof(zend_ast_zval) TSRMLS_CC);
+ ast = zend_ast_alloc(sizeof(zend_ast_zval));
ast->kind = ZEND_AST_ZVAL;
ast->attr = attr;
ZVAL_COPY_VALUE(&ast->val, zv);
@@ -70,9 +68,8 @@ ZEND_API zend_ast *zend_ast_create_decl(
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2
) {
zend_ast_decl *ast;
- TSRMLS_FETCH();
- ast = zend_ast_alloc(sizeof(zend_ast_decl) TSRMLS_CC);
+ ast = zend_ast_alloc(sizeof(zend_ast_decl));
ast->kind = kind;
ast->attr = 0;
ast->start_lineno = start_lineno;
@@ -91,9 +88,8 @@ ZEND_API zend_ast *zend_ast_create_decl(
static zend_ast *zend_ast_create_from_va_list(zend_ast_kind kind, zend_ast_attr attr, va_list va) {
uint32_t i, children = kind >> ZEND_AST_NUM_CHILDREN_SHIFT;
zend_ast *ast;
- TSRMLS_FETCH();
- ast = zend_ast_alloc(zend_ast_size(children) TSRMLS_CC);
+ ast = zend_ast_alloc(zend_ast_size(children));
ast->kind = kind;
ast->attr = attr;
ast->lineno = (uint32_t) -1;
@@ -140,9 +136,8 @@ ZEND_API zend_ast *zend_ast_create(zend_ast_kind kind, ...) {
ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind kind, ...) {
zend_ast *ast;
zend_ast_list *list;
- TSRMLS_FETCH();
- ast = zend_ast_alloc(zend_ast_list_size(4) TSRMLS_CC);
+ ast = zend_ast_alloc(zend_ast_list_size(4));
list = (zend_ast_list *) ast;
list->kind = kind;
list->attr = 0;
@@ -169,15 +164,14 @@ static inline zend_bool is_power_of_two(uint32_t n) {
ZEND_API zend_ast *zend_ast_list_add(zend_ast *ast, zend_ast *op) {
zend_ast_list *list = zend_ast_get_list(ast);
if (list->children >= 4 && is_power_of_two(list->children)) {
- TSRMLS_FETCH();
- list = zend_ast_realloc(list,
- zend_ast_list_size(list->children), zend_ast_list_size(list->children * 2) TSRMLS_CC);
+ list = zend_ast_realloc(list,
+ zend_ast_list_size(list->children), zend_ast_list_size(list->children * 2));
}
list->child[list->children++] = op;
return (zend_ast *) list;
}
-static void zend_ast_add_array_element(zval *result, zval *offset, zval *expr TSRMLS_DC)
+static void zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
{
switch (Z_TYPE_P(offset)) {
case IS_UNDEF:
@@ -208,7 +202,7 @@ static void zend_ast_add_array_element(zval *result, zval *offset, zval *expr TS
}
}
-ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC)
+ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope)
{
zval op1, op2;
@@ -216,9 +210,9 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
case ZEND_AST_BINARY_OP:
{
binary_op_type op = get_binary_op(ast->attr);
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- zend_ast_evaluate(&op2, ast->child[1], scope TSRMLS_CC);
- op(result, &op1, &op2 TSRMLS_CC);
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ zend_ast_evaluate(&op2, ast->child[1], scope);
+ op(result, &op1, &op2);
zval_dtor(&op1);
zval_dtor(&op2);
break;
@@ -229,9 +223,9 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
/* op1 > op2 is the same as op2 < op1 */
binary_op_type op = ast->kind == ZEND_AST_GREATER
? is_smaller_function : is_smaller_or_equal_function;
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- zend_ast_evaluate(&op2, ast->child[1], scope TSRMLS_CC);
- op(result, &op2, &op1 TSRMLS_CC);
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ zend_ast_evaluate(&op2, ast->child[1], scope);
+ op(result, &op2, &op1);
zval_dtor(&op1);
zval_dtor(&op2);
break;
@@ -239,8 +233,8 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
case ZEND_AST_UNARY_OP:
{
unary_op_type op = get_unary_op(ast->attr);
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- op(result, &op1 TSRMLS_CC);
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ op(result, &op1);
zval_dtor(&op1);
break;
}
@@ -250,22 +244,22 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
if (scope) {
/* class constants may be updated in-place */
if (Z_OPT_CONSTANT_P(zv)) {
- zval_update_constant_ex(zv, 1, scope TSRMLS_CC);
+ zval_update_constant_ex(zv, 1, scope);
}
ZVAL_DUP(result, zv);
} else {
ZVAL_DUP(result, zv);
if (Z_OPT_CONSTANT_P(result)) {
- zval_update_constant_ex(result, 1, scope TSRMLS_CC);
+ zval_update_constant_ex(result, 1, scope);
}
}
break;
}
case ZEND_AST_AND:
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- if (zend_is_true(&op1 TSRMLS_CC)) {
- zend_ast_evaluate(&op2, ast->child[1], scope TSRMLS_CC);
- ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ if (zend_is_true(&op1)) {
+ zend_ast_evaluate(&op2, ast->child[1], scope);
+ ZVAL_BOOL(result, zend_is_true(&op2));
zval_dtor(&op2);
} else {
ZVAL_BOOL(result, 0);
@@ -273,40 +267,40 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
zval_dtor(&op1);
break;
case ZEND_AST_OR:
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- if (zend_is_true(&op1 TSRMLS_CC)) {
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ if (zend_is_true(&op1)) {
ZVAL_BOOL(result, 1);
} else {
- zend_ast_evaluate(&op2, ast->child[1], scope TSRMLS_CC);
- ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
+ zend_ast_evaluate(&op2, ast->child[1], scope);
+ ZVAL_BOOL(result, zend_is_true(&op2));
zval_dtor(&op2);
}
zval_dtor(&op1);
break;
case ZEND_AST_CONDITIONAL:
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- if (zend_is_true(&op1 TSRMLS_CC)) {
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ if (zend_is_true(&op1)) {
if (!ast->child[1]) {
*result = op1;
} else {
- zend_ast_evaluate(result, ast->child[1], scope TSRMLS_CC);
+ zend_ast_evaluate(result, ast->child[1], scope);
zval_dtor(&op1);
}
} else {
- zend_ast_evaluate(result, ast->child[2], scope TSRMLS_CC);
+ zend_ast_evaluate(result, ast->child[2], scope);
zval_dtor(&op1);
}
break;
case ZEND_AST_UNARY_PLUS:
ZVAL_LONG(&op1, 0);
- zend_ast_evaluate(&op2, ast->child[0], scope TSRMLS_CC);
- add_function(result, &op1, &op2 TSRMLS_CC);
+ zend_ast_evaluate(&op2, ast->child[0], scope);
+ add_function(result, &op1, &op2);
zval_dtor(&op2);
break;
case ZEND_AST_UNARY_MINUS:
ZVAL_LONG(&op1, 0);
- zend_ast_evaluate(&op2, ast->child[0], scope TSRMLS_CC);
- sub_function(result, &op1, &op2 TSRMLS_CC);
+ zend_ast_evaluate(&op2, ast->child[0], scope);
+ sub_function(result, &op1, &op2);
zval_dtor(&op2);
break;
case ZEND_AST_ARRAY:
@@ -317,21 +311,21 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
for (i = 0; i < list->children; i++) {
zend_ast *elem = list->child[i];
if (elem->child[1]) {
- zend_ast_evaluate(&op1, elem->child[1], scope TSRMLS_CC);
+ zend_ast_evaluate(&op1, elem->child[1], scope);
} else {
ZVAL_UNDEF(&op1);
}
- zend_ast_evaluate(&op2, elem->child[0], scope TSRMLS_CC);
- zend_ast_add_array_element(result, &op1, &op2 TSRMLS_CC);
+ zend_ast_evaluate(&op2, elem->child[0], scope);
+ zend_ast_add_array_element(result, &op1, &op2);
}
}
break;
case ZEND_AST_DIM:
- zend_ast_evaluate(&op1, ast->child[0], scope TSRMLS_CC);
- zend_ast_evaluate(&op2, ast->child[1], scope TSRMLS_CC);
+ zend_ast_evaluate(&op1, ast->child[0], scope);
+ zend_ast_evaluate(&op2, ast->child[1], scope);
{
zval tmp;
- zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
+ zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
ZVAL_ZVAL(result, &tmp, 1, 1);
}
zval_dtor(&op1);
@@ -429,17 +423,17 @@ ZEND_API void zend_ast_destroy_and_free(zend_ast *ast) {
zend_ast_destroy_ex(ast, 1);
}
-ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn TSRMLS_DC) {
+ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) {
if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
for (i = 0; i < list->children; ++i) {
- fn(&list->child[i] TSRMLS_CC);
+ fn(&list->child[i]);
}
} else {
uint32_t i, children = zend_ast_get_num_children(ast);
for (i = 0; i < children; ++i) {
- fn(&ast->child[i] TSRMLS_CC);
+ fn(&ast->child[i]);
}
}
}
diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h
index 6bd6850d83..774e73ce7d 100644
--- a/Zend/zend_ast.h
+++ b/Zend/zend_ast.h
@@ -199,14 +199,14 @@ ZEND_API zend_ast *zend_ast_create_decl(
ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind kind, ...);
ZEND_API zend_ast *zend_ast_list_add(zend_ast *list, zend_ast *op);
-ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC);
+ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope);
ZEND_API zend_ast *zend_ast_copy(zend_ast *ast);
ZEND_API void zend_ast_destroy(zend_ast *ast);
ZEND_API void zend_ast_destroy_and_free(zend_ast *ast);
-typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr TSRMLS_DC);
-ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn TSRMLS_DC);
+typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr);
+ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn);
static zend_always_inline zend_bool zend_ast_is_list(zend_ast *ast) {
return (ast->kind >> ZEND_AST_IS_LIST_SHIFT) & 1;
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index fcf2420ac6..c05e797013 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -321,9 +321,9 @@ ZEND_MINIT_FUNCTION(core) { /* {{{ */
zend_class_entry class_entry;
INIT_CLASS_ENTRY(class_entry, "stdClass", NULL);
- zend_standard_class_def = zend_register_internal_class(&class_entry TSRMLS_CC);
+ zend_standard_class_def = zend_register_internal_class(&class_entry);
- zend_register_default_classes(TSRMLS_C);
+ zend_register_default_classes();
return SUCCESS;
}
@@ -343,11 +343,11 @@ zend_module_entry zend_builtin_module = { /* {{{ */
};
/* }}} */
-int zend_startup_builtin_functions(TSRMLS_D) /* {{{ */
+int zend_startup_builtin_functions(void) /* {{{ */
{
zend_builtin_module.module_number = 0;
zend_builtin_module.type = MODULE_PERSISTENT;
- return (EG(current_module) = zend_register_module_ex(&zend_builtin_module TSRMLS_CC)) == NULL ? FAILURE : SUCCESS;
+ return (EG(current_module) = zend_register_module_ex(&zend_builtin_module)) == NULL ? FAILURE : SUCCESS;
}
/* }}} */
@@ -364,7 +364,7 @@ ZEND_FUNCTION(zend_version)
Returns number of freed zvals */
ZEND_FUNCTION(gc_collect_cycles)
{
- RETURN_LONG(gc_collect_cycles(TSRMLS_C));
+ RETURN_LONG(gc_collect_cycles());
}
/* }}} */
@@ -420,7 +420,7 @@ ZEND_FUNCTION(func_get_arg)
zend_long requested_offset;
zend_execute_data *ex;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &requested_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &requested_offset) == FAILURE) {
return;
}
@@ -526,7 +526,7 @@ ZEND_FUNCTION(strlen)
zend_string *s;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &s) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
return;
}
#else
@@ -545,7 +545,7 @@ ZEND_FUNCTION(strcmp)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -560,7 +560,7 @@ ZEND_FUNCTION(strncmp)
zend_string *s1, *s2;
zend_long len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl", &s1, &s2, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSl", &s1, &s2, &len) == FAILURE) {
return;
}
@@ -579,7 +579,7 @@ ZEND_FUNCTION(strcasecmp)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -594,7 +594,7 @@ ZEND_FUNCTION(strncasecmp)
zend_string *s1, *s2;
zend_long len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl", &s1, &s2, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSl", &s1, &s2, &len) == FAILURE) {
return;
}
@@ -616,7 +616,7 @@ ZEND_FUNCTION(each)
HashTable *target_hash;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &array) == FAILURE) {
return;
}
@@ -673,7 +673,7 @@ ZEND_FUNCTION(error_reporting)
zend_string *err;
int old_error_reporting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &err) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &err) == FAILURE) {
return;
}
@@ -699,7 +699,7 @@ ZEND_FUNCTION(define)
zend_constant c;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &name, &val, &non_cs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
return;
}
#else
@@ -737,11 +737,11 @@ repeat:
if (Z_TYPE(val_free) == IS_UNDEF) {
if (Z_OBJ_HT_P(val)->get) {
zval rv;
- val = Z_OBJ_HT_P(val)->get(val, &rv TSRMLS_CC);
+ val = Z_OBJ_HT_P(val)->get(val, &rv);
ZVAL_COPY_VALUE(&val_free, val);
goto repeat;
} else if (Z_OBJ_HT_P(val)->cast_object) {
- if (Z_OBJ_HT_P(val)->cast_object(val, &val_free, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(val)->cast_object(val, &val_free, IS_STRING) == SUCCESS) {
val = &val_free;
break;
}
@@ -759,7 +759,7 @@ repeat:
c.flags = case_sensitive; /* non persistent */
c.name = zend_string_copy(name);
c.module_number = PHP_USER_CONSTANT;
- if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) {
+ if (zend_register_constant(&c) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -775,7 +775,7 @@ ZEND_FUNCTION(defined)
zend_string *name;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
@@ -784,7 +784,7 @@ ZEND_FUNCTION(defined)
ZEND_PARSE_PARAMETERS_END();
#endif
- if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC)) {
+ if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -798,7 +798,7 @@ ZEND_FUNCTION(get_class)
{
zval *obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o!", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &obj) == FAILURE) {
RETURN_FALSE;
}
@@ -839,7 +839,7 @@ ZEND_FUNCTION(get_parent_class)
zval *arg;
zend_class_entry *ce = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
return;
}
@@ -855,7 +855,7 @@ ZEND_FUNCTION(get_parent_class)
if (Z_TYPE_P(arg) == IS_OBJECT) {
ce = Z_OBJ_P(arg)->ce;
} else if (Z_TYPE_P(arg) == IS_STRING) {
- ce = zend_lookup_class(Z_STR_P(arg) TSRMLS_CC);
+ ce = zend_lookup_class(Z_STR_P(arg));
}
if (ce && ce->parent) {
@@ -876,7 +876,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
zend_bool retval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
return;
}
#else
@@ -895,7 +895,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
*/
if (allow_string && Z_TYPE_P(obj) == IS_STRING) {
- instance_ce = zend_lookup_class(Z_STR_P(obj) TSRMLS_CC);
+ instance_ce = zend_lookup_class(Z_STR_P(obj));
if (!instance_ce) {
RETURN_FALSE;
}
@@ -905,14 +905,14 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
RETURN_FALSE;
}
- ce = zend_lookup_class_ex(class_name, NULL, 0 TSRMLS_CC);
+ ce = zend_lookup_class_ex(class_name, NULL, 0);
if (!ce) {
retval = 0;
} else {
if (only_subclass && instance_ce == ce) {
retval = 0;
} else {
- retval = instanceof_function(instance_ce, ce TSRMLS_CC);
+ retval = instanceof_function(instance_ce, ce);
}
}
@@ -937,7 +937,7 @@ ZEND_FUNCTION(is_a)
/* }}} */
/* {{{ add_class_vars */
-static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC)
+static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value)
{
zend_property_info *prop_info;
zval *prop, prop_copy;
@@ -973,7 +973,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
/* this is necessary to make it able to work with default array
* properties, returned to user */
if (Z_OPT_CONSTANT_P(prop)) {
- zval_update_constant(prop, 0 TSRMLS_CC);
+ zval_update_constant(prop, 0);
}
zend_hash_add_new(Z_ARRVAL_P(return_value), key, prop);
@@ -988,18 +988,18 @@ ZEND_FUNCTION(get_class_vars)
zend_string *class_name;
zend_class_entry *ce;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &class_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &class_name) == FAILURE) {
return;
}
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (!ce) {
RETURN_FALSE;
} else {
array_init(return_value);
- zend_update_class_constants(ce TSRMLS_CC);
- add_class_vars(ce, 0, return_value TSRMLS_CC);
- add_class_vars(ce, 1, return_value TSRMLS_CC);
+ zend_update_class_constants(ce);
+ add_class_vars(ce, 0, return_value);
+ add_class_vars(ce, 1, return_value);
}
}
/* }}} */
@@ -1015,7 +1015,7 @@ ZEND_FUNCTION(get_object_vars)
zend_object *zobj;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
#else
@@ -1028,7 +1028,7 @@ ZEND_FUNCTION(get_object_vars)
RETURN_FALSE;
}
- properties = Z_OBJ_HT_P(obj)->get_properties(obj TSRMLS_CC);
+ properties = Z_OBJ_HT_P(obj)->get_properties(obj);
if (properties == NULL) {
RETURN_FALSE;
@@ -1040,7 +1040,7 @@ ZEND_FUNCTION(get_object_vars)
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(properties, key, value) {
if (key) {
- if (zend_check_property_access(zobj, key TSRMLS_CC) == SUCCESS) {
+ if (zend_check_property_access(zobj, key) == SUCCESS) {
/* Not separating references */
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
if (key->val[0] == 0) {
@@ -1076,14 +1076,14 @@ ZEND_FUNCTION(get_class_methods)
zend_function *mptr;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &klass) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &klass) == FAILURE) {
return;
}
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
- ce = zend_lookup_class(Z_STR_P(klass) TSRMLS_CC);
+ ce = zend_lookup_class(Z_STR_P(klass));
}
if (!ce) {
@@ -1136,7 +1136,7 @@ ZEND_FUNCTION(method_exists)
zend_class_entry * ce;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS", &klass, &method_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
return;
}
#else
@@ -1148,7 +1148,7 @@ ZEND_FUNCTION(method_exists)
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
- if ((ce = zend_lookup_class(Z_STR_P(klass) TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class(Z_STR_P(klass))) == NULL) {
RETURN_FALSE;
}
} else {
@@ -1165,7 +1165,7 @@ ZEND_FUNCTION(method_exists)
if (Z_TYPE_P(klass) == IS_OBJECT
&& Z_OBJ_HT_P(klass)->get_method != NULL
- && (func = Z_OBJ_HT_P(klass)->get_method(&Z_OBJ_P(klass), method_name, NULL TSRMLS_CC)) != NULL
+ && (func = Z_OBJ_HT_P(klass)->get_method(&Z_OBJ_P(klass), method_name, NULL)) != NULL
) {
if (func->type == ZEND_INTERNAL_FUNCTION
&& (func->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0
@@ -1198,7 +1198,7 @@ ZEND_FUNCTION(property_exists)
zend_property_info *property_info;
zval property_z;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zS", &object, &property) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &object, &property) == FAILURE) {
return;
}
@@ -1207,7 +1207,7 @@ ZEND_FUNCTION(property_exists)
}
if (Z_TYPE_P(object) == IS_STRING) {
- ce = zend_lookup_class(Z_STR_P(object) TSRMLS_CC);
+ ce = zend_lookup_class(Z_STR_P(object));
if (!ce) {
RETURN_FALSE;
}
@@ -1227,7 +1227,7 @@ ZEND_FUNCTION(property_exists)
if (Z_TYPE_P(object) == IS_OBJECT &&
Z_OBJ_HANDLER_P(object, has_property) &&
- Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2, NULL TSRMLS_CC)) {
+ Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2, NULL)) {
RETURN_TRUE;
}
RETURN_FALSE;
@@ -1244,7 +1244,7 @@ ZEND_FUNCTION(class_exists)
zend_bool autoload = 1;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &class_name, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
return;
}
#else
@@ -1269,7 +1269,7 @@ ZEND_FUNCTION(class_exists)
RETURN_BOOL(ce && !((ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT)) > ZEND_ACC_EXPLICIT_ABSTRACT_CLASS));
}
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (ce) {
RETURN_BOOL((ce->ce_flags & (ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT - ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) == 0);
} else {
@@ -1287,7 +1287,7 @@ ZEND_FUNCTION(interface_exists)
zend_bool autoload = 1;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &iface_name, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
return;
}
#else
@@ -1312,7 +1312,7 @@ ZEND_FUNCTION(interface_exists)
RETURN_BOOL(ce && ce->ce_flags & ZEND_ACC_INTERFACE);
}
- ce = zend_lookup_class(iface_name TSRMLS_CC);
+ ce = zend_lookup_class(iface_name);
if (ce) {
RETURN_BOOL((ce->ce_flags & ZEND_ACC_INTERFACE) > 0);
} else {
@@ -1330,7 +1330,7 @@ ZEND_FUNCTION(trait_exists)
zend_bool autoload = 1;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &trait_name, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
return;
}
#else
@@ -1355,7 +1355,7 @@ ZEND_FUNCTION(trait_exists)
RETURN_BOOL(ce && ((ce->ce_flags & ZEND_ACC_TRAIT) > ZEND_ACC_EXPLICIT_ABSTRACT_CLASS));
}
- ce = zend_lookup_class(trait_name TSRMLS_CC);
+ ce = zend_lookup_class(trait_name);
if (ce) {
RETURN_BOOL((ce->ce_flags & ZEND_ACC_TRAIT) > ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
} else {
@@ -1374,7 +1374,7 @@ ZEND_FUNCTION(function_exists)
zend_string *lcname;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
#else
@@ -1414,15 +1414,15 @@ ZEND_FUNCTION(class_alias)
size_t alias_name_len;
zend_bool autoload = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ss|b", &class_name, &alias_name, &alias_name_len, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ss|b", &class_name, &alias_name, &alias_name_len, &autoload) == FAILURE) {
return;
}
- ce = zend_lookup_class_ex(class_name, NULL, autoload TSRMLS_CC);
+ ce = zend_lookup_class_ex(class_name, NULL, autoload);
if (ce) {
if (ce->type == ZEND_USER_CLASS) {
- if (zend_register_class_alias_ex(alias_name, alias_name_len, ce TSRMLS_CC) == SUCCESS) {
+ if (zend_register_class_alias_ex(alias_name, alias_name_len, ce) == SUCCESS) {
RETURN_TRUE;
} else {
zend_error(E_WARNING, "Cannot redeclare class %s", alias_name);
@@ -1446,7 +1446,7 @@ ZEND_FUNCTION(leak)
{
zend_long leakbytes=3;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &leakbytes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &leakbytes) == FAILURE) {
return;
}
@@ -1460,7 +1460,7 @@ ZEND_FUNCTION(leak_variable)
zval *zv;
zend_bool leak_data = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zv, &leak_data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zv, &leak_data) == FAILURE) {
return;
}
@@ -1515,7 +1515,7 @@ ZEND_FUNCTION(trigger_error)
char *message;
size_t message_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &message, &message_len, &error_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &message, &message_len, &error_type) == FAILURE) {
return;
}
@@ -1544,14 +1544,14 @@ ZEND_FUNCTION(set_error_handler)
zend_string *error_handler_name = NULL;
zend_long error_type = E_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &error_handler, &error_type) == FAILURE) {
return;
}
if (Z_TYPE_P(error_handler) != IS_NULL) { /* NULL == unset */
- if (!zend_is_callable(error_handler, 0, &error_handler_name TSRMLS_CC)) {
+ if (!zend_is_callable(error_handler, 0, &error_handler_name)) {
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
- get_active_function_name(TSRMLS_C), error_handler_name?error_handler_name->val:"unknown");
+ get_active_function_name(), error_handler_name?error_handler_name->val:"unknown");
zend_string_release(error_handler_name);
return;
}
@@ -1608,14 +1608,14 @@ ZEND_FUNCTION(set_exception_handler)
zval *exception_handler;
zend_string *exception_handler_name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &exception_handler) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception_handler) == FAILURE) {
return;
}
if (Z_TYPE_P(exception_handler) != IS_NULL) { /* NULL == unset */
- if (!zend_is_callable(exception_handler, 0, &exception_handler_name TSRMLS_CC)) {
+ if (!zend_is_callable(exception_handler, 0, &exception_handler_name)) {
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
- get_active_function_name(TSRMLS_C), exception_handler_name?exception_handler_name->val:"unknown");
+ get_active_function_name(), exception_handler_name?exception_handler_name->val:"unknown");
zend_string_release(exception_handler_name);
return;
}
@@ -1655,7 +1655,7 @@ ZEND_FUNCTION(restore_exception_handler)
}
/* }}} */
-static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int copy_class_or_interface_name(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el);
zval *array = va_arg(args, zval *);
@@ -1689,7 +1689,7 @@ ZEND_FUNCTION(get_declared_traits)
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, copy_class_or_interface_name, 3, return_value, mask, comply);
+ zend_hash_apply_with_arguments(EG(class_table), copy_class_or_interface_name, 3, return_value, mask, comply);
}
/* }}} */
@@ -1705,7 +1705,7 @@ ZEND_FUNCTION(get_declared_classes)
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, copy_class_or_interface_name, 3, return_value, mask, comply);
+ zend_hash_apply_with_arguments(EG(class_table), copy_class_or_interface_name, 3, return_value, mask, comply);
}
/* }}} */
@@ -1721,11 +1721,11 @@ ZEND_FUNCTION(get_declared_interfaces)
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, copy_class_or_interface_name, 3, return_value, mask, comply);
+ zend_hash_apply_with_arguments(EG(class_table), copy_class_or_interface_name, 3, return_value, mask, comply);
}
/* }}} */
-static int copy_function_name(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int copy_function_name(zval *zv, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_function *func = Z_PTR_P(zv);
zval *internal_ar = va_arg(args, zval *),
@@ -1759,7 +1759,7 @@ ZEND_FUNCTION(get_defined_functions)
array_init(&user);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(function_table) TSRMLS_CC, copy_function_name, 2, &internal, &user);
+ zend_hash_apply_with_arguments(EG(function_table), copy_function_name, 2, &internal, &user);
zend_hash_str_add_new(Z_ARRVAL_P(return_value), "internal", sizeof("internal")-1, &internal);
zend_hash_str_add_new(Z_ARRVAL_P(return_value), "user", sizeof("user")-1, &user);
@@ -1770,7 +1770,7 @@ ZEND_FUNCTION(get_defined_functions)
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
ZEND_FUNCTION(get_defined_vars)
{
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
ZVAL_NEW_ARR(return_value);
zend_array_dup(Z_ARRVAL_P(return_value), &symbol_table->ht);
@@ -1788,7 +1788,7 @@ ZEND_FUNCTION(create_function)
int retval;
char *eval_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &function_args, &function_args_len, &function_code, &function_code_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &function_args, &function_args_len, &function_code, &function_code_len) == FAILURE) {
return;
}
@@ -1813,8 +1813,8 @@ ZEND_FUNCTION(create_function)
eval_code[eval_code_length++] = '}';
eval_code[eval_code_length] = '\0';
- eval_name = zend_make_compiled_string_description("runtime-created function" TSRMLS_CC);
- retval = zend_eval_stringl(eval_code, eval_code_length, NULL, eval_name TSRMLS_CC);
+ eval_name = zend_make_compiled_string_description("runtime-created function");
+ retval = zend_eval_stringl(eval_code, eval_code_length, NULL, eval_name);
efree(eval_code);
efree(eval_name);
@@ -1871,11 +1871,11 @@ ZEND_FUNCTION(get_resource_type)
const char *resource_type;
zval *z_resource_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_resource_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_resource_type) == FAILURE) {
return;
}
- resource_type = zend_rsrc_list_get_rsrc_type(Z_RES_P(z_resource_type) TSRMLS_CC);
+ resource_type = zend_rsrc_list_get_rsrc_type(Z_RES_P(z_resource_type));
if (resource_type) {
RETURN_STRING(resource_type);
} else {
@@ -1893,7 +1893,7 @@ ZEND_FUNCTION(get_resources)
zend_ulong index;
zval *val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &type) == FAILURE) {
return;
}
@@ -1932,7 +1932,7 @@ ZEND_FUNCTION(get_resources)
}
/* }}} */
-static int add_extension_info(zval *item, void *arg TSRMLS_DC) /* {{{ */
+static int add_extension_info(zval *item, void *arg) /* {{{ */
{
zval *name_array = (zval *)arg;
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(item);
@@ -1941,7 +1941,7 @@ static int add_extension_info(zval *item, void *arg TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */
+static int add_zendext_info(zend_extension *ext, void *arg) /* {{{ */
{
zval *name_array = (zval *)arg;
add_next_index_string(name_array, ext->name);
@@ -1949,7 +1949,7 @@ static int add_zendext_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int add_constant_info(zval *item, void *arg TSRMLS_DC) /* {{{ */
+static int add_constant_info(zval *item, void *arg) /* {{{ */
{
zval *name_array = (zval *)arg;
zend_constant *constant = (zend_constant*)Z_PTR_P(item);
@@ -1972,16 +1972,16 @@ ZEND_FUNCTION(get_loaded_extensions)
{
zend_bool zendext = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &zendext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &zendext) == FAILURE) {
return;
}
array_init(return_value);
if (zendext) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t)add_zendext_info, return_value TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t)add_zendext_info, return_value);
} else {
- zend_hash_apply_with_argument(&module_registry, add_extension_info, return_value TSRMLS_CC);
+ zend_hash_apply_with_argument(&module_registry, add_extension_info, return_value);
}
}
/* }}} */
@@ -1992,7 +1992,7 @@ ZEND_FUNCTION(get_defined_constants)
{
zend_bool categorize = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &categorize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &categorize) == FAILURE) {
return;
}
@@ -2043,12 +2043,12 @@ ZEND_FUNCTION(get_defined_constants)
efree(module_names);
efree(modules);
} else {
- zend_hash_apply_with_argument(EG(zend_constants), add_constant_info, return_value TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(zend_constants), add_constant_info, return_value);
}
}
/* }}} */
-static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) /* {{{ */
+static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /* {{{ */
{
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
@@ -2084,7 +2084,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TS
}
/* }}} */
-void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) /* {{{ */
+void debug_print_backtrace_args(zval *arg_array) /* {{{ */
{
zval *tmp;
int i = 0;
@@ -2093,7 +2093,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC) /* {{{ */
if (i++) {
ZEND_PUTS(", ");
}
- zend_print_flat_zval_r(tmp TSRMLS_CC);
+ zend_print_flat_zval_r(tmp);
} ZEND_HASH_FOREACH_END();
}
/* }}} */
@@ -2115,7 +2115,7 @@ ZEND_FUNCTION(debug_print_backtrace)
zend_long options = 0;
zend_long limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &options, &limit) == FAILURE) {
return;
}
@@ -2199,7 +2199,7 @@ ZEND_FUNCTION(debug_print_backtrace)
}
if (func->type != ZEND_EVAL_CODE) {
if ((options & DEBUG_BACKTRACE_IGNORE_ARGS) == 0) {
- debug_backtrace_get_args(call, &arg_array TSRMLS_CC);
+ debug_backtrace_get_args(call, &arg_array);
}
}
} else {
@@ -2249,7 +2249,7 @@ ZEND_FUNCTION(debug_print_backtrace)
}
zend_printf("%s(", function_name);
if (Z_TYPE(arg_array) != IS_UNDEF) {
- debug_print_backtrace_args(&arg_array TSRMLS_CC);
+ debug_print_backtrace_args(&arg_array);
zval_ptr_dtor(&arg_array);
}
if (filename) {
@@ -2285,7 +2285,7 @@ ZEND_FUNCTION(debug_print_backtrace)
/* }}} */
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC) /* {{{ */
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit) /* {{{ */
{
zend_execute_data *call, *ptr, *skip;
zend_object *object;
@@ -2427,7 +2427,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
func->type != ZEND_EVAL_CODE) {
zval args;
- debug_backtrace_get_args(call, &args TSRMLS_CC);
+ debug_backtrace_get_args(call, &args);
add_assoc_zval_ex(&stack_frame, "args", sizeof("args")-1, &args);
}
} else {
@@ -2497,11 +2497,11 @@ ZEND_FUNCTION(debug_backtrace)
zend_long options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
zend_long limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &options, &limit) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &options, &limit) == FAILURE) {
return;
}
- zend_fetch_debug_backtrace(return_value, 1, options, limit TSRMLS_CC);
+ zend_fetch_debug_backtrace(return_value, 1, options, limit);
}
/* }}} */
@@ -2513,7 +2513,7 @@ ZEND_FUNCTION(extension_loaded)
size_t extension_name_len;
zend_string *lcname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &extension_name, &extension_name_len) == FAILURE) {
return;
}
@@ -2539,7 +2539,7 @@ ZEND_FUNCTION(get_extension_funcs)
zend_module_entry *module;
zend_function *zif;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &extension_name, &extension_name_len) == FAILURE) {
return;
}
if (strncasecmp(extension_name, "zend", sizeof("zend"))) {
diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h
index 3db0d2002b..dde8aa48a2 100644
--- a/Zend/zend_builtin_functions.h
+++ b/Zend/zend_builtin_functions.h
@@ -22,10 +22,10 @@
#ifndef ZEND_BUILTIN_FUNCTIONS_H
#define ZEND_BUILTIN_FUNCTIONS_H
-int zend_startup_builtin_functions(TSRMLS_D);
+int zend_startup_builtin_functions(void);
BEGIN_EXTERN_C()
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit TSRMLS_DC);
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit);
END_EXTERN_C()
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 94ee585ddc..0b0ae2e4d4 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -55,7 +55,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
efree(arguments);
zend_error(E_RECOVERABLE_ERROR, "Cannot get arguments for calling closure");
RETVAL_FALSE;
- } else if (call_user_function_ex(CG(function_table), NULL, getThis(), return_value, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) {
+ } else if (call_user_function_ex(CG(function_table), NULL, getThis(), return_value, ZEND_NUM_ARGS(), arguments, 1, NULL) == FAILURE) {
RETVAL_FALSE;
}
efree(arguments);
@@ -78,7 +78,7 @@ ZEND_METHOD(Closure, call)
int my_param_count = 0;
zend_function my_function;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o*", &newthis, &my_params, &my_param_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o*", &newthis, &my_params, &my_param_count) == FAILURE) {
return;
}
@@ -93,14 +93,14 @@ ZEND_METHOD(Closure, call)
if (closure->func.type == ZEND_INTERNAL_FUNCTION) {
/* verify that we aren't binding internal function to a wrong object */
if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
- !instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", closure->func.common.scope->name->val, closure->func.common.function_name->val, Z_OBJCE_P(newthis)->name->val);
return;
}
}
/* This should never happen as closures will always be callable */
- if (zend_fcall_info_init(zclosure, 0, &fci, &fci_cache, NULL, NULL TSRMLS_CC) != SUCCESS) {
+ if (zend_fcall_info_init(zclosure, 0, &fci, &fci_cache, NULL, NULL) != SUCCESS) {
ZEND_ASSERT(0);
}
@@ -115,7 +115,7 @@ ZEND_METHOD(Closure, call)
my_function.common.scope = Z_OBJCE_P(newthis);
fci_cache.function_handler = &my_function;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(closure_result) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(closure_result) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &closure_result);
}
}
@@ -129,7 +129,7 @@ ZEND_METHOD(Closure, bind)
zend_closure *closure;
zend_class_entry *ce;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) {
RETURN_NULL();
}
@@ -148,7 +148,7 @@ ZEND_METHOD(Closure, bind)
zend_string *class_name = zval_get_string(scope_arg);
if (zend_string_equals_literal(class_name, "static")) {
ce = closure->func.common.scope;
- } else if ((ce = zend_lookup_class_ex(class_name, NULL, 1 TSRMLS_CC)) == NULL) {
+ } else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) {
zend_error(E_WARNING, "Class '%s' not found", class_name->val);
zend_string_release(class_name);
RETURN_NULL();
@@ -159,24 +159,24 @@ ZEND_METHOD(Closure, bind)
ce = closure->func.common.scope;
}
- zend_create_closure(return_value, &closure->func, ce, newthis TSRMLS_CC);
+ zend_create_closure(return_value, &closure->func, ce, newthis);
}
/* }}} */
-static zend_function *zend_closure_get_constructor(zend_object *object TSRMLS_DC) /* {{{ */
+static zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
{
zend_error(E_RECOVERABLE_ERROR, "Instantiation of 'Closure' is not allowed");
return NULL;
}
/* }}} */
-static int zend_closure_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int zend_closure_compare_objects(zval *o1, zval *o2) /* {{{ */
{
return (Z_OBJ_P(o1) != Z_OBJ_P(o2));
}
/* }}} */
-ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {{{ */
{
zend_closure *closure = (zend_closure *)object;
zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function));
@@ -193,21 +193,21 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object TSRML
}
/* }}} */
-ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC) /* {{{ */
+ZEND_API const zend_function *zend_get_closure_method_def(zval *obj) /* {{{ */
{
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
return &closure->func;
}
/* }}} */
-ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
+ZEND_API zval* zend_get_closure_this_ptr(zval *obj) /* {{{ */
{
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
return &closure->this_ptr;
}
/* }}} */
-static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
+static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
zend_string *lc_name;
@@ -215,34 +215,34 @@ static zend_function *zend_closure_get_method(zend_object **object, zend_string
zend_str_tolower_copy(lc_name->val, method->val, method->len);
if (zend_string_equals_literal(method, ZEND_INVOKE_FUNC_NAME)) {
zend_string_free(lc_name);
- return zend_get_closure_invoke_method(*object TSRMLS_CC);
+ return zend_get_closure_invoke_method(*object);
}
zend_string_free(lc_name);
- return std_object_handlers.get_method(object, method, key TSRMLS_CC);
+ return std_object_handlers.get_method(object, method, key);
}
/* }}} */
-static zval *zend_closure_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *zend_closure_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
return &EG(uninitialized_zval);
}
/* }}} */
-static void zend_closure_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+static void zend_closure_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
/* }}} */
-static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
return NULL;
}
/* }}} */
-static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
if (has_set_exists != 2) {
ZEND_CLOSURE_PROPERTY_ERROR();
@@ -251,17 +251,17 @@ static int zend_closure_has_property(zval *object, zval *member, int has_set_exi
}
/* }}} */
-static void zend_closure_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void zend_closure_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
/* }}} */
-static void zend_closure_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void zend_closure_free_storage(zend_object *object) /* {{{ */
{
zend_closure *closure = (zend_closure *)object;
- zend_object_std_dtor(&closure->std TSRMLS_CC);
+ zend_object_std_dtor(&closure->std);
if (closure->func.type == ZEND_USER_FUNCTION) {
zend_execute_data *ex = EG(current_execute_data);
@@ -271,7 +271,7 @@ static void zend_closure_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
ex = ex->prev_execute_data;
}
- destroy_op_array(&closure->func.op_array TSRMLS_CC);
+ destroy_op_array(&closure->func.op_array);
}
if (closure->debug_info != NULL) {
@@ -285,31 +285,31 @@ static void zend_closure_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_object *zend_closure_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *zend_closure_new(zend_class_entry *class_type) /* {{{ */
{
zend_closure *closure;
closure = emalloc(sizeof(zend_closure));
memset(closure, 0, sizeof(zend_closure));
- zend_object_std_init(&closure->std, class_type TSRMLS_CC);
+ zend_object_std_init(&closure->std, class_type);
closure->std.handlers = &closure_handlers;
return (zend_object*)closure;
}
/* }}} */
-static zend_object *zend_closure_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *zend_closure_clone(zval *zobject) /* {{{ */
{
zend_closure *closure = (zend_closure *)Z_OBJ_P(zobject);
zval result;
- zend_create_closure(&result, &closure->func, closure->func.common.scope, &closure->this_ptr TSRMLS_CC);
+ zend_create_closure(&result, &closure->func, closure->func.common.scope, &closure->this_ptr);
return Z_OBJ(result);
}
/* }}} */
-int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr TSRMLS_DC) /* {{{ */
+int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */
{
zend_closure *closure;
@@ -335,7 +335,7 @@ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function
}
/* }}} */
-static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
zend_closure *closure = (zend_closure *)Z_OBJ_P(object);
zval val;
@@ -390,7 +390,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
}
/* }}} */
-static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n) /* {{{ */
{
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
@@ -439,12 +439,12 @@ static const zend_function_entry closure_functions[] = {
ZEND_FE_END
};
-void zend_register_closure_ce(TSRMLS_D) /* {{{ */
+void zend_register_closure_ce(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "Closure", closure_functions);
- zend_ce_closure = zend_register_internal_class(&ce TSRMLS_CC);
+ zend_ce_closure = zend_register_internal_class(&ce);
zend_ce_closure->ce_flags |= ZEND_ACC_FINAL;
zend_ce_closure->create_object = zend_closure_new;
zend_ce_closure->serialize = zend_class_serialize_deny;
@@ -468,7 +468,7 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zval *this_ptr TSRMLS_DC) /* {{{ */
+ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zval *this_ptr) /* {{{ */
{
zend_closure *closure;
@@ -491,19 +491,19 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
ALLOC_HASHTABLE(closure->func.op_array.static_variables);
zend_hash_init(closure->func.op_array.static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_apply_with_arguments(static_variables TSRMLS_CC, zval_copy_static_var, 1, closure->func.op_array.static_variables);
+ zend_hash_apply_with_arguments(static_variables, zval_copy_static_var, 1, closure->func.op_array.static_variables);
}
closure->func.op_array.run_time_cache = NULL;
(*closure->func.op_array.refcount)++;
} else {
/* verify that we aren't binding internal function to a wrong scope */
if(func->common.scope != NULL) {
- if(scope && !instanceof_function(scope, func->common.scope TSRMLS_CC)) {
+ if(scope && !instanceof_function(scope, func->common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", func->common.scope->name->val, func->common.function_name->val, scope->name->val);
scope = NULL;
}
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
- !instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", func->common.scope->name->val, func->common.function_name->val, Z_OBJCE_P(this_ptr)->name->val);
scope = NULL;
this_ptr = NULL;
diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h
index 4f8ae6dd91..674c4b3013 100644
--- a/Zend/zend_closures.h
+++ b/Zend/zend_closures.h
@@ -24,14 +24,14 @@
BEGIN_EXTERN_C()
-void zend_register_closure_ce(TSRMLS_D);
+void zend_register_closure_ce(void);
extern ZEND_API zend_class_entry *zend_ce_closure;
-ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zval *this_ptr TSRMLS_DC);
-ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj TSRMLS_DC);
-ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC);
-ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC);
+ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zval *this_ptr);
+ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj);
+ZEND_API const zend_function *zend_get_closure_method_def(zval *obj);
+ZEND_API zval* zend_get_closure_this_ptr(zval *obj);
END_EXTERN_C()
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 95892cbe67..c196e39887 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -35,7 +35,7 @@
#define SET_NODE(target, src) do { \
target ## _type = (src)->op_type; \
if ((src)->op_type == IS_CONST) { \
- target.constant = zend_add_literal(CG(active_op_array), &(src)->u.constant TSRMLS_CC); \
+ target.constant = zend_add_literal(CG(active_op_array), &(src)->u.constant); \
} else { \
target = (src)->u.op; \
} \
@@ -50,21 +50,21 @@
} \
} while (0)
-static inline void zend_alloc_cache_slot(uint32_t literal TSRMLS_DC) {
+static inline void zend_alloc_cache_slot(uint32_t literal) {
zend_op_array *op_array = CG(active_op_array);
Z_CACHE_SLOT(op_array->literals[literal]) = op_array->last_cache_slot++;
}
#define POLYMORPHIC_CACHE_SLOT_SIZE 2
-static inline void zend_alloc_polymorphic_cache_slot(uint32_t literal TSRMLS_DC) {
+static inline void zend_alloc_polymorphic_cache_slot(uint32_t literal) {
zend_op_array *op_array = CG(active_op_array);
Z_CACHE_SLOT(op_array->literals[literal]) = op_array->last_cache_slot;
op_array->last_cache_slot += POLYMORPHIC_CACHE_SLOT_SIZE;
}
-ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
+ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type);
+ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename);
#ifndef ZTS
ZEND_API zend_compiler_globals compiler_globals;
@@ -91,11 +91,11 @@ static void zend_destroy_property_info_internal(zval *zv) /* {{{ */
}
/* }}} */
-static zend_string *zend_new_interned_string_safe(zend_string *str TSRMLS_DC) /* {{{ */ {
+static zend_string *zend_new_interned_string_safe(zend_string *str) /* {{{ */ {
zend_string *interned_str;
zend_string_addref(str);
- interned_str = zend_new_interned_string(str TSRMLS_CC);
+ interned_str = zend_new_interned_string(str);
if (str != interned_str) {
return interned_str;
} else {
@@ -105,7 +105,7 @@ static zend_string *zend_new_interned_string_safe(zend_string *str TSRMLS_DC) /*
}
/* }}} */
-static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigned char *lex_pos TSRMLS_DC) /* {{{ */
+static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigned char *lex_pos) /* {{{ */
{
zend_string *result;
char char_pos_buf[32];
@@ -122,7 +122,7 @@ static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigne
/* NULL, name length, filename length, last accepting char position length */
result = zend_string_alloc(1 + name->len + filename_len + char_pos_len, 0);
sprintf(result->val, "%c%s%s%s", '\0', name->val, filename, char_pos_buf);
- return zend_new_interned_string(result TSRMLS_CC);
+ return zend_new_interned_string(result);
}
/* }}} */
@@ -139,13 +139,13 @@ static zend_bool zend_get_unqualified_name(const zend_string *name, const char *
}
/* }}} */
-static void init_compiler_declarables(TSRMLS_D) /* {{{ */
+static void init_compiler_declarables(void) /* {{{ */
{
ZVAL_LONG(&CG(declarables).ticks, 0);
}
/* }}} */
-void zend_init_compiler_context(TSRMLS_D) /* {{{ */
+void zend_init_compiler_context(void) /* {{{ */
{
CG(context).opcodes_size = INITIAL_OP_ARRAY_SIZE;
CG(context).vars_size = 0;
@@ -158,7 +158,7 @@ void zend_init_compiler_context(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
+void zend_init_compiler_data_structures(void) /* {{{ */
{
zend_stack_init(&CG(loop_var_stack), sizeof(znode));
zend_stack_init(&CG(delayed_oplines_stack), sizeof(zend_op));
@@ -172,7 +172,7 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
CG(current_import_function) = NULL;
CG(current_import_const) = NULL;
zend_hash_init(&CG(const_filenames), 8, NULL, NULL, 0);
- init_compiler_declarables(TSRMLS_C);
+ init_compiler_declarables();
zend_stack_init(&CG(context_stack), sizeof(CG(context)));
CG(encoding_declared) = 0;
@@ -181,26 +181,25 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
{
- TSRMLS_FETCH();
- zend_file_handle_dtor(fh TSRMLS_CC);
+ zend_file_handle_dtor(fh);
}
/* }}} */
-void init_compiler(TSRMLS_D) /* {{{ */
+void init_compiler(void) /* {{{ */
{
CG(arena) = zend_arena_create(64 * 1024);
CG(active_op_array) = NULL;
memset(&CG(context), 0, sizeof(CG(context)));
- zend_init_compiler_data_structures(TSRMLS_C);
- zend_init_rsrc_list(TSRMLS_C);
+ zend_init_compiler_data_structures();
+ zend_init_rsrc_list();
zend_hash_init(&CG(filenames_table), 8, NULL, free_string_zval, 0);
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) file_handle_dtor, 0);
CG(unclean_shutdown) = 0;
}
/* }}} */
-void shutdown_compiler(TSRMLS_D) /* {{{ */
+void shutdown_compiler(void) /* {{{ */
{
zend_stack_destroy(&CG(loop_var_stack));
zend_stack_destroy(&CG(delayed_oplines_stack));
@@ -211,7 +210,7 @@ void shutdown_compiler(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename TSRMLS_DC) /* {{{ */
+ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename) /* {{{ */
{
zend_string *p;
@@ -227,25 +226,25 @@ ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filen
}
/* }}} */
-ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename TSRMLS_DC) /* {{{ */
+ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename) /* {{{ */
{
CG(compiled_filename) = original_compiled_filename;
}
/* }}} */
-ZEND_API zend_string *zend_get_compiled_filename(TSRMLS_D) /* {{{ */
+ZEND_API zend_string *zend_get_compiled_filename(void) /* {{{ */
{
return CG(compiled_filename);
}
/* }}} */
-ZEND_API int zend_get_compiled_lineno(TSRMLS_D) /* {{{ */
+ZEND_API int zend_get_compiled_lineno(void) /* {{{ */
{
return CG(zend_lineno);
}
/* }}} */
-ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */
+ZEND_API zend_bool zend_is_compiling(void) /* {{{ */
{
return CG(in_compilation);
}
@@ -257,7 +256,7 @@ static uint32_t get_temporary_variable(zend_op_array *op_array) /* {{{ */
}
/* }}} */
-static int lookup_cv(zend_op_array *op_array, zend_string* name TSRMLS_DC) /* {{{ */{
+static int lookup_cv(zend_op_array *op_array, zend_string* name) /* {{{ */{
int i = 0;
zend_ulong hash_value = zend_string_hash_val(name);
@@ -278,7 +277,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string* name TSRMLS_DC) /* {{
op_array->vars = erealloc(op_array->vars, CG(context).vars_size * sizeof(zend_string*));
}
- op_array->vars[i] = zend_new_interned_string(name TSRMLS_CC);
+ op_array->vars[i] = zend_new_interned_string(name);
return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
/* }}} */
@@ -295,11 +294,11 @@ void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
/* }}} */
/* Common part of zend_add_literal and zend_append_individual_literal */
-static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int literal_position TSRMLS_DC) /* {{{ */
+static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int literal_position) /* {{{ */
{
if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) {
zend_string_hash_val(Z_STR_P(zv));
- Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv) TSRMLS_CC);
+ Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
if (IS_INTERNED(Z_STR_P(zv))) {
Z_TYPE_FLAGS_P(zv) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
@@ -312,7 +311,7 @@ static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int li
/* Is used while compiling a function, using the context to keep track
of an approximate size to avoid to relocate to often.
Literals are truncated to actual size in the second compiler pass (pass_two()). */
-int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC) /* {{{ */
+int zend_add_literal(zend_op_array *op_array, zval *zv) /* {{{ */
{
int i = op_array->last_literal;
op_array->last_literal++;
@@ -322,81 +321,81 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC) /* {{{ */
}
op_array->literals = (zval*)erealloc(op_array->literals, CG(context).literals_size * sizeof(zval));
}
- zend_insert_literal(op_array, zv, i TSRMLS_CC);
+ zend_insert_literal(op_array, zv, i);
return i;
}
/* }}} */
-static inline int zend_add_literal_string(zend_op_array *op_array, zend_string **str TSRMLS_DC) /* {{{ */
+static inline int zend_add_literal_string(zend_op_array *op_array, zend_string **str) /* {{{ */
{
int ret;
zval zv;
ZVAL_STR(&zv, *str);
- ret = zend_add_literal(op_array, &zv TSRMLS_CC);
+ ret = zend_add_literal(op_array, &zv);
*str = Z_STR(zv);
return ret;
}
/* }}} */
-static int zend_add_func_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */
+static int zend_add_func_name_literal(zend_op_array *op_array, zend_string *name) /* {{{ */
{
/* Original name */
- int ret = zend_add_literal_string(op_array, &name TSRMLS_CC);
+ int ret = zend_add_literal_string(op_array, &name);
/* Lowercased name */
zend_string *lc_name = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lc_name->val, name->val, name->len);
- zend_add_literal_string(op_array, &lc_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &lc_name);
return ret;
}
/* }}} */
-static int zend_add_ns_func_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */
+static int zend_add_ns_func_name_literal(zend_op_array *op_array, zend_string *name) /* {{{ */
{
const char *unqualified_name;
size_t unqualified_name_len;
/* Original name */
- int ret = zend_add_literal_string(op_array, &name TSRMLS_CC);
+ int ret = zend_add_literal_string(op_array, &name);
/* Lowercased name */
zend_string *lc_name = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lc_name->val, name->val, name->len);
- zend_add_literal_string(op_array, &lc_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &lc_name);
/* Lowercased unqualfied name */
if (zend_get_unqualified_name(name, &unqualified_name, &unqualified_name_len)) {
lc_name = zend_string_alloc(unqualified_name_len, 0);
zend_str_tolower_copy(lc_name->val, unqualified_name, unqualified_name_len);
- zend_add_literal_string(op_array, &lc_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &lc_name);
}
return ret;
}
/* }}} */
-static int zend_add_class_name_literal(zend_op_array *op_array, zend_string *name TSRMLS_DC) /* {{{ */
+static int zend_add_class_name_literal(zend_op_array *op_array, zend_string *name) /* {{{ */
{
/* Original name */
- int ret = zend_add_literal_string(op_array, &name TSRMLS_CC);
+ int ret = zend_add_literal_string(op_array, &name);
/* Lowercased name */
zend_string *lc_name = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lc_name->val, name->val, name->len);
- zend_add_literal_string(op_array, &lc_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &lc_name);
- zend_alloc_cache_slot(ret TSRMLS_CC);
+ zend_alloc_cache_slot(ret);
return ret;
}
/* }}} */
-static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *name, zend_bool unqualified TSRMLS_DC) /* {{{ */
+static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *name, zend_bool unqualified) /* {{{ */
{
zend_string *tmp_name;
- int ret = zend_add_literal_string(op_array, &name TSRMLS_CC);
+ int ret = zend_add_literal_string(op_array, &name);
size_t ns_len = 0, after_ns_len = name->len;
const char *after_ns = zend_memrchr(name->val, '\\', name->len);
@@ -408,12 +407,12 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
/* lowercased namespace name & original constant name */
tmp_name = zend_string_init(name->val, name->len, 0);
zend_str_tolower(tmp_name->val, ns_len);
- zend_add_literal_string(op_array, &tmp_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &tmp_name);
/* lowercased namespace name & lowercased constant name */
tmp_name = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(tmp_name->val, name->val, name->len);
- zend_add_literal_string(op_array, &tmp_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &tmp_name);
if (!unqualified) {
return ret;
@@ -424,12 +423,12 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
/* original unqualified constant name */
tmp_name = zend_string_init(after_ns, after_ns_len, 0);
- zend_add_literal_string(op_array, &tmp_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &tmp_name);
/* lowercased unqualified constant name */
tmp_name = zend_string_alloc(after_ns_len, 0);
zend_str_tolower_copy(tmp_name->val, after_ns, after_ns_len);
- zend_add_literal_string(op_array, &tmp_name TSRMLS_CC);
+ zend_add_literal_string(op_array, &tmp_name);
return ret;
}
@@ -438,7 +437,7 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
#define LITERAL_STR(op, str) do { \
zval _c; \
ZVAL_STR(&_c, str); \
- op.constant = zend_add_literal(CG(active_op_array), &_c TSRMLS_CC); \
+ op.constant = zend_add_literal(CG(active_op_array), &_c); \
} while (0)
#define MAKE_NOP(opline) do { \
@@ -449,11 +448,11 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
opline->result_type = opline->op1_type = opline->op2_type = IS_UNUSED; \
} while (0)
-void zend_stop_lexing(TSRMLS_D) {
+void zend_stop_lexing(void) {
LANG_SCNG(yy_cursor) = LANG_SCNG(yy_limit);
}
-static inline void zend_begin_loop(TSRMLS_D) /* {{{ */
+static inline void zend_begin_loop(void) /* {{{ */
{
zend_brk_cont_element *brk_cont_element;
int parent;
@@ -466,7 +465,7 @@ static inline void zend_begin_loop(TSRMLS_D) /* {{{ */
}
/* }}} */
-static inline void zend_end_loop(int cont_addr, int has_loop_var TSRMLS_DC) /* {{{ */
+static inline void zend_end_loop(int cont_addr, int has_loop_var) /* {{{ */
{
if (!has_loop_var) {
/* The start fileld is used to free temporary variables in case of exceptions.
@@ -480,10 +479,10 @@ static inline void zend_end_loop(int cont_addr, int has_loop_var TSRMLS_DC) /* {
}
/* }}} */
-void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
+void zend_do_free(znode *op1) /* {{{ */
{
if (op1->op_type==IS_TMP_VAR) {
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, op1);
@@ -502,7 +501,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
/* It's very rare and useless case. It's better to use
additional FREE opcode and simplify the FETCH handlers
their selves */
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
@@ -514,7 +513,7 @@ void zend_do_free(znode *op1 TSRMLS_DC) /* {{{ */
if (opline->opcode == ZEND_FETCH_LIST &&
opline->op1_type == IS_VAR &&
opline->op1.var == op1->u.op.var) {
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, op1);
@@ -584,7 +583,7 @@ zend_string *zend_concat_names(char *name1, size_t name1_len, char *name2, size_
return zend_concat3(name1, name1_len, "\\", 1, name2, name2_len);
}
-zend_string *zend_prefix_with_ns(zend_string *name TSRMLS_DC) {
+zend_string *zend_prefix_with_ns(zend_string *name) {
if (CG(current_namespace)) {
zend_string *ns = CG(current_namespace);
return zend_concat_names(ns->val, ns->len, name->val, name->len);
@@ -608,7 +607,7 @@ void *zend_hash_find_ptr_lc(HashTable *ht, const char *str, size_t len) {
zend_string *zend_resolve_non_class_name(
zend_string *name, uint32_t type, zend_bool *is_fully_qualified,
- zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC
+ zend_bool case_sensitive, HashTable *current_import_sub
) {
char *compound;
*is_fully_qualified = 0;
@@ -625,7 +624,7 @@ zend_string *zend_resolve_non_class_name(
if (type == ZEND_NAME_RELATIVE) {
*is_fully_qualified = 1;
- return zend_prefix_with_ns(name TSRMLS_CC);
+ return zend_prefix_with_ns(name);
}
if (current_import_sub) {
@@ -659,29 +658,29 @@ zend_string *zend_resolve_non_class_name(
}
}
- return zend_prefix_with_ns(name TSRMLS_CC);
+ return zend_prefix_with_ns(name);
}
/* }}} */
-zend_string *zend_resolve_function_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified TSRMLS_DC) /* {{{ */
+zend_string *zend_resolve_function_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified) /* {{{ */
{
return zend_resolve_non_class_name(
- name, type, is_fully_qualified, 0, CG(current_import_function) TSRMLS_CC);
+ name, type, is_fully_qualified, 0, CG(current_import_function));
}
/* }}} */
-zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified TSRMLS_DC) /* {{{ */ {
+zend_string *zend_resolve_const_name(zend_string *name, uint32_t type, zend_bool *is_fully_qualified) /* {{{ */ {
return zend_resolve_non_class_name(
- name, type, is_fully_qualified, 1, CG(current_import_const) TSRMLS_CC);
+ name, type, is_fully_qualified, 1, CG(current_import_const));
}
/* }}} */
-zend_string *zend_resolve_class_name(zend_string *name, uint32_t type TSRMLS_DC) /* {{{ */
+zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /* {{{ */
{
char *compound;
if (type == ZEND_NAME_RELATIVE) {
- return zend_prefix_with_ns(name TSRMLS_CC);
+ return zend_prefix_with_ns(name);
}
if (type == ZEND_NAME_FQ || name->val[0] == '\\') {
@@ -721,14 +720,14 @@ zend_string *zend_resolve_class_name(zend_string *name, uint32_t type TSRMLS_DC)
}
/* If not fully qualified and not an alias, prepend the current namespace */
- return zend_prefix_with_ns(name TSRMLS_CC);
+ return zend_prefix_with_ns(name);
}
/* }}} */
-zend_string *zend_resolve_class_name_ast(zend_ast *ast TSRMLS_DC) /* {{{ */
+zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */
{
zend_string *name = zend_ast_get_str(ast);
- return zend_resolve_class_name(name, ast->attr TSRMLS_CC);
+ return zend_resolve_class_name(name, ast->attr);
}
/* }}} */
@@ -743,7 +742,7 @@ static void str_dtor(zval *zv) /* {{{ */ {
}
/* }}} */
-void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC) /* {{{ */
+void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2) /* {{{ */
{
zend_label *dest;
int current, distance;
@@ -798,7 +797,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
}
/* }}} */
-void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */
+void zend_release_labels(int temporary) /* {{{ */
{
if (CG(context).labels) {
zend_hash_destroy(CG(context).labels);
@@ -815,7 +814,7 @@ void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */
static zend_bool zend_is_call(zend_ast *ast);
-static int generate_free_loop_var(znode *var TSRMLS_DC) /* {{{ */
+static int generate_free_loop_var(znode *var) /* {{{ */
{
switch (var->op_type) {
case IS_UNUSED:
@@ -824,7 +823,7 @@ static int generate_free_loop_var(znode *var TSRMLS_DC) /* {{{ */
case IS_VAR:
case IS_TMP_VAR:
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, var);
@@ -836,7 +835,7 @@ static int generate_free_loop_var(znode *var TSRMLS_DC) /* {{{ */
}
/* }}} */
-static uint32_t zend_add_try_element(uint32_t try_op TSRMLS_DC) /* {{{ */
+static uint32_t zend_add_try_element(uint32_t try_op) /* {{{ */
{
zend_op_array *op_array = CG(active_op_array);
uint32_t try_catch_offset = op_array->last_try_catch++;
@@ -876,7 +875,7 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
}
/* }}} */
-ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC) /* {{{ */
+ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time) /* {{{ */
{
zend_function *function, *new_function;
zval *op1, *op2;
@@ -916,7 +915,7 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opli
}
/* }}} */
-ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time) /* {{{ */
{
zend_class_entry *ce;
zval *op1, *op2;
@@ -946,14 +945,14 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
return NULL;
} else {
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
- zend_verify_abstract_class(ce TSRMLS_CC);
+ zend_verify_abstract_class(ce);
}
return ce;
}
}
/* }}} */
-ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time) /* {{{ */
{
zend_class_entry *ce;
zval *op1, *op2;
@@ -986,7 +985,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name->val, parent_ce->name->val);
}
- zend_do_inheritance(ce, parent_ce TSRMLS_CC);
+ zend_do_inheritance(ce, parent_ce);
ce->refcount++;
@@ -998,7 +997,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
}
/* }}} */
-void zend_do_early_binding(TSRMLS_D) /* {{{ */
+void zend_do_early_binding(void) /* {{{ */
{
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
HashTable *table;
@@ -1009,13 +1008,13 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
switch (opline->opcode) {
case ZEND_DECLARE_FUNCTION:
- if (do_bind_function(CG(active_op_array), opline, CG(function_table), 1 TSRMLS_CC) == FAILURE) {
+ if (do_bind_function(CG(active_op_array), opline, CG(function_table), 1) == FAILURE) {
return;
}
table = CG(function_table);
break;
case ZEND_DECLARE_CLASS:
- if (do_bind_class(CG(active_op_array), opline, CG(class_table), 1 TSRMLS_CC) == NULL) {
+ if (do_bind_class(CG(active_op_array), opline, CG(class_table), 1) == NULL) {
return;
}
table = CG(class_table);
@@ -1027,7 +1026,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
zend_class_entry *ce;
parent_name = CT_CONSTANT(fetch_class_opline->op2);
- if (((ce = zend_lookup_class(Z_STR_P(parent_name) TSRMLS_CC)) == NULL) ||
+ if (((ce = zend_lookup_class(Z_STR_P(parent_name))) == NULL) ||
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
(ce->type == ZEND_INTERNAL_CLASS))) {
if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) {
@@ -1043,7 +1042,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
}
return;
}
- if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1 TSRMLS_CC) == NULL) {
+ if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1) == NULL) {
return;
}
/* clear unnecessary ZEND_FETCH_CLASS opcode */
@@ -1072,7 +1071,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array) /* {{{ */
{
if (op_array->early_binding != (uint32_t)-1) {
zend_bool orig_in_compilation = CG(in_compilation);
@@ -1081,8 +1080,8 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS
CG(in_compilation) = 1;
while (opline_num != (uint32_t)-1) {
- if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)) TSRMLS_CC)) != NULL) {
- do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0 TSRMLS_CC);
+ if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)))) != NULL) {
+ do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
}
opline_num = op_array->opcodes[opline_num].result.opline_num;
}
@@ -1152,7 +1151,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
}
/* }}} */
-static zend_constant *zend_lookup_reserved_const(const char *name, size_t len TSRMLS_DC) /* {{{ */
+static zend_constant *zend_lookup_reserved_const(const char *name, size_t len) /* {{{ */
{
zend_constant *c = zend_hash_find_ptr_lc(EG(zend_constants), name, len);
if (c && !(c->flags & CONST_CS) && (c->flags & CONST_CT_SUBST)) {
@@ -1162,7 +1161,7 @@ static zend_constant *zend_lookup_reserved_const(const char *name, size_t len TS
}
/* }}} */
-static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool is_fully_qualified TSRMLS_DC) /* {{{ */
+static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool is_fully_qualified) /* {{{ */
{
zend_constant *c;
@@ -1184,7 +1183,7 @@ static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool i
zend_get_unqualified_name(name, &lookup_name, &lookup_len);
}
- c = zend_lookup_reserved_const(lookup_name, lookup_len TSRMLS_CC);
+ c = zend_lookup_reserved_const(lookup_name, lookup_len);
if (c) {
ZVAL_DUP(zv, &c->value);
return 1;
@@ -1195,7 +1194,7 @@ static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool i
}
/* }}} */
-void zend_init_list(void *result, void *item TSRMLS_DC) /* {{{ */
+void zend_init_list(void *result, void *item) /* {{{ */
{
void** list = emalloc(sizeof(void*) * 2);
@@ -1206,7 +1205,7 @@ void zend_init_list(void *result, void *item TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */
+void zend_add_to_list(void *result, void *item) /* {{{ */
{
void** list = *(void**)result;
size_t n = 0;
@@ -1226,7 +1225,7 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_do_extended_info(TSRMLS_D) /* {{{ */
+void zend_do_extended_info(void) /* {{{ */
{
zend_op *opline;
@@ -1234,7 +1233,7 @@ void zend_do_extended_info(TSRMLS_D) /* {{{ */
return;
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_EXT_STMT;
SET_UNUSED(opline->op1);
@@ -1242,7 +1241,7 @@ void zend_do_extended_info(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_do_extended_fcall_begin(TSRMLS_D) /* {{{ */
+void zend_do_extended_fcall_begin(void) /* {{{ */
{
zend_op *opline;
@@ -1250,7 +1249,7 @@ void zend_do_extended_fcall_begin(TSRMLS_D) /* {{{ */
return;
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_EXT_FCALL_BEGIN;
SET_UNUSED(opline->op1);
@@ -1258,7 +1257,7 @@ void zend_do_extended_fcall_begin(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
+void zend_do_extended_fcall_end(void) /* {{{ */
{
zend_op *opline;
@@ -1266,7 +1265,7 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
return;
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_EXT_FCALL_END;
SET_UNUSED(opline->op1);
@@ -1274,13 +1273,13 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
}
/* }}} */
-zend_bool zend_is_auto_global(zend_string *name TSRMLS_DC) /* {{{ */
+zend_bool zend_is_auto_global(zend_string *name) /* {{{ */
{
zend_auto_global *auto_global;
if ((auto_global = zend_hash_find_ptr(CG(auto_globals), name)) != NULL) {
if (auto_global->armed) {
- auto_global->armed = auto_global->auto_global_callback(auto_global->name TSRMLS_CC);
+ auto_global->armed = auto_global->auto_global_callback(auto_global->name);
}
return 1;
}
@@ -1288,12 +1287,12 @@ zend_bool zend_is_auto_global(zend_string *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC) /* {{{ */
+int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback) /* {{{ */
{
zend_auto_global auto_global;
int retval;
- auto_global.name = zend_new_interned_string(name TSRMLS_CC);
+ auto_global.name = zend_new_interned_string(name);
auto_global.auto_global_callback = auto_global_callback;
auto_global.jit = jit;
@@ -1304,7 +1303,7 @@ int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global
}
/* }}} */
-ZEND_API void zend_activate_auto_globals(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate_auto_globals(void) /* {{{ */
{
zend_auto_global *auto_global;
@@ -1312,7 +1311,7 @@ ZEND_API void zend_activate_auto_globals(TSRMLS_D) /* {{{ */
if (auto_global->jit) {
auto_global->armed = 1;
} else if (auto_global->auto_global_callback) {
- auto_global->armed = auto_global->auto_global_callback(auto_global->name TSRMLS_CC);
+ auto_global->armed = auto_global->auto_global_callback(auto_global->name);
} else {
auto_global->armed = 0;
}
@@ -1320,7 +1319,7 @@ ZEND_API void zend_activate_auto_globals(TSRMLS_D) /* {{{ */
}
/* }}} */
-int zendlex(zend_parser_stack_elem *elem TSRMLS_DC) /* {{{ */
+int zendlex(zend_parser_stack_elem *elem) /* {{{ */
{
zval zv;
int retval;
@@ -1332,7 +1331,7 @@ int zendlex(zend_parser_stack_elem *elem TSRMLS_DC) /* {{{ */
again:
ZVAL_UNDEF(&zv);
- retval = lex_scan(&zv TSRMLS_CC);
+ retval = lex_scan(&zv);
switch (retval) {
case T_COMMENT:
case T_DOC_COMMENT:
@@ -1358,7 +1357,7 @@ again:
}
/* }}} */
-ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC) /* {{{ */
+ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers) /* {{{ */
{
zend_bool persistent_hashes = (ce->type == ZEND_INTERNAL_CLASS) ? 1 : 0;
dtor_func_t zval_ptr_dtor_func = ((persistent_hashes) ? ZVAL_INTERNAL_PTR_DTOR : ZVAL_PTR_DTOR);
@@ -1472,7 +1471,7 @@ zend_ast *zend_ast_append_str(zend_ast *left_ast, zend_ast *right_ast) /* {{{ */
/* }}} */
/* A hacky way that is used to store the doc comment for properties */
-zend_ast *zend_ast_append_doc_comment(zend_ast *list TSRMLS_DC) /* {{{ */
+zend_ast *zend_ast_append_doc_comment(zend_ast *list) /* {{{ */
{
if (CG(doc_comment)) {
list = zend_ast_list_add(list, zend_ast_create_zval_from_str(CG(doc_comment)));
@@ -1483,7 +1482,7 @@ zend_ast *zend_ast_append_doc_comment(zend_ast *list TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_verify_namespace(TSRMLS_D) /* {{{ */
+void zend_verify_namespace(void) /* {{{ */
{
if (CG(has_bracketed_namespaces) && !CG(in_namespace)) {
zend_error_noreturn(E_COMPILE_ERROR, "No code may exist outside of namespace {}");
@@ -1491,7 +1490,7 @@ void zend_verify_namespace(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void zend_reset_import_tables(TSRMLS_D) /* {{{ */
+static void zend_reset_import_tables(void) /* {{{ */
{
if (CG(current_import)) {
zend_hash_destroy(CG(current_import));
@@ -1513,9 +1512,9 @@ static void zend_reset_import_tables(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void zend_end_namespace(TSRMLS_D) /* {{{ */ {
+static void zend_end_namespace(void) /* {{{ */ {
CG(in_namespace) = 0;
- zend_reset_import_tables(TSRMLS_C);
+ zend_reset_import_tables();
if (CG(current_namespace)) {
zend_string_release(CG(current_namespace));
CG(current_namespace) = NULL;
@@ -1523,10 +1522,10 @@ static void zend_end_namespace(TSRMLS_D) /* {{{ */ {
}
/* }}} */
-void zend_do_end_compilation(TSRMLS_D) /* {{{ */
+void zend_do_end_compilation(void) /* {{{ */
{
CG(has_bracketed_namespaces) = 0;
- zend_end_namespace(TSRMLS_C);
+ zend_end_namespace();
}
/* }}} */
@@ -1658,7 +1657,7 @@ static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
}
/* }}} */
-static inline void zend_make_var_result(znode *result, zend_op *opline TSRMLS_DC) /* {{{ */
+static inline void zend_make_var_result(znode *result, zend_op *opline) /* {{{ */
{
opline->result_type = IS_VAR;
opline->result.var = get_temporary_variable(CG(active_op_array));
@@ -1666,7 +1665,7 @@ static inline void zend_make_var_result(znode *result, zend_op *opline TSRMLS_DC
}
/* }}} */
-static inline void zend_make_tmp_result(znode *result, zend_op *opline TSRMLS_DC) /* {{{ */
+static inline void zend_make_tmp_result(znode *result, zend_op *opline) /* {{{ */
{
opline->result_type = IS_TMP_VAR;
opline->result.var = get_temporary_variable(CG(active_op_array));
@@ -1674,9 +1673,9 @@ static inline void zend_make_tmp_result(znode *result, zend_op *opline TSRMLS_DC
}
/* }}} */
-static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2 TSRMLS_DC) /* {{{ */
+static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = opcode;
if (op1 == NULL) {
@@ -1692,15 +1691,15 @@ static zend_op *zend_emit_op(znode *result, zend_uchar opcode, znode *op1, znode
}
if (result) {
- zend_make_var_result(result, opline TSRMLS_CC);
+ zend_make_var_result(result, opline);
}
return opline;
}
/* }}} */
-static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, znode *op2 TSRMLS_DC) /* {{{ */
+static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = opcode;
if (op1 == NULL) {
@@ -1716,16 +1715,16 @@ static zend_op *zend_emit_op_tmp(znode *result, zend_uchar opcode, znode *op1, z
}
if (result) {
- zend_make_tmp_result(result, opline TSRMLS_CC);
+ zend_make_tmp_result(result, opline);
}
return opline;
}
/* }}} */
-static void zend_emit_tick(TSRMLS_D) /* {{{ */
+static void zend_emit_tick(void) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_TICKS;
SET_UNUSED(opline->op1);
@@ -1734,31 +1733,31 @@ static void zend_emit_tick(TSRMLS_D) /* {{{ */
}
/* }}} */
-static inline zend_op *zend_emit_op_data(znode *value TSRMLS_DC) /* {{{ */
+static inline zend_op *zend_emit_op_data(znode *value) /* {{{ */
{
- return zend_emit_op(NULL, ZEND_OP_DATA, value, NULL TSRMLS_CC);
+ return zend_emit_op(NULL, ZEND_OP_DATA, value, NULL);
}
/* }}} */
-static inline uint32_t zend_emit_jump(uint32_t opnum_target TSRMLS_DC) /* {{{ */
+static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number(CG(active_op_array));
- zend_op *opline = zend_emit_op(NULL, ZEND_JMP, NULL, NULL TSRMLS_CC);
+ zend_op *opline = zend_emit_op(NULL, ZEND_JMP, NULL, NULL);
opline->op1.opline_num = opnum_target;
return opnum;
}
/* }}} */
-static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target TSRMLS_DC) /* {{{ */
+static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number(CG(active_op_array));
- zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL TSRMLS_CC);
+ zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
opline->op2.opline_num = opnum_target;
return opnum;
}
/* }}} */
-static inline void zend_update_jump_target(uint32_t opnum_jump, uint32_t opnum_target TSRMLS_DC) /* {{{ */
+static inline void zend_update_jump_target(uint32_t opnum_jump, uint32_t opnum_target) /* {{{ */
{
zend_op *opline = &CG(active_op_array)->opcodes[opnum_jump];
switch (opline->opcode) {
@@ -1776,21 +1775,21 @@ static inline void zend_update_jump_target(uint32_t opnum_jump, uint32_t opnum_t
}
/* }}} */
-static inline void zend_update_jump_target_to_next(uint32_t opnum_jump TSRMLS_DC) /* {{{ */
+static inline void zend_update_jump_target_to_next(uint32_t opnum_jump) /* {{{ */
{
- zend_update_jump_target(opnum_jump, get_next_op_number(CG(active_op_array)) TSRMLS_CC);
+ zend_update_jump_target(opnum_jump, get_next_op_number(CG(active_op_array)));
}
/* }}} */
-static inline zend_op *zend_delayed_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2 TSRMLS_DC) /* {{{ */
+static inline zend_op *zend_delayed_emit_op(znode *result, zend_uchar opcode, znode *op1, znode *op2) /* {{{ */
{
zend_op tmp_opline;
- init_op(&tmp_opline TSRMLS_CC);
+ init_op(&tmp_opline);
tmp_opline.opcode = opcode;
SET_NODE(tmp_opline.op1, op1);
SET_NODE(tmp_opline.op2, op2);
if (result) {
- zend_make_var_result(result, &tmp_opline TSRMLS_CC);
+ zend_make_var_result(result, &tmp_opline);
}
zend_stack_push(&CG(delayed_oplines_stack), &tmp_opline);
@@ -1798,20 +1797,20 @@ static inline zend_op *zend_delayed_emit_op(znode *result, zend_uchar opcode, zn
}
/* }}} */
-static inline uint32_t zend_delayed_compile_begin(TSRMLS_D) /* {{{ */
+static inline uint32_t zend_delayed_compile_begin(void) /* {{{ */
{
return zend_stack_count(&CG(delayed_oplines_stack));
}
/* }}} */
-static zend_op *zend_delayed_compile_end(uint32_t offset TSRMLS_DC) /* {{{ */
+static zend_op *zend_delayed_compile_end(uint32_t offset) /* {{{ */
{
zend_op *opline = NULL, *oplines = zend_stack_base(&CG(delayed_oplines_stack));
uint32_t i, count = zend_stack_count(&CG(delayed_oplines_stack));
ZEND_ASSERT(count > offset);
for (i = offset; i < count; ++i) {
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
memcpy(opline, &oplines[i], sizeof(zend_op));
}
CG(delayed_oplines_stack).top = offset;
@@ -1819,7 +1818,7 @@ static zend_op *zend_delayed_compile_end(uint32_t offset TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_emit_final_return(zval *zv TSRMLS_DC) /* {{{ */
+void zend_emit_final_return(zval *zv) /* {{{ */
{
znode zn;
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
@@ -1831,7 +1830,7 @@ void zend_emit_final_return(zval *zv TSRMLS_DC) /* {{{ */
ZVAL_NULL(&zn.u.constant);
}
- zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL TSRMLS_CC);
+ zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
}
/* }}} */
@@ -1886,7 +1885,7 @@ static inline zend_bool zend_is_const_default_class_ref(zend_ast *name_ast) /* {
}
/* }}} */
-static inline void zend_handle_numeric_op(znode *node TSRMLS_DC) /* {{{ */
+static inline void zend_handle_numeric_op(znode *node) /* {{{ */
{
if (node->op_type == IS_CONST && Z_TYPE(node->u.constant) == IS_STRING) {
zend_ulong index;
@@ -1899,41 +1898,41 @@ static inline void zend_handle_numeric_op(znode *node TSRMLS_DC) /* {{{ */
}
/* }}} */
-static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node TSRMLS_DC) /* {{{ */
+static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /* {{{ */
{
if (class_node->op_type == IS_CONST) {
opline->op1_type = IS_CONST;
opline->op1.constant = zend_add_class_name_literal(
- CG(active_op_array), Z_STR(class_node->u.constant) TSRMLS_CC);
+ CG(active_op_array), Z_STR(class_node->u.constant));
} else {
SET_NODE(opline->op1, class_node);
}
}
/* }}} */
-static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast TSRMLS_DC) /* {{{ */
+static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast) /* {{{ */
{
zend_op *opline;
znode name_node;
- zend_compile_expr(&name_node, name_ast TSRMLS_CC);
+ zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
zend_string *name = Z_STR(name_node.u.constant);
uint32_t fetch_type = zend_get_class_fetch_type(name);
- opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
opline->extended_value = fetch_type;
if (fetch_type == ZEND_FETCH_CLASS_DEFAULT) {
uint32_t type = name_ast->kind == ZEND_AST_ZVAL ? name_ast->attr : ZEND_NAME_FQ;
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
- zend_resolve_class_name(name, type TSRMLS_CC) TSRMLS_CC);
+ zend_resolve_class_name(name, type));
}
zend_string_release(name);
} else {
- opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node);
opline->extended_value = ZEND_FETCH_CLASS_DEFAULT;
}
@@ -1941,19 +1940,19 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast TSRMLS_
}
/* }}} */
-static int zend_try_compile_cv(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+static int zend_try_compile_cv(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
if (name_ast->kind == ZEND_AST_ZVAL) {
zend_string *name = zval_get_string(zend_ast_get_zval(name_ast));
- if (zend_is_auto_global(name TSRMLS_CC)) {
+ if (zend_is_auto_global(name)) {
zend_string_release(name);
return FAILURE;
}
result->op_type = IS_CV;
- result->u.op.var = lookup_cv(CG(active_op_array), name TSRMLS_CC);
+ result->u.op.var = lookup_cv(CG(active_op_array), name);
if (zend_string_equals_literal(name, "this")) {
CG(active_op_array)->this_var = result->u.op.var;
@@ -1965,7 +1964,7 @@ static int zend_try_compile_cv(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
znode name_node;
@@ -1976,16 +1975,16 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
&& CG(active_op_array)->scope && CG(active_op_array)->this_var == (uint32_t)-1
) {
zend_string *key = zend_string_init("this", sizeof("this") - 1, 0);
- CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key TSRMLS_CC);
+ CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key);
}
- zend_compile_expr(&name_node, name_ast TSRMLS_CC);
+ zend_compile_expr(&name_node, name_ast);
- opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL);
opline->extended_value = ZEND_FETCH_LOCAL;
if (name_node.op_type == IS_CONST) {
- if (zend_is_auto_global(Z_STR(name_node.u.constant) TSRMLS_CC)) {
+ if (zend_is_auto_global(Z_STR(name_node.u.constant))) {
opline->extended_value = ZEND_FETCH_GLOBAL;
}
}
@@ -1994,20 +1993,20 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
}
/* }}} */
-static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- if (zend_try_compile_cv(result, ast TSRMLS_CC) == FAILURE) {
- zend_op *opline = zend_compile_simple_var_no_cv(result, ast, type TSRMLS_CC);
+ if (zend_try_compile_cv(result, ast) == FAILURE) {
+ zend_op *opline = zend_compile_simple_var_no_cv(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
}
}
/* }}} */
-static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t type) /* {{{ */
{
if (type != BP_VAR_R && type != BP_VAR_IS && zend_is_call(ast)) {
if (node->op_type == IS_VAR) {
- zend_op *opline = zend_emit_op(NULL, ZEND_SEPARATE, node, NULL TSRMLS_CC);
+ zend_op *opline = zend_emit_op(NULL, ZEND_SEPARATE, node, NULL);
opline->result_type = IS_VAR;
opline->result.var = opline->op1.var;
} else {
@@ -2017,33 +2016,33 @@ static void zend_separate_if_call_and_write(znode *node, zend_ast *ast, uint32_t
}
/* }}} */
-void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC);
-void zend_compile_assign(znode *result, zend_ast *ast TSRMLS_DC);
-static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_node TSRMLS_DC);
+void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type);
+void zend_compile_assign(znode *result, zend_ast *ast);
+static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_node);
-static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node TSRMLS_DC) /* {{{ */
+static inline void zend_emit_assign_znode(zend_ast *var_ast, znode *value_node) /* {{{ */
{
znode dummy_node;
if (var_ast->kind == ZEND_AST_LIST) {
- zend_compile_list_assign(&dummy_node, var_ast, value_node TSRMLS_CC);
+ zend_compile_list_assign(&dummy_node, var_ast, value_node);
} else {
zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN, var_ast,
zend_ast_create_znode(value_node));
- zend_compile_assign(&dummy_node, assign_ast TSRMLS_CC);
+ zend_compile_assign(&dummy_node, assign_ast);
}
- zend_do_free(&dummy_node TSRMLS_CC);
+ zend_do_free(&dummy_node);
}
/* }}} */
-static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
zend_ast *dim_ast = ast->child[1];
znode var_node, dim_node;
- zend_delayed_compile_var(&var_node, var_ast, type TSRMLS_CC);
- zend_separate_if_call_and_write(&var_node, var_ast, type TSRMLS_CC);
+ zend_delayed_compile_var(&var_node, var_ast, type);
+ zend_separate_if_call_and_write(&var_node, var_ast, type);
if (dim_ast == NULL) {
if (type == BP_VAR_R || type == BP_VAR_IS) {
@@ -2054,25 +2053,25 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
}
dim_node.op_type = IS_UNUSED;
} else {
- zend_compile_expr(&dim_node, dim_ast TSRMLS_CC);
- zend_handle_numeric_op(&dim_node TSRMLS_CC);
+ zend_compile_expr(&dim_node, dim_ast);
+ zend_handle_numeric_op(&dim_node);
}
- return zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node TSRMLS_CC);
+ return zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
}
/* }}} */
-static inline zend_op *zend_compile_dim_common(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static inline zend_op *zend_compile_dim_common(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- uint32_t offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_dim(result, ast, type TSRMLS_CC);
- return zend_delayed_compile_end(offset TSRMLS_CC);
+ uint32_t offset = zend_delayed_compile_begin();
+ zend_delayed_compile_dim(result, ast, type);
+ return zend_delayed_compile_end(offset);
}
/* }}} */
-void zend_compile_dim(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- zend_op *opline = zend_compile_dim_common(result, ast, type TSRMLS_CC);
+ zend_op *opline = zend_compile_dim_common(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
}
/* }}} */
@@ -2088,7 +2087,7 @@ static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
}
/* }}} */
-static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
zend_ast *prop_ast = ast->child[1];
@@ -2099,37 +2098,37 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
if (is_this_fetch(obj_ast)) {
obj_node.op_type = IS_UNUSED;
} else {
- zend_delayed_compile_var(&obj_node, obj_ast, type TSRMLS_CC);
- zend_separate_if_call_and_write(&obj_node, obj_ast, type TSRMLS_CC);
+ zend_delayed_compile_var(&obj_node, obj_ast, type);
+ zend_separate_if_call_and_write(&obj_node, obj_ast, type);
}
- zend_compile_expr(&prop_node, prop_ast TSRMLS_CC);
+ zend_compile_expr(&prop_node, prop_ast);
- opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node TSRMLS_CC);
+ opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node);
if (opline->op2_type == IS_CONST) {
convert_to_string(CT_CONSTANT(opline->op2));
- zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_polymorphic_cache_slot(opline->op2.constant);
}
return opline;
}
/* }}} */
-static zend_op *zend_compile_prop_common(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+static zend_op *zend_compile_prop_common(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- uint32_t offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_prop(result, ast, type TSRMLS_CC);
- return zend_delayed_compile_end(offset TSRMLS_CC);
+ uint32_t offset = zend_delayed_compile_begin();
+ zend_delayed_compile_prop(result, ast, type);
+ return zend_delayed_compile_end(offset);
}
/* }}} */
-void zend_compile_prop(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- zend_op *opline = zend_compile_prop_common(result, ast, type TSRMLS_CC);
+ zend_op *opline = zend_compile_prop_common(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
}
/* }}} */
-zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *prop_ast = ast->child[1];
@@ -2139,21 +2138,21 @@ zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t
if (zend_is_const_default_class_ref(class_ast)) {
class_node.op_type = IS_CONST;
- ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast TSRMLS_CC));
+ ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else {
- zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
+ zend_compile_class_ref(&class_node, class_ast);
}
- zend_compile_expr(&prop_node, prop_ast TSRMLS_CC);
+ zend_compile_expr(&prop_node, prop_ast);
- opline = zend_emit_op(result, ZEND_FETCH_R, &prop_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_FETCH_R, &prop_node, NULL);
if (opline->op1_type == IS_CONST) {
- zend_alloc_polymorphic_cache_slot(opline->op1.constant TSRMLS_CC);
+ zend_alloc_polymorphic_cache_slot(opline->op1.constant);
}
if (class_node.op_type == IS_CONST) {
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(
- CG(active_op_array), Z_STR(class_node.u.constant) TSRMLS_CC);
+ CG(active_op_array), Z_STR(class_node.u.constant));
} else {
SET_NODE(opline->op2, &class_node);
}
@@ -2163,14 +2162,14 @@ zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t
}
/* }}} */
-void zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- zend_op *opline = zend_compile_static_prop_common(result, ast, type TSRMLS_CC);
+ zend_op *opline = zend_compile_static_prop_common(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
}
/* }}} */
-static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_node TSRMLS_DC) /* {{{ */
+static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_node) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -2194,8 +2193,8 @@ static void zend_compile_list_assign(znode *result, zend_ast *ast, znode *expr_n
Z_TRY_ADDREF(expr_node->u.constant);
}
- zend_emit_op(&fetch_result, ZEND_FETCH_LIST, expr_node, &dim_node TSRMLS_CC);
- zend_emit_assign_znode(var_ast, &fetch_result TSRMLS_CC);
+ zend_emit_op(&fetch_result, ZEND_FETCH_LIST, expr_node, &dim_node);
+ zend_emit_assign_znode(var_ast, &fetch_result);
}
*result = *expr_node;
}
@@ -2213,7 +2212,7 @@ void zend_ensure_writable_variable(const zend_ast *ast) /* {{{ */
/* }}} */
/* Detects $a... = $a pattern */
-zend_bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast TSRMLS_DC) /* {{{ */
+zend_bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast) /* {{{ */
{
if (expr_ast->kind != ZEND_AST_VAR || expr_ast->child[0]->kind != ZEND_AST_ZVAL) {
return 0;
@@ -2238,7 +2237,7 @@ zend_bool zend_is_assign_to_self(zend_ast *var_ast, zend_ast *expr_ast TSRMLS_DC
}
/* }}} */
-void zend_compile_assign(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
zend_ast *expr_ast = ast->child[1];
@@ -2256,46 +2255,46 @@ void zend_compile_assign(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
switch (var_ast->kind) {
case ZEND_AST_VAR:
case ZEND_AST_STATIC_PROP:
- zend_compile_var(&var_node, var_ast, BP_VAR_W TSRMLS_CC);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
- zend_emit_op(result, ZEND_ASSIGN, &var_node, &expr_node TSRMLS_CC);
+ zend_compile_var(&var_node, var_ast, BP_VAR_W);
+ zend_compile_expr(&expr_node, expr_ast);
+ zend_emit_op(result, ZEND_ASSIGN, &var_node, &expr_node);
return;
case ZEND_AST_DIM:
- offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_dim(result, var_ast, BP_VAR_W TSRMLS_CC);
+ offset = zend_delayed_compile_begin();
+ zend_delayed_compile_dim(result, var_ast, BP_VAR_W);
- if (zend_is_assign_to_self(var_ast, expr_ast TSRMLS_CC)) {
+ if (zend_is_assign_to_self(var_ast, expr_ast)) {
/* $a[0] = $a should evaluate the right $a first */
- zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R TSRMLS_CC);
+ zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R);
} else {
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
}
- opline = zend_delayed_compile_end(offset TSRMLS_CC);
+ opline = zend_delayed_compile_end(offset);
opline->opcode = ZEND_ASSIGN_DIM;
- opline = zend_emit_op_data(&expr_node TSRMLS_CC);
+ opline = zend_emit_op_data(&expr_node);
return;
case ZEND_AST_PROP:
- offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_prop(result, var_ast, BP_VAR_W TSRMLS_CC);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ offset = zend_delayed_compile_begin();
+ zend_delayed_compile_prop(result, var_ast, BP_VAR_W);
+ zend_compile_expr(&expr_node, expr_ast);
- opline = zend_delayed_compile_end(offset TSRMLS_CC);
+ opline = zend_delayed_compile_end(offset);
opline->opcode = ZEND_ASSIGN_OBJ;
- zend_emit_op_data(&expr_node TSRMLS_CC);
+ zend_emit_op_data(&expr_node);
return;
case ZEND_AST_LIST:
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
- zend_compile_list_assign(result, var_ast, &expr_node TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
+ zend_compile_list_assign(result, var_ast, &expr_node);
return;
EMPTY_SWITCH_DEFAULT_CASE();
}
}
/* }}} */
-void zend_compile_assign_ref(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *target_ast = ast->child[0];
zend_ast *source_ast = ast->child[1];
@@ -2308,14 +2307,14 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
zend_ensure_writable_variable(target_ast);
- zend_compile_var(&target_node, target_ast, BP_VAR_W TSRMLS_CC);
- zend_compile_var(&source_node, source_ast, BP_VAR_REF TSRMLS_CC);
+ zend_compile_var(&target_node, target_ast, BP_VAR_W);
+ zend_compile_var(&source_node, source_ast, BP_VAR_REF);
if (source_node.op_type != IS_VAR && zend_is_call(source_ast)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use result of built-in function in write context");
}
- opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_ASSIGN_REF, &target_node, &source_node);
if (!result) {
opline->result_type |= EXT_TYPE_UNUSED;
}
@@ -2329,15 +2328,15 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_node TSRMLS_DC) /* {{{ */
+static inline void zend_emit_assign_ref_znode(zend_ast *var_ast, znode *value_node) /* {{{ */
{
zend_ast *assign_ast = zend_ast_create(ZEND_AST_ASSIGN_REF, var_ast,
zend_ast_create_znode(value_node));
- zend_compile_assign_ref(NULL, assign_ast TSRMLS_CC);
+ zend_compile_assign_ref(NULL, assign_ast);
}
/* }}} */
-void zend_compile_compound_assign(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
zend_ast *expr_ast = ast->child[1];
@@ -2352,38 +2351,38 @@ void zend_compile_compound_assign(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
switch (var_ast->kind) {
case ZEND_AST_VAR:
case ZEND_AST_STATIC_PROP:
- zend_compile_var(&var_node, var_ast, BP_VAR_RW TSRMLS_CC);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
- zend_emit_op(result, opcode, &var_node, &expr_node TSRMLS_CC);
+ zend_compile_var(&var_node, var_ast, BP_VAR_RW);
+ zend_compile_expr(&expr_node, expr_ast);
+ zend_emit_op(result, opcode, &var_node, &expr_node);
return;
case ZEND_AST_DIM:
- offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_dim(result, var_ast, BP_VAR_RW TSRMLS_CC);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ offset = zend_delayed_compile_begin();
+ zend_delayed_compile_dim(result, var_ast, BP_VAR_RW);
+ zend_compile_expr(&expr_node, expr_ast);
- opline = zend_delayed_compile_end(offset TSRMLS_CC);
+ opline = zend_delayed_compile_end(offset);
opline->opcode = opcode;
opline->extended_value = ZEND_ASSIGN_DIM;
- opline = zend_emit_op_data(&expr_node TSRMLS_CC);
+ opline = zend_emit_op_data(&expr_node);
return;
case ZEND_AST_PROP:
- offset = zend_delayed_compile_begin(TSRMLS_C);
- zend_delayed_compile_prop(result, var_ast, BP_VAR_RW TSRMLS_CC);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ offset = zend_delayed_compile_begin();
+ zend_delayed_compile_prop(result, var_ast, BP_VAR_RW);
+ zend_compile_expr(&expr_node, expr_ast);
- opline = zend_delayed_compile_end(offset TSRMLS_CC);
+ opline = zend_delayed_compile_end(offset);
opline->opcode = opcode;
opline->extended_value = ZEND_ASSIGN_OBJ;
- zend_emit_op_data(&expr_node TSRMLS_CC);
+ zend_emit_op_data(&expr_node);
return;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
/* }}} */
-uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ */
+uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */
{
/* TODO.AST &var error */
zend_ast_list *args = zend_ast_get_list(ast);
@@ -2404,8 +2403,8 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
uses_arg_unpack = 1;
fbc = NULL;
- zend_compile_expr(&arg_node, arg->child[0] TSRMLS_CC);
- opline = zend_emit_op(NULL, ZEND_SEND_UNPACK, &arg_node, NULL TSRMLS_CC);
+ zend_compile_expr(&arg_node, arg->child[0]);
+ opline = zend_emit_op(NULL, ZEND_SEND_UNPACK, &arg_node, NULL);
opline->op2.num = arg_count;
opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, arg_count);
continue;
@@ -2419,7 +2418,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
arg_count++;
if (zend_is_variable(arg)) {
if (zend_is_call(arg)) {
- zend_compile_var(&arg_node, arg, BP_VAR_R TSRMLS_CC);
+ zend_compile_var(&arg_node, arg, BP_VAR_R);
if (arg_node.op_type & (IS_CONST|IS_TMP_VAR)) {
/* Function call was converted into builtin instruction */
opcode = ZEND_SEND_VAL;
@@ -2435,19 +2434,19 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
}
} else if (fbc) {
if (ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) {
- zend_compile_var(&arg_node, arg, BP_VAR_W TSRMLS_CC);
+ zend_compile_var(&arg_node, arg, BP_VAR_W);
opcode = ZEND_SEND_REF;
} else {
- zend_compile_var(&arg_node, arg, BP_VAR_R TSRMLS_CC);
+ zend_compile_var(&arg_node, arg, BP_VAR_R);
opcode = ZEND_SEND_VAR;
}
} else {
zend_compile_var(&arg_node, arg,
- BP_VAR_FUNC_ARG | (arg_num << BP_VAR_SHIFT) TSRMLS_CC);
+ BP_VAR_FUNC_ARG | (arg_num << BP_VAR_SHIFT));
opcode = ZEND_SEND_VAR_EX;
}
} else {
- zend_compile_expr(&arg_node, arg TSRMLS_CC);
+ zend_compile_expr(&arg_node, arg);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
opcode = ZEND_SEND_VAR_NO_REF;
if (fbc && ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) {
@@ -2465,7 +2464,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
}
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = opcode;
SET_NODE(opline->op1, &arg_node);
SET_UNUSED(opline->op2);
@@ -2491,16 +2490,16 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
}
/* }}} */
-void zend_compile_call_common(znode *result, zend_ast *args_ast, zend_function *fbc TSRMLS_DC) /* {{{ */
+void zend_compile_call_common(znode *result, zend_ast *args_ast, zend_function *fbc) /* {{{ */
{
zend_op *opline;
uint32_t opnum_init = get_next_op_number(CG(active_op_array)) - 1;
uint32_t arg_count;
uint32_t call_flags;
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin();
- arg_count = zend_compile_args(args_ast, fbc TSRMLS_CC);
+ arg_count = zend_compile_args(args_ast, fbc);
opline = &CG(active_op_array)->opcodes[opnum_init];
opline->extended_value = arg_count;
@@ -2510,55 +2509,55 @@ void zend_compile_call_common(znode *result, zend_ast *args_ast, zend_function *
}
call_flags = (opline->opcode == ZEND_NEW ? ZEND_CALL_CTOR : 0);
- opline = zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
opline->op1.num = call_flags;
- zend_do_extended_fcall_end(TSRMLS_C);
+ zend_do_extended_fcall_end();
}
/* }}} */
-zend_bool zend_compile_function_name(znode *name_node, zend_ast *name_ast TSRMLS_DC) /* {{{ */
+zend_bool zend_compile_function_name(znode *name_node, zend_ast *name_ast) /* {{{ */
{
zend_string *orig_name = zend_ast_get_str(name_ast);
zend_bool is_fully_qualified;
name_node->op_type = IS_CONST;
ZVAL_STR(&name_node->u.constant, zend_resolve_function_name(
- orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC));
+ orig_name, name_ast->attr, &is_fully_qualified));
return !is_fully_qualified && CG(current_namespace);
}
/* }}} */
-void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args_ast TSRMLS_DC) /* {{{ */
+void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args_ast) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_INIT_NS_FCALL_BY_NAME;
SET_UNUSED(opline->op1);
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_ns_func_name_literal(
- CG(active_op_array), Z_STR(name_node->u.constant) TSRMLS_CC);
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ CG(active_op_array), Z_STR(name_node->u.constant));
+ zend_alloc_cache_slot(opline->op2.constant);
- zend_compile_call_common(result, args_ast, NULL TSRMLS_CC);
+ zend_compile_call_common(result, args_ast, NULL);
}
/* }}} */
-void zend_compile_dynamic_call(znode *result, znode *name_node, zend_ast *args_ast TSRMLS_DC) /* {{{ */
+void zend_compile_dynamic_call(znode *result, znode *name_node, zend_ast *args_ast) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
SET_UNUSED(opline->op1);
if (name_node->op_type == IS_CONST && Z_TYPE(name_node->u.constant) == IS_STRING) {
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_func_name_literal(CG(active_op_array),
- Z_STR(name_node->u.constant) TSRMLS_CC);
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ Z_STR(name_node->u.constant));
+ zend_alloc_cache_slot(opline->op2.constant);
} else {
SET_NODE(opline->op2, name_node);
}
- zend_compile_call_common(result, args_ast, NULL TSRMLS_CC);
+ zend_compile_call_common(result, args_ast, NULL);
}
/* }}} */
@@ -2574,7 +2573,7 @@ static zend_bool zend_args_contain_unpack(zend_ast_list *args) /* {{{ */
}
/* }}} */
-int zend_compile_func_strlen(znode *result, zend_ast_list *args TSRMLS_DC) /* {{{ */
+int zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */
{
znode arg_node;
@@ -2584,13 +2583,13 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args TSRMLS_DC) /* {{
return FAILURE;
}
- zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
- zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL TSRMLS_CC);
+ zend_compile_expr(&arg_node, args->child[0]);
+ zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL);
return SUCCESS;
}
/* }}} */
-int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t type TSRMLS_DC) /* {{{ */
+int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */
{
znode arg_node;
zend_op *opline;
@@ -2599,14 +2598,14 @@ int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t typ
return FAILURE;
}
- zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
- opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL TSRMLS_CC);
+ zend_compile_expr(&arg_node, args->child[0]);
+ opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL);
opline->extended_value = type;
return SUCCESS;
}
/* }}} */
-int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) /* {{{ */
+int zend_compile_func_defined(znode *result, zend_ast_list *args) /* {{{ */
{
zend_string *name;
zend_op *opline;
@@ -2621,10 +2620,10 @@ int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) /* {
return FAILURE;
}
- opline = zend_emit_op_tmp(result, ZEND_DEFINED, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_DEFINED, NULL, NULL);
opline->op1_type = IS_CONST;
LITERAL_STR(opline->op1, name);
- zend_alloc_cache_slot(opline->op1.constant TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op1.constant);
/* Lowercase constant name in a separate literal */
{
@@ -2632,13 +2631,13 @@ int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) /* {
zend_string *lcname = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lcname->val, name->val, name->len);
ZVAL_NEW_STR(&c, lcname);
- zend_add_literal(CG(active_op_array), &c TSRMLS_CC);
+ zend_add_literal(CG(active_op_array), &c);
}
return SUCCESS;
}
/* }}} */
-static int zend_try_compile_ct_bound_init_user_func(zend_ast *name_ast, uint32_t num_args TSRMLS_DC) /* {{{ */
+static int zend_try_compile_ct_bound_init_user_func(zend_ast *name_ast, uint32_t num_args) /* {{{ */
{
zend_string *name, *lcname;
zend_function *fbc;
@@ -2660,29 +2659,29 @@ static int zend_try_compile_ct_bound_init_user_func(zend_ast *name_ast, uint32_t
return FAILURE;
}
- opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, NULL);
opline->extended_value = num_args;
opline->op1.num = zend_vm_calc_used_stack(num_args, fbc);
opline->op2_type = IS_CONST;
LITERAL_STR(opline->op2, lcname);
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op2.constant);
return SUCCESS;
}
/* }}} */
-static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, zend_string *orig_func_name TSRMLS_DC) /* {{{ */
+static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, zend_string *orig_func_name) /* {{{ */
{
zend_op *opline;
znode name_node;
- if (zend_try_compile_ct_bound_init_user_func(name_ast, num_args TSRMLS_CC) == SUCCESS) {
+ if (zend_try_compile_ct_bound_init_user_func(name_ast, num_args) == SUCCESS) {
return;
}
- zend_compile_expr(&name_node, name_ast TSRMLS_CC);
+ zend_compile_expr(&name_node, name_ast);
- opline = zend_emit_op(NULL, ZEND_INIT_USER_CALL, NULL, &name_node TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_INIT_USER_CALL, NULL, &name_node);
opline->op1_type = IS_CONST;
LITERAL_STR(opline->op1, zend_string_copy(orig_func_name));
opline->extended_value = num_args;
@@ -2690,7 +2689,7 @@ static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, z
/* }}} */
/* cufa = call_user_func_array */
-int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcname TSRMLS_DC) /* {{{ */
+int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
{
znode arg_node;
@@ -2698,17 +2697,17 @@ int zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcna
return FAILURE;
}
- zend_compile_init_user_func(args->child[0], 0, lcname TSRMLS_CC);
- zend_compile_expr(&arg_node, args->child[1] TSRMLS_CC);
- zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL TSRMLS_CC);
- zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC);
+ zend_compile_init_user_func(args->child[0], 0, lcname);
+ zend_compile_expr(&arg_node, args->child[1]);
+ zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL);
+ zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
return SUCCESS;
}
/* }}} */
/* cuf = call_user_func */
-int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcname TSRMLS_DC) /* {{{ */
+int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
{
uint32_t i;
@@ -2716,7 +2715,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
return FAILURE;
}
- zend_compile_init_user_func(args->child[0], args->children - 1, lcname TSRMLS_CC);
+ zend_compile_init_user_func(args->child[0], args->children - 1, lcname);
for (i = 1; i < args->children; ++i) {
zend_ast *arg_ast = args->child[i];
znode arg_node;
@@ -2724,69 +2723,69 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
zend_bool send_user = 0;
if (zend_is_variable(arg_ast) && !zend_is_call(arg_ast)) {
- zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT) TSRMLS_CC);
+ zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT));
send_user = 1;
} else {
- zend_compile_expr(&arg_node, arg_ast TSRMLS_CC);
+ zend_compile_expr(&arg_node, arg_ast);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
send_user = 1;
}
}
if (send_user) {
- opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL);
} else {
- opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL);
}
opline->op2.num = i;
opline->result.var = (uint32_t)(zend_intptr_t)ZEND_CALL_ARG(NULL, i);
}
- zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL TSRMLS_CC);
+ zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
return SUCCESS;
}
/* }}} */
-int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_list *args TSRMLS_DC) /* {{{ */
+int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_list *args) /* {{{ */
{
if (zend_string_equals_literal(lcname, "strlen")) {
- return zend_compile_func_strlen(result, args TSRMLS_CC);
+ return zend_compile_func_strlen(result, args);
} else if (zend_string_equals_literal(lcname, "is_null")) {
- return zend_compile_func_typecheck(result, args, IS_NULL TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_NULL);
} else if (zend_string_equals_literal(lcname, "is_bool")) {
- return zend_compile_func_typecheck(result, args, _IS_BOOL TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, _IS_BOOL);
} else if (zend_string_equals_literal(lcname, "is_long")
|| zend_string_equals_literal(lcname, "is_int")
|| zend_string_equals_literal(lcname, "is_integer")
) {
- return zend_compile_func_typecheck(result, args, IS_LONG TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_LONG);
} else if (zend_string_equals_literal(lcname, "is_float")
|| zend_string_equals_literal(lcname, "is_double")
|| zend_string_equals_literal(lcname, "is_real")
) {
- return zend_compile_func_typecheck(result, args, IS_DOUBLE TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_DOUBLE);
} else if (zend_string_equals_literal(lcname, "is_string")) {
- return zend_compile_func_typecheck(result, args, IS_STRING TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_STRING);
} else if (zend_string_equals_literal(lcname, "is_array")) {
- return zend_compile_func_typecheck(result, args, IS_ARRAY TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_ARRAY);
} else if (zend_string_equals_literal(lcname, "is_object")) {
- return zend_compile_func_typecheck(result, args, IS_OBJECT TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_OBJECT);
} else if (zend_string_equals_literal(lcname, "is_resource")) {
- return zend_compile_func_typecheck(result, args, IS_RESOURCE TSRMLS_CC);
+ return zend_compile_func_typecheck(result, args, IS_RESOURCE);
} else if (zend_string_equals_literal(lcname, "defined")) {
- return zend_compile_func_defined(result, args TSRMLS_CC);
+ return zend_compile_func_defined(result, args);
} else if (zend_string_equals_literal(lcname, "call_user_func_array")) {
- return zend_compile_func_cufa(result, args, lcname TSRMLS_CC);
+ return zend_compile_func_cufa(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "call_user_func")) {
- return zend_compile_func_cuf(result, args, lcname TSRMLS_CC);
+ return zend_compile_func_cuf(result, args, lcname);
} else {
return FAILURE;
}
}
/* }}} */
-void zend_compile_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
zend_ast *args_ast = ast->child[1];
@@ -2794,15 +2793,15 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /*
znode name_node;
if (name_ast->kind != ZEND_AST_ZVAL || Z_TYPE_P(zend_ast_get_zval(name_ast)) != IS_STRING) {
- zend_compile_expr(&name_node, name_ast TSRMLS_CC);
- zend_compile_dynamic_call(result, &name_node, args_ast TSRMLS_CC);
+ zend_compile_expr(&name_node, name_ast);
+ zend_compile_dynamic_call(result, &name_node, args_ast);
return;
}
{
- zend_bool runtime_resolution = zend_compile_function_name(&name_node, name_ast TSRMLS_CC);
+ zend_bool runtime_resolution = zend_compile_function_name(&name_node, name_ast);
if (runtime_resolution) {
- zend_compile_ns_call(result, &name_node, args_ast TSRMLS_CC);
+ zend_compile_ns_call(result, &name_node, args_ast);
return;
}
}
@@ -2820,12 +2819,12 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /*
(CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS))
) {
zend_string_release(lcname);
- zend_compile_dynamic_call(result, &name_node, args_ast TSRMLS_CC);
+ zend_compile_dynamic_call(result, &name_node, args_ast);
return;
}
if (zend_try_compile_special_func(result, lcname,
- zend_ast_get_list(args_ast) TSRMLS_CC) == SUCCESS
+ zend_ast_get_list(args_ast)) == SUCCESS
) {
zend_string_release(lcname);
zval_ptr_dtor(&name_node.u.constant);
@@ -2835,15 +2834,15 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /*
zval_ptr_dtor(&name_node.u.constant);
ZVAL_NEW_STR(&name_node.u.constant, lcname);
- opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, &name_node TSRMLS_CC);
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, &name_node);
+ zend_alloc_cache_slot(opline->op2.constant);
- zend_compile_call_common(result, args_ast, fbc TSRMLS_CC);
+ zend_compile_call_common(result, args_ast, fbc);
}
}
/* }}} */
-void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
zend_ast *method_ast = ast->child[1];
@@ -2855,11 +2854,11 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS
if (is_this_fetch(obj_ast)) {
obj_node.op_type = IS_UNUSED;
} else {
- zend_compile_expr(&obj_node, obj_ast TSRMLS_CC);
+ zend_compile_expr(&obj_node, obj_ast);
}
- zend_compile_expr(&method_node, method_ast TSRMLS_CC);
- opline = zend_emit_op(NULL, ZEND_INIT_METHOD_CALL, &obj_node, NULL TSRMLS_CC);
+ zend_compile_expr(&method_node, method_ast);
+ opline = zend_emit_op(NULL, ZEND_INIT_METHOD_CALL, &obj_node, NULL);
if (method_node.op_type == IS_CONST) {
if (Z_TYPE(method_node.u.constant) != IS_STRING) {
@@ -2868,13 +2867,13 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_func_name_literal(CG(active_op_array),
- Z_STR(method_node.u.constant) TSRMLS_CC);
- zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
+ Z_STR(method_node.u.constant));
+ zend_alloc_polymorphic_cache_slot(opline->op2.constant);
} else {
SET_NODE(opline->op2, &method_node);
}
- zend_compile_call_common(result, args_ast, NULL TSRMLS_CC);
+ zend_compile_call_common(result, args_ast, NULL);
}
/* }}} */
@@ -2884,7 +2883,7 @@ zend_bool zend_is_constructor(zend_string *name) /* {{{ */
}
/* }}} */
-void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *method_ast = ast->child[1];
@@ -2896,13 +2895,13 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type TSRMLS
if (zend_is_const_default_class_ref(class_ast)) {
class_node.op_type = IS_CONST;
- ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast TSRMLS_CC));
+ ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else {
- opline = zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
+ opline = zend_compile_class_ref(&class_node, class_ast);
extended_value = opline->extended_value;
}
- zend_compile_expr(&method_node, method_ast TSRMLS_CC);
+ zend_compile_expr(&method_node, method_ast);
if (method_node.op_type == IS_CONST) {
zval *name = &method_node.u.constant;
if (Z_TYPE_P(name) != IS_STRING) {
@@ -2914,30 +2913,30 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type TSRMLS
}
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
opline->extended_value = extended_value;
- zend_set_class_name_op1(opline, &class_node TSRMLS_CC);
+ zend_set_class_name_op1(opline, &class_node);
if (method_node.op_type == IS_CONST) {
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_func_name_literal(CG(active_op_array),
- Z_STR(method_node.u.constant) TSRMLS_CC);
+ Z_STR(method_node.u.constant));
if (opline->op1_type == IS_CONST) {
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op2.constant);
} else {
- zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_polymorphic_cache_slot(opline->op2.constant);
}
} else {
SET_NODE(opline->op2, &method_node);
}
- zend_compile_call_common(result, args_ast, NULL TSRMLS_CC);
+ zend_compile_call_common(result, args_ast, NULL);
}
/* }}} */
-void zend_compile_new(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *args_ast = ast->child[1];
@@ -2948,24 +2947,24 @@ void zend_compile_new(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
if (zend_is_const_default_class_ref(class_ast)) {
class_node.op_type = IS_CONST;
- ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast TSRMLS_CC));
+ ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else {
- zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
+ zend_compile_class_ref(&class_node, class_ast);
}
opnum = get_next_op_number(CG(active_op_array));
- opline = zend_emit_op(result, ZEND_NEW, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_NEW, NULL, NULL);
if (class_node.op_type == IS_CONST) {
opline->op1_type = IS_CONST;
opline->op1.constant = zend_add_class_name_literal(
- CG(active_op_array), Z_STR(class_node.u.constant) TSRMLS_CC);
+ CG(active_op_array), Z_STR(class_node.u.constant));
} else {
SET_NODE(opline->op1, &class_node);
}
- zend_compile_call_common(&ctor_result, args_ast, NULL TSRMLS_CC);
- zend_do_free(&ctor_result TSRMLS_CC);
+ zend_compile_call_common(&ctor_result, args_ast, NULL);
+ zend_do_free(&ctor_result);
/* New jumps over ctor call if ctor does not exist */
opline = &CG(active_op_array)->opcodes[opnum];
@@ -2973,49 +2972,49 @@ void zend_compile_new(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_clone(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_clone(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
znode obj_node;
- zend_compile_expr(&obj_node, obj_ast TSRMLS_CC);
+ zend_compile_expr(&obj_node, obj_ast);
- zend_emit_op(result, ZEND_CLONE, &obj_node, NULL TSRMLS_CC);
+ zend_emit_op(result, ZEND_CLONE, &obj_node, NULL);
}
/* }}} */
-void zend_compile_global_var(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_global_var(zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
zend_ast *name_ast = var_ast->child[0];
znode name_node, result;
- zend_compile_expr(&name_node, name_ast TSRMLS_CC);
+ zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
convert_to_string(&name_node.u.constant);
}
- if (zend_try_compile_cv(&result, var_ast TSRMLS_CC) == SUCCESS) {
- zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node TSRMLS_CC);
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ if (zend_try_compile_cv(&result, var_ast) == SUCCESS) {
+ zend_op *opline = zend_emit_op(NULL, ZEND_BIND_GLOBAL, &result, &name_node);
+ zend_alloc_cache_slot(opline->op2.constant);
} else {
- zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL TSRMLS_CC);
+ zend_emit_op(&result, ZEND_FETCH_W, &name_node, NULL);
// TODO.AST Avoid double fetch
//opline->extended_value = ZEND_FETCH_GLOBAL_LOCK;
- zend_emit_assign_ref_znode(var_ast, &result TSRMLS_CC);
+ zend_emit_assign_ref_znode(var_ast, &result);
}
}
/* }}} */
-static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_bool by_ref TSRMLS_DC) /* {{{ */
+static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_bool by_ref) /* {{{ */
{
znode var_node, result;
zend_op *opline;
- zend_compile_expr(&var_node, var_ast TSRMLS_CC);
+ zend_compile_expr(&var_node, var_ast);
if (!CG(active_op_array)->static_variables) {
if (CG(active_op_array)->scope) {
@@ -3027,36 +3026,36 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
zend_hash_update(CG(active_op_array)->static_variables, Z_STR(var_node.u.constant), value);
- opline = zend_emit_op(&result, by_ref ? ZEND_FETCH_W : ZEND_FETCH_R, &var_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(&result, by_ref ? ZEND_FETCH_W : ZEND_FETCH_R, &var_node, NULL);
opline->extended_value = ZEND_FETCH_STATIC;
if (by_ref) {
zend_ast *fetch_ast = zend_ast_create(ZEND_AST_VAR, var_ast);
- zend_emit_assign_ref_znode(fetch_ast, &result TSRMLS_CC);
+ zend_emit_assign_ref_znode(fetch_ast, &result);
} else {
zend_ast *fetch_ast = zend_ast_create(ZEND_AST_VAR, var_ast);
- zend_emit_assign_znode(fetch_ast, &result TSRMLS_CC);
+ zend_emit_assign_znode(fetch_ast, &result);
}
}
/* }}} */
-void zend_compile_static_var(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_static_var(zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
zend_ast *value_ast = ast->child[1];
zval value_zv;
if (value_ast) {
- zend_const_expr_to_zval(&value_zv, value_ast TSRMLS_CC);
+ zend_const_expr_to_zval(&value_zv, value_ast);
} else {
ZVAL_NULL(&value_zv);
}
- zend_compile_static_var_common(var_ast, &value_zv, 1 TSRMLS_CC);
+ zend_compile_static_var_common(var_ast, &value_zv, 1);
}
/* }}} */
-void zend_compile_unset(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_unset(zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
@@ -3064,24 +3063,24 @@ void zend_compile_unset(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_op *opline;
switch (var_ast->kind) {
case ZEND_AST_VAR:
- if (zend_try_compile_cv(&var_node, var_ast TSRMLS_CC) == SUCCESS) {
- opline = zend_emit_op(NULL, ZEND_UNSET_VAR, &var_node, NULL TSRMLS_CC);
+ if (zend_try_compile_cv(&var_node, var_ast) == SUCCESS) {
+ opline = zend_emit_op(NULL, ZEND_UNSET_VAR, &var_node, NULL);
opline->extended_value = ZEND_FETCH_LOCAL | ZEND_QUICK_SET;
} else {
- opline = zend_compile_simple_var_no_cv(NULL, var_ast, BP_VAR_UNSET TSRMLS_CC);
+ opline = zend_compile_simple_var_no_cv(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_VAR;
}
return;
case ZEND_AST_DIM:
- opline = zend_compile_dim_common(NULL, var_ast, BP_VAR_UNSET TSRMLS_CC);
+ opline = zend_compile_dim_common(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_DIM;
return;
case ZEND_AST_PROP:
- opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_UNSET TSRMLS_CC);
+ opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_OBJ;
return;
case ZEND_AST_STATIC_PROP:
- opline = zend_compile_static_prop_common(NULL, var_ast, BP_VAR_UNSET TSRMLS_CC);
+ opline = zend_compile_static_prop_common(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_VAR;
return;
EMPTY_SWITCH_DEFAULT_CASE()
@@ -3089,17 +3088,13 @@ void zend_compile_unset(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void zend_free_foreach_and_switch_variables(TSRMLS_D) /* {{{ */
+static void zend_free_foreach_and_switch_variables(void) /* {{{ */
{
uint32_t opnum_start, opnum_end, i;
opnum_start = get_next_op_number(CG(active_op_array));
-#ifdef ZTS
- zend_stack_apply_with_argument(&CG(loop_var_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_loop_var TSRMLS_CC);
-#else
zend_stack_apply(&CG(loop_var_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_loop_var);
-#endif
opnum_end = get_next_op_number(CG(active_op_array));
@@ -3109,7 +3104,7 @@ static void zend_free_foreach_and_switch_variables(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_compile_return(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_return(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
zend_bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
@@ -3121,21 +3116,21 @@ void zend_compile_return(zend_ast *ast TSRMLS_DC) /* {{{ */
expr_node.op_type = IS_CONST;
ZVAL_NULL(&expr_node.u.constant);
} else if (by_ref && zend_is_variable(expr_ast) && !zend_is_call(expr_ast)) {
- zend_compile_var(&expr_node, expr_ast, BP_VAR_REF TSRMLS_CC);
+ zend_compile_var(&expr_node, expr_ast, BP_VAR_REF);
} else {
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
}
- zend_free_foreach_and_switch_variables(TSRMLS_C);
+ zend_free_foreach_and_switch_variables();
if (CG(context).in_finally) {
- opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL);
opline->op1_type = IS_TMP_VAR;
opline->op1.var = CG(context).fast_call_var;
}
opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN,
- &expr_node, NULL TSRMLS_CC);
+ &expr_node, NULL);
if (expr_ast) {
if (zend_is_call(expr_ast)) {
@@ -3147,29 +3142,29 @@ void zend_compile_return(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_echo(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_echo(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode expr_node;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
- zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
}
/* }}} */
-void zend_compile_throw(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_throw(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode expr_node;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
- zend_emit_op(NULL, ZEND_THROW, &expr_node, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_THROW, &expr_node, NULL);
}
/* }}} */
-void zend_compile_break_continue(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_break_continue(zend_ast *ast) /* {{{ */
{
zend_ast *depth_ast = ast->child[0];
@@ -3184,7 +3179,7 @@ void zend_compile_break_continue(zend_ast *ast TSRMLS_DC) /* {{{ */
"is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue");
}
- zend_compile_expr(&depth_node, depth_ast TSRMLS_CC);
+ zend_compile_expr(&depth_node, depth_ast);
if (Z_TYPE(depth_node.u.constant) != IS_LONG || Z_LVAL(depth_node.u.constant) < 1) {
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers",
@@ -3196,25 +3191,25 @@ void zend_compile_break_continue(zend_ast *ast TSRMLS_DC) /* {{{ */
}
opline = zend_emit_op(NULL, ast->kind == ZEND_AST_BREAK ? ZEND_BRK : ZEND_CONT,
- NULL, &depth_node TSRMLS_CC);
+ NULL, &depth_node);
opline->op1.opline_num = CG(context).current_brk_cont;
}
/* }}} */
-void zend_compile_goto(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_goto(zend_ast *ast) /* {{{ */
{
zend_ast *label_ast = ast->child[0];
znode label_node;
zend_op *opline;
- zend_compile_expr(&label_node, label_ast TSRMLS_CC);
- opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node TSRMLS_CC);
+ zend_compile_expr(&label_node, label_ast);
+ opline = zend_emit_op(NULL, ZEND_GOTO, NULL, &label_node);
opline->extended_value = CG(context).current_brk_cont;
- zend_resolve_goto_label(CG(active_op_array), opline, 0 TSRMLS_CC);
+ zend_resolve_goto_label(CG(active_op_array), opline, 0);
}
/* }}} */
-void zend_compile_label(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_label(zend_ast *ast) /* {{{ */
{
zend_string *label = zend_ast_get_str(ast->child[0]);
zend_label dest;
@@ -3233,7 +3228,7 @@ void zend_compile_label(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_while(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_while(zend_ast *ast) /* {{{ */
{
zend_ast *cond_ast = ast->child[0];
zend_ast *stmt_ast = ast->child[1];
@@ -3242,22 +3237,22 @@ void zend_compile_while(zend_ast *ast TSRMLS_DC) /* {{{ */
uint32_t opnum_start, opnum_jmpz;
opnum_start = get_next_op_number(CG(active_op_array));
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
- opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0 TSRMLS_CC);
- zend_begin_loop(TSRMLS_C);
+ opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0);
+ zend_begin_loop();
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
- zend_emit_jump(opnum_start TSRMLS_CC);
+ zend_emit_jump(opnum_start);
- zend_update_jump_target_to_next(opnum_jmpz TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmpz);
- zend_end_loop(opnum_start, 0 TSRMLS_CC);
+ zend_end_loop(opnum_start, 0);
}
/* }}} */
-void zend_compile_do_while(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_do_while(zend_ast *ast) /* {{{ */
{
zend_ast *stmt_ast = ast->child[0];
zend_ast *cond_ast = ast->child[1];
@@ -3265,21 +3260,21 @@ void zend_compile_do_while(zend_ast *ast TSRMLS_DC) /* {{{ */
znode cond_node;
uint32_t opnum_start, opnum_cond;
- zend_begin_loop(TSRMLS_C);
+ zend_begin_loop();
opnum_start = get_next_op_number(CG(active_op_array));
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
opnum_cond = get_next_op_number(CG(active_op_array));
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
- zend_emit_cond_jump(ZEND_JMPNZ, &cond_node, opnum_start TSRMLS_CC);
+ zend_emit_cond_jump(ZEND_JMPNZ, &cond_node, opnum_start);
- zend_end_loop(opnum_cond, 0 TSRMLS_CC);
+ zend_end_loop(opnum_cond, 0);
}
/* }}} */
-void zend_compile_expr_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_expr_list(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list;
uint32_t i;
@@ -3295,13 +3290,13 @@ void zend_compile_expr_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
for (i = 0; i < list->children; ++i) {
zend_ast *expr_ast = list->child[i];
- zend_do_free(result TSRMLS_CC);
- zend_compile_expr(result, expr_ast TSRMLS_CC);
+ zend_do_free(result);
+ zend_compile_expr(result, expr_ast);
}
}
/* }}} */
-void zend_compile_for(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_for(zend_ast *ast) /* {{{ */
{
zend_ast *init_ast = ast->child[0];
zend_ast *cond_ast = ast->child[1];
@@ -3311,31 +3306,31 @@ void zend_compile_for(zend_ast *ast TSRMLS_DC) /* {{{ */
znode result;
uint32_t opnum_cond, opnum_jmpz, opnum_loop;
- zend_compile_expr_list(&result, init_ast TSRMLS_CC);
- zend_do_free(&result TSRMLS_CC);
+ zend_compile_expr_list(&result, init_ast);
+ zend_do_free(&result);
opnum_cond = get_next_op_number(CG(active_op_array));
- zend_compile_expr_list(&result, cond_ast TSRMLS_CC);
- zend_do_extended_info(TSRMLS_C);
+ zend_compile_expr_list(&result, cond_ast);
+ zend_do_extended_info();
- opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &result, 0 TSRMLS_CC);
- zend_begin_loop(TSRMLS_C);
+ opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &result, 0);
+ zend_begin_loop();
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
opnum_loop = get_next_op_number(CG(active_op_array));
- zend_compile_expr_list(&result, loop_ast TSRMLS_CC);
- zend_do_free(&result TSRMLS_CC);
+ zend_compile_expr_list(&result, loop_ast);
+ zend_do_free(&result);
- zend_emit_jump(opnum_cond TSRMLS_CC);
+ zend_emit_jump(opnum_cond);
- zend_update_jump_target_to_next(opnum_jmpz TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmpz);
- zend_end_loop(opnum_loop, 0 TSRMLS_CC);
+ zend_end_loop(opnum_loop, 0);
}
/* }}} */
-void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_foreach(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
zend_ast *value_ast = ast->child[1];
@@ -3363,17 +3358,17 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (by_ref && is_variable) {
- zend_compile_var(&expr_node, expr_ast, BP_VAR_W TSRMLS_CC);
+ zend_compile_var(&expr_node, expr_ast, BP_VAR_W);
} else {
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
}
if (by_ref) {
- zend_separate_if_call_and_write(&expr_node, expr_ast, BP_VAR_W TSRMLS_CC);
+ zend_separate_if_call_and_write(&expr_node, expr_ast, BP_VAR_W);
}
opnum_reset = get_next_op_number(CG(active_op_array));
- opline = zend_emit_op(&reset_node, ZEND_FE_RESET, &expr_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(&reset_node, ZEND_FE_RESET, &expr_node, NULL);
if (by_ref && is_variable) {
opline->extended_value = ZEND_FE_FETCH_BYREF;
}
@@ -3381,7 +3376,7 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_stack_push(&CG(loop_var_stack), &reset_node);
opnum_fetch = get_next_op_number(CG(active_op_array));
- opline = zend_emit_op(&value_node, ZEND_FE_FETCH, &reset_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(&value_node, ZEND_FE_FETCH, &reset_node, NULL);
if (by_ref) {
opline->extended_value |= ZEND_FE_FETCH_BYREF;
}
@@ -3389,7 +3384,7 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
opline->extended_value |= ZEND_FE_FETCH_WITH_KEY;
}
- opline = zend_emit_op(NULL, ZEND_OP_DATA, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_OP_DATA, NULL, NULL);
/* Allocate enough space to keep HashPointer on VM stack */
opline->op1_type = IS_TMP_VAR;
@@ -3400,24 +3395,24 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (key_ast) {
- zend_make_tmp_result(&key_node, opline TSRMLS_CC);
+ zend_make_tmp_result(&key_node, opline);
}
if (by_ref) {
- zend_emit_assign_ref_znode(value_ast, &value_node TSRMLS_CC);
+ zend_emit_assign_ref_znode(value_ast, &value_node);
} else {
- zend_emit_assign_znode(value_ast, &value_node TSRMLS_CC);
+ zend_emit_assign_znode(value_ast, &value_node);
}
if (key_ast) {
- zend_emit_assign_znode(key_ast, &key_node TSRMLS_CC);
+ zend_emit_assign_znode(key_ast, &key_node);
}
- zend_begin_loop(TSRMLS_C);
+ zend_begin_loop();
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
- zend_emit_jump(opnum_fetch TSRMLS_CC);
+ zend_emit_jump(opnum_fetch);
opline = &CG(active_op_array)->opcodes[opnum_reset];
opline->op2.opline_num = get_next_op_number(CG(active_op_array));
@@ -3425,14 +3420,14 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) /* {{{ */
opline = &CG(active_op_array)->opcodes[opnum_fetch];
opline->op2.opline_num = get_next_op_number(CG(active_op_array));
- zend_end_loop(opnum_fetch, 1 TSRMLS_CC);
+ zend_end_loop(opnum_fetch, 1);
- generate_free_loop_var(&reset_node TSRMLS_CC);
+ generate_free_loop_var(&reset_node);
zend_stack_del_top(&CG(loop_var_stack));
}
/* }}} */
-void zend_compile_if(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_if(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -3450,31 +3445,31 @@ void zend_compile_if(zend_ast *ast TSRMLS_DC) /* {{{ */
znode cond_node;
uint32_t opnum_jmpz;
if (cond_ast) {
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
- opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0 TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
+ opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0);
}
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
if (i != list->children - 1) {
- jmp_opnums[i] = zend_emit_jump(0 TSRMLS_CC);
+ jmp_opnums[i] = zend_emit_jump(0);
}
if (cond_ast) {
- zend_update_jump_target_to_next(opnum_jmpz TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmpz);
}
}
if (list->children > 1) {
for (i = 0; i < list->children - 1; ++i) {
- zend_update_jump_target_to_next(jmp_opnums[i] TSRMLS_CC);
+ zend_update_jump_target_to_next(jmp_opnums[i]);
}
efree(jmp_opnums);
}
}
/* }}} */
-void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_switch(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
zend_ast_list *cases = zend_ast_get_list(ast->child[1]);
@@ -3487,11 +3482,11 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
uint32_t *jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
uint32_t opnum_default_jmp;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
zend_stack_push(&CG(loop_var_stack), &expr_node);
- zend_begin_loop(TSRMLS_C);
+ zend_begin_loop();
case_node.op_type = IS_TMP_VAR;
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
@@ -3511,18 +3506,18 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
continue;
}
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
- opline = zend_emit_op(NULL, ZEND_CASE, &expr_node, &cond_node TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_CASE, &expr_node, &cond_node);
SET_NODE(opline->result, &case_node);
if (opline->op1_type == IS_CONST) {
zval_copy_ctor(CT_CONSTANT(opline->op1));
}
- jmpnz_opnums[i] = zend_emit_cond_jump(ZEND_JMPNZ, &case_node, 0 TSRMLS_CC);
+ jmpnz_opnums[i] = zend_emit_cond_jump(ZEND_JMPNZ, &case_node, 0);
}
- opnum_default_jmp = zend_emit_jump(0 TSRMLS_CC);
+ opnum_default_jmp = zend_emit_jump(0);
for (i = 0; i < cases->children; ++i) {
zend_ast *case_ast = cases->child[i];
@@ -3530,23 +3525,23 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_ast *stmt_ast = case_ast->child[1];
if (cond_ast) {
- zend_update_jump_target_to_next(jmpnz_opnums[i] TSRMLS_CC);
+ zend_update_jump_target_to_next(jmpnz_opnums[i]);
} else {
- zend_update_jump_target_to_next(opnum_default_jmp TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_default_jmp);
}
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
}
if (!has_default_case) {
- zend_update_jump_target_to_next(opnum_default_jmp TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_default_jmp);
}
- zend_end_loop(get_next_op_number(CG(active_op_array)), 1 TSRMLS_CC);
+ zend_end_loop(get_next_op_number(CG(active_op_array)), 1);
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
zend_emit_op(NULL, ZEND_FREE,
- &expr_node, NULL TSRMLS_CC);
+ &expr_node, NULL);
} else if (expr_node.op_type == IS_CONST) {
zval_dtor(&expr_node.u.constant);
}
@@ -3556,7 +3551,7 @@ void zend_compile_switch(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_try(zend_ast *ast) /* {{{ */
{
zend_ast *try_ast = ast->child[0];
zend_ast_list *catches = zend_ast_get_list(ast->child[1]);
@@ -3565,17 +3560,17 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
uint32_t i;
zend_op *opline;
uint32_t try_catch_offset = zend_add_try_element(
- get_next_op_number(CG(active_op_array)) TSRMLS_CC);
+ get_next_op_number(CG(active_op_array)));
uint32_t *jmp_opnums = safe_emalloc(sizeof(uint32_t), catches->children, 0);
if (catches->children == 0 && !finally_ast) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use try without catch or finally");
}
- zend_compile_stmt(try_ast TSRMLS_CC);
+ zend_compile_stmt(try_ast);
if (catches->children != 0) {
- jmp_opnums[0] = zend_emit_jump(0 TSRMLS_CC);
+ jmp_opnums[0] = zend_emit_jump(0);
}
for (i = 0; i < catches->children; ++i) {
@@ -3599,20 +3594,20 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(zend_lineno) = catch_ast->lineno;
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_CATCH;
opline->op1_type = IS_CONST;
opline->op1.constant = zend_add_class_name_literal(CG(active_op_array),
- zend_resolve_class_name_ast(class_ast TSRMLS_CC) TSRMLS_CC);
+ zend_resolve_class_name_ast(class_ast));
opline->op2_type = IS_CV;
- opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR_P(var_name)) TSRMLS_CC);
+ opline->op2.var = lookup_cv(CG(active_op_array), zend_string_copy(Z_STR_P(var_name)));
opline->result.num = is_last_catch;
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
if (!is_last_catch) {
- jmp_opnums[i + 1] = zend_emit_jump(0 TSRMLS_CC);
+ jmp_opnums[i + 1] = zend_emit_jump(0);
}
opline = &CG(active_op_array)->opcodes[opnum_catch];
@@ -3620,7 +3615,7 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
}
for (i = 0; i < catches->children; ++i) {
- zend_update_jump_target_to_next(jmp_opnums[i] TSRMLS_CC);
+ zend_update_jump_target_to_next(jmp_opnums[i]);
}
if (finally_ast) {
@@ -3631,26 +3626,26 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(context).fast_call_var = get_temporary_variable(CG(active_op_array));
}
- opline = zend_emit_op(NULL, ZEND_FAST_CALL, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_FAST_CALL, NULL, NULL);
opline->op1.opline_num = opnum_jmp + 1;
opline->result_type = IS_TMP_VAR;
opline->result.var = CG(context).fast_call_var;
- zend_emit_op(NULL, ZEND_JMP, NULL, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_JMP, NULL, NULL);
CG(context).in_finally++;
- zend_compile_stmt(finally_ast TSRMLS_CC);
+ zend_compile_stmt(finally_ast);
CG(context).in_finally--;
CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = opnum_jmp + 1;
CG(active_op_array)->try_catch_array[try_catch_offset].finally_end
= get_next_op_number(CG(active_op_array));
- opline = zend_emit_op(NULL, ZEND_FAST_RET, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_FAST_RET, NULL, NULL);
opline->op1_type = IS_TMP_VAR;
opline->op1.var = CG(context).fast_call_var;
- zend_update_jump_target_to_next(opnum_jmp TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmp);
}
efree(jmp_opnums);
@@ -3658,7 +3653,7 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) /* {{{ */
/* }}} */
/* Encoding declarations must already be handled during parsing */
-void zend_handle_encoding_declaration(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */
{
zend_ast_list *declares = zend_ast_get_list(ast);
uint32_t i;
@@ -3681,18 +3676,18 @@ void zend_handle_encoding_declaration(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(encoding_declared) = 1;
- new_encoding = zend_multibyte_fetch_encoding(encoding_name->val TSRMLS_CC);
+ new_encoding = zend_multibyte_fetch_encoding(encoding_name->val);
if (!new_encoding) {
zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", encoding_name->val);
} else {
old_input_filter = LANG_SCNG(input_filter);
old_encoding = LANG_SCNG(script_encoding);
- zend_multibyte_set_filter(new_encoding TSRMLS_CC);
+ zend_multibyte_set_filter(new_encoding);
/* need to re-scan if input filter changed */
if (old_input_filter != LANG_SCNG(input_filter) ||
(old_input_filter && new_encoding != old_encoding)) {
- zend_multibyte_yyinput_again(old_input_filter, old_encoding TSRMLS_CC);
+ zend_multibyte_yyinput_again(old_input_filter, old_encoding);
}
}
@@ -3706,7 +3701,7 @@ void zend_handle_encoding_declaration(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_declare(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_declare(zend_ast *ast) /* {{{ */
{
zend_ast_list *declares = zend_ast_get_list(ast->child[0]);
zend_ast *stmt_ast = ast->child[1];
@@ -3721,7 +3716,7 @@ void zend_compile_declare(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_string *name = zend_ast_get_str(name_ast);
if (zend_string_equals_literal_ci(name, "ticks")) {
zval value_zv;
- zend_const_expr_to_zval(&value_zv, value_ast TSRMLS_CC);
+ zend_const_expr_to_zval(&value_zv, value_ast);
convert_to_long(&value_zv);
ZVAL_COPY_VALUE(&CG(declarables).ticks, &value_zv);
zval_dtor(&value_zv);
@@ -3745,24 +3740,24 @@ void zend_compile_declare(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (stmt_ast) {
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
CG(declarables) = orig_declarables;
}
}
/* }}} */
-void zend_compile_stmt_list(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_stmt_list(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
for (i = 0; i < list->children; ++i) {
- zend_compile_stmt(list->child[i] TSRMLS_CC);
+ zend_compile_stmt(list->child[i]);
}
}
/* }}} */
-void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_params(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -3788,13 +3783,13 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_op *opline;
zend_arg_info *arg_info;
- if (zend_is_auto_global(name TSRMLS_CC)) {
+ if (zend_is_auto_global(name)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s",
name->val);
}
var_node.op_type = IS_CV;
- var_node.u.op.var = lookup_cv(CG(active_op_array), zend_string_copy(name) TSRMLS_CC);
+ var_node.u.op.var = lookup_cv(CG(active_op_array), zend_string_copy(name));
if (EX_VAR_TO_NUM(var_node.u.op.var) != i) {
zend_error_noreturn(E_COMPILE_ERROR, "Redefinition of parameter $%s",
@@ -3822,14 +3817,14 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
} else if (default_ast) {
opcode = ZEND_RECV_INIT;
default_node.op_type = IS_CONST;
- zend_const_expr_to_zval(&default_node.u.constant, default_ast TSRMLS_CC);
+ zend_const_expr_to_zval(&default_node.u.constant, default_ast);
} else {
opcode = ZEND_RECV;
default_node.op_type = IS_UNUSED;
op_array->required_num_args = i + 1;
}
- opline = zend_emit_op(NULL, opcode, NULL, &default_node TSRMLS_CC);
+ opline = zend_emit_op(NULL, opcode, NULL, &default_node);
SET_NODE(opline->result, &var_node);
opline->op1.num = i + 1;
@@ -3870,7 +3865,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_string *class_name = zend_ast_get_str(type_ast);
if (zend_is_const_default_class_ref(type_ast)) {
- class_name = zend_resolve_class_name_ast(type_ast TSRMLS_CC);
+ class_name = zend_resolve_class_name_ast(type_ast);
} else {
zend_string_addref(class_name);
}
@@ -3892,7 +3887,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_closure_uses(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_closure_uses(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -3910,12 +3905,12 @@ void zend_compile_closure_uses(zend_ast *ast TSRMLS_DC) /* {{{ */
ZVAL_NULL(&zv);
Z_CONST_FLAGS(zv) = by_ref ? IS_LEXICAL_REF : IS_LEXICAL_VAR;
- zend_compile_static_var_common(var_ast, &zv, by_ref TSRMLS_CC);
+ zend_compile_static_var_common(var_ast, &zv, by_ref);
}
}
/* }}} */
-void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_bool has_body TSRMLS_DC) /* {{{ */
+void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_bool has_body) /* {{{ */
{
zend_class_entry *ce = CG(active_class_entry);
zend_bool in_interface = (ce->ce_flags & ZEND_ACC_INTERFACE) != 0;
@@ -3958,7 +3953,7 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
lcname = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lcname->val, name->val, name->len);
- lcname = zend_new_interned_string(lcname TSRMLS_CC);
+ lcname = zend_new_interned_string(lcname);
if (zend_hash_add_ptr(&ce->function_table, lcname, op_array) == NULL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::%s()",
@@ -4089,13 +4084,13 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
}
/* }}} */
-static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl TSRMLS_DC) /* {{{ */
+static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl) /* {{{ */
{
zend_ast *params_ast = decl->child[0];
zend_string *name = decl->name, *lcname;
zend_op *opline;
- op_array->function_name = name = zend_prefix_with_ns(name TSRMLS_CC);
+ op_array->function_name = name = zend_prefix_with_ns(name);
lcname = zend_string_alloc(name->len, 0);
zend_str_tolower_copy(lcname->val, name->val, name->len);
@@ -4116,16 +4111,16 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
}
if (op_array->fn_flags & ZEND_ACC_CLOSURE) {
- opline = zend_emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL);
} else {
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_DECLARE_FUNCTION;
opline->op2_type = IS_CONST;
LITERAL_STR(opline->op2, zend_string_copy(lcname));
}
{
- zend_string *key = zend_build_runtime_definition_key(lcname, decl->lex_pos TSRMLS_CC);
+ zend_string *key = zend_build_runtime_definition_key(lcname, decl->lex_pos);
opline->op1_type = IS_CONST;
LITERAL_STR(opline->op1, key);
@@ -4137,7 +4132,7 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
}
/* }}} */
-void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_func_decl(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast_decl *decl = (zend_ast_decl *) ast;
zend_ast *params_ast = decl->child[0];
@@ -4150,7 +4145,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
// TODO.AST interactive (not just here - also bpc etc!)
- init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
op_array->fn_flags |= decl->flags;
op_array->line_start = decl->start_lineno;
@@ -4164,17 +4159,17 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
if (is_method) {
zend_bool has_body = stmt_ast != NULL;
- zend_begin_method_decl(op_array, decl->name, has_body TSRMLS_CC);
+ zend_begin_method_decl(op_array, decl->name, has_body);
} else {
- zend_begin_func_decl(result, op_array, decl TSRMLS_CC);
+ zend_begin_func_decl(result, op_array, decl);
}
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context));
- zend_init_compiler_context(TSRMLS_C);
+ zend_init_compiler_context();
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
- zend_op *opline_ext = zend_emit_op(NULL, ZEND_EXT_NOP, NULL, NULL TSRMLS_CC);
+ zend_op *opline_ext = zend_emit_op(NULL, ZEND_EXT_NOP, NULL, NULL);
opline_ext->lineno = decl->start_lineno;
}
@@ -4186,22 +4181,22 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_stack_push(&CG(loop_var_stack), (void *) &dummy_var);
}
- zend_compile_params(params_ast TSRMLS_CC);
+ zend_compile_params(params_ast);
if (uses_ast) {
- zend_compile_closure_uses(uses_ast TSRMLS_CC);
+ zend_compile_closure_uses(uses_ast);
}
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
if (is_method) {
zend_check_magic_method_implementation(
- CG(active_class_entry), (zend_function *) op_array, E_COMPILE_ERROR TSRMLS_CC);
+ CG(active_class_entry), (zend_function *) op_array, E_COMPILE_ERROR);
}
- zend_do_extended_info(TSRMLS_C);
- zend_emit_final_return(NULL TSRMLS_CC);
+ zend_do_extended_info();
+ zend_emit_final_return(NULL);
- pass_two(CG(active_op_array) TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
+ pass_two(CG(active_op_array));
+ zend_release_labels(0);
/* Pop the loop variable stack separator */
zend_stack_del_top(&CG(loop_var_stack));
@@ -4210,7 +4205,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_prop_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t flags = list->attr;
@@ -4251,13 +4246,13 @@ void zend_compile_prop_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (value_ast) {
- zend_const_expr_to_zval(&value_zv, value_ast TSRMLS_CC);
+ zend_const_expr_to_zval(&value_zv, value_ast);
} else {
ZVAL_NULL(&value_zv);
}
- name = zend_new_interned_string_safe(name TSRMLS_CC);
- zend_declare_property_ex(ce, name, &value_zv, flags, doc_comment TSRMLS_CC);
+ name = zend_new_interned_string_safe(name);
+ zend_declare_property_ex(ce, name, &value_zv, flags, doc_comment);
/* Doc comment is only assigned to first property */
doc_comment = NULL;
@@ -4265,7 +4260,7 @@ void zend_compile_prop_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_class_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_class_const_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_class_entry *ce = CG(active_class_entry);
@@ -4283,9 +4278,9 @@ void zend_compile_class_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
return;
}
- zend_const_expr_to_zval(&value_zv, value_ast TSRMLS_CC);
+ zend_const_expr_to_zval(&value_zv, value_ast);
- name = zend_new_interned_string_safe(name TSRMLS_CC);
+ name = zend_new_interned_string_safe(name);
if (zend_hash_add(&ce->constants_table, name, &value_zv) == NULL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s",
ce->name->val, name->val);
@@ -4298,7 +4293,7 @@ void zend_compile_class_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast TSRMLS_DC) /* {{{ */
+static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *method_ast = ast->child[1];
@@ -4308,7 +4303,7 @@ static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast TSRMLS
method_ref->method_name = zend_string_copy(zend_ast_get_str(method_ast));
if (class_ast) {
- method_ref->class_name = zend_resolve_class_name_ast(class_ast TSRMLS_CC);
+ method_ref->class_name = zend_resolve_class_name_ast(class_ast);
} else {
method_ref->class_name = NULL;
}
@@ -4317,7 +4312,7 @@ static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast TSRMLS
}
/* }}} */
-static zend_string **zend_compile_name_list(zend_ast *ast TSRMLS_DC) /* {{{ */
+static zend_string **zend_compile_name_list(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_string **names = safe_emalloc(sizeof(zend_string *), list->children + 1, 0);
@@ -4325,7 +4320,7 @@ static zend_string **zend_compile_name_list(zend_ast *ast TSRMLS_DC) /* {{{ */
for (i = 0; i < list->children; ++i) {
zend_ast *name_ast = list->child[i];
- names[i] = zend_resolve_class_name_ast(name_ast TSRMLS_CC);
+ names[i] = zend_resolve_class_name_ast(name_ast);
}
names[list->children] = NULL;
@@ -4334,21 +4329,21 @@ static zend_string **zend_compile_name_list(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void zend_compile_trait_precedence(zend_ast *ast TSRMLS_DC) /* {{{ */
+static void zend_compile_trait_precedence(zend_ast *ast) /* {{{ */
{
zend_ast *method_ref_ast = ast->child[0];
zend_ast *insteadof_ast = ast->child[1];
zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence));
- precedence->trait_method = zend_compile_method_ref(method_ref_ast TSRMLS_CC);
+ precedence->trait_method = zend_compile_method_ref(method_ref_ast);
precedence->exclude_from_classes
- = (void *) zend_compile_name_list(insteadof_ast TSRMLS_CC);
+ = (void *) zend_compile_name_list(insteadof_ast);
- zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence TSRMLS_CC);
+ zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence);
}
/* }}} */
-static void zend_compile_trait_alias(zend_ast *ast TSRMLS_DC) /* {{{ */
+static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */
{
zend_ast *method_ref_ast = ast->child[0];
zend_ast *alias_ast = ast->child[1];
@@ -4365,7 +4360,7 @@ static void zend_compile_trait_alias(zend_ast *ast TSRMLS_DC) /* {{{ */
}
alias = emalloc(sizeof(zend_trait_alias));
- alias->trait_method = zend_compile_method_ref(method_ref_ast TSRMLS_CC);
+ alias->trait_method = zend_compile_method_ref(method_ref_ast);
alias->modifiers = modifiers;
if (alias_ast) {
@@ -4374,11 +4369,11 @@ static void zend_compile_trait_alias(zend_ast *ast TSRMLS_DC) /* {{{ */
alias->alias = NULL;
}
- zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias TSRMLS_CC);
+ zend_add_to_list(&CG(active_class_entry)->trait_aliases, alias);
}
/* }}} */
-void zend_compile_use_trait(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_use_trait(zend_ast *ast) /* {{{ */
{
zend_ast_list *traits = zend_ast_get_list(ast->child[0]);
zend_ast_list *adaptations = ast->child[1] ? zend_ast_get_list(ast->child[1]) : NULL;
@@ -4404,12 +4399,12 @@ void zend_compile_use_trait(zend_ast *ast TSRMLS_DC) /* {{{ */
break;
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_ADD_TRAIT;
SET_NODE(opline->op1, &CG(implementing_class));
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
- zend_resolve_class_name_ast(trait_ast TSRMLS_CC) TSRMLS_CC);
+ zend_resolve_class_name_ast(trait_ast));
ce->num_traits++;
}
@@ -4422,10 +4417,10 @@ void zend_compile_use_trait(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_ast *adaptation_ast = adaptations->child[i];
switch (adaptation_ast->kind) {
case ZEND_AST_TRAIT_PRECEDENCE:
- zend_compile_trait_precedence(adaptation_ast TSRMLS_CC);
+ zend_compile_trait_precedence(adaptation_ast);
break;
case ZEND_AST_TRAIT_ALIAS:
- zend_compile_trait_alias(adaptation_ast TSRMLS_CC);
+ zend_compile_trait_alias(adaptation_ast);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
@@ -4433,7 +4428,7 @@ void zend_compile_use_trait(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_implements(znode *class_node, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_implements(znode *class_node, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -4454,17 +4449,17 @@ void zend_compile_implements(znode *class_node, zend_ast *ast TSRMLS_DC) /* {{{
"Cannot use '%s' as interface name as it is reserved", name->val);
}
- opline = zend_emit_op(NULL, ZEND_ADD_INTERFACE, class_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(NULL, ZEND_ADD_INTERFACE, class_node, NULL);
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
- zend_resolve_class_name_ast(class_ast TSRMLS_CC) TSRMLS_CC);
+ zend_resolve_class_name_ast(class_ast));
CG(active_class_entry)->num_interfaces++;
}
}
/* }}} */
-void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_class_decl(zend_ast *ast) /* {{{ */
{
zend_ast_decl *decl = (zend_ast_decl *) ast;
zend_ast *extends_ast = decl->child[0];
@@ -4494,7 +4489,7 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (CG(current_namespace)) {
- name = zend_prefix_with_ns(name TSRMLS_CC);
+ name = zend_prefix_with_ns(name);
zend_string_release(lcname);
lcname = zend_string_alloc(name->len, 0);
@@ -4508,15 +4503,15 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
"because the name is already in use", name->val);
}
- name = zend_new_interned_string(name TSRMLS_CC);
- lcname = zend_new_interned_string(lcname TSRMLS_CC);
+ name = zend_new_interned_string(name);
+ lcname = zend_new_interned_string(lcname);
ce->type = ZEND_USER_CLASS;
ce->name = name;
- zend_initialize_class_data(ce, 1 TSRMLS_CC);
+ zend_initialize_class_data(ce, 1);
ce->ce_flags |= decl->flags;
- ce->info.user.filename = zend_get_compiled_filename(TSRMLS_C);
+ ce->info.user.filename = zend_get_compiled_filename();
ce->info.user.line_start = decl->start_lineno;
ce->info.user.line_end = decl->end_lineno;
if (decl->doc_comment) {
@@ -4536,11 +4531,11 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
"Cannot use '%s' as class name as it is reserved", extends_name->val);
}
- zend_compile_class_ref(&extends_node, extends_ast TSRMLS_CC);
+ zend_compile_class_ref(&extends_node, extends_ast);
}
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- zend_make_var_result(&declare_node, opline TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
+ zend_make_var_result(&declare_node, opline);
// TODO.AST drop this
GET_NODE(&CG(implementing_class), opline->result);
@@ -4556,7 +4551,7 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
{
- zend_string *key = zend_build_runtime_definition_key(lcname, decl->lex_pos TSRMLS_CC);
+ zend_string *key = zend_build_runtime_definition_key(lcname, decl->lex_pos);
opline->op1_type = IS_CONST;
LITERAL_STR(opline->op1, key);
@@ -4567,10 +4562,10 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(active_class_entry) = ce;
if (implements_ast) {
- zend_compile_implements(&declare_node, implements_ast TSRMLS_CC);
+ zend_compile_implements(&declare_node, implements_ast);
}
- zend_compile_stmt(stmt_ast TSRMLS_CC);
+ zend_compile_stmt(stmt_ast);
if (ce->constructor) {
ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
@@ -4602,15 +4597,15 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
ce->num_traits = 0;
ce->ce_flags |= ZEND_ACC_IMPLEMENT_TRAITS;
- zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL);
}
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& (extends_ast || ce->num_interfaces > 0)
) {
- zend_verify_abstract_class(ce TSRMLS_CC);
+ zend_verify_abstract_class(ce);
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
- zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL);
}
}
@@ -4628,7 +4623,7 @@ void zend_compile_class_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-static HashTable *zend_get_import_ht(uint32_t type TSRMLS_DC) /* {{{ */
+static HashTable *zend_get_import_ht(uint32_t type) /* {{{ */
{
switch (type) {
case T_CLASS:
@@ -4683,13 +4678,13 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend
}
/* }}} */
-void zend_compile_use(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_use(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
zend_string *current_ns = CG(current_namespace);
uint32_t type = ast->attr;
- HashTable *current_import = zend_get_import_ht(type TSRMLS_CC);
+ HashTable *current_import = zend_get_import_ht(type);
zend_bool case_sensitive = type == T_CONST;
for (i = 0; i < list->children; ++i) {
@@ -4793,7 +4788,7 @@ void zend_compile_use(zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_const_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -4808,14 +4803,14 @@ void zend_compile_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
zval *value_zv = &value_node.u.constant;
value_node.op_type = IS_CONST;
- zend_const_expr_to_zval(value_zv, value_ast TSRMLS_CC);
+ zend_const_expr_to_zval(value_zv, value_ast);
- if (zend_lookup_reserved_const(name->val, name->len TSRMLS_CC)) {
+ if (zend_lookup_reserved_const(name->val, name->len)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", name->val);
}
- name = zend_prefix_with_ns(name TSRMLS_CC);
- name = zend_new_interned_string(name TSRMLS_CC);
+ name = zend_prefix_with_ns(name);
+ name = zend_new_interned_string(name);
if (CG(current_import_const)
&& (import_name = zend_hash_find_ptr(CG(current_import_const), name))
@@ -4829,14 +4824,14 @@ void zend_compile_const_decl(zend_ast *ast TSRMLS_DC) /* {{{ */
name_node.op_type = IS_CONST;
ZVAL_STR(&name_node.u.constant, name);
- zend_emit_op(NULL, ZEND_DECLARE_CONST, &name_node, &value_node TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_DECLARE_CONST, &name_node, &value_node);
zend_hash_add_ptr(&CG(const_filenames), name, CG(compiled_filename));
}
}
/* }}}*/
-void zend_compile_namespace(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_namespace(zend_ast *ast) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
zend_ast *stmt_ast = ast->child[1];
@@ -4894,7 +4889,7 @@ void zend_compile_namespace(zend_ast *ast TSRMLS_DC) /* {{{ */
CG(current_namespace) = NULL;
}
- zend_reset_import_tables(TSRMLS_C);
+ zend_reset_import_tables();
CG(in_namespace) = 1;
if (with_bracket) {
@@ -4902,13 +4897,13 @@ void zend_compile_namespace(zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (stmt_ast) {
- zend_compile_top_stmt(stmt_ast TSRMLS_CC);
- zend_end_namespace(TSRMLS_C);
+ zend_compile_top_stmt(stmt_ast);
+ zend_end_namespace();
}
}
/* }}} */
-void zend_compile_halt_compiler(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_halt_compiler(zend_ast *ast) /* {{{ */
{
zend_ast *offset_ast = ast->child[0];
zend_long offset = Z_LVAL_P(zend_ast_get_zval(offset_ast));
@@ -4921,16 +4916,16 @@ void zend_compile_halt_compiler(zend_ast *ast TSRMLS_DC) /* {{{ */
"__HALT_COMPILER() can only be used from the outermost scope");
}
- filename = zend_get_compiled_filename(TSRMLS_C);
+ filename = zend_get_compiled_filename();
name = zend_mangle_property_name(const_name, sizeof(const_name) - 1,
filename->val, filename->len, 0);
- zend_register_long_constant(name->val, name->len, offset, CONST_CS, 0 TSRMLS_CC);
+ zend_register_long_constant(name->val, name->len, offset, CONST_CS, 0);
zend_string_release(name);
}
/* }}} */
-static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC) /* {{{ */
+static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
{
zend_op_array *op_array = CG(active_op_array);
zend_class_entry *ce = CG(active_class_entry);
@@ -5014,33 +5009,33 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast TSRMLS_DC)
}
/* }}} */
-static inline void zend_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static inline void zend_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2) /* {{{ */
{
binary_op_type fn = get_binary_op(opcode);
- fn(result, op1, op2 TSRMLS_CC);
+ fn(result, op1, op2);
}
/* }}} */
-static inline void zend_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op TSRMLS_DC) /* {{{ */
+static inline void zend_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
{
binary_op_type fn = kind == ZEND_AST_UNARY_PLUS
? add_function : sub_function;
zval left;
ZVAL_LONG(&left, 0);
- fn(result, &left, op TSRMLS_CC);
+ fn(result, &left, op);
}
/* }}} */
-static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *op1, zval *op2) /* {{{ */
{
binary_op_type fn = kind == ZEND_AST_GREATER
? is_smaller_function : is_smaller_or_equal_function;
- fn(result, op2, op1 TSRMLS_CC);
+ fn(result, op2, op1);
}
/* }}} */
-static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -5049,8 +5044,8 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast TSRMLS_DC) /
for (i = 0; i < list->children; ++i) {
zend_ast *elem_ast = list->child[i];
zend_bool by_ref = elem_ast->attr;
- zend_eval_const_expr(&elem_ast->child[0] TSRMLS_CC);
- zend_eval_const_expr(&elem_ast->child[1] TSRMLS_CC);
+ zend_eval_const_expr(&elem_ast->child[0]);
+ zend_eval_const_expr(&elem_ast->child[1]);
if (by_ref || elem_ast->child[0]->kind != ZEND_AST_ZVAL
|| (elem_ast->child[1] && elem_ast->child[1]->kind != ZEND_AST_ZVAL)
@@ -5103,32 +5098,32 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast TSRMLS_DC) /
}
/* }}} */
-void zend_compile_binary_op(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_binary_op(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *left_ast = ast->child[0];
zend_ast *right_ast = ast->child[1];
uint32_t opcode = ast->attr;
znode left_node, right_node;
- zend_compile_expr(&left_node, left_ast TSRMLS_CC);
- zend_compile_expr(&right_node, right_ast TSRMLS_CC);
+ zend_compile_expr(&left_node, left_ast);
+ zend_compile_expr(&right_node, right_ast);
if (left_node.op_type == IS_CONST && right_node.op_type == IS_CONST) {
result->op_type = IS_CONST;
zend_ct_eval_binary_op(&result->u.constant, opcode,
- &left_node.u.constant, &right_node.u.constant TSRMLS_CC);
+ &left_node.u.constant, &right_node.u.constant);
zval_ptr_dtor(&left_node.u.constant);
zval_ptr_dtor(&right_node.u.constant);
return;
}
- zend_emit_op_tmp(result, opcode, &left_node, &right_node TSRMLS_CC);
+ zend_emit_op_tmp(result, opcode, &left_node, &right_node);
}
/* }}} */
/* We do not use zend_compile_binary_op for this because we want to retain the left-to-right
* evaluation order. */
-void zend_compile_greater(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_greater(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *left_ast = ast->child[0];
zend_ast *right_ast = ast->child[1];
@@ -5136,13 +5131,13 @@ void zend_compile_greater(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
ZEND_ASSERT(ast->kind == ZEND_AST_GREATER || ast->kind == ZEND_AST_GREATER_EQUAL);
- zend_compile_expr(&left_node, left_ast TSRMLS_CC);
- zend_compile_expr(&right_node, right_ast TSRMLS_CC);
+ zend_compile_expr(&left_node, left_ast);
+ zend_compile_expr(&right_node, right_ast);
if (left_node.op_type == IS_CONST && right_node.op_type == IS_CONST) {
result->op_type = IS_CONST;
zend_ct_eval_greater(&result->u.constant, ast->kind,
- &left_node.u.constant, &right_node.u.constant TSRMLS_CC);
+ &left_node.u.constant, &right_node.u.constant);
zval_ptr_dtor(&left_node.u.constant);
zval_ptr_dtor(&right_node.u.constant);
return;
@@ -5150,34 +5145,34 @@ void zend_compile_greater(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_emit_op_tmp(result,
ast->kind == ZEND_AST_GREATER ? ZEND_IS_SMALLER : ZEND_IS_SMALLER_OR_EQUAL,
- &right_node, &left_node TSRMLS_CC);
+ &right_node, &left_node);
}
/* }}} */
-void zend_compile_unary_op(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_unary_op(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
uint32_t opcode = ast->attr;
znode expr_node;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
- zend_emit_op_tmp(result, opcode, &expr_node, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, opcode, &expr_node, NULL);
}
/* }}} */
-void zend_compile_unary_pm(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode zero_node, expr_node;
ZEND_ASSERT(ast->kind == ZEND_AST_UNARY_PLUS || ast->kind == ZEND_AST_UNARY_MINUS);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
if (expr_node.op_type == IS_CONST) {
result->op_type = IS_CONST;
- zend_ct_eval_unary_pm(&result->u.constant, ast->kind, &expr_node.u.constant TSRMLS_CC);
+ zend_ct_eval_unary_pm(&result->u.constant, ast->kind, &expr_node.u.constant);
zval_ptr_dtor(&expr_node.u.constant);
return;
}
@@ -5186,11 +5181,11 @@ void zend_compile_unary_pm(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
ZVAL_LONG(&zero_node.u.constant, 0);
zend_emit_op_tmp(result, ast->kind == ZEND_AST_UNARY_PLUS ? ZEND_ADD : ZEND_SUB,
- &zero_node, &expr_node TSRMLS_CC);
+ &zero_node, &expr_node);
}
/* }}} */
-void zend_compile_short_circuiting(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *left_ast = ast->child[0];
zend_ast *right_ast = ast->child[1];
@@ -5201,11 +5196,11 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast TSRMLS_DC) /* {{
ZEND_ASSERT(ast->kind == ZEND_AST_AND || ast->kind == ZEND_AST_OR);
- zend_compile_expr(&left_node, left_ast TSRMLS_CC);
+ zend_compile_expr(&left_node, left_ast);
opnum_jmpz = get_next_op_number(CG(active_op_array));
opline_jmpz = zend_emit_op(NULL, ast->kind == ZEND_AST_AND ? ZEND_JMPZ_EX : ZEND_JMPNZ_EX,
- &left_node, NULL TSRMLS_CC);
+ &left_node, NULL);
if (left_node.op_type == IS_TMP_VAR) {
SET_NODE(opline_jmpz->result, &left_node);
@@ -5215,64 +5210,64 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast TSRMLS_DC) /* {{
}
GET_NODE(result, opline_jmpz->result);
- zend_compile_expr(&right_node, right_ast TSRMLS_CC);
+ zend_compile_expr(&right_node, right_ast);
- opline_bool = zend_emit_op(NULL, ZEND_BOOL, &right_node, NULL TSRMLS_CC);
+ opline_bool = zend_emit_op(NULL, ZEND_BOOL, &right_node, NULL);
SET_NODE(opline_bool->result, result);
- zend_update_jump_target_to_next(opnum_jmpz TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmpz);
}
/* }}} */
-void zend_compile_post_incdec(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_post_incdec(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
ZEND_ASSERT(ast->kind == ZEND_AST_POST_INC || ast->kind == ZEND_AST_POST_DEC);
if (var_ast->kind == ZEND_AST_PROP) {
- zend_op *opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_RW TSRMLS_CC);
+ zend_op *opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_RW);
opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ;
- zend_make_tmp_result(result, opline TSRMLS_CC);
+ zend_make_tmp_result(result, opline);
} else {
znode var_node;
- zend_compile_var(&var_node, var_ast, BP_VAR_RW TSRMLS_CC);
+ zend_compile_var(&var_node, var_ast, BP_VAR_RW);
zend_emit_op_tmp(result, ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC : ZEND_POST_DEC,
- &var_node, NULL TSRMLS_CC);
+ &var_node, NULL);
}
}
/* }}} */
-void zend_compile_pre_incdec(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_pre_incdec(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
ZEND_ASSERT(ast->kind == ZEND_AST_PRE_INC || ast->kind == ZEND_AST_PRE_DEC);
if (var_ast->kind == ZEND_AST_PROP) {
- zend_op *opline = zend_compile_prop_common(result, var_ast, BP_VAR_RW TSRMLS_CC);
+ zend_op *opline = zend_compile_prop_common(result, var_ast, BP_VAR_RW);
opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ;
} else {
znode var_node;
- zend_compile_var(&var_node, var_ast, BP_VAR_RW TSRMLS_CC);
+ zend_compile_var(&var_node, var_ast, BP_VAR_RW);
zend_emit_op(result, ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC : ZEND_PRE_DEC,
- &var_node, NULL TSRMLS_CC);
+ &var_node, NULL);
}
}
/* }}} */
-void zend_compile_cast(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_cast(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode expr_node;
zend_op *opline;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
- opline = zend_emit_op_tmp(result, ZEND_CAST, &expr_node, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_CAST, &expr_node, NULL);
opline->extended_value = ast->attr;
}
/* }}} */
-static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *cond_ast = ast->child[0];
zend_ast *false_ast = ast->child[2];
@@ -5283,21 +5278,21 @@ static void zend_compile_shorthand_conditional(znode *result, zend_ast *ast TSRM
ZEND_ASSERT(ast->child[1] == NULL);
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
opnum_jmp_set = get_next_op_number(CG(active_op_array));
- zend_emit_op_tmp(result, ZEND_JMP_SET, &cond_node, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, ZEND_JMP_SET, &cond_node, NULL);
- zend_compile_expr(&false_node, false_ast TSRMLS_CC);
+ zend_compile_expr(&false_node, false_ast);
opline_jmp_set = &CG(active_op_array)->opcodes[opnum_jmp_set];
opline_jmp_set->op2.opline_num = get_next_op_number(CG(active_op_array)) + 1;
- opline_qm_assign = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &false_node, NULL TSRMLS_CC);
+ opline_qm_assign = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &false_node, NULL);
SET_NODE(opline_qm_assign->result, result);
}
/* }}} */
-void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_conditional(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *cond_ast = ast->child[0];
zend_ast *true_ast = ast->child[1];
@@ -5308,34 +5303,34 @@ void zend_compile_conditional(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
uint32_t opnum_jmpz, opnum_jmp, opnum_qm_assign1;
if (!true_ast) {
- zend_compile_shorthand_conditional(result, ast TSRMLS_CC);
+ zend_compile_shorthand_conditional(result, ast);
return;
}
- zend_compile_expr(&cond_node, cond_ast TSRMLS_CC);
+ zend_compile_expr(&cond_node, cond_ast);
- opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0 TSRMLS_CC);
+ opnum_jmpz = zend_emit_cond_jump(ZEND_JMPZ, &cond_node, 0);
- zend_compile_expr(&true_node, true_ast TSRMLS_CC);
+ zend_compile_expr(&true_node, true_ast);
opnum_qm_assign1 = get_next_op_number(CG(active_op_array));
- zend_emit_op_tmp(result, ZEND_QM_ASSIGN, &true_node, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, ZEND_QM_ASSIGN, &true_node, NULL);
- opnum_jmp = zend_emit_jump(0 TSRMLS_CC);
+ opnum_jmp = zend_emit_jump(0);
- zend_update_jump_target_to_next(opnum_jmpz TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmpz);
- zend_compile_expr(&false_node, false_ast TSRMLS_CC);
+ zend_compile_expr(&false_node, false_ast);
opline_qm_assign1 = &CG(active_op_array)->opcodes[opnum_qm_assign1];
- opline_qm_assign2 = zend_emit_op(NULL, opline_qm_assign1->opcode, &false_node, NULL TSRMLS_CC);
+ opline_qm_assign2 = zend_emit_op(NULL, opline_qm_assign1->opcode, &false_node, NULL);
SET_NODE(opline_qm_assign2->result, result);
- zend_update_jump_target_to_next(opnum_jmp TSRMLS_CC);
+ zend_update_jump_target_to_next(opnum_jmp);
}
/* }}} */
-void zend_compile_coalesce(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_coalesce(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
zend_ast *default_ast = ast->child[1];
@@ -5344,14 +5339,14 @@ void zend_compile_coalesce(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_op *opline;
uint32_t opnum;
- zend_compile_var(&expr_node, expr_ast, BP_VAR_IS TSRMLS_CC);
+ zend_compile_var(&expr_node, expr_ast, BP_VAR_IS);
opnum = get_next_op_number(CG(active_op_array));
- zend_emit_op_tmp(result, ZEND_COALESCE, &expr_node, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, ZEND_COALESCE, &expr_node, NULL);
- zend_compile_expr(&default_node, default_ast TSRMLS_CC);
+ zend_compile_expr(&default_node, default_ast);
- opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &default_node, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &default_node, NULL);
SET_NODE(opline->result, result);
opline = &CG(active_op_array)->opcodes[opnum];
@@ -5359,27 +5354,27 @@ void zend_compile_coalesce(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_print(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_print(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode expr_node;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
- zend_emit_op_tmp(result, ZEND_PRINT, &expr_node, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, ZEND_PRINT, &expr_node, NULL);
}
/* }}} */
-void zend_compile_exit(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_exit(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
if (expr_ast) {
znode expr_node;
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
- zend_emit_op(NULL, ZEND_EXIT, &expr_node, NULL TSRMLS_CC);
+ zend_compile_expr(&expr_node, expr_ast);
+ zend_emit_op(NULL, ZEND_EXIT, &expr_node, NULL);
} else {
- zend_emit_op(NULL, ZEND_EXIT, NULL, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_EXIT, NULL, NULL);
}
result->op_type = IS_CONST;
@@ -5387,7 +5382,7 @@ void zend_compile_exit(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_yield(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_yield(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *value_ast = ast->child[0];
zend_ast *key_ast = ast->child[1];
@@ -5405,20 +5400,20 @@ void zend_compile_yield(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR;
if (key_ast) {
- zend_compile_expr(&key_node, key_ast TSRMLS_CC);
+ zend_compile_expr(&key_node, key_ast);
key_node_ptr = &key_node;
}
if (value_ast) {
if (returns_by_ref && zend_is_variable(value_ast) && !zend_is_call(value_ast)) {
- zend_compile_var(&value_node, value_ast, BP_VAR_REF TSRMLS_CC);
+ zend_compile_var(&value_node, value_ast, BP_VAR_REF);
} else {
- zend_compile_expr(&value_node, value_ast TSRMLS_CC);
+ zend_compile_expr(&value_node, value_ast);
}
value_node_ptr = &value_node;
}
- opline = zend_emit_op(result, ZEND_YIELD, value_node_ptr, key_node_ptr TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_YIELD, value_node_ptr, key_node_ptr);
if (value_ast && returns_by_ref && zend_is_call(value_ast)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
@@ -5426,7 +5421,7 @@ void zend_compile_yield(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_instanceof(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_instanceof(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
zend_ast *class_ast = ast->child[1];
@@ -5434,7 +5429,7 @@ void zend_compile_instanceof(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
znode obj_node, class_node;
zend_op *opline;
- zend_compile_expr(&obj_node, obj_ast TSRMLS_CC);
+ zend_compile_expr(&obj_node, obj_ast);
if (obj_node.op_type == IS_CONST) {
zend_error_noreturn(E_COMPILE_ERROR,
"instanceof expects an object instance, constant given");
@@ -5442,41 +5437,41 @@ void zend_compile_instanceof(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
if (zend_is_const_default_class_ref(class_ast)) {
class_node.op_type = IS_CONST;
- ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast TSRMLS_CC));
+ ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else {
- opline = zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
+ opline = zend_compile_class_ref(&class_node, class_ast);
opline->extended_value |= ZEND_FETCH_CLASS_NO_AUTOLOAD;
}
- opline = zend_emit_op_tmp(result, ZEND_INSTANCEOF, &obj_node, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_INSTANCEOF, &obj_node, NULL);
if (class_node.op_type == IS_CONST) {
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(
- CG(active_op_array), Z_STR(class_node.u.constant) TSRMLS_CC);
+ CG(active_op_array), Z_STR(class_node.u.constant));
} else {
SET_NODE(opline->op2, &class_node);
}
}
/* }}} */
-void zend_compile_include_or_eval(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_include_or_eval(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode expr_node;
zend_op *opline;
- zend_do_extended_fcall_begin(TSRMLS_C);
- zend_compile_expr(&expr_node, expr_ast TSRMLS_CC);
+ zend_do_extended_fcall_begin();
+ zend_compile_expr(&expr_node, expr_ast);
- opline = zend_emit_op(result, ZEND_INCLUDE_OR_EVAL, &expr_node, NULL TSRMLS_CC);
+ opline = zend_emit_op(result, ZEND_INCLUDE_OR_EVAL, &expr_node, NULL);
opline->extended_value = ast->attr;
- zend_do_extended_fcall_end(TSRMLS_C);
+ zend_do_extended_fcall_end();
}
/* }}} */
-void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_isset_or_empty(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *var_ast = ast->child[0];
@@ -5489,7 +5484,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
if (ast->kind == ZEND_AST_EMPTY) {
/* empty(expr) can be transformed to !expr */
zend_ast *not_ast = zend_ast_create_ex(ZEND_AST_UNARY_OP, ZEND_BOOL_NOT, var_ast);
- zend_compile_expr(result, not_ast TSRMLS_CC);
+ zend_compile_expr(result, not_ast);
return;
} else {
zend_error_noreturn(E_COMPILE_ERROR,
@@ -5500,24 +5495,24 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
switch (var_ast->kind) {
case ZEND_AST_VAR:
- if (zend_try_compile_cv(&var_node, var_ast TSRMLS_CC) == SUCCESS) {
- opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_VAR, &var_node, NULL TSRMLS_CC);
+ if (zend_try_compile_cv(&var_node, var_ast) == SUCCESS) {
+ opline = zend_emit_op(result, ZEND_ISSET_ISEMPTY_VAR, &var_node, NULL);
opline->extended_value = ZEND_FETCH_LOCAL | ZEND_QUICK_SET;
} else {
- opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS TSRMLS_CC);
+ opline = zend_compile_simple_var_no_cv(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_VAR;
}
break;
case ZEND_AST_DIM:
- opline = zend_compile_dim_common(result, var_ast, BP_VAR_IS TSRMLS_CC);
+ opline = zend_compile_dim_common(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_DIM_OBJ;
break;
case ZEND_AST_PROP:
- opline = zend_compile_prop_common(result, var_ast, BP_VAR_IS TSRMLS_CC);
+ opline = zend_compile_prop_common(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ;
break;
case ZEND_AST_STATIC_PROP:
- opline = zend_compile_static_prop_common(result, var_ast, BP_VAR_IS TSRMLS_CC);
+ opline = zend_compile_static_prop_common(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_VAR;
break;
EMPTY_SWITCH_DEFAULT_CASE()
@@ -5528,7 +5523,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
}
/* }}} */
-void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_silence(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
znode silence_node;
@@ -5536,18 +5531,18 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_brk_cont_element *brk_cont_element;
begin_opline_num = get_next_op_number(CG(active_op_array));
- zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC);
+ zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL);
if (expr_ast->kind == ZEND_AST_VAR) {
/* For @$var we need to force a FETCH instruction, otherwise the CV access will
* happen outside the silenced section. */
- zend_compile_simple_var_no_cv(result, expr_ast, BP_VAR_R TSRMLS_CC);
+ zend_compile_simple_var_no_cv(result, expr_ast, BP_VAR_R);
} else {
- zend_compile_expr(result, expr_ast TSRMLS_CC);
+ zend_compile_expr(result, expr_ast);
}
end_opline_num = get_next_op_number(CG(active_op_array));
- zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL TSRMLS_CC);
+ zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL);
/* Store BEGIN_SILENCE/END_SILENCE pair to restore previous
* EG(error_reporting) value on exception */
@@ -5558,7 +5553,7 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_shell_exec(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_shell_exec(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
@@ -5570,20 +5565,20 @@ void zend_compile_shell_exec(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
args_ast = zend_ast_create_list(1, ZEND_AST_ARG_LIST, expr_ast);
call_ast = zend_ast_create(ZEND_AST_CALL, name_ast, args_ast);
- zend_compile_expr(result, call_ast TSRMLS_CC);
+ zend_compile_expr(result, call_ast);
zval_ptr_dtor(&fn_name);
}
/* }}} */
-void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_op *opline;
uint32_t i, opnum_init = -1;
zend_bool packed = 1;
- if (zend_try_ct_eval_array(&result->u.constant, ast TSRMLS_CC)) {
+ if (zend_try_ct_eval_array(&result->u.constant, ast)) {
result->op_type = IS_CONST;
return;
}
@@ -5597,25 +5592,25 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
znode value_node, key_node, *key_node_ptr = NULL;
if (key_ast) {
- zend_compile_expr(&key_node, key_ast TSRMLS_CC);
- zend_handle_numeric_op(&key_node TSRMLS_CC);
+ zend_compile_expr(&key_node, key_ast);
+ zend_handle_numeric_op(&key_node);
key_node_ptr = &key_node;
}
if (by_ref) {
zend_ensure_writable_variable(value_ast);
- zend_compile_var(&value_node, value_ast, BP_VAR_W TSRMLS_CC);
+ zend_compile_var(&value_node, value_ast, BP_VAR_W);
} else {
- zend_compile_expr(&value_node, value_ast TSRMLS_CC);
+ zend_compile_expr(&value_node, value_ast);
}
if (i == 0) {
opnum_init = get_next_op_number(CG(active_op_array));
- opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr);
opline->extended_value = list->children << ZEND_ARRAY_SIZE_SHIFT;
} else {
opline = zend_emit_op(NULL, ZEND_ADD_ARRAY_ELEMENT,
- &value_node, key_node_ptr TSRMLS_CC);
+ &value_node, key_node_ptr);
SET_NODE(opline->result, result);
}
opline->extended_value |= by_ref;
@@ -5627,7 +5622,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
/* Handle empty array */
if (!list->children) {
- zend_emit_op_tmp(result, ZEND_INIT_ARRAY, NULL, NULL TSRMLS_CC);
+ zend_emit_op_tmp(result, ZEND_INIT_ARRAY, NULL, NULL);
}
/* Add a flag to INIT_ARRAY if we know this array cannot be packed */
@@ -5639,7 +5634,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
@@ -5648,36 +5643,36 @@ void zend_compile_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
zend_bool is_fully_qualified;
zend_string *orig_name = zend_ast_get_str(name_ast);
zend_string *resolved_name = zend_resolve_const_name(
- orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC);
+ orig_name, name_ast->attr, &is_fully_qualified);
- if (zend_try_ct_eval_const(&result->u.constant, resolved_name, is_fully_qualified TSRMLS_CC)) {
+ if (zend_try_ct_eval_const(&result->u.constant, resolved_name, is_fully_qualified)) {
result->op_type = IS_CONST;
zend_string_release(resolved_name);
return;
}
- opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, NULL TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, NULL);
opline->op2_type = IS_CONST;
if (is_fully_qualified) {
opline->op2.constant = zend_add_const_name_literal(
- CG(active_op_array), resolved_name, 0 TSRMLS_CC);
+ CG(active_op_array), resolved_name, 0);
} else {
opline->extended_value = IS_CONSTANT_UNQUALIFIED;
if (CG(current_namespace)) {
opline->extended_value |= IS_CONSTANT_IN_NAMESPACE;
opline->op2.constant = zend_add_const_name_literal(
- CG(active_op_array), resolved_name, 1 TSRMLS_CC);
+ CG(active_op_array), resolved_name, 1);
} else {
opline->op2.constant = zend_add_const_name_literal(
- CG(active_op_array), resolved_name, 0 TSRMLS_CC);
+ CG(active_op_array), resolved_name, 0);
}
}
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op2.constant);
}
/* }}} */
-void zend_compile_class_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *const_ast = ast->child[1];
@@ -5687,26 +5682,26 @@ void zend_compile_class_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
if (zend_is_const_default_class_ref(class_ast)) {
class_node.op_type = IS_CONST;
- ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast TSRMLS_CC));
+ ZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));
} else {
- zend_compile_class_ref(&class_node, class_ast TSRMLS_CC);
+ zend_compile_class_ref(&class_node, class_ast);
}
- zend_compile_expr(&const_node, const_ast TSRMLS_CC);
+ zend_compile_expr(&const_node, const_ast);
- opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, &const_node TSRMLS_CC);
+ opline = zend_emit_op_tmp(result, ZEND_FETCH_CONSTANT, NULL, &const_node);
- zend_set_class_name_op1(opline, &class_node TSRMLS_CC);
+ zend_set_class_name_op1(opline, &class_node);
if (opline->op1_type == IS_CONST) {
- zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_cache_slot(opline->op2.constant);
} else {
- zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
+ zend_alloc_polymorphic_cache_slot(opline->op2.constant);
}
}
/* }}} */
-void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_resolve_class_name(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast *name_ast = ast->child[0];
uint32_t fetch_type = zend_get_class_fetch_type(zend_ast_get_str(name_ast));
@@ -5725,7 +5720,7 @@ void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /*
class_str_ast = zend_ast_create_zval(&class_str_zv);
class_const_ast = zend_ast_create(ZEND_AST_CLASS_CONST, name_ast, class_str_ast);
- zend_compile_expr(result, class_const_ast TSRMLS_CC);
+ zend_compile_expr(result, class_const_ast);
zval_ptr_dtor(&class_str_zv);
} else {
@@ -5748,21 +5743,21 @@ void zend_compile_resolve_class_name(znode *result, zend_ast *ast TSRMLS_DC) /*
class_const_ast = zend_ast_create(
ZEND_AST_CLASS_CONST, name_ast, class_str_ast);
- zend_compile_expr(result, class_const_ast TSRMLS_CC);
+ zend_compile_expr(result, class_const_ast);
zval_ptr_dtor(&class_str_zv);
}
break;
case ZEND_FETCH_CLASS_DEFAULT:
result->op_type = IS_CONST;
- ZVAL_STR(&result->u.constant, zend_resolve_class_name_ast(name_ast TSRMLS_CC));
+ ZVAL_STR(&result->u.constant, zend_resolve_class_name_ast(name_ast));
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
/* }}} */
-void zend_compile_encaps_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
@@ -5777,21 +5772,21 @@ void zend_compile_encaps_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
znode elem_node;
zend_op *opline;
- zend_compile_expr(&elem_node, elem_ast TSRMLS_CC);
+ zend_compile_expr(&elem_node, elem_ast);
if (elem_ast->kind == ZEND_AST_ZVAL) {
zval *zv = &elem_node.u.constant;
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
if (Z_STRLEN_P(zv) > 1) {
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_ADD_STRING;
} else if (Z_STRLEN_P(zv) == 1) {
char ch = *Z_STRVAL_P(zv);
zend_string_release(Z_STR_P(zv));
ZVAL_LONG(zv, ch);
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_ADD_CHAR;
} else {
/* String can be empty after a variable at the end of a heredoc */
@@ -5799,7 +5794,7 @@ void zend_compile_encaps_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
continue;
}
} else {
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_ADD_VAR;
ZEND_ASSERT(elem_node.op_type != IS_CONST);
}
@@ -5815,9 +5810,9 @@ void zend_compile_encaps_list(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_magic_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_magic_const(znode *result, zend_ast *ast) /* {{{ */
{
- if (zend_try_ct_eval_magic_const(&result->u.constant, ast TSRMLS_CC)) {
+ if (zend_try_ct_eval_magic_const(&result->u.constant, ast)) {
result->op_type = IS_CONST;
return;
}
@@ -5829,7 +5824,7 @@ void zend_compile_magic_const(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
{
zend_ast *const_ast = zend_ast_create(ZEND_AST_CONST,
zend_ast_create_zval_from_str(zend_string_init("__CLASS__", sizeof("__CLASS__") - 1, 0)));
- zend_compile_const(result, const_ast TSRMLS_CC);
+ zend_compile_const(result, const_ast);
zend_ast_destroy(const_ast);
}
}
@@ -5849,7 +5844,7 @@ zend_bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
}
/* }}} */
-void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_compile_const_expr_class_const(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
zend_ast *class_ast = ast->child[0];
@@ -5873,7 +5868,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
}
if (ZEND_FETCH_CLASS_DEFAULT == fetch_type) {
- class_name = zend_resolve_class_name_ast(class_ast TSRMLS_CC);
+ class_name = zend_resolve_class_name_ast(class_ast);
} else {
zend_string_addref(class_name);
}
@@ -5891,7 +5886,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_const_expr_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_compile_const_expr_const(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
zend_ast *name_ast = ast->child[0];
@@ -5900,9 +5895,9 @@ void zend_compile_const_expr_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
zval result, resolved_name;
ZVAL_STR(&resolved_name, zend_resolve_const_name(
- orig_name, name_ast->attr, &is_fully_qualified TSRMLS_CC));
+ orig_name, name_ast->attr, &is_fully_qualified));
- if (zend_try_ct_eval_const(&result, Z_STR(resolved_name), is_fully_qualified TSRMLS_CC)) {
+ if (zend_try_ct_eval_const(&result, Z_STR(resolved_name), is_fully_qualified)) {
zend_string_release(Z_STR(resolved_name));
zend_ast_destroy(ast);
*ast_ptr = zend_ast_create_zval(&result);
@@ -5919,7 +5914,7 @@ void zend_compile_const_expr_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
zend_ast *name_ast = ast->child[0];
@@ -5942,7 +5937,7 @@ void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /*
);
break;
case ZEND_FETCH_CLASS_DEFAULT:
- ZVAL_STR(&result, zend_resolve_class_name_ast(name_ast TSRMLS_CC));
+ ZVAL_STR(&result, zend_resolve_class_name_ast(name_ast));
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
@@ -5952,7 +5947,7 @@ void zend_compile_const_expr_resolve_class_name(zend_ast **ast_ptr TSRMLS_DC) /*
}
/* }}} */
-void zend_compile_const_expr_magic_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_compile_const_expr_magic_const(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
@@ -5972,7 +5967,7 @@ void zend_compile_const_expr_magic_const(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_compile_const_expr(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
if (ast == NULL || ast->kind == ZEND_AST_ZVAL) {
@@ -5985,29 +5980,29 @@ void zend_compile_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
switch (ast->kind) {
case ZEND_AST_CLASS_CONST:
- zend_compile_const_expr_class_const(ast_ptr TSRMLS_CC);
+ zend_compile_const_expr_class_const(ast_ptr);
break;
case ZEND_AST_CONST:
- zend_compile_const_expr_const(ast_ptr TSRMLS_CC);
+ zend_compile_const_expr_const(ast_ptr);
break;
case ZEND_AST_RESOLVE_CLASS_NAME:
- zend_compile_const_expr_resolve_class_name(ast_ptr TSRMLS_CC);
+ zend_compile_const_expr_resolve_class_name(ast_ptr);
break;
case ZEND_AST_MAGIC_CONST:
- zend_compile_const_expr_magic_const(ast_ptr TSRMLS_CC);
+ zend_compile_const_expr_magic_const(ast_ptr);
break;
default:
- zend_ast_apply(ast, zend_compile_const_expr TSRMLS_CC);
+ zend_ast_apply(ast, zend_compile_const_expr);
break;
}
}
/* }}} */
-void zend_const_expr_to_zval(zval *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */
{
zend_ast *orig_ast = ast;
- zend_eval_const_expr(&ast TSRMLS_CC);
- zend_compile_const_expr(&ast TSRMLS_CC);
+ zend_eval_const_expr(&ast);
+ zend_compile_const_expr(&ast);
if (ast->kind == ZEND_AST_ZVAL) {
ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast));
@@ -6022,7 +6017,7 @@ void zend_const_expr_to_zval(zval *result, zend_ast *ast TSRMLS_DC) /* {{{ */
/* }}} */
/* Same as compile_stmt, but with early binding */
-void zend_compile_top_stmt(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_top_stmt(zend_ast *ast) /* {{{ */
{
if (!ast) {
return;
@@ -6032,24 +6027,24 @@ void zend_compile_top_stmt(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
for (i = 0; i < list->children; ++i) {
- zend_compile_top_stmt(list->child[i] TSRMLS_CC);
+ zend_compile_top_stmt(list->child[i]);
}
return;
}
- zend_compile_stmt(ast TSRMLS_CC);
+ zend_compile_stmt(ast);
if (ast->kind != ZEND_AST_NAMESPACE && ast->kind != ZEND_AST_HALT_COMPILER) {
- zend_verify_namespace(TSRMLS_C);
+ zend_verify_namespace();
}
if (ast->kind == ZEND_AST_FUNC_DECL || ast->kind == ZEND_AST_CLASS) {
CG(zend_lineno) = ((zend_ast_decl *) ast)->end_lineno;
- zend_do_early_binding(TSRMLS_C);
+ zend_do_early_binding();
}
}
/* }}} */
-void zend_compile_stmt(zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_stmt(zend_ast *ast) /* {{{ */
{
if (!ast) {
return;
@@ -6059,103 +6054,103 @@ void zend_compile_stmt(zend_ast *ast TSRMLS_DC) /* {{{ */
switch (ast->kind) {
case ZEND_AST_STMT_LIST:
- zend_compile_stmt_list(ast TSRMLS_CC);
+ zend_compile_stmt_list(ast);
break;
case ZEND_AST_GLOBAL:
- zend_compile_global_var(ast TSRMLS_CC);
+ zend_compile_global_var(ast);
break;
case ZEND_AST_STATIC:
- zend_compile_static_var(ast TSRMLS_CC);
+ zend_compile_static_var(ast);
break;
case ZEND_AST_UNSET:
- zend_compile_unset(ast TSRMLS_CC);
+ zend_compile_unset(ast);
break;
case ZEND_AST_RETURN:
- zend_compile_return(ast TSRMLS_CC);
+ zend_compile_return(ast);
break;
case ZEND_AST_ECHO:
- zend_compile_echo(ast TSRMLS_CC);
+ zend_compile_echo(ast);
break;
case ZEND_AST_THROW:
- zend_compile_throw(ast TSRMLS_CC);
+ zend_compile_throw(ast);
break;
case ZEND_AST_BREAK:
case ZEND_AST_CONTINUE:
- zend_compile_break_continue(ast TSRMLS_CC);
+ zend_compile_break_continue(ast);
break;
case ZEND_AST_GOTO:
- zend_compile_goto(ast TSRMLS_CC);
+ zend_compile_goto(ast);
break;
case ZEND_AST_LABEL:
- zend_compile_label(ast TSRMLS_CC);
+ zend_compile_label(ast);
break;
case ZEND_AST_WHILE:
- zend_compile_while(ast TSRMLS_CC);
+ zend_compile_while(ast);
break;
case ZEND_AST_DO_WHILE:
- zend_compile_do_while(ast TSRMLS_CC);
+ zend_compile_do_while(ast);
break;
case ZEND_AST_FOR:
- zend_compile_for(ast TSRMLS_CC);
+ zend_compile_for(ast);
break;
case ZEND_AST_FOREACH:
- zend_compile_foreach(ast TSRMLS_CC);
+ zend_compile_foreach(ast);
break;
case ZEND_AST_IF:
- zend_compile_if(ast TSRMLS_CC);
+ zend_compile_if(ast);
break;
case ZEND_AST_SWITCH:
- zend_compile_switch(ast TSRMLS_CC);
+ zend_compile_switch(ast);
break;
case ZEND_AST_TRY:
- zend_compile_try(ast TSRMLS_CC);
+ zend_compile_try(ast);
break;
case ZEND_AST_DECLARE:
- zend_compile_declare(ast TSRMLS_CC);
+ zend_compile_declare(ast);
break;
case ZEND_AST_FUNC_DECL:
case ZEND_AST_METHOD:
- zend_compile_func_decl(NULL, ast TSRMLS_CC);
+ zend_compile_func_decl(NULL, ast);
break;
case ZEND_AST_PROP_DECL:
- zend_compile_prop_decl(ast TSRMLS_CC);
+ zend_compile_prop_decl(ast);
break;
case ZEND_AST_CLASS_CONST_DECL:
- zend_compile_class_const_decl(ast TSRMLS_CC);
+ zend_compile_class_const_decl(ast);
break;
case ZEND_AST_USE_TRAIT:
- zend_compile_use_trait(ast TSRMLS_CC);
+ zend_compile_use_trait(ast);
break;
case ZEND_AST_CLASS:
- zend_compile_class_decl(ast TSRMLS_CC);
+ zend_compile_class_decl(ast);
break;
case ZEND_AST_USE:
- zend_compile_use(ast TSRMLS_CC);
+ zend_compile_use(ast);
break;
case ZEND_AST_CONST_DECL:
- zend_compile_const_decl(ast TSRMLS_CC);
+ zend_compile_const_decl(ast);
break;
case ZEND_AST_NAMESPACE:
- zend_compile_namespace(ast TSRMLS_CC);
+ zend_compile_namespace(ast);
break;
case ZEND_AST_HALT_COMPILER:
- zend_compile_halt_compiler(ast TSRMLS_CC);
+ zend_compile_halt_compiler(ast);
break;
default:
{
znode result;
- zend_compile_expr(&result, ast TSRMLS_CC);
- zend_do_free(&result TSRMLS_CC);
+ zend_compile_expr(&result, ast);
+ zend_do_free(&result);
}
}
if (Z_LVAL(CG(declarables).ticks) && !zend_is_unticked_stmt(ast)) {
- zend_emit_tick(TSRMLS_C);
+ zend_emit_tick();
}
}
/* }}} */
-void zend_compile_expr(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
+void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
{
/* CG(zend_lineno) = ast->lineno; */
CG(zend_lineno) = zend_ast_get_lineno(ast);
@@ -6175,103 +6170,103 @@ void zend_compile_expr(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
case ZEND_AST_CALL:
case ZEND_AST_METHOD_CALL:
case ZEND_AST_STATIC_CALL:
- zend_compile_var(result, ast, BP_VAR_R TSRMLS_CC);
+ zend_compile_var(result, ast, BP_VAR_R);
return;
case ZEND_AST_ASSIGN:
- zend_compile_assign(result, ast TSRMLS_CC);
+ zend_compile_assign(result, ast);
return;
case ZEND_AST_ASSIGN_REF:
- zend_compile_assign_ref(result, ast TSRMLS_CC);
+ zend_compile_assign_ref(result, ast);
return;
case ZEND_AST_NEW:
- zend_compile_new(result, ast TSRMLS_CC);
+ zend_compile_new(result, ast);
return;
case ZEND_AST_CLONE:
- zend_compile_clone(result, ast TSRMLS_CC);
+ zend_compile_clone(result, ast);
return;
case ZEND_AST_ASSIGN_OP:
- zend_compile_compound_assign(result, ast TSRMLS_CC);
+ zend_compile_compound_assign(result, ast);
return;
case ZEND_AST_BINARY_OP:
- zend_compile_binary_op(result, ast TSRMLS_CC);
+ zend_compile_binary_op(result, ast);
return;
case ZEND_AST_GREATER:
case ZEND_AST_GREATER_EQUAL:
- zend_compile_greater(result, ast TSRMLS_CC);
+ zend_compile_greater(result, ast);
return;
case ZEND_AST_UNARY_OP:
- zend_compile_unary_op(result, ast TSRMLS_CC);
+ zend_compile_unary_op(result, ast);
return;
case ZEND_AST_UNARY_PLUS:
case ZEND_AST_UNARY_MINUS:
- zend_compile_unary_pm(result, ast TSRMLS_CC);
+ zend_compile_unary_pm(result, ast);
return;
case ZEND_AST_AND:
case ZEND_AST_OR:
- zend_compile_short_circuiting(result, ast TSRMLS_CC);
+ zend_compile_short_circuiting(result, ast);
return;
case ZEND_AST_POST_INC:
case ZEND_AST_POST_DEC:
- zend_compile_post_incdec(result, ast TSRMLS_CC);
+ zend_compile_post_incdec(result, ast);
return;
case ZEND_AST_PRE_INC:
case ZEND_AST_PRE_DEC:
- zend_compile_pre_incdec(result, ast TSRMLS_CC);
+ zend_compile_pre_incdec(result, ast);
return;
case ZEND_AST_CAST:
- zend_compile_cast(result, ast TSRMLS_CC);
+ zend_compile_cast(result, ast);
return;
case ZEND_AST_CONDITIONAL:
- zend_compile_conditional(result, ast TSRMLS_CC);
+ zend_compile_conditional(result, ast);
return;
case ZEND_AST_COALESCE:
- zend_compile_coalesce(result, ast TSRMLS_CC);
+ zend_compile_coalesce(result, ast);
return;
case ZEND_AST_PRINT:
- zend_compile_print(result, ast TSRMLS_CC);
+ zend_compile_print(result, ast);
return;
case ZEND_AST_EXIT:
- zend_compile_exit(result, ast TSRMLS_CC);
+ zend_compile_exit(result, ast);
return;
case ZEND_AST_YIELD:
- zend_compile_yield(result, ast TSRMLS_CC);
+ zend_compile_yield(result, ast);
return;
case ZEND_AST_INSTANCEOF:
- zend_compile_instanceof(result, ast TSRMLS_CC);
+ zend_compile_instanceof(result, ast);
return;
case ZEND_AST_INCLUDE_OR_EVAL:
- zend_compile_include_or_eval(result, ast TSRMLS_CC);
+ zend_compile_include_or_eval(result, ast);
return;
case ZEND_AST_ISSET:
case ZEND_AST_EMPTY:
- zend_compile_isset_or_empty(result, ast TSRMLS_CC);
+ zend_compile_isset_or_empty(result, ast);
return;
case ZEND_AST_SILENCE:
- zend_compile_silence(result, ast TSRMLS_CC);
+ zend_compile_silence(result, ast);
return;
case ZEND_AST_SHELL_EXEC:
- zend_compile_shell_exec(result, ast TSRMLS_CC);
+ zend_compile_shell_exec(result, ast);
return;
case ZEND_AST_ARRAY:
- zend_compile_array(result, ast TSRMLS_CC);
+ zend_compile_array(result, ast);
return;
case ZEND_AST_CONST:
- zend_compile_const(result, ast TSRMLS_CC);
+ zend_compile_const(result, ast);
return;
case ZEND_AST_CLASS_CONST:
- zend_compile_class_const(result, ast TSRMLS_CC);
+ zend_compile_class_const(result, ast);
return;
case ZEND_AST_RESOLVE_CLASS_NAME:
- zend_compile_resolve_class_name(result, ast TSRMLS_CC);
+ zend_compile_resolve_class_name(result, ast);
return;
case ZEND_AST_ENCAPS_LIST:
- zend_compile_encaps_list(result, ast TSRMLS_CC);
+ zend_compile_encaps_list(result, ast);
return;
case ZEND_AST_MAGIC_CONST:
- zend_compile_magic_const(result, ast TSRMLS_CC);
+ zend_compile_magic_const(result, ast);
return;
case ZEND_AST_CLOSURE:
- zend_compile_func_decl(result, ast TSRMLS_CC);
+ zend_compile_func_decl(result, ast);
return;
default:
ZEND_ASSERT(0 /* not supported */);
@@ -6279,29 +6274,29 @@ void zend_compile_expr(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
/* }}} */
-void zend_compile_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
switch (ast->kind) {
case ZEND_AST_VAR:
- zend_compile_simple_var(result, ast, type TSRMLS_CC);
+ zend_compile_simple_var(result, ast, type);
return;
case ZEND_AST_DIM:
- zend_compile_dim(result, ast, type TSRMLS_CC);
+ zend_compile_dim(result, ast, type);
return;
case ZEND_AST_PROP:
- zend_compile_prop(result, ast, type TSRMLS_CC);
+ zend_compile_prop(result, ast, type);
return;
case ZEND_AST_STATIC_PROP:
- zend_compile_static_prop(result, ast, type TSRMLS_CC);
+ zend_compile_static_prop(result, ast, type);
return;
case ZEND_AST_CALL:
- zend_compile_call(result, ast, type TSRMLS_CC);
+ zend_compile_call(result, ast, type);
return;
case ZEND_AST_METHOD_CALL:
- zend_compile_method_call(result, ast, type TSRMLS_CC);
+ zend_compile_method_call(result, ast, type);
return;
case ZEND_AST_STATIC_CALL:
- zend_compile_static_call(result, ast, type TSRMLS_CC);
+ zend_compile_static_call(result, ast, type);
return;
case ZEND_AST_ZNODE:
*result = *zend_ast_get_znode(ast);
@@ -6317,32 +6312,32 @@ void zend_compile_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /*
}
}
- zend_compile_expr(result, ast TSRMLS_CC);
+ zend_compile_expr(result, ast);
return;
}
}
/* }}} */
-void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type TSRMLS_DC) /* {{{ */
+void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_op *opline;
switch (ast->kind) {
case ZEND_AST_DIM:
- opline = zend_delayed_compile_dim(result, ast, type TSRMLS_CC);
+ opline = zend_delayed_compile_dim(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
return;
case ZEND_AST_PROP:
- opline = zend_delayed_compile_prop(result, ast, type TSRMLS_CC);
+ opline = zend_delayed_compile_prop(result, ast, type);
zend_adjust_for_fetch_type(opline, type);
return;
default:
- zend_compile_var(result, ast, type TSRMLS_CC);
+ zend_compile_var(result, ast, type);
return;
}
}
/* }}} */
-void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
+void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
{
zend_ast *ast = *ast_ptr;
zval result;
@@ -6353,43 +6348,43 @@ void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
switch (ast->kind) {
case ZEND_AST_BINARY_OP:
- zend_eval_const_expr(&ast->child[0] TSRMLS_CC);
- zend_eval_const_expr(&ast->child[1] TSRMLS_CC);
+ zend_eval_const_expr(&ast->child[0]);
+ zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
zend_ct_eval_binary_op(&result, ast->attr,
- zend_ast_get_zval(ast->child[0]), zend_ast_get_zval(ast->child[1]) TSRMLS_CC);
+ zend_ast_get_zval(ast->child[0]), zend_ast_get_zval(ast->child[1]));
break;
case ZEND_AST_GREATER:
case ZEND_AST_GREATER_EQUAL:
- zend_eval_const_expr(&ast->child[0] TSRMLS_CC);
- zend_eval_const_expr(&ast->child[1] TSRMLS_CC);
+ zend_eval_const_expr(&ast->child[0]);
+ zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
zend_ct_eval_greater(&result, ast->kind,
- zend_ast_get_zval(ast->child[0]), zend_ast_get_zval(ast->child[1]) TSRMLS_CC);
+ zend_ast_get_zval(ast->child[0]), zend_ast_get_zval(ast->child[1]));
break;
case ZEND_AST_UNARY_PLUS:
case ZEND_AST_UNARY_MINUS:
- zend_eval_const_expr(&ast->child[0] TSRMLS_CC);
+ zend_eval_const_expr(&ast->child[0]);
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
return;
}
zend_ct_eval_unary_pm(&result, ast->kind,
- zend_ast_get_zval(ast->child[0]) TSRMLS_CC);
+ zend_ast_get_zval(ast->child[0]));
break;
case ZEND_AST_ARRAY:
- if (!zend_try_ct_eval_array(&result, ast TSRMLS_CC)) {
+ if (!zend_try_ct_eval_array(&result, ast)) {
return;
}
break;
case ZEND_AST_MAGIC_CONST:
- if (!zend_try_ct_eval_magic_const(&result, ast TSRMLS_CC)) {
+ if (!zend_try_ct_eval_magic_const(&result, ast)) {
return;
}
break;
@@ -6398,9 +6393,9 @@ void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC) /* {{{ */
zend_ast *name_ast = ast->child[0];
zend_bool is_fully_qualified;
zend_string *resolved_name = zend_resolve_const_name(
- zend_ast_get_str(name_ast), name_ast->attr, &is_fully_qualified TSRMLS_CC);
+ zend_ast_get_str(name_ast), name_ast->attr, &is_fully_qualified);
- if (!zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified TSRMLS_CC)) {
+ if (!zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified)) {
zend_string_release(resolved_name);
return;
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 150d09a692..9b0bfda273 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -113,15 +113,15 @@ typedef union _zend_parser_stack_elem {
zend_ulong num;
} zend_parser_stack_elem;
-void zend_compile_top_stmt(zend_ast *ast TSRMLS_DC);
-void zend_compile_stmt(zend_ast *ast TSRMLS_DC);
-void zend_compile_expr(znode *node, zend_ast *ast TSRMLS_DC);
-void zend_compile_var(znode *node, zend_ast *ast, uint32_t type TSRMLS_DC);
-void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC);
-void zend_const_expr_to_zval(zval *result, zend_ast *ast TSRMLS_DC);
+void zend_compile_top_stmt(zend_ast *ast);
+void zend_compile_stmt(zend_ast *ast);
+void zend_compile_expr(znode *node, zend_ast *ast);
+void zend_compile_var(znode *node, zend_ast *ast, uint32_t type);
+void zend_eval_const_expr(zend_ast **ast_ptr);
+void zend_const_expr_to_zval(zval *result, zend_ast *ast);
-#define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data TSRMLS_DC
-#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data TSRMLS_CC
+#define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data
+#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data
typedef int (*user_opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS);
typedef int (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS);
@@ -597,65 +597,65 @@ struct _zend_execute_data {
BEGIN_EXTERN_C()
-void init_compiler(TSRMLS_D);
-void shutdown_compiler(TSRMLS_D);
-void zend_init_compiler_data_structures(TSRMLS_D);
-void zend_init_compiler_context(TSRMLS_D);
+void init_compiler(void);
+void shutdown_compiler(void);
+void zend_init_compiler_data_structures(void);
+void zend_init_compiler_context(void);
-extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
+extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type);
+extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename);
-ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
-void startup_scanner(TSRMLS_D);
-void shutdown_scanner(TSRMLS_D);
+ZEND_API int lex_scan(zval *zendlval);
+void startup_scanner(void);
+void shutdown_scanner(void);
-ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename TSRMLS_DC);
-ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename TSRMLS_DC);
-ZEND_API zend_string *zend_get_compiled_filename(TSRMLS_D);
-ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
-ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
+ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename);
+ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename);
+ZEND_API zend_string *zend_get_compiled_filename(void);
+ZEND_API int zend_get_compiled_lineno(void);
+ZEND_API size_t zend_get_scanned_file_offset(void);
ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var);
#ifdef ZTS
-const char *zend_get_zendtext(TSRMLS_D);
-int zend_get_zendleng(TSRMLS_D);
+const char *zend_get_zendtext(void);
+int zend_get_zendleng(void);
#endif
-typedef int (*unary_op_type)(zval *, zval * TSRMLS_DC);
-typedef int (*binary_op_type)(zval *, zval *, zval * TSRMLS_DC);
+typedef int (*unary_op_type)(zval *, zval *);
+typedef int (*binary_op_type)(zval *, zval *, zval *);
ZEND_API unary_op_type get_unary_op(int opcode);
ZEND_API binary_op_type get_binary_op(int opcode);
-void zend_stop_lexing(TSRMLS_D);
-void zend_emit_final_return(zval *zv TSRMLS_DC);
+void zend_stop_lexing(void);
+void zend_emit_final_return(zval *zv);
zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right);
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag);
-zend_ast *zend_ast_append_doc_comment(zend_ast *list TSRMLS_DC);
-void zend_handle_encoding_declaration(zend_ast *ast TSRMLS_DC);
+zend_ast *zend_ast_append_doc_comment(zend_ast *list);
+void zend_handle_encoding_declaration(zend_ast *ast);
/* parser-driven code generators */
-void zend_do_free(znode *op1 TSRMLS_DC);
+void zend_do_free(znode *op1);
-ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC);
-ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
-ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
-ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
+ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opline, HashTable *function_table, zend_bool compile_time);
+ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time);
+ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time);
+ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array);
/* Functions for a null terminated pointer list, used for traits parsing and compilation */
-void zend_init_list(void *result, void *item TSRMLS_DC);
-void zend_add_to_list(void *result, void *item TSRMLS_DC);
+void zend_init_list(void *result, void *item);
+void zend_add_to_list(void *result, void *item);
-void zend_do_extended_info(TSRMLS_D);
-void zend_do_extended_fcall_begin(TSRMLS_D);
-void zend_do_extended_fcall_end(TSRMLS_D);
+void zend_do_extended_info(void);
+void zend_do_extended_fcall_begin(void);
+void zend_do_extended_fcall_end(void);
-void zend_verify_namespace(TSRMLS_D);
-void zend_do_end_compilation(TSRMLS_D);
+void zend_verify_namespace(void);
+void zend_do_end_compilation(void);
-void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
-void zend_release_labels(int temporary TSRMLS_DC);
+void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2);
+void zend_release_labels(int temporary);
ZEND_API void function_add_ref(zend_function *function);
@@ -663,22 +663,22 @@ ZEND_API void function_add_ref(zend_function *function);
/* helper functions in zend_language_scanner.l */
-ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
-ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
-ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_count, ...);
-ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
-ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC);
-ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC);
-ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC);
-ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC);
-ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
-ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
+ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type);
+ZEND_API zend_op_array *compile_string(zval *source_string, char *filename);
+ZEND_API zend_op_array *compile_filename(int type, zval *filename);
+ZEND_API int zend_execute_scripts(int type, zval *retval, int file_count, ...);
+ZEND_API int open_file_for_scanning(zend_file_handle *file_handle);
+ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size);
+ZEND_API void destroy_op_array(zend_op_array *op_array);
+ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle);
+ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce);
+ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce);
+ZEND_API void zend_cleanup_internal_classes(void);
ZEND_API void zend_cleanup_op_array_data(zend_op_array *op_array);
-ZEND_API int clean_non_persistent_function_full(zval *zv TSRMLS_DC);
-ZEND_API int clean_non_persistent_class_full(zval *zv TSRMLS_DC);
+ZEND_API int clean_non_persistent_function_full(zval *zv);
+ZEND_API int clean_non_persistent_class_full(zval *zv);
-ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
+ZEND_API void destroy_zend_function(zend_function *function);
ZEND_API void zend_function_dtor(zval *zv);
ZEND_API void destroy_zend_class(zval *zv);
void zend_class_add_ref(zval *zv);
@@ -691,19 +691,19 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
#define ZEND_FUNCTION_DTOR zend_function_dtor
#define ZEND_CLASS_DTOR destroy_zend_class
-zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC);
-void init_op(zend_op *op TSRMLS_DC);
+zend_op *get_next_op(zend_op_array *op_array);
+void init_op(zend_op *op);
int get_next_op_number(zend_op_array *op_array);
-int print_class(zend_class_entry *class_entry TSRMLS_DC);
+int print_class(zend_class_entry *class_entry);
void print_op_array(zend_op_array *op_array, int optimizations);
-ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC);
+ZEND_API int pass_two(zend_op_array *op_array);
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
-ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
-ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC);
-ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
+ZEND_API zend_bool zend_is_compiling(void);
+ZEND_API char *zend_make_compiled_string_description(const char *name);
+ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
-typedef zend_bool (*zend_auto_global_callback)(zend_string *name TSRMLS_DC);
+typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
zend_string *name;
zend_auto_global_callback auto_global_callback;
@@ -711,14 +711,14 @@ typedef struct _zend_auto_global {
zend_bool armed;
} zend_auto_global;
-ZEND_API int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC);
-ZEND_API void zend_activate_auto_globals(TSRMLS_D);
-ZEND_API zend_bool zend_is_auto_global(zend_string *name TSRMLS_DC);
+ZEND_API int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback);
+ZEND_API void zend_activate_auto_globals(void);
+ZEND_API zend_bool zend_is_auto_global(zend_string *name);
ZEND_API size_t zend_dirname(char *path, size_t len);
-int zendlex(zend_parser_stack_elem *elem TSRMLS_DC);
+int zendlex(zend_parser_stack_elem *elem);
-int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
+int zend_add_literal(zend_op_array *op_array, zval *zv);
/* BEGIN: OPCODES */
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 61cc49e5c5..a6f679b445 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -68,21 +68,21 @@ void zend_copy_constants(HashTable *target, HashTable *source)
}
-static int clean_non_persistent_constant(zval *zv TSRMLS_DC)
+static int clean_non_persistent_constant(zval *zv)
{
zend_constant *c = Z_PTR_P(zv);
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE;
}
-static int clean_non_persistent_constant_full(zval *zv TSRMLS_DC)
+static int clean_non_persistent_constant_full(zval *zv)
{
zend_constant *c = Z_PTR_P(zv);
return (c->flags & CONST_PERSISTENT) ? 0 : 1;
}
-static int clean_module_constant(zval *el, void *arg TSRMLS_DC)
+static int clean_module_constant(zval *el, void *arg)
{
zend_constant *c = (zend_constant *)Z_PTR_P(el);
int module_number = *(int *)arg;
@@ -95,13 +95,13 @@ static int clean_module_constant(zval *el, void *arg TSRMLS_DC)
}
-void clean_module_constants(int module_number TSRMLS_DC)
+void clean_module_constants(int module_number)
{
- zend_hash_apply_with_argument(EG(zend_constants), clean_module_constant, (void *) &module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(zend_constants), clean_module_constant, (void *) &module_number);
}
-int zend_startup_constants(TSRMLS_D)
+int zend_startup_constants(void)
{
EG(zend_constants) = (HashTable *) malloc(sizeof(HashTable));
@@ -111,7 +111,7 @@ int zend_startup_constants(TSRMLS_D)
-void zend_register_standard_constants(TSRMLS_D)
+void zend_register_standard_constants(void)
{
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
@@ -144,7 +144,7 @@ void zend_register_standard_constants(TSRMLS_D)
}
-int zend_shutdown_constants(TSRMLS_D)
+int zend_shutdown_constants(void)
{
zend_hash_destroy(EG(zend_constants));
free(EG(zend_constants));
@@ -152,16 +152,16 @@ int zend_shutdown_constants(TSRMLS_D)
}
-void clean_non_persistent_constants(TSRMLS_D)
+void clean_non_persistent_constants(void)
{
if (EG(full_tables_cleanup)) {
- zend_hash_apply(EG(zend_constants), clean_non_persistent_constant_full TSRMLS_CC);
+ zend_hash_apply(EG(zend_constants), clean_non_persistent_constant_full);
} else {
- zend_hash_reverse_apply(EG(zend_constants), clean_non_persistent_constant TSRMLS_CC);
+ zend_hash_reverse_apply(EG(zend_constants), clean_non_persistent_constant);
}
}
-ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number)
{
zend_constant c;
@@ -169,10 +169,10 @@ ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int
c.flags = flags;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
-ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number)
{
zend_constant c;
@@ -180,10 +180,10 @@ ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zen
c.flags = flags;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
-ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number)
{
zend_constant c;
@@ -191,11 +191,11 @@ ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zen
c.flags = flags;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
-ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number)
{
zend_constant c;
@@ -203,11 +203,11 @@ ZEND_API void zend_register_double_constant(const char *name, size_t name_len, d
c.flags = flags;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
-ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_t strlen, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_t strlen, int flags, int module_number)
{
zend_constant c;
@@ -215,16 +215,16 @@ ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len,
c.flags = flags;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
-ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int flags, int module_number TSRMLS_DC)
+ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int flags, int module_number)
{
- zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
+ zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number);
}
-static zend_constant *zend_get_special_constant(const char *name, size_t name_len TSRMLS_DC)
+static zend_constant *zend_get_special_constant(const char *name, size_t name_len)
{
zend_constant *c;
static char haltoff[] = "__COMPILER_HALT_OFFSET__";
@@ -267,7 +267,7 @@ static zend_constant *zend_get_special_constant(const char *name, size_t name_le
zend_string *haltname;
size_t clen;
- cfilename = zend_get_executed_filename(TSRMLS_C);
+ cfilename = zend_get_executed_filename();
clen = strlen(cfilename);
/* check for __COMPILER_HALT_OFFSET__ */
haltname = zend_mangle_property_name(haltoff,
@@ -281,7 +281,7 @@ static zend_constant *zend_get_special_constant(const char *name, size_t name_le
}
-ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len TSRMLS_DC)
+ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
{
zend_constant *c;
ALLOCA_FLAG(use_heap)
@@ -294,7 +294,7 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len TSRMLS_DC
c = NULL;
}
} else {
- c = zend_get_special_constant(name, name_len TSRMLS_CC);
+ c = zend_get_special_constant(name, name_len);
}
free_alloca(lcname, use_heap);
}
@@ -302,7 +302,7 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len TSRMLS_DC
return c ? &c->value : NULL;
}
-ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC)
+ZEND_API zval *zend_get_constant(zend_string *name)
{
zend_constant *c;
ALLOCA_FLAG(use_heap)
@@ -315,7 +315,7 @@ ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC)
c = NULL;
}
} else {
- c = zend_get_special_constant(name->val, name->len TSRMLS_CC);
+ c = zend_get_special_constant(name->val, name->len);
}
free_alloca(lcname, use_heap);
}
@@ -323,7 +323,7 @@ ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC)
return c ? &c->value : NULL;
}
-ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, zend_ulong flags TSRMLS_DC)
+ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, zend_ulong flags)
{
zend_constant *c;
const char *colon;
@@ -383,7 +383,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
}
} else {
- ce = zend_fetch_class(class_name, flags TSRMLS_CC);
+ ce = zend_fetch_class(class_name, flags);
}
free_alloca(lcname, use_heap);
if (ce) {
@@ -399,7 +399,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
zend_string_release(class_name);
zend_string_free(constant_name);
if (ret_constant && Z_CONSTANT_P(ret_constant)) {
- zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
+ zval_update_constant_ex(ret_constant, 1, ce);
}
return ret_constant;
}
@@ -437,19 +437,19 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
}
/* name requires runtime resolution, need to check non-namespaced name */
if ((flags & IS_CONSTANT_UNQUALIFIED) != 0) {
- return zend_get_constant_str(constant_name, const_name_len TSRMLS_CC);
+ return zend_get_constant_str(constant_name, const_name_len);
}
return NULL;
}
if (cname) {
- return zend_get_constant(cname TSRMLS_CC);
+ return zend_get_constant(cname);
} else {
- return zend_get_constant_str(name, name_len TSRMLS_CC);
+ return zend_get_constant_str(name, name_len);
}
}
-zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags TSRMLS_DC)
+zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags)
{
zend_constant *c;
@@ -465,12 +465,12 @@ zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags TSRMLS_
(c->flags & CONST_CS) != 0) {
key--;
- c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key) TSRMLS_CC);
+ c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key));
}
}
} else {
key--;
- c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key) TSRMLS_CC);
+ c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key));
}
}
}
@@ -490,7 +490,7 @@ static void* zend_hash_add_constant(HashTable *ht, zend_string *key, zend_consta
return ret;
}
-ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
+ZEND_API int zend_register_constant(zend_constant *c)
{
zend_string *lowercase_name = NULL;
zend_string *name;
@@ -503,14 +503,14 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
if (!(c->flags & CONST_CS)) {
lowercase_name = zend_string_alloc(c->name->len, c->flags & CONST_PERSISTENT);
zend_str_tolower_copy(lowercase_name->val, c->name->val, c->name->len);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ lowercase_name = zend_new_interned_string(lowercase_name);
name = lowercase_name;
} else {
char *slash = strrchr(c->name->val, '\\');
if (slash) {
lowercase_name = zend_string_init(c->name->val, c->name->len, c->flags & CONST_PERSISTENT);
zend_str_tolower(lowercase_name->val, slash - c->name->val);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ lowercase_name = zend_new_interned_string(lowercase_name);
name = lowercase_name;
} else {
name = c->name;
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 058e0135c7..755eb91ff9 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -37,46 +37,46 @@ typedef struct _zend_constant {
int module_number;
} zend_constant;
-#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number TSRMLS_CC)
-#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number TSRMLS_CC)
-#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number TSRMLS_CC)
-#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), module_number TSRMLS_CC)
-#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number TSRMLS_CC)
-#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number)
+#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number)
+#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
+#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), module_number)
+#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
+#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number)
-#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (bval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (lval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (dval), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number TSRMLS_CC)
-#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (len), (flags), module_number TSRMLS_CC)
+#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (flags), module_number)
+#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (bval), (flags), module_number)
+#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (lval), (flags), module_number)
+#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (dval), (flags), module_number)
+#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (flags), module_number)
+#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, (str), (len), (flags), module_number)
-#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0 TSRMLS_CC)
-#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0 TSRMLS_CC)
-#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), 0 TSRMLS_CC)
-#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), 0 TSRMLS_CC)
-#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), 0 TSRMLS_CC)
-#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), 0 TSRMLS_CC)
+#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0)
+#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0)
+#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), 0)
+#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), 0)
+#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), 0)
+#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), 0)
BEGIN_EXTERN_C()
-void clean_module_constants(int module_number TSRMLS_DC);
+void clean_module_constants(int module_number);
void free_zend_constant(zval *zv);
-int zend_startup_constants(TSRMLS_D);
-int zend_shutdown_constants(TSRMLS_D);
-void zend_register_standard_constants(TSRMLS_D);
-void clean_non_persistent_constants(TSRMLS_D);
-ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC);
-ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len TSRMLS_DC);
-ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, zend_ulong flags TSRMLS_DC);
-ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int flags, int module_number TSRMLS_DC);
-ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_t strlen, int flags, int module_number TSRMLS_DC);
-ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC);
+int zend_startup_constants(void);
+int zend_shutdown_constants(void);
+void zend_register_standard_constants(void);
+void clean_non_persistent_constants(void);
+ZEND_API zval *zend_get_constant(zend_string *name);
+ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len);
+ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, zend_ulong flags);
+ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int flags, int module_number);
+ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_number);
+ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int flags, int module_number);
+ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int flags, int module_number);
+ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int flags, int module_number);
+ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_t strlen, int flags, int module_number);
+ZEND_API int zend_register_constant(zend_constant *c);
void zend_copy_constants(HashTable *target, HashTable *sourc);
-zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags TSRMLS_DC);
+zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags);
END_EXTERN_C()
#define ZEND_CONSTANT_DTOR free_zend_constant
diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c
index 40b28f7a23..3326b13ddf 100644
--- a/Zend/zend_default_classes.c
+++ b/Zend/zend_default_classes.c
@@ -28,13 +28,13 @@
#include "zend_generators.h"
-ZEND_API void zend_register_default_classes(TSRMLS_D)
+ZEND_API void zend_register_default_classes(void)
{
- zend_register_interfaces(TSRMLS_C);
- zend_register_default_exception(TSRMLS_C);
- zend_register_iterator_wrapper(TSRMLS_C);
- zend_register_closure_ce(TSRMLS_C);
- zend_register_generator_ce(TSRMLS_C);
+ zend_register_interfaces();
+ zend_register_default_exception();
+ zend_register_iterator_wrapper();
+ zend_register_closure_ce();
+ zend_register_generator_ce();
}
/*
diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c
index 285f6c044e..a4682477c3 100644
--- a/Zend/zend_dtrace.c
+++ b/Zend/zend_dtrace.c
@@ -24,7 +24,7 @@
#ifdef HAVE_DTRACE
/* PHP DTrace probes {{{ */
-static inline const char *dtrace_get_executed_filename(TSRMLS_D)
+static inline const char *dtrace_get_executed_filename(void)
{
zend_execute_data *ex = EG(current_execute_data);
@@ -34,22 +34,22 @@ static inline const char *dtrace_get_executed_filename(TSRMLS_D)
if (ex) {
return ex->func->op_array.filename->val;
} else {
- return zend_get_executed_filename(TSRMLS_C);
+ return zend_get_executed_filename();
}
}
-ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type)
{
zend_op_array *res;
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
- res = compile_file(file_handle, type TSRMLS_CC);
+ res = compile_file(file_handle, type);
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
return res;
}
/* We wrap the execute function to have fire the execute-entry/return and function-entry/return probes */
-ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
+ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data)
{
int lineno;
const char *scope, *filename, *funcname, *classname;
@@ -58,13 +58,13 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
/* we need filename and lineno for both execute and function probes */
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()
|| DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
- filename = dtrace_get_executed_filename(TSRMLS_C);
- lineno = zend_get_executed_lineno(TSRMLS_C);
+ filename = dtrace_get_executed_filename();
+ lineno = zend_get_executed_lineno();
}
if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
- classname = get_active_class_name(&scope TSRMLS_CC);
- funcname = get_active_function_name(TSRMLS_C);
+ classname = get_active_class_name(&scope);
+ funcname = get_active_function_name();
}
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
@@ -75,7 +75,7 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
}
- execute_ex(execute_data TSRMLS_CC);
+ execute_ex(execute_data);
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
@@ -86,20 +86,20 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
}
}
-ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
+ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value)
{
int lineno;
const char *filename;
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
- filename = dtrace_get_executed_filename(TSRMLS_C);
- lineno = zend_get_executed_lineno(TSRMLS_C);
+ filename = dtrace_get_executed_filename();
+ lineno = zend_get_executed_lineno();
}
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
}
- execute_internal(execute_data, return_value TSRMLS_CC);
+ execute_internal(execute_data, return_value);
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
diff --git a/Zend/zend_dtrace.h b/Zend/zend_dtrace.h
index 6b1c8413e0..17b5b538b6 100644
--- a/Zend/zend_dtrace.h
+++ b/Zend/zend_dtrace.h
@@ -30,13 +30,13 @@ extern "C" {
#endif
#ifdef HAVE_DTRACE
-ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC);
-ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
+ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type);
+ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array);
+ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data, zval *return_value);
-ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC);
-ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
+ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type);
+ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data);
+ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value);
#include <zend_dtrace_gen.h>
#endif /* HAVE_DTRACE */
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 0d5fc53da8..f5e6d92308 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -33,9 +33,9 @@
static zend_class_entry *default_exception_ce;
static zend_class_entry *error_exception_ce;
static zend_object_handlers default_exception_handlers;
-ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
+ZEND_API void (*zend_throw_exception_hook)(zval *ex);
-void zend_exception_set_previous(zend_object *exception, zend_object *add_previous TSRMLS_DC)
+void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)
{
zval tmp, *previous, zv, *pzv;
@@ -43,16 +43,16 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo
return;
}
ZVAL_OBJ(&tmp, add_previous);
- if (!instanceof_function(Z_OBJCE(tmp), default_exception_ce TSRMLS_CC)) {
+ if (!instanceof_function(Z_OBJCE(tmp), default_exception_ce)) {
zend_error(E_ERROR, "Cannot set non exception as previous exception");
return;
}
ZVAL_OBJ(&zv, exception);
pzv = &zv;
do {
- previous = zend_read_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
+ previous = zend_read_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, 1);
if (Z_TYPE_P(previous) == IS_NULL) {
- zend_update_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, &tmp TSRMLS_CC);
+ zend_update_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, &tmp);
GC_REFCOUNT(add_previous)--;
return;
}
@@ -60,10 +60,10 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo
} while (pzv && Z_OBJ_P(pzv) != add_previous);
}
-void zend_exception_save(TSRMLS_D) /* {{{ */
+void zend_exception_save(void) /* {{{ */
{
if (EG(prev_exception)) {
- zend_exception_set_previous(EG(exception), EG(prev_exception) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), EG(prev_exception));
}
if (EG(exception)) {
EG(prev_exception) = EG(exception);
@@ -72,11 +72,11 @@ void zend_exception_save(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_exception_restore(TSRMLS_D) /* {{{ */
+void zend_exception_restore(void) /* {{{ */
{
if (EG(prev_exception)) {
if (EG(exception)) {
- zend_exception_set_previous(EG(exception), EG(prev_exception) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), EG(prev_exception));
} else {
EG(exception) = EG(prev_exception);
}
@@ -85,7 +85,7 @@ void zend_exception_restore(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
+ZEND_API void zend_throw_exception_internal(zval *exception) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
@@ -99,7 +99,7 @@ ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
if (exception != NULL) {
zend_object *previous = EG(exception);
- zend_exception_set_previous(Z_OBJ_P(exception), EG(exception) TSRMLS_CC);
+ zend_exception_set_previous(Z_OBJ_P(exception), EG(exception));
EG(exception) = Z_OBJ_P(exception);
if (previous) {
return;
@@ -107,13 +107,13 @@ ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
}
if (!EG(current_execute_data)) {
if(EG(exception)) {
- zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR);
}
zend_error(E_ERROR, "Exception thrown without a stack frame");
}
if (zend_throw_exception_hook) {
- zend_throw_exception_hook(exception TSRMLS_CC);
+ zend_throw_exception_hook(exception);
}
if (!EG(current_execute_data)->func ||
@@ -127,7 +127,7 @@ ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API void zend_clear_exception(TSRMLS_D) /* {{{ */
+ZEND_API void zend_clear_exception(void) /* {{{ */
{
if (EG(prev_exception)) {
@@ -146,37 +146,37 @@ ZEND_API void zend_clear_exception(TSRMLS_D) /* {{{ */
}
/* }}} */
-static zend_object *zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces TSRMLS_DC) /* {{{ */
+static zend_object *zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces) /* {{{ */
{
zval obj;
zend_object *object;
zval trace;
- Z_OBJ(obj) = object = zend_objects_new(class_type TSRMLS_CC);
+ Z_OBJ(obj) = object = zend_objects_new(class_type);
Z_OBJ_HT(obj) = &default_exception_handlers;
object_properties_init(object, class_type);
- zend_fetch_debug_backtrace(&trace, skip_top_traces, 0, 0 TSRMLS_CC);
+ zend_fetch_debug_backtrace(&trace, skip_top_traces, 0, 0);
Z_SET_REFCOUNT(trace, 0);
- zend_update_property_string(default_exception_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
- zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
- zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, &trace TSRMLS_CC);
+ zend_update_property_string(default_exception_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename());
+ zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno());
+ zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, &trace);
return object;
}
/* }}} */
-static zend_object *zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *zend_default_exception_new(zend_class_entry *class_type) /* {{{ */
{
- return zend_default_exception_new_ex(class_type, 0 TSRMLS_CC);
+ return zend_default_exception_new_ex(class_type, 0);
}
/* }}} */
-static zend_object *zend_error_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{{ */
{
- return zend_default_exception_new_ex(class_type, 2 TSRMLS_CC);
+ return zend_default_exception_new_ex(class_type, 2);
}
/* }}} */
@@ -185,7 +185,7 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type TSRMLS
ZEND_METHOD(exception, __clone)
{
/* Should never be executable */
- zend_throw_exception(NULL, "Cannot clone object using __clone()", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone object using __clone()", 0);
}
/* }}} */
@@ -198,22 +198,22 @@ ZEND_METHOD(exception, __construct)
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|SlO!", &message, &code, &previous, default_exception_ce) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message, &code, &previous, default_exception_ce) == FAILURE) {
zend_error(E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])");
}
object = getThis();
if (message) {
- zend_update_property_str(default_exception_ce, object, "message", sizeof("message")-1, message TSRMLS_CC);
+ zend_update_property_str(default_exception_ce, object, "message", sizeof("message")-1, message);
}
if (code) {
- zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code);
}
if (previous) {
- zend_update_property(default_exception_ce, object, "previous", sizeof("previous")-1, previous TSRMLS_CC);
+ zend_update_property(default_exception_ce, object, "previous", sizeof("previous")-1, previous);
}
}
/* }}} */
@@ -228,32 +228,32 @@ ZEND_METHOD(error_exception, __construct)
int argc = ZEND_NUM_ARGS();
size_t message_len, filename_len;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, default_exception_ce) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, default_exception_ce) == FAILURE) {
zend_error(E_ERROR, "Wrong parameters for ErrorException([string $exception [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Exception $previous = NULL]]]]]])");
}
object = getThis();
if (message) {
- zend_update_property_string(default_exception_ce, object, "message", sizeof("message")-1, message TSRMLS_CC);
+ zend_update_property_string(default_exception_ce, object, "message", sizeof("message")-1, message);
}
if (code) {
- zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, object, "code", sizeof("code")-1, code);
}
if (previous) {
- zend_update_property(default_exception_ce, object, "previous", sizeof("previous")-1, previous TSRMLS_CC);
+ zend_update_property(default_exception_ce, object, "previous", sizeof("previous")-1, previous);
}
- zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity);
if (argc >= 4) {
- zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename TSRMLS_CC);
+ zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename);
if (argc < 5) {
lineno = 0; /* invalidate lineno */
}
- zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, lineno TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, lineno);
}
}
/* }}} */
@@ -264,9 +264,9 @@ ZEND_METHOD(error_exception, __construct)
}
#define GET_PROPERTY(object, name) \
- zend_read_property(default_exception_ce, (object), name, sizeof(name) - 1, 0 TSRMLS_CC)
+ zend_read_property(default_exception_ce, (object), name, sizeof(name) - 1, 0)
#define GET_PROPERTY_SILENT(object, name) \
- zend_read_property(default_exception_ce, (object), name, sizeof(name) - 1, 1 TSRMLS_CC)
+ zend_read_property(default_exception_ce, (object), name, sizeof(name) - 1, 1)
/* {{{ proto string Exception::getFile()
Get the file in which the exception occurred */
@@ -398,7 +398,7 @@ static void smart_str_append_escaped(smart_str *str, const char *s, size_t l) {
}
}
-static void _build_trace_args(zval *arg, smart_str *str TSRMLS_DC) /* {{{ */
+static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
{
/* the trivial way would be to do
* convert_to_string_ex(arg);
@@ -456,7 +456,7 @@ static void _build_trace_args(zval *arg, smart_str *str TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num TSRMLS_DC) /* {{{ */
+static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /* {{{ */
{
zval *file, *tmp;
@@ -501,7 +501,7 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num TSRM
zval *arg;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(tmp), arg) {
- _build_trace_args(arg, str TSRMLS_CC);
+ _build_trace_args(arg, str);
} ZEND_HASH_FOREACH_END();
if (last_len != str->s->len) {
@@ -526,14 +526,14 @@ ZEND_METHOD(exception, getTraceAsString)
DEFAULT_0_PARAMS;
- trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
+ trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1);
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) {
if (Z_TYPE_P(frame) != IS_ARRAY) {
zend_error(E_WARNING, "Expected array for frame %pu", index);
continue;
}
- _build_trace_string(&str, Z_ARRVAL_P(frame), num++ TSRMLS_CC);
+ _build_trace_string(&str, Z_ARRVAL_P(frame), num++);
} ZEND_HASH_FOREACH_END();
smart_str_appendc(&str, '#');
@@ -610,7 +610,7 @@ ZEND_METHOD(exception, __toString)
fci.params = NULL;
fci.no_separation = 1;
- zend_call_function(&fci, NULL TSRMLS_CC);
+ zend_call_function(&fci, NULL);
if (Z_TYPE(trace) != IS_STRING) {
zval_ptr_dtor(&trace);
@@ -642,7 +642,7 @@ ZEND_METHOD(exception, __toString)
/* We store the result in the private property string so we can access
* the result in uncaught exception handlers without memleaks. */
- zend_update_property_str(default_exception_ce, getThis(), "string", sizeof("string")-1, str TSRMLS_CC);
+ zend_update_property_str(default_exception_ce, getThis(), "string", sizeof("string")-1, str);
RETURN_STR(str);
}
@@ -694,49 +694,49 @@ static const zend_function_entry error_exception_functions[] = {
};
/* }}} */
-void zend_register_default_exception(TSRMLS_D) /* {{{ */
+void zend_register_default_exception(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
- default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ default_exception_ce = zend_register_internal_class(&ce);
default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
- zend_declare_property_string(default_exception_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_string(default_exception_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE TSRMLS_CC);
- zend_declare_property_long(default_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_null(default_exception_ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_null(default_exception_ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_null(default_exception_ce, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE TSRMLS_CC);
- zend_declare_property_null(default_exception_ce, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE TSRMLS_CC);
+ zend_declare_property_string(default_exception_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED);
+ zend_declare_property_string(default_exception_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE);
+ zend_declare_property_long(default_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(default_exception_ce, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(default_exception_ce, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(default_exception_ce, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
+ zend_declare_property_null(default_exception_ce, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
- error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce TSRMLS_CC);
+ error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce);
error_exception_ce->create_object = zend_error_exception_new;
- zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
+ zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED);
}
/* }}} */
-ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D) /* {{{ */
+ZEND_API zend_class_entry *zend_exception_get_default(void) /* {{{ */
{
return default_exception_ce;
}
/* }}} */
-ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */
+ZEND_API zend_class_entry *zend_get_error_exception(void) /* {{{ */
{
return error_exception_ce;
}
/* }}} */
-ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code TSRMLS_DC) /* {{{ */
+ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code) /* {{{ */
{
zval ex;
if (exception_ce) {
- if (!instanceof_function(exception_ce, default_exception_ce TSRMLS_CC)) {
+ if (!instanceof_function(exception_ce, default_exception_ce)) {
zend_error(E_NOTICE, "Exceptions must be derived from the Exception base class");
exception_ce = default_exception_ce;
}
@@ -747,18 +747,18 @@ ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const
if (message) {
- zend_update_property_string(default_exception_ce, &ex, "message", sizeof("message")-1, message TSRMLS_CC);
+ zend_update_property_string(default_exception_ce, &ex, "message", sizeof("message")-1, message);
}
if (code) {
- zend_update_property_long(default_exception_ce, &ex, "code", sizeof("code")-1, code TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, &ex, "code", sizeof("code")-1, code);
}
- zend_throw_exception_internal(&ex TSRMLS_CC);
+ zend_throw_exception_internal(&ex);
return Z_OBJ(ex);
}
/* }}} */
-ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code TSRMLS_DC, const char *format, ...) /* {{{ */
+ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) /* {{{ */
{
va_list arg;
char *message;
@@ -767,18 +767,18 @@ ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, ze
va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
- obj = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
+ obj = zend_throw_exception(exception_ce, message, code);
efree(message);
return obj;
}
/* }}} */
-ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity TSRMLS_DC) /* {{{ */
+ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity) /* {{{ */
{
zval ex;
- zend_object *obj = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
+ zend_object *obj = zend_throw_exception(exception_ce, message, code);
ZVAL_OBJ(&ex, obj);
- zend_update_property_long(default_exception_ce, &ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
+ zend_update_property_long(default_exception_ce, &ex, "severity", sizeof("severity")-1, severity);
return obj;
}
/* }}} */
@@ -794,14 +794,14 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
/* }}} */
/* This function doesn't return if it uses E_ERROR */
-ZEND_API void zend_exception_error(zend_object *ex, int severity TSRMLS_DC) /* {{{ */
+ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
{
zval exception;
zend_class_entry *ce_exception;
ZVAL_OBJ(&exception, ex);
ce_exception = Z_OBJCE(exception);
- if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
+ if (instanceof_function(ce_exception, default_exception_ce)) {
zval tmp;
zend_string *str, *file = NULL;
zend_long line = 0;
@@ -813,7 +813,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity TSRMLS_DC) /* {
if (Z_TYPE(tmp) != IS_STRING) {
zend_error(E_WARNING, "%s::__toString() must return a string", ce_exception->name->val);
} else {
- zend_update_property_string(default_exception_ce, &exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name->val : Z_STRVAL(tmp) TSRMLS_CC);
+ zend_update_property_string(default_exception_ce, &exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name->val : Z_STRVAL(tmp));
}
}
zval_ptr_dtor(&tmp);
@@ -823,7 +823,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity TSRMLS_DC) /* {
ZVAL_OBJ(&zv, EG(exception));
/* do the best we can to inform about the inner exception */
- if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
+ if (instanceof_function(ce_exception, default_exception_ce)) {
file = zval_get_string(GET_PROPERTY_SILENT(&zv, "file"));
line = zval_get_long(GET_PROPERTY_SILENT(&zv, "line"));
}
@@ -852,7 +852,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity TSRMLS_DC) /* {
}
/* }}} */
-ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC) /* {{{ */
+ZEND_API void zend_throw_exception_object(zval *exception) /* {{{ */
{
zend_class_entry *exception_ce;
@@ -862,10 +862,10 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC) /* {{{ */
exception_ce = Z_OBJCE_P(exception);
- if (!exception_ce || !instanceof_function(exception_ce, default_exception_ce TSRMLS_CC)) {
+ if (!exception_ce || !instanceof_function(exception_ce, default_exception_ce)) {
zend_error(E_ERROR, "Exceptions must be valid objects derived from the Exception base class");
}
- zend_throw_exception_internal(exception TSRMLS_CC);
+ zend_throw_exception_internal(exception);
}
/* }}} */
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h
index 3118ce1053..bdbee23995 100644
--- a/Zend/zend_exceptions.h
+++ b/Zend/zend_exceptions.h
@@ -26,31 +26,31 @@
BEGIN_EXTERN_C()
-ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *add_previous TSRMLS_DC);
-ZEND_API void zend_exception_save(TSRMLS_D);
-ZEND_API void zend_exception_restore(TSRMLS_D);
+ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *add_previous);
+ZEND_API void zend_exception_save(void);
+ZEND_API void zend_exception_restore(void);
-ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC);
+ZEND_API void zend_throw_exception_internal(zval *exception);
-void zend_register_default_exception(TSRMLS_D);
+void zend_register_default_exception(void);
-ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
-ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
-ZEND_API void zend_register_default_classes(TSRMLS_D);
+ZEND_API zend_class_entry *zend_exception_get_default(void);
+ZEND_API zend_class_entry *zend_get_error_exception(void);
+ZEND_API void zend_register_default_classes(void);
/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
-ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code TSRMLS_DC);
-ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code TSRMLS_DC, const char *format, ...);
-ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
-ZEND_API void zend_clear_exception(TSRMLS_D);
+ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
+ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
+ZEND_API void zend_throw_exception_object(zval *exception);
+ZEND_API void zend_clear_exception(void);
-ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity TSRMLS_DC);
+ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity);
-extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
+extern ZEND_API void (*zend_throw_exception_hook)(zval *ex);
/* show an exception using zend_error(severity,...), severity should be E_ERROR */
-ZEND_API void zend_exception_error(zend_object *exception, int severity TSRMLS_DC);
+ZEND_API void zend_exception_error(zend_object *exception, int severity);
/* do not export, in php it's available thru spprintf directly */
size_t zend_spprintf(char **message, size_t max_len, const char *format, ...);
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 0a156f84a4..f7dc69c099 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -51,17 +51,17 @@
typedef int (*incdec_t)(zval *);
-#define get_zval_ptr(op_type, node, ex, should_free, type) _get_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
-#define get_zval_ptr_deref(op_type, node, ex, should_free, type) _get_zval_ptr_deref(op_type, node, ex, should_free, type TSRMLS_CC)
-#define get_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
-#define get_zval_ptr_ptr_undef(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
-#define get_obj_zval_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
-#define get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
+#define get_zval_ptr(op_type, node, ex, should_free, type) _get_zval_ptr(op_type, node, ex, should_free, type)
+#define get_zval_ptr_deref(op_type, node, ex, should_free, type) _get_zval_ptr_deref(op_type, node, ex, should_free, type)
+#define get_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type)
+#define get_zval_ptr_ptr_undef(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type)
+#define get_obj_zval_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr(op_type, node, ex, should_free, type)
+#define get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type)
/* Prototypes */
-static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
-static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
-static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
+static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array);
+static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array);
+static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array);
#define RETURN_VALUE_USED(opline) (!((opline)->result_type & EXT_TYPE_UNUSED))
@@ -83,7 +83,7 @@ static const zend_internal_function zend_pass_function = {
};
#undef zval_ptr_dtor
-#define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC TSRMLS_CC)
+#define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC)
#define PZVAL_LOCK(z) if (Z_REFCOUNTED_P(z)) Z_ADDREF_P((z))
#define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
@@ -142,7 +142,7 @@ static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend
return page;
}
-ZEND_API void zend_vm_stack_init(TSRMLS_D)
+ZEND_API void zend_vm_stack_init(void)
{
EG(vm_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE, NULL);
EG(vm_stack)->top++;
@@ -150,7 +150,7 @@ ZEND_API void zend_vm_stack_init(TSRMLS_D)
EG(vm_stack_end) = EG(vm_stack)->end;
}
-ZEND_API void zend_vm_stack_destroy(TSRMLS_D)
+ZEND_API void zend_vm_stack_destroy(void)
{
zend_vm_stack stack = EG(vm_stack);
@@ -161,7 +161,7 @@ ZEND_API void zend_vm_stack_destroy(TSRMLS_D)
}
}
-ZEND_API void* zend_vm_stack_extend(size_t size TSRMLS_DC)
+ZEND_API void* zend_vm_stack_extend(size_t size)
{
zend_vm_stack stack;
void *ptr;
@@ -210,7 +210,7 @@ static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend
return ret;
}
-static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data)
{
zend_string *cv;
@@ -234,7 +234,7 @@ static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int
return ptr;
}
-static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var, const zend_execute_data *execute_data)
{
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
@@ -242,7 +242,7 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t
return &EG(uninitialized_zval);
}
-static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var, const zend_execute_data *execute_data)
{
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
@@ -250,7 +250,7 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint
return &EG(uninitialized_zval);
}
-static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data)
{
zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
@@ -259,83 +259,83 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_
return ptr;
}
-static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var, const zend_execute_data *execute_data)
{
ZVAL_NULL(ptr);
return ptr;
}
-static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execute_data, uint32_t var, int type)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup(ret, var, type, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup(ret, var, type, execute_data);
}
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *execute_data, uint32_t var, int type)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup(ret, var, type, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup(ret, var, type, execute_data);
}
ZVAL_DEREF(ret);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data);
}
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_R(ret, var, execute_data);
}
ZVAL_DEREF(ret);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data);
}
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_UNSET(ret, var, execute_data);
}
ZVAL_DEREF(ret);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
@@ -343,54 +343,54 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_exec
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data);
}
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
- return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_RW(ret, var, execute_data);
}
ZVAL_DEREF(ret);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (Z_TYPE_P(ret) == IS_UNDEF) {
- return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data);
}
return ret;
}
-static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var)
{
return EX_VAR(var);
}
-static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var)
{
zval *ret = EX_VAR(var);
if (Z_TYPE_P(ret) == IS_UNDEF) {
- return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data TSRMLS_CC);
+ return _get_zval_cv_lookup_BP_VAR_W(ret, var, execute_data);
}
ZVAL_DEREF(ret);
return ret;
}
-static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -405,12 +405,12 @@ static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, const
return EX_CONSTANT(node);
} else {
ZEND_ASSERT(op_type == IS_CV);
- return _get_zval_ptr_cv(execute_data, node.var, type TSRMLS_CC);
+ return _get_zval_ptr_cv(execute_data, node.var, type);
}
}
}
-static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -425,7 +425,7 @@ static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node,
return EX_CONSTANT(node);
} else {
ZEND_ASSERT(op_type == IS_CV);
- return _get_zval_ptr_cv_deref(execute_data, node.var, type TSRMLS_CC);
+ return _get_zval_ptr_cv_deref(execute_data, node.var, type);
}
}
}
@@ -447,11 +447,11 @@ static zend_always_inline zval *_get_zval_ptr_ptr_var(uint32_t var, const zend_e
return ret;
}
-static inline zval *_get_zval_ptr_ptr(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_zval_ptr_ptr(int op_type, znode_op node, const zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
if (op_type == IS_CV) {
*should_free = NULL;
- return _get_zval_ptr_cv(execute_data, node.var, type TSRMLS_CC);
+ return _get_zval_ptr_cv(execute_data, node.var, type);
} else /* if (op_type == IS_VAR) */ {
ZEND_ASSERT(op_type == IS_VAR);
return _get_zval_ptr_ptr_var(node.var, execute_data, should_free);
@@ -468,7 +468,7 @@ static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *exec
}
}
-static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
if (op_type == IS_UNUSED) {
if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
@@ -481,7 +481,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_execute_dat
return get_zval_ptr(op_type, op, execute_data, should_free, type);
}
-static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
if (op_type == IS_UNUSED) {
if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
@@ -494,7 +494,7 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execu
return get_zval_ptr_ptr(op_type, node, execute_data, should_free, type);
}
-static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr TSRMLS_DC)
+static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr)
{
if (EXPECTED(variable_ptr != value_ptr)) {
zend_reference *ref;
@@ -510,7 +510,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
}
/* this should modify object only if it's empty */
-static inline int make_real_object(zval **object_ptr TSRMLS_DC)
+static inline int make_real_object(zval **object_ptr)
{
zval *object = *object_ptr;
@@ -529,13 +529,13 @@ static inline int make_real_object(zval **object_ptr TSRMLS_DC)
return 1;
}
-ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC)
+ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce)
{
zend_string *key;
ALLOCA_FLAG(use_heap);
STR_ALLOCA_INIT(key, cur_arg_info->class_name, strlen(cur_arg_info->class_name), use_heap);
- *pce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
+ *pce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
STR_ALLOCA_FREE(key, use_heap);
*class_name = (*pce) ? (*pce)->name->val : (char*)cur_arg_info->class_name;
@@ -546,9 +546,9 @@ ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info
}
}
-ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC)
+ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce)
{
- *pce = zend_fetch_class(cur_arg_info->class_name, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
+ *pce = zend_fetch_class(cur_arg_info->class_name, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
*class_name = (*pce) ? (*pce)->name->val : cur_arg_info->class_name->val;
if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
@@ -558,7 +558,7 @@ ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ch
}
}
-ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC)
+ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname = zf->common.function_name->val;
@@ -594,13 +594,13 @@ ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uin
}
}
-static int is_null_constant(zval *default_value TSRMLS_DC)
+static int is_null_constant(zval *default_value)
{
if (Z_CONSTANT_P(default_value)) {
zval constant;
ZVAL_COPY_VALUE(&constant, default_value);
- zval_update_constant(&constant, 0 TSRMLS_CC);
+ zval_update_constant(&constant, 0);
if (Z_TYPE(constant) == IS_NULL) {
return 1;
}
@@ -609,7 +609,7 @@ static int is_null_constant(zval *default_value TSRMLS_DC)
return 0;
}
-static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg TSRMLS_DC)
+static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg)
{
zend_internal_arg_info *cur_arg_info;
char *need_msg;
@@ -632,23 +632,23 @@ static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, z
ZVAL_DEREF(arg);
if (Z_TYPE_P(arg) == IS_OBJECT) {
- need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce TSRMLS_CC);
- if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
+ need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
+ if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce)) {
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg);
}
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
- need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce TSRMLS_CC);
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg);
}
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
ZVAL_DEREF(arg);
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg);
}
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg);
}
#if ZEND_DEBUG
} else {
@@ -658,7 +658,7 @@ static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, z
}
}
-static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value TSRMLS_DC)
+static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -681,23 +681,23 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg,
ZVAL_DEREF(arg);
if (Z_TYPE_P(arg) == IS_OBJECT) {
- need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
- if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce);
+ if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce)) {
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg);
}
- } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
- need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value)))) {
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg);
}
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
ZVAL_DEREF(arg);
- if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value))))) {
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg);
}
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value))))) {
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg);
}
#if ZEND_DEBUG
} else {
@@ -707,7 +707,7 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg,
}
}
-static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_num TSRMLS_DC)
+static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_num)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -728,14 +728,14 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n
if (cur_arg_info->class_name) {
char *class_name;
- need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "none", "", NULL TSRMLS_CC);
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "none", "", NULL);
return 0;
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "", NULL TSRMLS_CC);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "", NULL);
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "", NULL TSRMLS_CC);
+ zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "", NULL);
#if ZEND_DEBUG
} else {
zend_error(E_ERROR, "Unknown typehint");
@@ -746,10 +746,10 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n
return 1;
}
-static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num TSRMLS_DC)
+static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num)
{
if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
- zend_verify_missing_arg_type(EX(func), arg_num TSRMLS_CC)) {
+ zend_verify_missing_arg_type(EX(func), arg_num)) {
const char *class_name = EX(func)->common.scope ? EX(func)->common.scope->name->val : "";
const char *space = EX(func)->common.scope ? "::" : "";
const char *func_name = EX(func)->common.function_name ? EX(func)->common.function_name->val : "main";
@@ -763,7 +763,7 @@ static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t ar
}
}
-static zend_always_inline void zend_assign_to_object(zval *retval, zval *object, uint32_t object_op_type, zval *property_name, uint32_t property_op_type, int value_type, znode_op value_op, const zend_execute_data *execute_data, void **cache_slot TSRMLS_DC)
+static zend_always_inline void zend_assign_to_object(zval *retval, zval *object, uint32_t object_op_type, zval *property_name, uint32_t property_op_type, int value_type, znode_op value_op, const zend_execute_data *execute_data, void **cache_slot)
{
zend_free_op free_value;
zval *value = get_zval_ptr_deref(value_type, value_op, execute_data, &free_value, BP_VAR_R);
@@ -824,7 +824,7 @@ static zend_always_inline void zend_assign_to_object(zval *retval, zval *object,
property = OBJ_PROP(zobj, prop_info->offset);
if (Z_TYPE_P(property) != IS_UNDEF) {
fast_assign:
- value = zend_assign_to_variable(property, value, value_type TSRMLS_CC);
+ value = zend_assign_to_variable(property, value, value_type);
if (retval && !EG(exception)) {
ZVAL_COPY(retval, value);
}
@@ -889,7 +889,7 @@ fast_assign:
Z_ADDREF_P(value);
}
- Z_OBJ_HT_P(object)->write_property(object, property_name, value, cache_slot TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property_name, value, cache_slot);
if (retval && !EG(exception)) {
ZVAL_COPY(retval, value);
@@ -900,7 +900,7 @@ fast_assign:
}
}
-static zend_always_inline void zend_assign_to_object_dim(zval *retval, zval *object, zval *property_name, int value_type, znode_op value_op, const zend_execute_data *execute_data TSRMLS_DC)
+static zend_always_inline void zend_assign_to_object_dim(zval *retval, zval *object, zval *property_name, int value_type, znode_op value_op, const zend_execute_data *execute_data)
{
zend_free_op free_value;
zval *value = get_zval_ptr_deref(value_type, value_op, execute_data, &free_value, BP_VAR_R);
@@ -923,7 +923,7 @@ static zend_always_inline void zend_assign_to_object_dim(zval *retval, zval *obj
Z_ADDREF_P(value);
}
- Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_dimension(object, property_name, value);
if (retval && !EG(exception)) {
ZVAL_COPY(retval, value);
@@ -934,27 +934,27 @@ static zend_always_inline void zend_assign_to_object_dim(zval *retval, zval *obj
}
}
-static void zend_binary_assign_op_obj_dim(zval *object, zval *property, zval *value, zval *retval, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) TSRMLS_DC)
+static void zend_binary_assign_op_obj_dim(zval *object, zval *property, zval *value, zval *retval, int (*binary_op)(zval *result, zval *op1, zval *op2))
{
zval *z;
zval rv;
if (Z_OBJ_HT_P(object)->read_dimension &&
- (z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_dimension(object, property, z);
if (retval) {
ZVAL_COPY(retval, z);
}
@@ -967,7 +967,7 @@ static void zend_binary_assign_op_obj_dim(zval *object, zval *property, zval *va
}
}
-static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, zval *result TSRMLS_DC)
+static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *value, zval *result)
{
zend_string *old_str;
@@ -1018,7 +1018,7 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
}
/* Utility Functions for Extensions */
-static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array)
{
if (extension->statement_handler) {
extension->statement_handler(op_array);
@@ -1026,7 +1026,7 @@ static void zend_extension_statement_handler(const zend_extension *extension, ze
}
-static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_fcall_begin_handler(const zend_extension *extension, zend_op_array *op_array)
{
if (extension->fcall_begin_handler) {
extension->fcall_begin_handler(op_array);
@@ -1034,7 +1034,7 @@ static void zend_extension_fcall_begin_handler(const zend_extension *extension,
}
-static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_fcall_end_handler(const zend_extension *extension, zend_op_array *op_array)
{
if (extension->fcall_end_handler) {
extension->fcall_end_handler(op_array);
@@ -1042,7 +1042,7 @@ static void zend_extension_fcall_end_handler(const zend_extension *extension, ze
}
-static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_data *execute_data, int fetch_type TSRMLS_DC)
+static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_data *execute_data, int fetch_type)
{
HashTable *ht;
@@ -1055,14 +1055,14 @@ static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_d
} else {
ZEND_ASSERT(fetch_type == ZEND_FETCH_LOCAL);
if (!EX(symbol_table)) {
- zend_rebuild_symbol_table(TSRMLS_C);
+ zend_rebuild_symbol_table();
}
ht = &EX(symbol_table)->ht;
}
return ht;
}
-static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type TSRMLS_DC)
+static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type)
{
zval *retval;
zend_string *offset_key;
@@ -1168,7 +1168,7 @@ str_index:
return retval;
}
-static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type TSRMLS_DC)
+static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type)
{
zend_long offset;
@@ -1209,9 +1209,9 @@ try_again:
return offset;
}
-static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zval *dim, int type TSRMLS_DC)
+static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zval *dim, int type)
{
- zend_long offset = zend_check_string_offset(dim, type TSRMLS_CC);
+ zend_long offset = zend_check_string_offset(dim, type);
if (Z_REFCOUNTED_P(container)) {
if (Z_REFCOUNT_P(container) > 1) {
@@ -1223,7 +1223,7 @@ static zend_always_inline zend_long zend_fetch_string_offset(zval *container, zv
return offset;
}
-static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC)
+static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *container, zval *dim, int dim_type, int type)
{
zval *retval;
@@ -1238,7 +1238,7 @@ fetch_from_array:
retval = &EG(error_zval);
}
} else {
- retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
+ retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type);
}
ZVAL_INDIRECT(result, retval);
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -1250,14 +1250,14 @@ convert_to_array:
goto fetch_from_array;
}
- zend_check_string_offset(dim, type TSRMLS_CC);
+ zend_check_string_offset(dim, type);
ZVAL_INDIRECT(result, NULL); /* wrong string offset */
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (!Z_OBJ_HT_P(container)->read_dimension) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
- retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
if (UNEXPECTED(retval == &EG(uninitialized_zval))) {
zend_class_entry *ce = Z_OBJCE_P(container);
@@ -1312,28 +1312,28 @@ convert_to_array:
}
}
-static zend_never_inline void zend_fetch_dimension_address_W(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
+static zend_never_inline void zend_fetch_dimension_address_W(zval *result, zval *container_ptr, zval *dim, int dim_type)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_W);
}
-static zend_never_inline void zend_fetch_dimension_address_RW(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
+static zend_never_inline void zend_fetch_dimension_address_RW(zval *result, zval *container_ptr, zval *dim, int dim_type)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_RW TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_RW);
}
-static zend_never_inline void zend_fetch_dimension_address_UNSET(zval *result, zval *container_ptr, zval *dim, int dim_type TSRMLS_DC)
+static zend_never_inline void zend_fetch_dimension_address_UNSET(zval *result, zval *container_ptr, zval *dim, int dim_type)
{
- zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET);
}
-static zend_always_inline void zend_fetch_dimension_address_read(zval *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC)
+static zend_always_inline void zend_fetch_dimension_address_read(zval *result, zval *container, zval *dim, int dim_type, int type)
{
zval *retval;
try_again:
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
- retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
+ retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type);
ZVAL_COPY(result, retval);
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
zend_long offset;
@@ -1389,7 +1389,7 @@ try_string_offset:
if (!Z_OBJ_HT_P(container)->read_dimension) {
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
- retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
ZEND_ASSERT(result != NULL);
if (retval) {
@@ -1408,22 +1408,22 @@ try_string_offset:
}
}
-static zend_never_inline void zend_fetch_dimension_address_read_R(zval *result, zval *container, zval *dim, int dim_type TSRMLS_DC)
+static zend_never_inline void zend_fetch_dimension_address_read_R(zval *result, zval *container, zval *dim, int dim_type)
{
- zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R TSRMLS_CC);
+ zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R);
}
-static zend_never_inline void zend_fetch_dimension_address_read_IS(zval *result, zval *container, zval *dim, int dim_type TSRMLS_DC)
+static zend_never_inline void zend_fetch_dimension_address_read_IS(zval *result, zval *container, zval *dim, int dim_type)
{
- zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS TSRMLS_CC);
+ zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS);
}
-ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim TSRMLS_DC)
+ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim)
{
- zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR);
}
-static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type TSRMLS_DC)
+static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type)
{
if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
do {
@@ -1473,10 +1473,10 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
}
}
if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) {
- zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot TSRMLS_CC);
+ zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot);
if (NULL == ptr) {
if (Z_OBJ_HT_P(container)->read_property &&
- (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC)) != NULL) {
+ (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result)) != NULL) {
if (ptr != result) {
ZVAL_INDIRECT(result, ptr);
}
@@ -1487,7 +1487,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
ZVAL_INDIRECT(result, ptr);
}
} else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
- zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC);
+ zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result);
if (ptr != result) {
ZVAL_INDIRECT(result, ptr);
}
@@ -1497,7 +1497,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
}
}
-static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const zend_execute_data *execute_data TSRMLS_DC)
+static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const zend_execute_data *execute_data)
{
int original_nest_levels = nest_levels;
zend_brk_cont_element *jmp_to;
@@ -1524,12 +1524,12 @@ static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_of
#if ZEND_INTENSIVE_DEBUGGING
#define CHECK_SYMBOL_TABLES() \
- zend_hash_apply(&EG(symbol_table), zend_check_symbol TSRMLS_CC); \
+ zend_hash_apply(&EG(symbol_table), zend_check_symbol); \
if (&EG(symbol_table)!=EX(symbol_table)) { \
- zend_hash_apply(EX(symbol_table), zend_check_symbol TSRMLS_CC); \
+ zend_hash_apply(EX(symbol_table), zend_check_symbol); \
}
-static int zend_check_symbol(zval *pz TSRMLS_DC)
+static int zend_check_symbol(zval *pz)
{
if (Z_TYPE_P(pz) == IS_INDIRECT) {
pz = Z_INDIRECT_P(pz);
@@ -1541,10 +1541,10 @@ static int zend_check_symbol(zval *pz TSRMLS_DC)
fflush(stderr);
#endif
} else if (Z_TYPE_P(pz) == IS_ARRAY) {
- zend_hash_apply(Z_ARRVAL_P(pz), zend_check_symbol TSRMLS_CC);
+ zend_hash_apply(Z_ARRVAL_P(pz), zend_check_symbol);
} else if (Z_TYPE_P(pz) == IS_OBJECT) {
/* OBJ-TBI - doesn't support new object model! */
- zend_hash_apply(Z_OBJPROP_P(pz), zend_check_symbol TSRMLS_CC);
+ zend_hash_apply(Z_OBJPROP_P(pz), zend_check_symbol);
}
return 0;
@@ -1557,26 +1557,26 @@ static int zend_check_symbol(zval *pz TSRMLS_DC)
ZEND_API opcode_handler_t *zend_opcode_handlers;
-ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
+ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value)
{
- execute_data->func->internal_function.handler(execute_data, return_value TSRMLS_CC);
+ execute_data->func->internal_function.handler(execute_data, return_value);
}
-ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
+ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /* {{{ */
{
if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
- zend_array_destroy(&symbol_table->ht TSRMLS_CC);
+ zend_array_destroy(&symbol_table->ht);
efree_size(symbol_table, sizeof(zend_array));
} else {
/* clean before putting into the cache, since clean
could call dtors, which could use cached hash */
- zend_symtable_clean(&symbol_table->ht TSRMLS_CC);
+ zend_symtable_clean(&symbol_table->ht);
*(++EG(symtable_cache_ptr)) = symbol_table;
}
}
/* }}} */
-static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
{
if (EXPECTED(EX(func)->op_array.last_var > 0)) {
zval *cv = EX_VAR_NUM(0);
@@ -1589,9 +1589,9 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
}
/* }}} */
-void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
{
- i_free_compiled_variables(execute_data TSRMLS_CC);
+ i_free_compiled_variables(execute_data);
}
/* }}} */
@@ -1615,7 +1615,7 @@ void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /*
* +----------------------------------------+
*/
-static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
{
uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
@@ -1681,7 +1681,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
}
/* }}} */
-static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
{
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
@@ -1706,7 +1706,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
}
/* }}} */
-static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
{
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
@@ -1781,7 +1781,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
}
/* }}} */
-ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value) /* {{{ */
{
/*
* Normally the execute_data is allocated on the VM stack (because it does
@@ -1810,7 +1810,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
num_args,
call->called_scope,
Z_OBJ(call->This),
- NULL TSRMLS_CC);
+ NULL);
EX_NUM_ARGS() = num_args;
/* copy arguments */
@@ -1826,33 +1826,33 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
EX(symbol_table) = NULL;
- i_init_func_execute_data(execute_data, op_array, return_value TSRMLS_CC);
+ i_init_func_execute_data(execute_data, op_array, return_value);
return execute_data;
}
/* }}} */
-ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
{
EX(prev_execute_data) = EG(current_execute_data);
- i_init_execute_data(execute_data, op_array, return_value TSRMLS_CC);
+ i_init_execute_data(execute_data, op_array, return_value);
}
/* }}} */
-static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(const zend_op *opline, zend_execute_data *call TSRMLS_DC) /* {{{ */
+static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(const zend_op *opline, zend_execute_data *call) /* {{{ */
{
uint32_t arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;
return ARG_SHOULD_BE_SENT_BY_REF(call->func, arg_num);
}
/* }}} */
-static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */
+static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, uint32_t passed_args, uint32_t additional_args) /* {{{ */
{
zend_execute_data *new_call;
int used_stack = (EG(vm_stack_top) - (zval*)call) + additional_args;
/* copy call frame into new stack segment */
- new_call = zend_vm_stack_extend(used_stack * sizeof(zval) TSRMLS_CC);
+ new_call = zend_vm_stack_extend(used_stack * sizeof(zval));
*new_call = *call;
if (passed_args) {
zval *src = ZEND_CALL_ARG(call, 1);
@@ -1880,12 +1880,12 @@ static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call,
}
/* }}} */
-static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data **call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */
+static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data **call, uint32_t passed_args, uint32_t additional_args) /* {{{ */
{
if (EXPECTED(EG(vm_stack_end) - EG(vm_stack_top) > additional_args)) {
EG(vm_stack_top) += additional_args;
} else {
- *call = zend_vm_stack_copy_call_frame(*call, passed_args, additional_args TSRMLS_CC);
+ *call = zend_vm_stack_copy_call_frame(*call, passed_args, additional_args);
}
}
/* }}} */
@@ -1941,7 +1941,7 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode)
return zend_user_opcode_handlers[opcode];
}
-ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) {
+ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type) {
return get_zval_ptr(op_type, *node, execute_data, should_free, type);
}
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 455ff508b2..0d58c6195d 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -29,29 +29,29 @@
BEGIN_EXTERN_C()
struct _zend_fcall_info;
-ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC);
-ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
-
-void init_executor(TSRMLS_D);
-void shutdown_executor(TSRMLS_D);
-void shutdown_destructors(TSRMLS_D);
-ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value TSRMLS_DC);
-ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC);
-ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC);
-ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC);
-ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
-ZEND_API zend_class_entry *zend_lookup_class(zend_string *name TSRMLS_DC);
-ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload TSRMLS_DC);
-ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
-ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char *string_name TSRMLS_DC);
-ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
-ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
-
-ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC);
-ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC);
-ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC);
-
-static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type TSRMLS_DC)
+ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data);
+ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);
+
+void init_executor(void);
+void shutdown_executor(void);
+void shutdown_destructors(void);
+ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value);
+ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value);
+ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value);
+ZEND_API void execute_ex(zend_execute_data *execute_data);
+ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
+ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
+ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload);
+ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name);
+ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char *string_name);
+ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions);
+ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions);
+
+ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce);
+ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce);
+ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg);
+
+static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
do {
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
@@ -65,7 +65,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
}
if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
- Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value TSRMLS_CC);
+ Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value);
return variable_ptr;
}
if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
@@ -90,7 +90,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
if ((Z_COLLECTABLE_P(variable_ptr)) &&
UNEXPECTED(!GC_INFO(garbage))) {
- gc_possible_root(garbage TSRMLS_CC);
+ gc_possible_root(garbage);
}
}
}
@@ -110,10 +110,10 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
return variable_ptr;
}
-ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC);
-ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
-ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
-ZEND_API int zval_update_constant_ex(zval *pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
+ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change);
+ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope);
+ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope);
+ZEND_API int zval_update_constant_ex(zval *pp, zend_bool inline_change, zend_class_entry *scope);
/* dedicated Zend executor functions - do not use! */
struct _zend_vm_stack {
@@ -128,24 +128,24 @@ struct _zend_vm_stack {
#define ZEND_VM_STACK_ELEMETS(stack) \
(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS)
-ZEND_API void zend_vm_stack_init(TSRMLS_D);
-ZEND_API void zend_vm_stack_destroy(TSRMLS_D);
-ZEND_API void* zend_vm_stack_extend(size_t size TSRMLS_DC);
+ZEND_API void zend_vm_stack_init(void);
+ZEND_API void zend_vm_stack_destroy(void);
+ZEND_API void* zend_vm_stack_extend(size_t size);
-static zend_always_inline zval* zend_vm_stack_alloc(size_t size TSRMLS_DC)
+static zend_always_inline zval* zend_vm_stack_alloc(size_t size)
{
char *top = (char*)EG(vm_stack_top);
if (UNEXPECTED(size > (size_t)(((char*)EG(vm_stack_end)) - top))) {
- return (zval*)zend_vm_stack_extend(size TSRMLS_CC);
+ return (zval*)zend_vm_stack_extend(size);
}
EG(vm_stack_top) = (zval*)(top + size);
return (zval*)top;
}
-static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
+static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev)
{
- zend_execute_data *call = (zend_execute_data*)zend_vm_stack_alloc(used_stack TSRMLS_CC);
+ zend_execute_data *call = (zend_execute_data*)zend_vm_stack_alloc(used_stack);
call->func = func;
Z_OBJ(call->This) = object;
@@ -166,15 +166,15 @@ static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, ze
return used_stack * sizeof(zval);
}
-static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
+static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev)
{
uint32_t used_stack = zend_vm_calc_used_stack(num_args, func);
return zend_vm_stack_push_call_frame_ex(used_stack, call_info,
- func, num_args, called_scope, object, prev TSRMLS_CC);
+ func, num_args, called_scope, object, prev);
}
-static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call TSRMLS_DC)
+static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call)
{
uint32_t first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0);
@@ -188,7 +188,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
}
}
-static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call TSRMLS_DC)
+static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
{
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
@@ -203,7 +203,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call T
}
}
-static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call TSRMLS_DC)
+static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call)
{
zend_vm_stack p = EG(vm_stack);
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(p) == (zval*)call)) {
@@ -219,20 +219,20 @@ static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *
}
/* services */
-ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC);
-ZEND_API const char *get_active_function_name(TSRMLS_D);
-ZEND_API const char *zend_get_executed_filename(TSRMLS_D);
-ZEND_API uint zend_get_executed_lineno(TSRMLS_D);
-ZEND_API zend_bool zend_is_executing(TSRMLS_D);
+ZEND_API const char *get_active_class_name(const char **space);
+ZEND_API const char *get_active_function_name(void);
+ZEND_API const char *zend_get_executed_filename(void);
+ZEND_API uint zend_get_executed_lineno(void);
+ZEND_API zend_bool zend_is_executing(void);
ZEND_API void zend_set_timeout(zend_long seconds, int reset_signals);
-ZEND_API void zend_unset_timeout(TSRMLS_D);
+ZEND_API void zend_unset_timeout(void);
ZEND_API void zend_timeout(int dummy);
-ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type TSRMLS_DC);
-ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type TSRMLS_DC);
-void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
+ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type);
+ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type);
+void zend_verify_abstract_class(zend_class_entry *ce);
-ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim TSRMLS_DC);
+ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim);
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
@@ -250,12 +250,12 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
/* former zend_execute_locks.h */
typedef zval* zend_free_op;
-ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
+ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type);
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS);
-ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC);
-void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC);
+ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table);
+void zend_free_compiled_variables(zend_execute_data *execute_data);
#define CACHED_PTR(num) \
EX_RUN_TIME_CACHE()[(num)]
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 2b7951a8ee..10238e0396 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -38,8 +38,8 @@
#include <sys/time.h>
#endif
-ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC);
-ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
+ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data);
+ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);
/* true globals */
ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, {{0}, {{0}}, {0}}, NULL, NULL, NULL, NULL, 0, 0 };
@@ -64,14 +64,13 @@ static void zend_handle_sigsegv(int dummy) /* {{{ */
signal(SIGSEGV, SIG_DFL);
}
{
- TSRMLS_FETCH();
-
+
fprintf(stderr, "SIGSEGV caught on opcode %d on opline %d of %s() at %s:%d\n\n",
active_opline->opcode,
active_opline-EG(active_op_array)->opcodes,
- get_active_function_name(TSRMLS_C),
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C));
+ get_active_function_name(),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno());
/* See http://support.microsoft.com/kb/190351 */
#ifdef PHP_WIN32
fflush(stderr);
@@ -84,7 +83,7 @@ static void zend_handle_sigsegv(int dummy) /* {{{ */
/* }}} */
#endif
-static void zend_extension_activator(zend_extension *extension TSRMLS_DC) /* {{{ */
+static void zend_extension_activator(zend_extension *extension) /* {{{ */
{
if (extension->activate) {
extension->activate();
@@ -92,7 +91,7 @@ static void zend_extension_activator(zend_extension *extension TSRMLS_DC) /* {{{
}
/* }}} */
-static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC) /* {{{ */
+static void zend_extension_deactivator(zend_extension *extension) /* {{{ */
{
if (extension->deactivate) {
extension->deactivate();
@@ -100,37 +99,37 @@ static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC) /* {
}
/* }}} */
-static int clean_non_persistent_function(zval *zv TSRMLS_DC) /* {{{ */
+static int clean_non_persistent_function(zval *zv) /* {{{ */
{
zend_function *function = Z_PTR_P(zv);
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
-ZEND_API int clean_non_persistent_function_full(zval *zv TSRMLS_DC) /* {{{ */
+ZEND_API int clean_non_persistent_function_full(zval *zv) /* {{{ */
{
zend_function *function = Z_PTR_P(zv);
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
-static int clean_non_persistent_class(zval *zv TSRMLS_DC) /* {{{ */
+static int clean_non_persistent_class(zval *zv) /* {{{ */
{
zend_class_entry *ce = Z_PTR_P(zv);
return (ce->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
-ZEND_API int clean_non_persistent_class_full(zval *zv TSRMLS_DC) /* {{{ */
+ZEND_API int clean_non_persistent_class_full(zval *zv) /* {{{ */
{
zend_class_entry *ce = Z_PTR_P(zv);
return (ce->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
-void init_executor(TSRMLS_D) /* {{{ */
+void init_executor(void) /* {{{ */
{
- zend_init_fpu(TSRMLS_C);
+ zend_init_fpu();
ZVAL_NULL(&EG(uninitialized_zval));
/* trick to make uninitialized_zval never be modified, passed by ref, etc. */
@@ -151,14 +150,14 @@ void init_executor(TSRMLS_D) /* {{{ */
EG(autoload_func) = NULL;
EG(error_handling) = EH_NORMAL;
- zend_vm_stack_init(TSRMLS_C);
+ zend_vm_stack_init();
zend_hash_init(&EG(symbol_table).ht, 64, NULL, ZVAL_PTR_DTOR, 0);
GC_REFCOUNT(&EG(symbol_table)) = 1;
GC_TYPE_INFO(&EG(symbol_table)) = IS_ARRAY;
EG(valid_symbol_table) = 1;
- zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator TSRMLS_CC);
+ zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator);
zend_hash_init(&EG(included_files), 8, NULL, NULL, 0);
@@ -188,7 +187,7 @@ void init_executor(TSRMLS_D) /* {{{ */
}
/* }}} */
-static int zval_call_destructor(zval *zv TSRMLS_DC) /* {{{ */
+static int zval_call_destructor(zval *zv) /* {{{ */
{
if (Z_TYPE_P(zv) == IS_INDIRECT) {
zv = Z_INDIRECT_P(zv);
@@ -203,16 +202,15 @@ static int zval_call_destructor(zval *zv TSRMLS_DC) /* {{{ */
static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */
{
- TSRMLS_FETCH();
if (Z_TYPE_P(zv) == IS_INDIRECT) {
zv = Z_INDIRECT_P(zv);
}
- i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC);
}
/* }}} */
-void shutdown_destructors(TSRMLS_D) /* {{{ */
+void shutdown_destructors(void) /* {{{ */
{
if (CG(unclean_shutdown)) {
EG(symbol_table).ht.pDestructor = zend_unclean_zval_ptr_dtor;
@@ -221,17 +219,17 @@ void shutdown_destructors(TSRMLS_D) /* {{{ */
uint32_t symbols;
do {
symbols = zend_hash_num_elements(&EG(symbol_table).ht);
- zend_hash_reverse_apply(&EG(symbol_table).ht, (apply_func_t) zval_call_destructor TSRMLS_CC);
+ zend_hash_reverse_apply(&EG(symbol_table).ht, (apply_func_t) zval_call_destructor);
} while (symbols != zend_hash_num_elements(&EG(symbol_table).ht));
- zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
+ zend_objects_store_call_destructors(&EG(objects_store));
} zend_catch {
/* if we couldn't destruct cleanly, mark all objects as destructed anyway */
- zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
+ zend_objects_store_mark_destructed(&EG(objects_store));
} zend_end_try();
}
/* }}} */
-void shutdown_executor(TSRMLS_D) /* {{{ */
+void shutdown_executor(void) /* {{{ */
{
zend_function *func;
zend_class_entry *ce;
@@ -243,7 +241,7 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
Object 3 holds reference to object 2.
Now when 1 and 2 are destroyed, 3 can still access 2 in its destructor, with
very problematic results */
-/* zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC); */
+/* zend_objects_store_call_destructors(&EG(objects_store)); */
/* Moved after symbol table cleaners, because some of the cleaners can call
destructors, which would use EG(symtable_cache_ptr) and thus leave leaks */
@@ -253,7 +251,7 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
EG(symtable_cache_ptr)--;
}
*/
- zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
+ zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator);
if (CG(unclean_shutdown)) {
EG(symbol_table).ht.pDestructor = zend_unclean_zval_ptr_dtor;
@@ -301,9 +299,9 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
} ZEND_HASH_FOREACH_END();
ZEND_HASH_REVERSE_FOREACH_PTR(EG(class_table), ce) {
if (ce->type == ZEND_USER_CLASS) {
- zend_cleanup_user_class_data(ce TSRMLS_CC);
+ zend_cleanup_user_class_data(ce);
} else {
- zend_cleanup_internal_class_data(ce TSRMLS_CC);
+ zend_cleanup_internal_class_data(ce);
}
} ZEND_HASH_FOREACH_END();
} else {
@@ -317,9 +315,9 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
if (ce->type != ZEND_USER_CLASS) {
break;
}
- zend_cleanup_user_class_data(ce TSRMLS_CC);
+ zend_cleanup_user_class_data(ce);
} ZEND_HASH_FOREACH_END();
- zend_cleanup_internal_classes(TSRMLS_C);
+ zend_cleanup_internal_classes();
}
} zend_end_try();
@@ -328,21 +326,21 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
} zend_end_try();
zend_try {
- zend_close_rsrc_list(&EG(regular_list) TSRMLS_CC);
+ zend_close_rsrc_list(&EG(regular_list));
} zend_end_try();
zend_try {
- zend_objects_store_free_object_storage(&EG(objects_store) TSRMLS_CC);
+ zend_objects_store_free_object_storage(&EG(objects_store));
- zend_vm_stack_destroy(TSRMLS_C);
+ zend_vm_stack_destroy();
/* Destroy all op arrays */
if (EG(full_tables_cleanup)) {
- zend_hash_reverse_apply(EG(function_table), clean_non_persistent_function_full TSRMLS_CC);
- zend_hash_reverse_apply(EG(class_table), clean_non_persistent_class_full TSRMLS_CC);
+ zend_hash_reverse_apply(EG(function_table), clean_non_persistent_function_full);
+ zend_hash_reverse_apply(EG(class_table), clean_non_persistent_class_full);
} else {
- zend_hash_reverse_apply(EG(function_table), clean_non_persistent_function TSRMLS_CC);
- zend_hash_reverse_apply(EG(class_table), clean_non_persistent_class TSRMLS_CC);
+ zend_hash_reverse_apply(EG(function_table), clean_non_persistent_function);
+ zend_hash_reverse_apply(EG(class_table), clean_non_persistent_class);
}
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
@@ -353,7 +351,7 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
} zend_end_try();
zend_try {
- clean_non_persistent_constants(TSRMLS_C);
+ clean_non_persistent_constants();
} zend_end_try();
zend_try {
@@ -373,18 +371,18 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
}
} zend_end_try();
- zend_shutdown_fpu(TSRMLS_C);
+ zend_shutdown_fpu();
EG(active) = 0;
}
/* }}} */
/* return class name and "::" or "". */
-ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC) /* {{{ */
+ZEND_API const char *get_active_class_name(const char **space) /* {{{ */
{
zend_function *func;
- if (!zend_is_executing(TSRMLS_C)) {
+ if (!zend_is_executing()) {
if (space) {
*space = "";
}
@@ -412,11 +410,11 @@ ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC) /* {{{
}
/* }}} */
-ZEND_API const char *get_active_function_name(TSRMLS_D) /* {{{ */
+ZEND_API const char *get_active_function_name(void) /* {{{ */
{
zend_function *func;
- if (!zend_is_executing(TSRMLS_C)) {
+ if (!zend_is_executing()) {
return NULL;
}
func = EG(current_execute_data)->func;
@@ -440,7 +438,7 @@ ZEND_API const char *get_active_function_name(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */
+ZEND_API const char *zend_get_executed_filename(void) /* {{{ */
{
zend_execute_data *ex = EG(current_execute_data);
@@ -455,7 +453,7 @@ ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */
+ZEND_API uint zend_get_executed_lineno(void) /* {{{ */
{
zend_execute_data *ex = EG(current_execute_data);
@@ -474,7 +472,7 @@ ZEND_API uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
+ZEND_API zend_bool zend_is_executing(void) /* {{{ */
{
return EG(current_execute_data) != 0;
}
@@ -482,8 +480,7 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
- TSRMLS_FETCH();
- i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+ i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC);
}
/* }}} */
@@ -502,7 +499,7 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ *
#define IS_CONSTANT_VISITED(p) (Z_TYPE_P(p) & IS_VISITED_CONSTANT)
#define MARK_CONSTANT_VISITED(p) Z_TYPE_INFO_P(p) |= IS_VISITED_CONSTANT
-ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_class_entry *scope) /* {{{ */
{
zval *const_value;
char *colon;
@@ -515,7 +512,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
SEPARATE_ZVAL_NOREF(p);
MARK_CONSTANT_VISITED(p);
refcount = Z_REFCOUNTED_P(p) ? Z_REFCOUNT_P(p) : 1;
- const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p) TSRMLS_CC);
+ const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p));
if (!const_value) {
char *actual = Z_STRVAL_P(p);
@@ -582,7 +579,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
}
ZVAL_COPY_VALUE(p, const_value);
if (Z_OPT_CONSTANT_P(p)) {
- zval_update_constant_ex(p, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(p, 1, NULL);
}
zval_opt_copy_ctor(p);
}
@@ -592,7 +589,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
zval tmp;
SEPARATE_ZVAL_NOREF(p);
- zend_ast_evaluate(&tmp, Z_ASTVAL_P(p), scope TSRMLS_CC);
+ zend_ast_evaluate(&tmp, Z_ASTVAL_P(p), scope);
if (inline_change) {
zend_ast_destroy_and_free(Z_ASTVAL_P(p));
efree_size(Z_AST_P(p), sizeof(zend_ast_ref));
@@ -603,31 +600,31 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
}
/* }}} */
-ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope) /* {{{ */
{
- return zval_update_constant_ex(pp, 1, scope TSRMLS_CC);
+ return zval_update_constant_ex(pp, 1, scope);
}
/* }}} */
-ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope) /* {{{ */
{
- return zval_update_constant_ex(pp, 0, scope TSRMLS_CC);
+ return zval_update_constant_ex(pp, 0, scope);
}
/* }}} */
-ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC) /* {{{ */
+ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change) /* {{{ */
{
- return zval_update_constant_ex(pp, inline_change, NULL TSRMLS_CC);
+ return zval_update_constant_ex(pp, inline_change, NULL);
}
/* }}} */
-int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[] TSRMLS_DC) /* {{{ */
+int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]) /* {{{ */
{
- return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, 1, NULL TSRMLS_CC);
+ return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, 1, NULL);
}
/* }}} */
-int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC) /* {{{ */
+int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table) /* {{{ */
{
zend_fcall_info fci;
@@ -641,11 +638,11 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
fci.no_separation = (zend_bool) no_separation;
fci.symbol_table = symbol_table;
- return zend_call_function(&fci, NULL TSRMLS_CC);
+ return zend_call_function(&fci, NULL);
}
/* }}} */
-int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC) /* {{{ */
+int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /* {{{ */
{
uint32_t i;
zend_class_entry *calling_scope = NULL;
@@ -703,7 +700,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
fci_cache = &fci_cache_local;
}
- if (!zend_is_callable_ex(&fci->function_name, fci->object, IS_CALLABLE_CHECK_SILENT, &callable_name, fci_cache, &error TSRMLS_CC)) {
+ if (!zend_is_callable_ex(&fci->function_name, fci->object, IS_CALLABLE_CHECK_SILENT, &callable_name, fci_cache, &error)) {
if (error) {
zend_error(E_WARNING, "Invalid callback %s, %s", callable_name->val, error);
efree(error);
@@ -728,7 +725,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
func = fci_cache->function_handler;
call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION,
- func, fci->param_count, fci_cache->called_scope, fci_cache->object, NULL TSRMLS_CC);
+ func, fci->param_count, fci_cache->called_scope, fci_cache->object, NULL);
calling_scope = fci_cache->calling_scope;
fci->object = fci_cache->object;
if (fci->object &&
@@ -779,9 +776,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (i) {
/* hack to clean up the stack */
ZEND_CALL_NUM_ARGS(call) = i;
- zend_vm_stack_free_args(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
}
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
i+1,
@@ -834,10 +831,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
EG(scope) = func->common.scope;
call->symbol_table = fci->symbol_table;
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
- zend_init_execute_data(call, &func->op_array, fci->retval TSRMLS_CC);
- zend_execute_ex(call TSRMLS_CC);
+ zend_init_execute_data(call, &func->op_array, fci->retval);
+ zend_execute_ex(call);
} else {
- zend_generator_create_zval(call, &func->op_array, fci->retval TSRMLS_CC);
+ zend_generator_create_zval(call, &func->op_array, fci->retval);
}
} else if (func->type == ZEND_INTERNAL_FUNCTION) {
int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
@@ -850,13 +847,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
EG(current_execute_data) = call;
if (EXPECTED(zend_execute_internal == NULL)) {
/* saves one function call if zend_execute_internal is not used */
- func->internal_function.handler(call, fci->retval TSRMLS_CC);
+ func->internal_function.handler(call, fci->retval);
} else {
- zend_execute_internal(call, fci->retval TSRMLS_CC);
+ zend_execute_internal(call, fci->retval);
}
EG(current_execute_data) = call->prev_execute_data;
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
/* We shouldn't fix bad extensions here,
because it can break proper ones (Bug #34045)
@@ -880,14 +877,14 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (fci->object) {
call->prev_execute_data = EG(current_execute_data);
EG(current_execute_data) = call;
- fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval TSRMLS_CC);
+ fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval);
EG(current_execute_data) = call->prev_execute_data;
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
if (func->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
zend_string_release(func->common.function_name);
@@ -910,13 +907,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
if (EG(exception)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
}
return SUCCESS;
}
/* }}} */
-ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload) /* {{{ */
{
zend_class_entry *ce = NULL;
zval args[1];
@@ -953,7 +950,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
* (doesn't impact functionality of __autoload()
*/
- if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
+ if (!use_autoload || zend_is_compiling()) {
if (!key) {
zend_string_free(lc_name);
}
@@ -1017,9 +1014,9 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
fcall_cache.called_scope = NULL;
fcall_cache.object = NULL;
- zend_exception_save(TSRMLS_C);
- retval = zend_call_function(&fcall_info, &fcall_cache TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_exception_save();
+ retval = zend_call_function(&fcall_info, &fcall_cache);
+ zend_exception_restore();
zval_ptr_dtor(&args[0]);
zval_dtor(&fcall_info.function_name);
@@ -1038,13 +1035,13 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
}
/* }}} */
-ZEND_API zend_class_entry *zend_lookup_class(zend_string *name TSRMLS_DC) /* {{{ */
+ZEND_API zend_class_entry *zend_lookup_class(zend_string *name) /* {{{ */
{
- return zend_lookup_class_ex(name, NULL, 1 TSRMLS_CC);
+ return zend_lookup_class_ex(name, NULL, 1);
}
/* }}} */
-ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */
+ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char *string_name) /* {{{ */
{
zval pv;
zend_op_array *new_op_array;
@@ -1065,7 +1062,7 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
original_compiler_options = CG(compiler_options);
CG(compiler_options) = ZEND_COMPILE_DEFAULT_FOR_EVAL;
- new_op_array = zend_compile_string(&pv, string_name TSRMLS_CC);
+ new_op_array = zend_compile_string(&pv, string_name);
CG(compiler_options) = original_compiler_options;
if (new_op_array) {
@@ -1075,9 +1072,9 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
zend_try {
ZVAL_UNDEF(&local_retval);
- zend_execute(new_op_array, &local_retval TSRMLS_CC);
+ zend_execute(new_op_array, &local_retval);
} zend_catch {
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
zend_bailout();
} zend_end_try();
@@ -1095,7 +1092,7 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
}
EG(no_extensions)=0;
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
retval = SUCCESS;
} else {
@@ -1106,34 +1103,33 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
}
/* }}} */
-ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */
+ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name) /* {{{ */
{
- return zend_eval_stringl(str, strlen(str), retval_ptr, string_name TSRMLS_CC);
+ return zend_eval_stringl(str, strlen(str), retval_ptr, string_name);
}
/* }}} */
-ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */
+ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions) /* {{{ */
{
int result;
- result = zend_eval_stringl(str, str_len, retval_ptr, string_name TSRMLS_CC);
+ result = zend_eval_stringl(str, str_len, retval_ptr, string_name);
if (handle_exceptions && EG(exception)) {
- zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR);
result = FAILURE;
}
return result;
}
/* }}} */
-ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */
+ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions) /* {{{ */
{
- return zend_eval_stringl_ex(str, strlen(str), retval_ptr, string_name, handle_exceptions TSRMLS_CC);
+ return zend_eval_stringl_ex(str, strlen(str), retval_ptr, string_name, handle_exceptions);
}
/* }}} */
ZEND_API void zend_timeout(int dummy) /* {{{ */
{
- TSRMLS_FETCH();
if (zend_on_timeout) {
#ifdef ZEND_SIGNALS
@@ -1145,7 +1141,7 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
*/
SIGG(running) = 0;
#endif
- zend_on_timeout(EG(timeout_seconds) TSRMLS_CC);
+ zend_on_timeout(EG(timeout_seconds));
}
zend_error(E_ERROR, "Maximum execution time of %pd second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
@@ -1175,7 +1171,6 @@ VOID CALLBACK tq_timer_cb(PVOID arg, BOOLEAN timed_out)
void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
{
- TSRMLS_FETCH();
EG(timeout_seconds) = seconds;
@@ -1227,7 +1222,7 @@ void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
if (reset_signals) {
# ifdef ZEND_SIGNALS
- zend_signal(signo, zend_timeout TSRMLS_CC);
+ zend_signal(signo, zend_timeout);
# else
sigset_t sigset;
@@ -1243,7 +1238,7 @@ void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
}
/* }}} */
-void zend_unset_timeout(TSRMLS_D) /* {{{ */
+void zend_unset_timeout(void) /* {{{ */
{
#ifdef ZEND_WIN32
if (NULL != tq_timer) {
@@ -1274,7 +1269,7 @@ void zend_unset_timeout(TSRMLS_D) /* {{{ */
}
/* }}} */
-zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type TSRMLS_DC) /* {{{ */
+zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {{{ */
{
zend_class_entry *ce;
int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
@@ -1311,7 +1306,7 @@ check_fetch_type:
break;
}
- if ((ce = zend_lookup_class_ex(class_name, NULL, use_autoload TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class_ex(class_name, NULL, use_autoload)) == NULL) {
if (use_autoload) {
if (!silent && !EG(exception)) {
if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) {
@@ -1329,12 +1324,12 @@ check_fetch_type:
}
/* }}} */
-zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type TSRMLS_DC) /* {{{ */
+zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type) /* {{{ */
{
zend_class_entry *ce;
int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
- if ((ce = zend_lookup_class_ex(class_name, key, use_autoload TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class_ex(class_name, key, use_autoload)) == NULL) {
if (use_autoload) {
if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
@@ -1366,7 +1361,7 @@ typedef struct _zend_abstract_info {
int ctor;
} zend_abstract_info;
-static void zend_verify_abstract_class_function(zend_function *fn, zend_abstract_info *ai TSRMLS_DC) /* {{{ */
+static void zend_verify_abstract_class_function(zend_function *fn, zend_abstract_info *ai) /* {{{ */
{
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
if (ai->cnt < MAX_ABSTRACT_INFO_CNT) {
@@ -1386,7 +1381,7 @@ static void zend_verify_abstract_class_function(zend_function *fn, zend_abstract
}
/* }}} */
-void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+void zend_verify_abstract_class(zend_class_entry *ce) /* {{{ */
{
zend_function *func;
zend_abstract_info ai;
@@ -1395,7 +1390,7 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC) /* {{{ */
memset(&ai, 0, sizeof(ai));
ZEND_HASH_FOREACH_PTR(&ce->function_table, func) {
- zend_verify_abstract_class_function(func, &ai TSRMLS_CC);
+ zend_verify_abstract_class_function(func, &ai);
} ZEND_HASH_FOREACH_END();
if (ai.cnt) {
@@ -1411,13 +1406,13 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC) /* {{{ */
+ZEND_API int zend_delete_global_variable(zend_string *name) /* {{{ */
{
return zend_hash_del_ind(&EG(symbol_table).ht, name);
}
/* }}} */
-ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
+ZEND_API zend_array *zend_rebuild_symbol_table(void) /* {{{ */
{
int i;
zend_execute_data *ex;
@@ -1502,7 +1497,7 @@ ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data) /* {{{ *
}
/* }}} */
-ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS_DC) /* {{{ */
+ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force) /* {{{ */
{
zend_execute_data *execute_data = EG(current_execute_data);
@@ -1525,7 +1520,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS
}
}
if (force) {
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
if (symbol_table) {
return zend_hash_update(&symbol_table->ht, name, value) ? SUCCESS : FAILURE;;
}
@@ -1538,7 +1533,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS
}
/* }}} */
-ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force TSRMLS_DC) /* {{{ */
+ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force) /* {{{ */
{
zend_execute_data *execute_data = EG(current_execute_data);
@@ -1563,7 +1558,7 @@ ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, i
}
if (force) {
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
if (symbol_table) {
return zend_hash_str_update(&symbol_table->ht, name, len, value) ? SUCCESS : FAILURE;;
}
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index 04150920af..365a902171 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -24,7 +24,7 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
-int zend_load_extension(const char *path TSRMLS_DC)
+int zend_load_extension(const char *path)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
@@ -115,7 +115,7 @@ int zend_load_extension(const char *path TSRMLS_DC)
return FAILURE;
}
- return zend_register_extension(new_extension, handle TSRMLS_CC);
+ return zend_register_extension(new_extension, handle);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
@@ -127,7 +127,7 @@ int zend_load_extension(const char *path TSRMLS_DC)
}
-int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC)
+int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
@@ -135,7 +135,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRM
extension = *new_extension;
extension.handle = handle;
- zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC);
+ zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
zend_llist_add_element(&zend_extensions, &extension);
@@ -146,7 +146,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRM
}
-static void zend_extension_shutdown(zend_extension *extension TSRMLS_DC)
+static void zend_extension_shutdown(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
if (extension->shutdown) {
@@ -185,9 +185,9 @@ int zend_startup_extensions()
}
-void zend_shutdown_extensions(TSRMLS_D)
+void zend_shutdown_extensions(void)
{
- zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_shutdown TSRMLS_CC);
+ zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_shutdown);
zend_llist_destroy(&zend_extensions);
}
@@ -202,7 +202,7 @@ void zend_extension_dtor(zend_extension *extension)
}
-static void zend_extension_message_dispatcher(const zend_extension *extension, int num_args, va_list args TSRMLS_DC)
+static void zend_extension_message_dispatcher(const zend_extension *extension, int num_args, va_list args)
{
int message;
void *arg;
@@ -216,9 +216,9 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i
}
-ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC)
+ZEND_API void zend_extension_dispatch_message(int message, void *arg)
{
- zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
+ zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher, 2, message, arg);
}
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 4fd7dd8fa1..6f046ce00d 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -94,7 +94,7 @@ struct _zend_extension {
BEGIN_EXTERN_C()
ZEND_API int zend_get_resource_handle(zend_extension *extension);
-ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC);
+ZEND_API void zend_extension_dispatch_message(int message, void *arg);
END_EXTERN_C()
#define ZEND_EXTMSG_NEW_EXTENSION 1
@@ -114,11 +114,11 @@ void zend_extension_dtor(zend_extension *extension);
ZEND_API void zend_append_version_info(const zend_extension *extension);
int zend_startup_extensions_mechanism(void);
int zend_startup_extensions(void);
-void zend_shutdown_extensions(TSRMLS_D);
+void zend_shutdown_extensions(void);
BEGIN_EXTERN_C()
-ZEND_API int zend_load_extension(const char *path TSRMLS_DC);
-ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC);
+ZEND_API int zend_load_extension(const char *path);
+ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
ZEND_API zend_extension *zend_get_extension(const char *extension_name);
END_EXTERN_C()
diff --git a/Zend/zend_float.c b/Zend/zend_float.c
index ca0130134c..31723a699d 100644
--- a/Zend/zend_float.c
+++ b/Zend/zend_float.c
@@ -22,7 +22,7 @@
#include "zend_compile.h"
#include "zend_float.h"
-ZEND_API void zend_init_fpu(TSRMLS_D) /* {{{ */
+ZEND_API void zend_init_fpu(void) /* {{{ */
{
#if XPFPA_HAVE_CW
XPFPA_DECLARE
@@ -38,7 +38,7 @@ ZEND_API void zend_init_fpu(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_shutdown_fpu(TSRMLS_D) /* {{{ */
+ZEND_API void zend_shutdown_fpu(void) /* {{{ */
{
#if XPFPA_HAVE_CW
if (EG(saved_fpu_cw_ptr)) {
@@ -49,7 +49,7 @@ ZEND_API void zend_shutdown_fpu(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API void zend_ensure_fpu_mode(TSRMLS_D) /* {{{ */
+ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */
{
XPFPA_DECLARE
diff --git a/Zend/zend_float.h b/Zend/zend_float.h
index 008bf07854..c96cdfe4d9 100644
--- a/Zend/zend_float.h
+++ b/Zend/zend_float.h
@@ -26,9 +26,9 @@ BEGIN_EXTERN_C()
/*
Define functions for FP initialization and de-initialization.
*/
-extern ZEND_API void zend_init_fpu(TSRMLS_D);
-extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
-extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
+extern ZEND_API void zend_init_fpu(void);
+extern ZEND_API void zend_shutdown_fpu(void);
+extern ZEND_API void zend_ensure_fpu_mode(void);
END_EXTERN_C()
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index f6aad866a7..671a306843 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -32,9 +32,9 @@ ZEND_API zend_gc_globals gc_globals;
#endif
#define GC_REMOVE_FROM_ROOTS(current) \
- gc_remove_from_roots((current) TSRMLS_CC)
+ gc_remove_from_roots((current))
-static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root TSRMLS_DC)
+static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root)
{
root->next->prev = root->prev;
root->prev->next = root->next;
@@ -43,7 +43,7 @@ static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root TSRMLS_
GC_BENCH_DEC(root_buf_length);
}
-static void root_buffer_dtor(zend_gc_globals *gc_globals TSRMLS_DC)
+static void root_buffer_dtor(zend_gc_globals *gc_globals)
{
if (gc_globals->buf) {
free(gc_globals->buf);
@@ -51,7 +51,7 @@ static void root_buffer_dtor(zend_gc_globals *gc_globals TSRMLS_DC)
}
}
-static void gc_globals_ctor_ex(zend_gc_globals *gc_globals TSRMLS_DC)
+static void gc_globals_ctor_ex(zend_gc_globals *gc_globals)
{
gc_globals->gc_enabled = 0;
gc_globals->gc_active = 0;
@@ -79,7 +79,7 @@ static void gc_globals_ctor_ex(zend_gc_globals *gc_globals TSRMLS_DC)
#endif
}
-ZEND_API void gc_globals_ctor(TSRMLS_D)
+ZEND_API void gc_globals_ctor(void)
{
#ifdef ZTS
ts_allocate_id(&gc_globals_id, sizeof(zend_gc_globals), (ts_allocate_ctor) gc_globals_ctor_ex, (ts_allocate_dtor) root_buffer_dtor);
@@ -88,14 +88,14 @@ ZEND_API void gc_globals_ctor(TSRMLS_D)
#endif
}
-ZEND_API void gc_globals_dtor(TSRMLS_D)
+ZEND_API void gc_globals_dtor(void)
{
#ifndef ZTS
- root_buffer_dtor(&gc_globals TSRMLS_DC);
+ root_buffer_dtor(&gc_globals);
#endif
}
-ZEND_API void gc_reset(TSRMLS_D)
+ZEND_API void gc_reset(void)
{
GC_G(gc_runs) = 0;
GC_G(collected) = 0;
@@ -126,16 +126,16 @@ ZEND_API void gc_reset(TSRMLS_D)
}
}
-ZEND_API void gc_init(TSRMLS_D)
+ZEND_API void gc_init(void)
{
if (GC_G(buf) == NULL && GC_G(gc_enabled)) {
GC_G(buf) = (gc_root_buffer*) malloc(sizeof(gc_root_buffer) * GC_ROOT_BUFFER_MAX_ENTRIES);
GC_G(last_unused) = &GC_G(buf)[GC_ROOT_BUFFER_MAX_ENTRIES];
- gc_reset(TSRMLS_C);
+ gc_reset();
}
}
-ZEND_API void gc_possible_root(zend_refcounted *ref TSRMLS_DC)
+ZEND_API void gc_possible_root(zend_refcounted *ref)
{
GC_BENCH_INC(zval_possible_root);
@@ -156,7 +156,7 @@ ZEND_API void gc_possible_root(zend_refcounted *ref TSRMLS_DC)
return;
}
GC_REFCOUNT(ref)++;
- gc_collect_cycles(TSRMLS_C);
+ gc_collect_cycles();
GC_REFCOUNT(ref)--;
newRoot = GC_G(unused);
if (!newRoot) {
@@ -182,7 +182,7 @@ ZEND_API void gc_possible_root(zend_refcounted *ref TSRMLS_DC)
}
}
-ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC)
+ZEND_API void gc_remove_from_buffer(zend_refcounted *ref)
{
gc_root_buffer *root;
@@ -197,7 +197,7 @@ ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC)
}
}
-static void gc_scan_black(zend_refcounted *ref TSRMLS_DC)
+static void gc_scan_black(zend_refcounted *ref)
{
HashTable *ht;
uint idx;
@@ -219,7 +219,7 @@ tail_call:
HashTable *props;
ZVAL_OBJ(&tmp, obj);
- props = get_gc(&tmp, &table, &n TSRMLS_CC);
+ props = get_gc(&tmp, &table, &n);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) n--;
for (i = 0; i < n; i++) {
if (Z_REFCOUNTED(table[i])) {
@@ -231,7 +231,7 @@ tail_call:
if (!props && i == n - 1) {
goto tail_call;
} else {
- gc_scan_black(ref TSRMLS_CC);
+ gc_scan_black(ref);
}
}
}
@@ -273,13 +273,13 @@ tail_call:
if (idx == ht->nNumUsed-1) {
goto tail_call;
} else {
- gc_scan_black(ref TSRMLS_CC);
+ gc_scan_black(ref);
}
}
}
}
-static void gc_mark_grey(zend_refcounted *ref TSRMLS_DC)
+static void gc_mark_grey(zend_refcounted *ref)
{
HashTable *ht;
uint idx;
@@ -303,7 +303,7 @@ tail_call:
HashTable *props;
ZVAL_OBJ(&tmp, obj);
- props = get_gc(&tmp, &table, &n TSRMLS_CC);
+ props = get_gc(&tmp, &table, &n);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) n--;
for (i = 0; i < n; i++) {
@@ -315,7 +315,7 @@ tail_call:
if (!props && i == n - 1) {
goto tail_call;
} else {
- gc_mark_grey(ref TSRMLS_CC);
+ gc_mark_grey(ref);
}
}
}
@@ -355,25 +355,25 @@ tail_call:
if (idx == ht->nNumUsed-1) {
goto tail_call;
} else {
- gc_mark_grey(ref TSRMLS_CC);
+ gc_mark_grey(ref);
}
}
}
}
-static void gc_mark_roots(TSRMLS_D)
+static void gc_mark_roots(void)
{
gc_root_buffer *current = GC_G(roots).next;
while (current != &GC_G(roots)) {
if (GC_GET_COLOR(GC_INFO(current->ref)) == GC_PURPLE) {
- gc_mark_grey(current->ref TSRMLS_CC);
+ gc_mark_grey(current->ref);
}
current = current->next;
}
}
-static void gc_scan(zend_refcounted *ref TSRMLS_DC)
+static void gc_scan(zend_refcounted *ref)
{
HashTable *ht;
uint idx;
@@ -383,7 +383,7 @@ tail_call:
if (GC_GET_COLOR(GC_INFO(ref)) == GC_GREY) {
ht = NULL;
if (GC_REFCOUNT(ref) > 0) {
- gc_scan_black(ref TSRMLS_CC);
+ gc_scan_black(ref);
} else {
GC_SET_COLOR(GC_INFO(ref), GC_WHITE);
if (GC_TYPE(ref) == IS_OBJECT && EG(objects_store).object_buckets) {
@@ -398,7 +398,7 @@ tail_call:
HashTable *props;
ZVAL_OBJ(&tmp, obj);
- props = get_gc(&tmp, &table, &n TSRMLS_CC);
+ props = get_gc(&tmp, &table, &n);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) n--;
for (i = 0; i < n; i++) {
if (Z_REFCOUNTED(table[i])) {
@@ -406,7 +406,7 @@ tail_call:
if (!props && i == n - 1) {
goto tail_call;
} else {
- gc_scan(ref TSRMLS_CC);
+ gc_scan(ref);
}
}
}
@@ -441,23 +441,23 @@ tail_call:
if (idx == ht->nNumUsed-1) {
goto tail_call;
} else {
- gc_scan(ref TSRMLS_CC);
+ gc_scan(ref);
}
}
}
}
-static void gc_scan_roots(TSRMLS_D)
+static void gc_scan_roots(void)
{
gc_root_buffer *current = GC_G(roots).next;
while (current != &GC_G(roots)) {
- gc_scan(current->ref TSRMLS_CC);
+ gc_scan(current->ref);
current = current->next;
}
}
-static int gc_collect_white(zend_refcounted *ref TSRMLS_DC)
+static int gc_collect_white(zend_refcounted *ref)
{
int count = 0;
HashTable *ht;
@@ -513,7 +513,7 @@ tail_call:
HashTable *props;
ZVAL_OBJ(&tmp, obj);
- props = get_gc(&tmp, &table, &n TSRMLS_CC);
+ props = get_gc(&tmp, &table, &n);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) {
/* count non-refcounted for compatibility ??? */
if (Z_TYPE(table[n-1]) != IS_UNDEF) {
@@ -530,7 +530,7 @@ tail_call:
if (!props && i == n - 1) {
goto tail_call;
} else {
- count += gc_collect_white(ref TSRMLS_CC);
+ count += gc_collect_white(ref);
}
/* count non-refcounted for compatibility ??? */
} else if (Z_TYPE(table[i]) != IS_UNDEF) {
@@ -576,14 +576,14 @@ tail_call:
if (idx == ht->nNumUsed-1) {
goto tail_call;
} else {
- count += gc_collect_white(ref TSRMLS_CC);
+ count += gc_collect_white(ref);
}
}
}
return count;
}
-static int gc_collect_roots(TSRMLS_D)
+static int gc_collect_roots(void)
{
int count = 0;
gc_root_buffer *current = GC_G(roots).next;
@@ -601,7 +601,7 @@ static int gc_collect_roots(TSRMLS_D)
while (current != &GC_G(roots)) {
if (GC_GET_COLOR(GC_INFO(current->ref)) == GC_WHITE) {
GC_REFCOUNT(current->ref)++;
- count += gc_collect_white(current->ref TSRMLS_CC);
+ count += gc_collect_white(current->ref);
}
current = current->next;
}
@@ -613,7 +613,7 @@ static int gc_collect_roots(TSRMLS_D)
GC_SET_BLACK(GC_INFO(current->ref));
current = current->next;
}
- gc_reset(TSRMLS_C);
+ gc_reset();
return 0;
}
@@ -639,7 +639,7 @@ static int gc_collect_roots(TSRMLS_D)
return count;
}
-static void gc_remove_nested_data_from_buffer(zend_refcounted *ref TSRMLS_DC)
+static void gc_remove_nested_data_from_buffer(zend_refcounted *ref)
{
HashTable *ht = NULL;
uint idx;
@@ -661,7 +661,7 @@ tail_call:
HashTable *props;
ZVAL_OBJ(&tmp, obj);
- props = get_gc(&tmp, &table, &n TSRMLS_CC);
+ props = get_gc(&tmp, &table, &n);
while (n > 0 && !Z_REFCOUNTED(table[n-1])) n--;
for (i = 0; i < n; i++) {
@@ -670,7 +670,7 @@ tail_call:
if (!props && i == n - 1) {
goto tail_call;
} else {
- gc_remove_nested_data_from_buffer(ref TSRMLS_CC);
+ gc_remove_nested_data_from_buffer(ref);
}
}
}
@@ -700,13 +700,13 @@ tail_call:
if (idx == ht->nNumUsed-1) {
goto tail_call;
} else {
- gc_remove_nested_data_from_buffer(ref TSRMLS_CC);
+ gc_remove_nested_data_from_buffer(ref);
}
}
}
}
-ZEND_API int gc_collect_cycles(TSRMLS_D)
+ZEND_API int gc_collect_cycles(void)
{
int count = 0;
@@ -720,9 +720,9 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
}
GC_G(gc_runs)++;
GC_G(gc_active) = 1;
- gc_mark_roots(TSRMLS_C);
- gc_scan_roots(TSRMLS_C);
- count = gc_collect_roots(TSRMLS_C);
+ gc_mark_roots();
+ gc_scan_roots();
+ count = gc_collect_roots();
GC_G(gc_active) = 0;
if (GC_G(to_free).next == &GC_G(to_free)) {
@@ -764,7 +764,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
if (obj->handlers->dtor_obj) {
GC_REFCOUNT(obj)++;
- obj->handlers->dtor_obj(obj TSRMLS_CC);
+ obj->handlers->dtor_obj(obj);
GC_REFCOUNT(obj)--;
}
}
@@ -777,7 +777,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
while (current != &to_free) {
GC_G(next_to_free) = current->next;
if (GC_REFCOUNT(current->ref) > current->refcount) {
- gc_remove_nested_data_from_buffer(current->ref TSRMLS_CC);
+ gc_remove_nested_data_from_buffer(current->ref);
}
current = GC_G(next_to_free);
}
@@ -797,7 +797,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj) {
GC_REFCOUNT(obj)++;
- obj->handlers->free_obj(obj TSRMLS_CC);
+ obj->handlers->free_obj(obj);
GC_REFCOUNT(obj)--;
}
}
@@ -821,7 +821,7 @@ ZEND_API int gc_collect_cycles(TSRMLS_D)
if (EG(objects_store).object_buckets &&
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
- zend_objects_store_free(obj TSRMLS_CC);
+ zend_objects_store_free(obj);
}
} else {
GC_REMOVE_FROM_BUFFER(p);
diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h
index 2eb8ea6ea3..92a4004317 100644
--- a/Zend/zend_gc.h
+++ b/Zend/zend_gc.h
@@ -112,37 +112,37 @@ typedef struct _zend_gc_globals {
BEGIN_EXTERN_C()
ZEND_API extern int gc_globals_id;
END_EXTERN_C()
-#define GC_G(v) TSRMG(gc_globals_id, zend_gc_globals *, v)
+#define GC_G(v) ZEND_TSRMG(gc_globals_id, zend_gc_globals *, v)
#else
#define GC_G(v) (gc_globals.v)
extern ZEND_API zend_gc_globals gc_globals;
#endif
BEGIN_EXTERN_C()
-ZEND_API int gc_collect_cycles(TSRMLS_D);
-ZEND_API void gc_possible_root(zend_refcounted *ref TSRMLS_DC);
-ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC);
-ZEND_API void gc_globals_ctor(TSRMLS_D);
-ZEND_API void gc_globals_dtor(TSRMLS_D);
-ZEND_API void gc_init(TSRMLS_D);
-ZEND_API void gc_reset(TSRMLS_D);
+ZEND_API int gc_collect_cycles(void);
+ZEND_API void gc_possible_root(zend_refcounted *ref);
+ZEND_API void gc_remove_from_buffer(zend_refcounted *ref);
+ZEND_API void gc_globals_ctor(void);
+ZEND_API void gc_globals_dtor(void);
+ZEND_API void gc_init(void);
+ZEND_API void gc_reset(void);
END_EXTERN_C()
#define GC_ZVAL_CHECK_POSSIBLE_ROOT(z) \
- gc_check_possible_root((z) TSRMLS_CC)
+ gc_check_possible_root((z))
#define GC_REMOVE_FROM_BUFFER(p) do { \
zend_refcounted *_p = (zend_refcounted*)(p); \
if (GC_ADDRESS(GC_INFO(_p))) { \
- gc_remove_from_buffer(_p TSRMLS_CC); \
+ gc_remove_from_buffer(_p); \
} \
} while (0)
-static zend_always_inline void gc_check_possible_root(zval *z TSRMLS_DC)
+static zend_always_inline void gc_check_possible_root(zval *z)
{
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
- gc_possible_root(Z_COUNTED_P(z) TSRMLS_CC);
+ gc_possible_root(Z_COUNTED_P(z));
}
}
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index c3827c5c51..17bd4a3da5 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -27,9 +27,9 @@
ZEND_API zend_class_entry *zend_ce_generator;
static zend_object_handlers zend_generator_handlers;
-static zend_object *zend_generator_create(zend_class_entry *class_type TSRMLS_DC);
+static zend_object *zend_generator_create(zend_class_entry *class_type);
-static void zend_generator_cleanup_unfinished_execution(zend_generator *generator TSRMLS_DC) /* {{{ */
+static void zend_generator_cleanup_unfinished_execution(zend_generator *generator) /* {{{ */
{
zend_execute_data *execute_data = generator->execute_data;
zend_op_array *op_array = &execute_data->func->op_array;
@@ -76,7 +76,7 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
}
/* }}} */
-ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC) /* {{{ */
+ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
{
if (Z_TYPE(generator->value) != IS_UNDEF) {
zval_ptr_dtor(&generator->value);
@@ -93,9 +93,9 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
zend_op_array *op_array = &execute_data->func->op_array;
if (!execute_data->symbol_table) {
- zend_free_compiled_variables(execute_data TSRMLS_CC);
+ zend_free_compiled_variables(execute_data);
} else {
- zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC);
+ zend_clean_and_cache_symbol_table(execute_data->symbol_table);
}
if (Z_OBJ(execute_data->This)) {
@@ -109,17 +109,17 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
return;
}
- zend_vm_stack_free_extra_args(generator->execute_data TSRMLS_CC);
+ zend_vm_stack_free_extra_args(generator->execute_data);
/* Some cleanups are only necessary if the generator was closued
* before it could finish execution (reach a return statement). */
if (!finished_execution) {
- zend_generator_cleanup_unfinished_execution(generator TSRMLS_CC);
+ zend_generator_cleanup_unfinished_execution(generator);
}
/* Free a clone of closure */
if (op_array->fn_flags & ZEND_ACC_CLOSURE) {
- destroy_op_array(op_array TSRMLS_CC);
+ destroy_op_array(op_array);
efree_size(op_array, sizeof(zend_op_array));
}
@@ -129,7 +129,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
}
/* }}} */
-static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
{
zend_generator *generator = (zend_generator*) object;
zend_execute_data *ex = generator->execute_data;
@@ -169,26 +169,26 @@ static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
fast_call->u2.lineno = (uint32_t)-1;
ex->opline = &ex->func->op_array.opcodes[finally_op_num];
generator->flags |= ZEND_GENERATOR_FORCED_CLOSE;
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
}
}
/* }}} */
-static void zend_generator_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void zend_generator_free_storage(zend_object *object) /* {{{ */
{
zend_generator *generator = (zend_generator*) object;
- zend_generator_close(generator, 0 TSRMLS_CC);
+ zend_generator_close(generator, 0);
- zend_object_std_dtor(&generator->std TSRMLS_CC);
+ zend_object_std_dtor(&generator->std);
if (generator->iterator) {
- zend_iterator_dtor(generator->iterator TSRMLS_CC);
+ zend_iterator_dtor(generator->iterator);
}
}
/* }}} */
-static zend_object *zend_generator_create(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *zend_generator_create(zend_class_entry *class_type) /* {{{ */
{
zend_generator *generator;
@@ -198,14 +198,14 @@ static zend_object *zend_generator_create(zend_class_entry *class_type TSRMLS_DC
/* The key will be incremented on first use, so it'll start at 0 */
generator->largest_used_integer_key = -1;
- zend_object_std_init(&generator->std, class_type TSRMLS_CC);
+ zend_object_std_init(&generator->std, class_type);
generator->std.handlers = &zend_generator_handlers;
return (zend_object*)generator;
}
/* }}} */
-static int copy_closure_static_var(zval *var TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
+static int copy_closure_static_var(zval *var, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
HashTable *target = va_arg(args, HashTable *);
@@ -217,7 +217,7 @@ static int copy_closure_static_var(zval *var TSRMLS_DC, int num_args, va_list ar
/* }}} */
/* Requires globals EG(scope), EG(This) and EG(current_execute_data). */
-ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
+ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value) /* {{{ */
{
zend_generator *generator;
zend_execute_data *current_execute_data;
@@ -240,7 +240,7 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
NULL, ZVAL_PTR_DTOR, 0
);
zend_hash_apply_with_arguments(
- op_array->static_variables TSRMLS_CC,
+ op_array->static_variables,
copy_closure_static_var, 1,
op_array_copy->static_variables
);
@@ -252,7 +252,7 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
/* Create new execution context. We have to back up and restore
* EG(current_execute_data) here. */
current_execute_data = EG(current_execute_data);
- execute_data = zend_create_generator_execute_data(call, op_array, return_value TSRMLS_CC);
+ execute_data = zend_create_generator_execute_data(call, op_array, return_value);
EG(current_execute_data) = current_execute_data;
object_init_ex(return_value, zend_ce_generator);
@@ -276,7 +276,7 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
}
/* }}} */
-static zend_function *zend_generator_get_constructor(zend_object *object TSRMLS_DC) /* {{{ */
+static zend_function *zend_generator_get_constructor(zend_object *object) /* {{{ */
{
zend_error(E_RECOVERABLE_ERROR, "The \"Generator\" class is reserved for internal use and cannot be manually instantiated");
@@ -284,7 +284,7 @@ static zend_function *zend_generator_get_constructor(zend_object *object TSRMLS_
}
/* }}} */
-ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */
+ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
{
/* The generator is already closed, thus can't resume */
if (!generator->execute_data) {
@@ -320,7 +320,7 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
/* Resume execution */
generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING;
- zend_execute_ex(generator->execute_data TSRMLS_CC);
+ zend_execute_ex(generator->execute_data);
generator->flags &= ~ZEND_GENERATOR_CURRENTLY_RUNNING;
/* Unlink generator call_frame from the caller */
@@ -338,27 +338,27 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
/* If an exception was thrown in the generator we have to internally
* rethrow it in the parent scope. */
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
}
}
}
/* }}} */
-static void zend_generator_ensure_initialized(zend_generator *generator TSRMLS_DC) /* {{{ */
+static void zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
{
if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF) {
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
generator->flags |= ZEND_GENERATOR_AT_FIRST_YIELD;
}
}
/* }}} */
-static void zend_generator_rewind(zend_generator *generator TSRMLS_DC) /* {{{ */
+static void zend_generator_rewind(zend_generator *generator) /* {{{ */
{
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
if (!(generator->flags & ZEND_GENERATOR_AT_FIRST_YIELD)) {
- zend_throw_exception(NULL, "Cannot rewind a generator that was already run", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot rewind a generator that was already run", 0);
}
}
/* }}} */
@@ -375,7 +375,7 @@ ZEND_METHOD(Generator, rewind)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_rewind(generator TSRMLS_CC);
+ zend_generator_rewind(generator);
}
/* }}} */
@@ -391,7 +391,7 @@ ZEND_METHOD(Generator, valid)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF);
}
@@ -409,7 +409,7 @@ ZEND_METHOD(Generator, current)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
@@ -429,7 +429,7 @@ ZEND_METHOD(Generator, key)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
if (Z_TYPE(generator->key) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->key);
@@ -449,9 +449,9 @@ ZEND_METHOD(Generator, next)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
}
/* }}} */
@@ -462,13 +462,13 @@ ZEND_METHOD(Generator, send)
zval *value;
zend_generator *generator;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
/* The generator is already closed, thus can't send anything */
if (!generator->execute_data) {
@@ -481,7 +481,7 @@ ZEND_METHOD(Generator, send)
ZVAL_COPY(generator->send_target, value);
}
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
@@ -496,7 +496,7 @@ ZEND_METHOD(Generator, throw)
zval *exception, exception_copy;
zend_generator *generator;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &exception) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
return;
}
@@ -504,18 +504,18 @@ ZEND_METHOD(Generator, throw)
generator = (zend_generator *) Z_OBJ_P(getThis());
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
if (generator->execute_data) {
/* Throw the exception in the context of the generator */
zend_execute_data *current_execute_data = EG(current_execute_data);
EG(current_execute_data) = generator->execute_data;
- zend_throw_exception_object(&exception_copy TSRMLS_CC);
+ zend_throw_exception_object(&exception_copy);
EG(current_execute_data) = current_execute_data;
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
@@ -523,7 +523,7 @@ ZEND_METHOD(Generator, throw)
} else {
/* If the generator is already closed throw the exception in the
* current context */
- zend_throw_exception_object(&exception_copy TSRMLS_CC);
+ zend_throw_exception_object(&exception_copy);
}
}
/* }}} */
@@ -540,46 +540,46 @@ ZEND_METHOD(Generator, __wakeup)
return;
}
- zend_throw_exception(NULL, "Unserialization of 'Generator' is not allowed", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Unserialization of 'Generator' is not allowed", 0);
}
/* }}} */
/* get_iterator implementation */
-static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
+static void zend_generator_iterator_dtor(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
generator->iterator = NULL;
zval_ptr_dtor(&iterator->data);
- zend_iterator_dtor(iterator TSRMLS_CC);
+ zend_iterator_dtor(iterator);
}
/* }}} */
-static int zend_generator_iterator_valid(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
+static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
return Z_TYPE(generator->value) != IS_UNDEF ? SUCCESS : FAILURE;
}
/* }}} */
-static zval *zend_generator_iterator_get_data(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
+static zval *zend_generator_iterator_get_data(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
return &generator->value;
}
/* }}} */
-static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key TSRMLS_DC) /* {{{ */
+static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
if (Z_TYPE(generator->key) != IS_UNDEF) {
ZVAL_ZVAL(key, &generator->key, 1, 0);
@@ -589,21 +589,21 @@ static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval
}
/* }}} */
-static void zend_generator_iterator_move_forward(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
+static void zend_generator_iterator_move_forward(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
- zend_generator_ensure_initialized(generator TSRMLS_CC);
+ zend_generator_ensure_initialized(generator);
- zend_generator_resume(generator TSRMLS_CC);
+ zend_generator_resume(generator);
}
/* }}} */
-static void zend_generator_iterator_rewind(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
+static void zend_generator_iterator_rewind(zend_object_iterator *iterator) /* {{{ */
{
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
- zend_generator_rewind(generator TSRMLS_CC);
+ zend_generator_rewind(generator);
}
/* }}} */
@@ -616,24 +616,24 @@ static zend_object_iterator_funcs zend_generator_iterator_functions = {
zend_generator_iterator_rewind
};
-zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
zend_object_iterator *iterator;
zend_generator *generator = (zend_generator*)Z_OBJ_P(object);
if (!generator->execute_data) {
- zend_throw_exception(NULL, "Cannot traverse an already closed generator", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot traverse an already closed generator", 0);
return NULL;
}
if (by_ref && !(generator->execute_data->func->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
- zend_throw_exception(NULL, "You can only iterate a generator by-reference if it declared that it yields by-reference", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "You can only iterate a generator by-reference if it declared that it yields by-reference", 0);
return NULL;
}
iterator = generator->iterator = emalloc(sizeof(zend_object_iterator));
- zend_iterator_init(iterator TSRMLS_CC);
+ zend_iterator_init(iterator);
iterator->funcs = &zend_generator_iterator_functions;
ZVAL_COPY(&iterator->data, object);
@@ -665,19 +665,19 @@ static const zend_function_entry generator_functions[] = {
ZEND_FE_END
};
-void zend_register_generator_ce(TSRMLS_D) /* {{{ */
+void zend_register_generator_ce(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "Generator", generator_functions);
- zend_ce_generator = zend_register_internal_class(&ce TSRMLS_CC);
+ zend_ce_generator = zend_register_internal_class(&ce);
zend_ce_generator->ce_flags |= ZEND_ACC_FINAL;
zend_ce_generator->create_object = zend_generator_create;
zend_ce_generator->serialize = zend_class_serialize_deny;
zend_ce_generator->unserialize = zend_class_unserialize_deny;
/* get_iterator has to be assigned *after* implementing the inferface */
- zend_class_implements(zend_ce_generator TSRMLS_CC, 1, zend_ce_iterator);
+ zend_class_implements(zend_ce_generator, 1, zend_ce_iterator);
zend_ce_generator->get_iterator = zend_generator_get_iterator;
zend_ce_generator->iterator_funcs.funcs = &zend_generator_iterator_functions;
diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h
index a85b8dd976..7d7536cd52 100644
--- a/Zend/zend_generators.h
+++ b/Zend/zend_generators.h
@@ -53,10 +53,10 @@ static const zend_uchar ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1;
static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2;
static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
-void zend_register_generator_ce(TSRMLS_D);
-ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC);
-ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC);
-ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC);
+void zend_register_generator_ce(void);
+ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value);
+ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution);
+ZEND_API void zend_generator_resume(zend_generator *generator);
END_EXTERN_C()
diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h
index ac9b793775..7678b2b01d 100644
--- a/Zend/zend_globals_macros.h
+++ b/Zend/zend_globals_macros.h
@@ -31,18 +31,17 @@ BEGIN_EXTERN_C()
/* Compiler */
#ifdef ZTS
-# define CG(v) TSRMG(compiler_globals_id, zend_compiler_globals *, v)
-int zendparse(void *compiler_globals);
+# define CG(v) ZEND_TSRMG(compiler_globals_id, zend_compiler_globals *, v)
#else
# define CG(v) (compiler_globals.v)
extern ZEND_API struct _zend_compiler_globals compiler_globals;
-int zendparse(void);
#endif
+int zendparse(void);
/* Executor */
#ifdef ZTS
-# define EG(v) TSRMG(executor_globals_id, zend_executor_globals *, v)
+# define EG(v) ZEND_TSRMG(executor_globals_id, zend_executor_globals *, v)
#else
# define EG(v) (executor_globals.v)
extern ZEND_API zend_executor_globals executor_globals;
@@ -50,7 +49,7 @@ extern ZEND_API zend_executor_globals executor_globals;
/* Language Scanner */
#ifdef ZTS
-# define LANG_SCNG(v) TSRMG(language_scanner_globals_id, zend_php_scanner_globals *, v)
+# define LANG_SCNG(v) ZEND_TSRMG(language_scanner_globals_id, zend_php_scanner_globals *, v)
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
#else
# define LANG_SCNG(v) (language_scanner_globals.v)
@@ -60,7 +59,7 @@ extern ZEND_API zend_php_scanner_globals language_scanner_globals;
/* INI Scanner */
#ifdef ZTS
-# define INI_SCNG(v) TSRMG(ini_scanner_globals_id, zend_ini_scanner_globals *, v)
+# define INI_SCNG(v) ZEND_TSRMG(ini_scanner_globals_id, zend_ini_scanner_globals *, v)
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
#else
# define INI_SCNG(v) (ini_scanner_globals.v)
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 0f77ca6048..cc593f657a 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -265,7 +265,6 @@ static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_s
uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -419,7 +418,6 @@ static zend_always_inline zval *_zend_hash_index_add_or_update_i(HashTable *ht,
uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -568,7 +566,6 @@ ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_
static void zend_hash_do_resize(HashTable *ht)
{
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -689,7 +686,6 @@ ZEND_API int zend_hash_del(HashTable *ht, zend_string *key)
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -728,7 +724,6 @@ ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key)
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -780,7 +775,6 @@ ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, size_t len)
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -831,7 +825,6 @@ ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, size_t len)
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -864,7 +857,6 @@ ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h)
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -945,7 +937,7 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);
}
-ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC)
+ZEND_API void zend_array_destroy(HashTable *ht)
{
Bucket *p, *end;
@@ -966,13 +958,13 @@ ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC)
if (ht->u.flags & HASH_FLAG_PACKED) {
do {
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
- i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
}
} while (++p != end);
} else {
do {
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
- i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
@@ -1036,7 +1028,7 @@ ZEND_API void zend_hash_clean(HashTable *ht)
}
}
-ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC)
+ZEND_API void zend_symtable_clean(HashTable *ht)
{
Bucket *p, *end;
@@ -1047,7 +1039,7 @@ ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC)
end = p + ht->nNumUsed;
do {
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
- i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
@@ -1073,7 +1065,6 @@ ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC)
static void zend_hash_apply_deleter(HashTable *ht, uint32_t idx, Bucket *p)
{
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -1132,7 +1123,7 @@ ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
* ZEND_HASH_APPLY_REMOVE - delete the element, combineable with the former
*/
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
{
uint32_t idx;
Bucket *p;
@@ -1145,7 +1136,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
p = ht->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
- result = apply_func(&p->val TSRMLS_CC);
+ result = apply_func(&p->val);
if (result & ZEND_HASH_APPLY_REMOVE) {
zend_hash_apply_deleter(ht, idx, p);
@@ -1158,7 +1149,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
}
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC)
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
{
uint32_t idx;
Bucket *p;
@@ -1171,7 +1162,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
p = ht->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
- result = apply_func(&p->val, argument TSRMLS_CC);
+ result = apply_func(&p->val, argument);
if (result & ZEND_HASH_APPLY_REMOVE) {
zend_hash_apply_deleter(ht, idx, p);
@@ -1184,7 +1175,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
}
-ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...)
+ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int num_args, ...)
{
uint32_t idx;
Bucket *p;
@@ -1203,7 +1194,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
hash_key.h = p->h;
hash_key.key = p->key;
- result = apply_func(&p->val TSRMLS_CC, num_args, args, &hash_key);
+ result = apply_func(&p->val, num_args, args, &hash_key);
if (result & ZEND_HASH_APPLY_REMOVE) {
zend_hash_apply_deleter(ht, idx, p);
@@ -1219,7 +1210,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
}
-ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
+ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func)
{
uint32_t idx;
Bucket *p;
@@ -1234,7 +1225,7 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
p = ht->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
- result = apply_func(&p->val TSRMLS_CC);
+ result = apply_func(&p->val);
if (result & ZEND_HASH_APPLY_REMOVE) {
zend_hash_apply_deleter(ht, idx, p);
@@ -1750,7 +1741,7 @@ ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos)
}
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
- compare_func_t compar, zend_bool renumber TSRMLS_DC)
+ compare_func_t compar, zend_bool renumber)
{
Bucket *p;
uint32_t i, j;
@@ -1774,7 +1765,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
}
}
- (*sort_func)((void *) ht->arData, i, sizeof(Bucket), compar TSRMLS_CC);
+ (*sort_func)((void *) ht->arData, i, sizeof(Bucket), compar);
HANDLE_BLOCK_INTERRUPTIONS();
ht->nNumUsed = i;
@@ -1812,7 +1803,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
}
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
{
uint32_t idx1, idx2;
Bucket *p1, *p2 = NULL;
@@ -1901,7 +1892,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
} else if (Z_TYPE_P(pData2) == IS_UNDEF) {
return 1;
} else {
- result = compar(pData1, pData2 TSRMLS_CC);
+ result = compar(pData1, pData2);
}
if (result != 0) {
HASH_UNPROTECT_RECURSION(ht1);
@@ -1919,7 +1910,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
}
-ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC)
+ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag)
{
uint32_t idx;
Bucket *p, *res;
@@ -1944,11 +1935,11 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint
if (Z_TYPE(p->val) == IS_UNDEF) continue;
if (flag) {
- if (compar(res, p TSRMLS_CC) < 0) { /* max */
+ if (compar(res, p) < 0) { /* max */
res = p;
}
} else {
- if (compar(res, p TSRMLS_CC) > 0) { /* min */
+ if (compar(res, p) > 0) { /* min */
res = p;
}
}
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 8f12b0e66e..81b933289f 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -122,15 +122,15 @@ ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, s
#define ZEND_HASH_APPLY_REMOVE 1<<0
#define ZEND_HASH_APPLY_STOP 1<<1
-typedef int (*apply_func_t)(zval *pDest TSRMLS_DC);
-typedef int (*apply_func_arg_t)(zval *pDest, void *argument TSRMLS_DC);
-typedef int (*apply_func_args_t)(zval *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
+typedef int (*apply_func_t)(zval *pDest);
+typedef int (*apply_func_arg_t)(zval *pDest, void *argument);
+typedef int (*apply_func_args_t)(zval *pDest, int num_args, va_list args, zend_hash_key *hash_key);
ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht);
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
-ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int, ...);
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func);
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *);
+ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...);
/* This function should be used with special care (in other words,
* it should usually not be used). When used with the ZEND_HASH_APPLY_STOP
@@ -138,7 +138,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
* Also, it does not provide the same kind of reentrancy protection that
* the standard apply functions do.
*/
-ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
+ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func);
/* Deletes */
@@ -200,9 +200,9 @@ typedef struct _HashPointer {
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor);
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, zend_bool overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
-ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, zend_bool renumber TSRMLS_DC);
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
-ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag TSRMLS_DC);
+ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, zend_bool renumber);
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
+ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag);
#define zend_hash_merge(target, source, pCopyConstructor, overwrite) \
_zend_hash_merge(target, source, pCopyConstructor, overwrite ZEND_FILE_LINE_CC)
@@ -216,8 +216,8 @@ ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_array_dup(HashTable *target, HashTable *source);
-ZEND_API void zend_array_destroy(HashTable *ht TSRMLS_DC);
-ZEND_API void zend_symtable_clean(HashTable *ht TSRMLS_DC);
+ZEND_API void zend_array_destroy(HashTable *ht);
+ZEND_API void zend_symtable_clean(HashTable *ht);
#if ZEND_DEBUG
/* debug */
diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c
index 79a552635f..27e4fee93a 100644
--- a/Zend/zend_highlight.c
+++ b/Zend/zend_highlight.c
@@ -54,14 +54,14 @@ ZEND_API void zend_html_putc(char c)
}
-ZEND_API void zend_html_puts(const char *s, size_t len TSRMLS_DC)
+ZEND_API void zend_html_puts(const char *s, size_t len)
{
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
unsigned char *filtered = NULL;
size_t filtered_len;
if (LANG_SCNG(output_filter)) {
- LANG_SCNG(output_filter)(&filtered, &filtered_len, ptr, len TSRMLS_CC);
+ LANG_SCNG(output_filter)(&filtered, &filtered_len, ptr, len);
ptr = filtered;
end = filtered + filtered_len;
}
@@ -82,7 +82,7 @@ ZEND_API void zend_html_puts(const char *s, size_t len TSRMLS_DC)
}
-ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
+ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini)
{
zval token;
int token_type;
@@ -93,7 +93,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
zend_printf("<span style=\"color: %s\">\n", last_color);
/* highlight stuff coming back from zendlex() */
ZVAL_UNDEF(&token);
- while ((token_type=lex_scan(&token TSRMLS_CC))) {
+ while ((token_type=lex_scan(&token))) {
switch (token_type) {
case T_INLINE_HTML:
next_color = syntax_highlighter_ini->highlight_html;
@@ -121,7 +121,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
next_color = syntax_highlighter_ini->highlight_string;
break;
case T_WHITESPACE:
- zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC); /* no color needed */
+ zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); /* no color needed */
ZVAL_UNDEF(&token);
continue;
break;
@@ -144,7 +144,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
}
}
- zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
+ zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
if (Z_TYPE(token) == IS_STRING) {
switch (token_type) {
@@ -170,14 +170,14 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
zend_printf("</code>");
}
-ZEND_API void zend_strip(TSRMLS_D)
+ZEND_API void zend_strip(void)
{
zval token;
int token_type;
int prev_space = 0;
ZVAL_UNDEF(&token);
- while ((token_type=lex_scan(&token TSRMLS_CC))) {
+ while ((token_type=lex_scan(&token))) {
switch (token_type) {
case T_WHITESPACE:
if (!prev_space) {
@@ -193,7 +193,7 @@ ZEND_API void zend_strip(TSRMLS_D)
case T_END_HEREDOC:
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
/* read the following character, either newline or ; */
- if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
+ if (lex_scan(&token) != T_WHITESPACE) {
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
}
zend_write("\n", sizeof("\n") - 1);
diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h
index 3e91fd71f4..37bf6549c3 100644
--- a/Zend/zend_highlight.h
+++ b/Zend/zend_highlight.h
@@ -39,12 +39,12 @@ typedef struct _zend_syntax_highlighter_ini {
BEGIN_EXTERN_C()
-ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
-ZEND_API void zend_strip(TSRMLS_D);
-ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
-ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
+ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
+ZEND_API void zend_strip(void);
+ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
+ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
ZEND_API void zend_html_putc(char c);
-ZEND_API void zend_html_puts(const char *s, size_t len TSRMLS_DC);
+ZEND_API void zend_html_puts(const char *s, size_t len);
END_EXTERN_C()
extern zend_syntax_highlighter_ini syntax_highlighter_ini;
diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c
index 22cc4d2b9e..7e2ee0a471 100644
--- a/Zend/zend_indent.c
+++ b/Zend/zend_indent.c
@@ -47,7 +47,7 @@ static void handle_whitespace(unsigned int *emit_whitespace)
}
-ZEND_API void zend_indent(TSRMLS_D)
+ZEND_API void zend_indent(void)
{
zval token;
int token_type;
@@ -60,7 +60,7 @@ ZEND_API void zend_indent(TSRMLS_D)
/* highlight stuff coming back from zendlex() */
ZVAL_UNDEF(&token);
- while ((token_type=lex_scan(&token TSRMLS_CC))) {
+ while ((token_type=lex_scan(&token))) {
switch (token_type) {
case T_INLINE_HTML:
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
diff --git a/Zend/zend_indent.h b/Zend/zend_indent.h
index 1c1afb9127..6d0996efa8 100644
--- a/Zend/zend_indent.h
+++ b/Zend/zend_indent.h
@@ -23,7 +23,7 @@
#define ZEND_INDENT_H
BEGIN_EXTERN_C()
-ZEND_API void zend_indent(TSRMLS_D);
+ZEND_API void zend_indent(void);
END_EXTERN_C()
#endif /* ZEND_INDENT_H */
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 8963d2b93b..5f7b17277b 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -29,7 +29,7 @@ static void ptr_dtor(zval *zv) /* {{{ */
}
/* }}} */
-static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info TSRMLS_DC) /* {{{ */
+static zend_property_info *zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
{
zend_property_info* new_property_info;
@@ -52,7 +52,7 @@ static zend_property_info *zend_duplicate_property_info_internal(zend_property_i
}
/* }}} */
-static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
{
zend_function *function, *new_function;
@@ -187,7 +187,7 @@ char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
}
/* }}} */
-static zend_function *do_inherit_method(zend_function *old_function, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static zend_function *do_inherit_method(zend_function *old_function, zend_class_entry *ce) /* {{{ */
{
zend_function *new_function;
@@ -213,7 +213,7 @@ static zend_function *do_inherit_method(zend_function *old_function, zend_class_
}
/* }}} */
-static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
+static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto) /* {{{ */
{
uint32_t i, num_args;
@@ -331,8 +331,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
strcasecmp(colon+1, proto_class_name->val) != 0) {
zend_class_entry *fe_ce, *proto_ce;
- fe_ce = zend_lookup_class(fe_class_name TSRMLS_CC);
- proto_ce = zend_lookup_class(proto_class_name TSRMLS_CC);
+ fe_ce = zend_lookup_class(fe_class_name);
+ proto_ce = zend_lookup_class(proto_class_name);
/* Check for class alias */
if (!fe_ce || !proto_ce ||
@@ -363,7 +363,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
}
/* }}} */
-static zend_string *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */
+static zend_string *zend_get_function_declaration(zend_function *fptr) /* {{{ */
{
smart_str str = {0};
@@ -500,7 +500,7 @@ static zend_string *zend_get_function_declaration(zend_function *fptr TSRMLS_DC)
}
/* }}} */
-static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */
+static void do_inheritance_check_on_method(zend_function *child, zend_function *parent) /* {{{ */
{
uint32_t child_flags;
uint32_t parent_flags = parent->common.fn_flags;
@@ -559,12 +559,12 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
}
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
- if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
- zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype TSRMLS_CC)->val);
+ if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype)->val);
}
} else if (EG(error_reporting) & E_STRICT || Z_TYPE(EG(user_error_handler)) != IS_UNDEF) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
- if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
- zend_string *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
+ if (!zend_do_perform_implementation_check(child, parent)) {
+ zend_string *method_prototype = zend_get_function_declaration(parent);
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype->val);
zend_string_free(method_prototype);
}
@@ -576,7 +576,6 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
{
uint32_t parent_flags = parent->common.fn_flags;
zend_function *child;
- TSRMLS_FETCH();
if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) {
if (parent_flags & (ZEND_ACC_ABSTRACT)) {
@@ -585,13 +584,13 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
return 1; /* method doesn't exist in child, copy from parent */
}
- do_inheritance_check_on_method(child, parent TSRMLS_CC);
+ do_inheritance_check_on_method(child, parent);
return 0;
}
/* }}} */
-static zend_bool do_inherit_property_access_check(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static zend_bool do_inherit_property_access_check(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce) /* {{{ */
{
zend_property_info *child_info;
zend_class_entry *parent_ce = ce->parent;
@@ -603,7 +602,7 @@ static zend_bool do_inherit_property_access_check(zend_property_info *parent_inf
if(ce->type & ZEND_INTERNAL_CLASS) {
child_info = zend_duplicate_property_info_internal(parent_info);
} else {
- child_info = zend_duplicate_property_info(parent_info TSRMLS_CC);
+ child_info = zend_duplicate_property_info(parent_info);
}
zend_hash_update_ptr(&ce->properties_info, key, child_info);
child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */
@@ -642,9 +641,9 @@ static zend_bool do_inherit_property_access_check(zend_property_info *parent_inf
}
/* }}} */
-static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry *iface) /* {{{ */
{
- if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) {
+ if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce) == FAILURE) {
zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name->val, iface->name->val);
}
if (ce == iface) {
@@ -653,7 +652,7 @@ static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry
}
/* }}} */
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface) /* {{{ */
{
/* expects interface to be contained in ce's interface list already */
uint32_t i, ce_num, if_num = iface->num_interfaces;
@@ -685,7 +684,7 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_
/* and now call the implementing handlers */
while (ce_num < ce->num_interfaces) {
- do_implement_interface(ce, ce->interfaces[ce_num++] TSRMLS_CC);
+ do_implement_interface(ce, ce->interfaces[ce_num++]);
}
}
/* }}} */
@@ -698,7 +697,7 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_
zval_add_ref
#endif
-static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
+static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *parent_ce) /* {{{ */
{
if (!Z_ISREF_P(zv)) {
if (parent_ce->type == ZEND_INTERNAL_CLASS) {
@@ -716,7 +715,7 @@ static void do_inherit_class_constant(zend_string *name, zval *zv, zend_class_en
}
/* }}} */
-ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) /* {{{ */
{
zend_property_info *property_info;
zend_function *func;
@@ -741,7 +740,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
}
/* Inherit interfaces */
- zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC);
+ zend_do_inherit_interfaces(ce, parent_ce);
/* Inherit properties */
if (parent_ce->default_properties_count) {
@@ -774,7 +773,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
if (parent_ce->type != ce->type) {
/* User class extends internal class */
- zend_update_class_constants(parent_ce TSRMLS_CC);
+ zend_update_class_constants(parent_ce );
if (parent_ce->default_static_members_count) {
int i = ce->default_static_members_count + parent_ce->default_static_members_count;
@@ -831,34 +830,34 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->properties_info, key, property_info) {
- if (do_inherit_property_access_check(property_info, key, ce TSRMLS_CC)) {
+ if (do_inherit_property_access_check(property_info, key, ce)) {
if (ce->type & ZEND_INTERNAL_CLASS) {
property_info = zend_duplicate_property_info_internal(property_info);
} else {
- property_info = zend_duplicate_property_info(property_info TSRMLS_CC);
+ property_info = zend_duplicate_property_info(property_info);
}
zend_hash_add_new_ptr(&ce->properties_info, key, property_info);
}
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_VAL(&parent_ce->constants_table, key, zv) {
- do_inherit_class_constant(key, zv, ce, parent_ce TSRMLS_CC);
+ do_inherit_class_constant(key, zv, ce, parent_ce);
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, func) {
if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
- zend_function *new_func = do_inherit_method(func, ce TSRMLS_CC);
+ zend_function *new_func = do_inherit_method(func, ce);
zend_hash_add_new_ptr(&ce->function_table, key, new_func);
}
} ZEND_HASH_FOREACH_END();
- do_inherit_parent_constructor(ce TSRMLS_CC);
+ do_inherit_parent_constructor(ce);
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
} else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
/* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */
- zend_verify_abstract_class(ce TSRMLS_CC);
+ zend_verify_abstract_class(ce);
}
ce->ce_flags |= parent_ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS;
}
@@ -880,7 +879,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
}
/* }}} */
-static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface) /* {{{ */
{
if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) {
ZVAL_MAKE_REF(zv);
@@ -893,7 +892,7 @@ static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_en
}
/* }}} */
-ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface) /* {{{ */
{
uint32_t i, ignore = 0;
uint32_t current_iface_num = ce->num_interfaces;
@@ -930,23 +929,23 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry
ce->interfaces[ce->num_interfaces++] = iface;
ZEND_HASH_FOREACH_STR_KEY_VAL(&iface->constants_table, key, zv) {
- do_inherit_iface_constant(key, zv, ce, iface TSRMLS_CC);
+ do_inherit_iface_constant(key, zv, ce, iface);
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_PTR(&iface->function_table, key, func) {
if (do_inherit_method_check(&ce->function_table, func, key, ce)) {
- zend_function *new_func = do_inherit_method(func, ce TSRMLS_CC);
+ zend_function *new_func = do_inherit_method(func, ce);
zend_hash_add_new_ptr(&ce->function_table, key, new_func);
}
} ZEND_HASH_FOREACH_END();
- do_implement_interface(ce, iface TSRMLS_CC);
- zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
+ do_implement_interface(ce, iface);
+ zend_do_inherit_interfaces(ce, iface);
}
}
/* }}} */
-ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait) /* {{{ */
{
uint32_t i, ignore = 0;
uint32_t current_trait_num = ce->num_traits;
@@ -975,19 +974,19 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
}
/* }}} */
-static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */
+static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn) /* {{{ */
{
uint32_t fn_flags = fn->common.scope->ce_flags;
uint32_t other_flags = other_fn->common.scope->ce_flags;
- return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
- && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
+ return zend_do_perform_implementation_check(fn, other_fn)
+ && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn))
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
}
/* }}} */
-static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe TSRMLS_DC) /* {{{ */
+static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe) /* {{{ */
{
if (!strncmp(mname->val, ZEND_CLONE_FUNC_NAME, mname->len)) {
ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE;
@@ -1017,7 +1016,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
} else if (ce->name->len == mname->len) {
zend_string *lowercase_name = zend_string_alloc(ce->name->len, 0);
zend_str_tolower_copy(lowercase_name->val, ce->name->val, ce->name->len);
- lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
+ lowercase_name = zend_new_interned_string(lowercase_name);
if (!memcmp(mname->val, lowercase_name->val, mname->len)) {
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name->val);
@@ -1030,7 +1029,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
}
/* }}} */
-static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */
+static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_string *key, zend_function *fn, HashTable **overriden) /* {{{ */
{
zend_function *existing_fn = NULL;
zend_function *new_fn;
@@ -1043,17 +1042,17 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
if ((existing_fn = zend_hash_find_ptr(*overriden, key)) != NULL) {
if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the trait method is compatible with previosly declared abstract method */
- if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
+ if (!zend_traits_method_compatibility_check(fn, existing_fn)) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC)->val,
- zend_get_function_declaration(existing_fn TSRMLS_CC)->val);
+ zend_get_function_declaration(fn)->val,
+ zend_get_function_declaration(existing_fn)->val);
}
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
- if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
+ if (!zend_traits_method_compatibility_check(existing_fn, fn)) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC)->val,
- zend_get_function_declaration(existing_fn TSRMLS_CC)->val);
+ zend_get_function_declaration(fn)->val,
+ zend_get_function_declaration(existing_fn)->val);
}
return;
}
@@ -1066,17 +1065,17 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
return;
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the trait method is compatible with previosly declared abstract method */
- if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
+ if (!zend_traits_method_compatibility_check(fn, existing_fn)) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC)->val,
- zend_get_function_declaration(existing_fn TSRMLS_CC)->val);
+ zend_get_function_declaration(fn)->val,
+ zend_get_function_declaration(existing_fn)->val);
}
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
- if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
+ if (!zend_traits_method_compatibility_check(existing_fn, fn)) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- zend_get_function_declaration(fn TSRMLS_CC)->val,
- zend_get_function_declaration(existing_fn TSRMLS_CC)->val);
+ zend_get_function_declaration(fn)->val,
+ zend_get_function_declaration(existing_fn)->val);
}
return;
} else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
@@ -1093,7 +1092,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
} else {
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fulfills the inheritance requirements */
- do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
+ do_inheritance_check_on_method(fn, existing_fn);
}
}
@@ -1101,7 +1100,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
memcpy(new_fn, fn, sizeof(zend_op_array));
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
- zend_add_magic_methods(ce, key, fn TSRMLS_CC);
+ zend_add_magic_methods(ce, key, fn);
}
/* }}} */
@@ -1121,7 +1120,7 @@ static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /*
}
/* }}} */
-static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table TSRMLS_DC) /* {{{ */
+static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, zend_class_entry *ce, HashTable **overriden, HashTable *exclude_table) /* {{{ */
{
zend_trait_alias *alias, **alias_ptr;
zend_string *lcname;
@@ -1146,7 +1145,7 @@ static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, ze
lcname = zend_string_alloc(alias->alias->len, 0);
zend_str_tolower_copy(lcname->val, alias->alias->val, alias->alias->len);
- zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden TSRMLS_CC);
+ zend_add_trait_method(ce, alias->alias->val, lcname, &fn_copy, overriden);
zend_string_release(lcname);
/* Record the trait from which this alias was resolved. */
@@ -1186,14 +1185,14 @@ static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, ze
}
}
- zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden TSRMLS_CC);
+ zend_add_trait_method(ce, fn->common.function_name->val, fnname, &fn_copy, overriden);
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */
+static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait) /* {{{ */
{
uint32_t i;
@@ -1210,7 +1209,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
}
/* }}} */
-static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void zend_traits_init_trait_structures(zend_class_entry *ce) /* {{{ */
{
size_t i, j = 0;
zend_trait_precedence *cur_precedence;
@@ -1226,10 +1225,10 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
if (cur_precedence->exclude_from_classes) {
cur_method_ref = cur_precedence->trait_method;
if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name,
- ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
}
- zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC);
+ zend_check_trait_usage(ce, cur_precedence->trait_method->ce);
/** Ensure that the preferred method is actually available. */
lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
@@ -1256,10 +1255,10 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
while (cur_precedence->exclude_from_classes[j].class_name) {
zend_string* class_name = cur_precedence->exclude_from_classes[j].class_name;
- if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ if (!(cur_precedence->exclude_from_classes[j].ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name->val);
}
- zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce TSRMLS_CC);
+ zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j].ce);
/* make sure that the trait method is not from a class mentioned in
exclude_from_classes, for consistency */
@@ -1286,10 +1285,10 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/** For all aliases with an explicit class name, resolve the class now. */
if (ce->trait_aliases[i]->trait_method->class_name) {
cur_method_ref = ce->trait_aliases[i]->trait_method;
- if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) {
+ if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name->val);
}
- zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC);
+ zend_check_trait_usage(ce, cur_method_ref->ce);
/** And, ensure that the referenced method is resolvable, too. */
lcname = zend_string_alloc(cur_method_ref->method_name->len, 0);
@@ -1341,7 +1340,7 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra
}
/* }}} */
-static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void zend_do_traits_method_binding(zend_class_entry *ce) /* {{{ */
{
uint32_t i;
HashTable *overriden = NULL;
@@ -1359,13 +1358,13 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
/* copies functions, applies defined aliasing, and excludes unused trait methods */
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
- zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table TSRMLS_CC);
+ zend_traits_copy_functions(key, fn, ce, &overriden, &exclude_table);
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(&exclude_table);
} else {
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->traits[i]->function_table, key, fn) {
- zend_traits_copy_functions(key, fn, ce, &overriden, NULL TSRMLS_CC);
+ zend_traits_copy_functions(key, fn, ce, &overriden, NULL);
} ZEND_HASH_FOREACH_END();
}
}
@@ -1397,7 +1396,7 @@ static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t curr
}
/* }}} */
-static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */
{
size_t i;
zend_property_info *property_info;
@@ -1445,12 +1444,12 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
if (flags & ZEND_ACC_STATIC) {
not_compatible = (FAILURE == compare_function(&compare_result,
&ce->default_static_members_table[coliding_prop->offset],
- &ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
+ &ce->traits[i]->default_static_members_table[property_info->offset]))
|| (Z_LVAL(compare_result) != 0);
} else {
not_compatible = (FAILURE == compare_function(&compare_result,
&ce->default_properties_table[OBJ_PROP_TO_NUM(coliding_prop->offset)],
- &ce->traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)] TSRMLS_CC))
+ &ce->traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)]))
|| (Z_LVAL(compare_result) != 0);
}
} else {
@@ -1489,14 +1488,14 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
zend_declare_property_ex(ce, prop_name,
prop_value, flags,
- doc_comment TSRMLS_CC);
+ doc_comment);
zend_string_release(prop_name);
} ZEND_HASH_FOREACH_END();
}
}
/* }}} */
-static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce) /* {{{ */
{
int i = 0;
zend_trait_alias* cur_alias;
@@ -1549,7 +1548,7 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce
}
/* }}} */
-ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+ZEND_API void zend_do_bind_traits(zend_class_entry *ce) /* {{{ */
{
if (ce->num_traits <= 0) {
@@ -1557,19 +1556,19 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
}
/* complete initialization of trait strutures in ce */
- zend_traits_init_trait_structures(ce TSRMLS_CC);
+ zend_traits_init_trait_structures(ce);
/* first care about all methods to be flattened into the class */
- zend_do_traits_method_binding(ce TSRMLS_CC);
+ zend_do_traits_method_binding(ce);
/* Aliases which have not been applied indicate typos/bugs. */
- zend_do_check_for_inconsistent_traits_aliasing(ce TSRMLS_CC);
+ zend_do_check_for_inconsistent_traits_aliasing(ce);
/* then flatten the properties into it, to, mostly to notfiy developer about problems */
- zend_do_traits_property_binding(ce TSRMLS_CC);
+ zend_do_traits_property_binding(ce);
/* verify that all abstract methods from traits have been implemented */
- zend_verify_abstract_class(ce TSRMLS_CC);
+ zend_verify_abstract_class(ce);
/* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h
index 647b492371..d4810acca1 100644
--- a/Zend/zend_inheritance.h
+++ b/Zend/zend_inheritance.h
@@ -24,14 +24,14 @@
BEGIN_EXTERN_C()
-ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
-ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC);
+ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface);
+ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface);
-ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC);
-ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC);
+ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait);
+ZEND_API void zend_do_bind_traits(zend_class_entry *ce);
-ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
-void zend_do_early_binding(TSRMLS_D);
+ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
+void zend_do_early_binding(void);
END_EXTERN_C()
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 0b13f43315..fe1f950184 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -34,7 +34,7 @@ static HashTable *registered_zend_ini_directives;
/*
* hash_apply functions
*/
-static int zend_remove_ini_entries(zval *el, void *arg TSRMLS_DC) /* {{{ */
+static int zend_remove_ini_entries(zval *el, void *arg) /* {{{ */
{
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
int module_number = *(int *)arg;
@@ -46,7 +46,7 @@ static int zend_remove_ini_entries(zval *el, void *arg TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */
+static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage) /* {{{ */
{
int result = FAILURE;
@@ -56,7 +56,7 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
/* even if on_modify bails out, we have to continue on with restoring,
since there can be allocated variables that would be freed on MM shutdown
and would lead to memory corruption later ini entry is modified again */
- result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
+ result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage);
} zend_end_try();
}
if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) {
@@ -76,10 +76,10 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
}
/* }}} */
-static int zend_restore_ini_entry_wrapper(zval *el TSRMLS_DC) /* {{{ */
+static int zend_restore_ini_entry_wrapper(zval *el) /* {{{ */
{
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
- zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
+ zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE);
return 1;
}
/* }}} */
@@ -102,7 +102,7 @@ static void free_ini_entry(zval *zv) /* {{{ */
/*
* Startup / shutdown
*/
-ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */
+ZEND_API int zend_ini_startup(void) /* {{{ */
{
registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable));
@@ -114,15 +114,21 @@ ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API int zend_ini_shutdown(TSRMLS_D) /* {{{ */
+ZEND_API int zend_ini_shutdown(void) /* {{{ */
{
- zend_hash_destroy(EG(ini_directives));
- free(EG(ini_directives));
+ zend_ini_dtor(EG(ini_directives));
return SUCCESS;
}
/* }}} */
-ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */
+ZEND_API void zend_ini_dtor(HashTable *ini_directives) /* {{{ */
+{
+ zend_hash_destroy(ini_directives);
+ free(ini_directives);
+}
+/* }}} */
+
+ZEND_API int zend_ini_global_shutdown(void) /* {{{ */
{
zend_hash_destroy(registered_zend_ini_directives);
free(registered_zend_ini_directives);
@@ -130,10 +136,10 @@ ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */
}
/* }}} */
-ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */
+ZEND_API int zend_ini_deactivate(void) /* {{{ */
{
if (EG(modified_ini_directives)) {
- zend_hash_apply(EG(modified_ini_directives), zend_restore_ini_entry_wrapper TSRMLS_CC);
+ zend_hash_apply(EG(modified_ini_directives), zend_restore_ini_entry_wrapper);
zend_hash_destroy(EG(modified_ini_directives));
FREE_HASHTABLE(EG(modified_ini_directives));
EG(modified_ini_directives) = NULL;
@@ -162,7 +168,7 @@ static void copy_ini_entry(zval *zv) /* {{{ */
}
/* }}} */
-ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
+ZEND_API int zend_copy_ini_directives(void) /* {{{ */
{
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
@@ -174,7 +180,7 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
/* }}} */
#endif
-static int ini_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int ini_key_compare(const void *a, const void *b) /* {{{ */
{
const Bucket *f;
const Bucket *s;
@@ -194,16 +200,16 @@ static int ini_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API void zend_ini_sort_entries(TSRMLS_D) /* {{{ */
+ZEND_API void zend_ini_sort_entries(void) /* {{{ */
{
- zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC);
+ zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0);
}
/* }}} */
/*
* Registration / unregistration
*/
-ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number) /* {{{ */
{
zend_ini_entry *p;
zval *default_value;
@@ -243,11 +249,11 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int
if (p->name) {
zend_string_release(p->name);
}
- zend_unregister_ini_entries(module_number TSRMLS_CC);
+ zend_unregister_ini_entries(module_number);
return FAILURE;
}
if (((default_value = zend_get_configuration_directive(p->name)) != NULL) &&
- (!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS)) {
+ (!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP) == SUCCESS)) {
p->value = zend_string_copy(Z_STR_P(default_value));
} else {
@@ -255,7 +261,7 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int
zend_string_init(ini_entry->value, ini_entry->value_length, 1) : NULL;
if (p->on_modify) {
- p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
+ p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP);
}
}
ini_entry++;
@@ -264,37 +270,36 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int
}
/* }}} */
-ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) /* {{{ */
+ZEND_API void zend_unregister_ini_entries(int module_number) /* {{{ */
{
- zend_hash_apply_with_argument(registered_zend_ini_directives, zend_remove_ini_entries, (void *) &module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(registered_zend_ini_directives, zend_remove_ini_entries, (void *) &module_number);
}
/* }}} */
#ifdef ZTS
-static int zend_ini_refresh_cache(zval *el, void *arg TSRMLS_DC) /* {{{ */
+static int zend_ini_refresh_cache(zval *el, void *arg) /* {{{ */
{
zend_ini_entry *p = (zend_ini_entry *)Z_PTR_P(el);
int stage = (int)(zend_intptr_t)arg;
if (p->on_modify) {
- p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
+ p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage);
}
return 0;
}
/* }}} */
-ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
+ZEND_API void zend_ini_refresh_caches(int stage) /* {{{ */
{
- zend_hash_apply_with_argument(EG(ini_directives), zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(ini_directives), zend_ini_refresh_cache, (void *)(zend_intptr_t) stage);
}
/* }}} */
#endif
ZEND_API int zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage) /* {{{ */
{
- TSRMLS_FETCH();
- return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
+ return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0);
}
/* }}} */
@@ -302,28 +307,27 @@ ZEND_API int zend_alter_ini_entry_chars(zend_string *name, const char *value, si
{
int ret;
zend_string *new_value;
- TSRMLS_FETCH();
new_value = zend_string_init(value, value_length, stage != ZEND_INI_STAGE_RUNTIME);
- ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
+ ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0);
zend_string_release(new_value);
return ret;
}
/* }}} */
-ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
+ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change) /* {{{ */
{
int ret;
zend_string *new_value;
new_value = zend_string_init(value, value_length, stage != ZEND_INI_STAGE_RUNTIME);
- ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, force_change TSRMLS_CC);
+ ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, force_change);
zend_string_release(new_value);
return ret;
}
/* }}} */
-ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
+ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change) /* {{{ */
{
zend_ini_entry *ini_entry;
zend_string *duplicate;
@@ -361,7 +365,7 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
duplicate = zend_string_copy(new_value);
if (!ini_entry->on_modify
- || ini_entry->on_modify(ini_entry, duplicate, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
+ || ini_entry->on_modify(ini_entry, duplicate, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) {
if (modified && ini_entry->orig_value != ini_entry->value) { /* we already changed the value, free the changed value */
zend_string_release(ini_entry->value);
}
@@ -378,7 +382,6 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage) /* {{{ */
{
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL ||
(stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
@@ -386,7 +389,7 @@ ZEND_API int zend_restore_ini_entry(zend_string *name, int stage) /* {{{ */
}
if (EG(modified_ini_directives)) {
- if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
+ if (zend_restore_ini_entry_cb(ini_entry, stage) == 0) {
zend_hash_del(EG(modified_ini_directives), name);
} else {
return FAILURE;
@@ -418,7 +421,6 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
@@ -436,7 +438,6 @@ ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{
ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
@@ -454,7 +455,6 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists) /* {{{ */
{
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index f0a72c5142..5030819d6b 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -27,7 +27,7 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
-#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
+#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
typedef struct _zend_ini_entry_def {
@@ -61,22 +61,23 @@ struct _zend_ini_entry {
};
BEGIN_EXTERN_C()
-ZEND_API int zend_ini_startup(TSRMLS_D);
-ZEND_API int zend_ini_shutdown(TSRMLS_D);
-ZEND_API int zend_ini_global_shutdown(TSRMLS_D);
-ZEND_API int zend_ini_deactivate(TSRMLS_D);
+ZEND_API int zend_ini_startup(void);
+ZEND_API int zend_ini_shutdown(void);
+ZEND_API int zend_ini_global_shutdown(void);
+ZEND_API int zend_ini_deactivate(void);
+ZEND_API void zend_ini_dtor(HashTable *ini_directives);
-ZEND_API int zend_copy_ini_directives(TSRMLS_D);
+ZEND_API int zend_copy_ini_directives(void);
-ZEND_API void zend_ini_sort_entries(TSRMLS_D);
+ZEND_API void zend_ini_sort_entries(void);
-ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number TSRMLS_DC);
-ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
-ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
+ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int module_number);
+ZEND_API void zend_unregister_ini_entries(int module_number);
+ZEND_API void zend_ini_refresh_caches(int stage);
ZEND_API int zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage);
-ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change TSRMLS_DC);
+ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value, int modify_type, int stage, int force_change);
ZEND_API int zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage);
-ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change TSRMLS_DC);
+ZEND_API int zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change);
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
@@ -145,8 +146,8 @@ END_EXTERN_C()
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name)-1, 1)
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
-#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC)
-#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC)
+#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number)
+#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number)
#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module)
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name)-1, displayer)
@@ -173,10 +174,10 @@ END_EXTERN_C()
#define ZEND_INI_STAGE_HTACCESS (1<<5)
/* INI parsing engine */
-typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC);
+typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg);
BEGIN_EXTERN_C()
-ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC);
-ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC);
+ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg);
END_EXTERN_C()
/* INI entries */
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 20991bf3f9..b3caa0217f 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -36,13 +36,7 @@
#define YYERROR_VERBOSE
#define YYSTYPE zval
-#ifdef ZTS
-#define YYPARSE_PARAM tsrm_ls
-#define YYLEX_PARAM tsrm_ls
-int ini_parse(void *arg);
-#else
int ini_parse(void);
-#endif
#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb
#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg
@@ -119,17 +113,17 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
/* {{{ zend_ini_get_constant()
*/
-static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
+static void zend_ini_get_constant(zval *result, zval *name)
{
zval *c, tmp;
/* If name contains ':' it is not a constant. Bug #26893. */
if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
- && (c = zend_get_constant(Z_STR_P(name) TSRMLS_CC)) != 0) {
+ && (c = zend_get_constant(Z_STR_P(name))) != 0) {
if (Z_TYPE_P(c) != IS_STRING) {
ZVAL_COPY_VALUE(&tmp, c);
if (Z_OPT_CONSTANT(tmp)) {
- zval_update_constant_ex(&tmp, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(&tmp, 1, NULL);
}
zval_opt_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -148,7 +142,7 @@ static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
/* {{{ zend_ini_get_var()
*/
-static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
+static void zend_ini_get_var(zval *result, zval *name)
{
zval *curval;
char *envvar;
@@ -157,7 +151,7 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
ZVAL_PSTRINGL(result, Z_STRVAL_P(curval), Z_STRLEN_P(curval));
/* ..or if not found, try ENV */
- } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL ||
+ } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL ||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
ZVAL_PSTRING(result, envvar);
} else {
@@ -173,14 +167,13 @@ static void ini_error(const char *msg)
char *error_buf;
int error_buf_len;
char *currently_parsed_filename;
- TSRMLS_FETCH();
- currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C);
+ currently_parsed_filename = zend_ini_scanner_get_filename();
if (currently_parsed_filename) {
error_buf_len = 128 + (int)strlen(msg) + (int)strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);
- sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
+ sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
} else {
error_buf = estrdup("Invalid configuration directive\n");
}
@@ -199,7 +192,7 @@ static void ini_error(const char *msg)
/* {{{ zend_parse_ini_file()
*/
-ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC)
+ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
int retval;
zend_ini_parser_param ini_parser_param;
@@ -208,15 +201,15 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
ini_parser_param.arg = arg;
CG(ini_parser_param) = &ini_parser_param;
- if (zend_ini_open_file_for_scanning(fh, scanner_mode TSRMLS_CC) == FAILURE) {
+ if (zend_ini_open_file_for_scanning(fh, scanner_mode) == FAILURE) {
return FAILURE;
}
CG(ini_parser_unbuffered_errors) = unbuffered_errors;
- retval = ini_parse(TSRMLS_C);
- zend_file_handle_dtor(fh TSRMLS_CC);
+ retval = ini_parse();
+ zend_file_handle_dtor(fh);
- shutdown_ini_scanner(TSRMLS_C);
+ shutdown_ini_scanner();
if (retval == 0) {
return SUCCESS;
@@ -228,7 +221,7 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
/* {{{ zend_parse_ini_string()
*/
-ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC)
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
int retval;
zend_ini_parser_param ini_parser_param;
@@ -237,14 +230,14 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
ini_parser_param.arg = arg;
CG(ini_parser_param) = &ini_parser_param;
- if (zend_ini_prepare_string_for_scanning(str, scanner_mode TSRMLS_CC) == FAILURE) {
+ if (zend_ini_prepare_string_for_scanning(str, scanner_mode) == FAILURE) {
return FAILURE;
}
CG(ini_parser_unbuffered_errors) = unbuffered_errors;
- retval = ini_parse(TSRMLS_C);
+ retval = ini_parse();
- shutdown_ini_scanner(TSRMLS_C);
+ shutdown_ini_scanner();
if (retval == 0) {
return SUCCESS;
@@ -290,14 +283,14 @@ statement:
#if DEBUG_CFG_PARSER
printf("SECTION: [%s]\n", Z_STRVAL($2));
#endif
- ZEND_INI_PARSER_CB(&$2, NULL, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG TSRMLS_CC);
+ ZEND_INI_PARSER_CB(&$2, NULL, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG);
zend_string_release(Z_STR($2));
}
| TC_LABEL '=' string_or_value {
#if DEBUG_CFG_PARSER
printf("NORMAL: '%s' = '%s'\n", Z_STRVAL($1), Z_STRVAL($3));
#endif
- ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
+ ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG);
zend_string_release(Z_STR($1));
zval_ptr_dtor(&$3);
}
@@ -305,12 +298,12 @@ statement:
#if DEBUG_CFG_PARSER
printf("OFFSET: '%s'[%s] = '%s'\n", Z_STRVAL($1), Z_STRVAL($2), Z_STRVAL($5));
#endif
- ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
+ ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG);
zend_string_release(Z_STR($1));
zend_string_release(Z_STR($2));
zval_ptr_dtor(&$5);
}
- | TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); zend_string_release(Z_STR($1)); }
+ | TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); zend_string_release(Z_STR($1)); }
| END_OF_LINE
;
@@ -367,7 +360,7 @@ expr:
;
cfg_var_ref:
- TC_DOLLAR_CURLY TC_VARNAME '}' { zend_ini_get_var(&$$, &$2 TSRMLS_CC); zend_string_free(Z_STR($2)); }
+ TC_DOLLAR_CURLY TC_VARNAME '}' { zend_ini_get_var(&$$, &$2); zend_string_free(Z_STR($2)); }
;
constant_literal:
@@ -379,7 +372,7 @@ constant_literal:
;
constant_string:
- TC_CONSTANT { zend_ini_get_constant(&$$, &$1 TSRMLS_CC); }
+ TC_CONSTANT { zend_ini_get_constant(&$$, &$1); }
| TC_RAW { $$ = $1; /*printf("TC_RAW: '%s'\n", Z_STRVAL($1));*/ }
| TC_NUMBER { $$ = $1; /*printf("TC_NUMBER: '%s'\n", Z_STRVAL($1));*/ }
| TC_STRING { $$ = $1; /*printf("TC_STRING: '%s'\n", Z_STRVAL($1));*/ }
diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 61e7575dad..770e719c91 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -189,7 +189,7 @@ static void zend_ini_copy_typed_value(zval *retval, const int type, const char *
}
}
-static void _yy_push_state(int new_state TSRMLS_DC)
+static void _yy_push_state(int new_state)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
@@ -197,14 +197,14 @@ static void _yy_push_state(int new_state TSRMLS_DC)
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
-static void yy_pop_state(TSRMLS_D)
+static void yy_pop_state(void)
{
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
-static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+static void yy_scan_buffer(char *str, unsigned int len)
{
YYCURSOR = (YYCTYPE*)str;
SCNG(yy_start) = YYCURSOR;
@@ -215,7 +215,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
/* {{{ init_ini_scanner()
*/
-static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
+static int init_ini_scanner(int scanner_mode, zend_file_handle *fh)
{
/* Sanity check */
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
@@ -242,7 +242,7 @@ static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
/* {{{ shutdown_ini_scanner()
*/
-void shutdown_ini_scanner(TSRMLS_D)
+void shutdown_ini_scanner(void)
{
zend_stack_destroy(&SCNG(state_stack));
if (ini_filename) {
@@ -253,7 +253,7 @@ void shutdown_ini_scanner(TSRMLS_D)
/* {{{ zend_ini_scanner_get_lineno()
*/
-int zend_ini_scanner_get_lineno(TSRMLS_D)
+int zend_ini_scanner_get_lineno(void)
{
return SCNG(lineno);
}
@@ -261,7 +261,7 @@ int zend_ini_scanner_get_lineno(TSRMLS_D)
/* {{{ zend_ini_scanner_get_filename()
*/
-char *zend_ini_scanner_get_filename(TSRMLS_D)
+char *zend_ini_scanner_get_filename(void)
{
return ini_filename ? ini_filename : "Unknown";
}
@@ -269,21 +269,21 @@ char *zend_ini_scanner_get_filename(TSRMLS_D)
/* {{{ zend_ini_open_file_for_scanning()
*/
-int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC)
+int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode)
{
char *buf;
size_t size;
- if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(fh, &buf, &size) == FAILURE) {
return FAILURE;
}
- if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
- zend_file_handle_dtor(fh TSRMLS_CC);
+ if (init_ini_scanner(scanner_mode, fh) == FAILURE) {
+ zend_file_handle_dtor(fh);
return FAILURE;
}
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
return SUCCESS;
}
@@ -291,15 +291,15 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
/* {{{ zend_ini_prepare_string_for_scanning()
*/
-int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
+int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode)
{
int len = (int)strlen(str);
- if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
+ if (init_ini_scanner(scanner_mode, NULL) == FAILURE) {
return FAILURE;
}
- yy_scan_buffer(str, len TSRMLS_CC);
+ yy_scan_buffer(str, len);
return SUCCESS;
}
@@ -307,7 +307,7 @@ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
/* {{{ zend_ini_escape_string()
*/
-static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC)
+static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type)
{
register char *s, *t;
char *end;
@@ -354,7 +354,7 @@ static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_ty
}
/* }}} */
-int ini_lex(zval *ini_lval TSRMLS_DC)
+int ini_lex(zval *ini_lval)
{
restart:
SCNG(yy_text) = YYCURSOR;
@@ -614,9 +614,9 @@ yy17:
#line 487 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
- yy_push_state(ST_RAW TSRMLS_CC);
+ yy_push_state(ST_RAW);
} else {
- yy_push_state(ST_VALUE TSRMLS_CC);
+ yy_push_state(ST_VALUE);
}
return '=';
}
@@ -680,9 +680,9 @@ yy23:
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
- yy_push_state(ST_SECTION_RAW TSRMLS_CC);
+ yy_push_state(ST_SECTION_RAW);
} else {
- yy_push_state(ST_SECTION_VALUE TSRMLS_CC);
+ yy_push_state(ST_SECTION_VALUE);
}
return TC_SECTION;
}
@@ -725,7 +725,7 @@ yy28:
EAT_TRAILING_WHITESPACE_EX('[');
/* Enter offset lookup state */
- yy_push_state(ST_OFFSET TSRMLS_CC);
+ yy_push_state(ST_OFFSET);
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
@@ -1114,7 +1114,7 @@ yy70:
yyleng = YYCURSOR - SCNG(yy_text);
#line 639 "Zend/zend_ini_scanner.l"
{ /* #Comment */
- zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
+ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(), SCNG(lineno));
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
@@ -1292,7 +1292,7 @@ yy81:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
+ zend_ini_escape_string(ini_lval, yytext, yyleng, '"');
return TC_QUOTED_STRING;
}
#line 1299 "Zend/zend_ini_scanner.c"
@@ -1306,7 +1306,7 @@ yy83:
yyleng = YYCURSOR - SCNG(yy_text);
#line 578 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return '"';
}
#line 1313 "Zend/zend_ini_scanner.c"
@@ -1320,7 +1320,7 @@ yy84:
yyleng = YYCURSOR - SCNG(yy_text);
#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
- yy_push_state(ST_VARNAME TSRMLS_CC);
+ yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 1327 "Zend/zend_ini_scanner.c"
@@ -1457,7 +1457,7 @@ yy97:
yyleng = YYCURSOR - SCNG(yy_text);
#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
- yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 1464 "Zend/zend_ini_scanner.c"
@@ -1879,7 +1879,7 @@ yy134:
yyleng = YYCURSOR - SCNG(yy_text);
#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
- yy_push_state(ST_VARNAME TSRMLS_CC);
+ yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 1886 "Zend/zend_ini_scanner.c"
@@ -2382,7 +2382,7 @@ yy183:
yyleng = YYCURSOR - SCNG(yy_text);
#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
- yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 2389 "Zend/zend_ini_scanner.c"
@@ -2829,7 +2829,7 @@ yy224:
yyleng = YYCURSOR - SCNG(yy_text);
#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
- yy_push_state(ST_VARNAME TSRMLS_CC);
+ yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 2836 "Zend/zend_ini_scanner.c"
@@ -3084,7 +3084,7 @@ yy243:
yyleng = YYCURSOR - SCNG(yy_text);
#line 573 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
- yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
#line 3091 "Zend/zend_ini_scanner.c"
@@ -4641,7 +4641,7 @@ yy309:
yyleng = YYCURSOR - SCNG(yy_text);
#line 445 "Zend/zend_ini_scanner.l"
{ /* Variable start */
- yy_push_state(ST_VARNAME TSRMLS_CC);
+ yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
#line 4648 "Zend/zend_ini_scanner.c"
@@ -4803,7 +4803,7 @@ yy324:
yyleng = YYCURSOR - SCNG(yy_text);
#line 460 "Zend/zend_ini_scanner.l"
{ /* Variable end */
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return '}';
}
#line 4810 "Zend/zend_ini_scanner.c"
diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h
index c81e3605d8..7d990463f4 100644
--- a/Zend/zend_ini_scanner.h
+++ b/Zend/zend_ini_scanner.h
@@ -28,12 +28,12 @@
#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */
BEGIN_EXTERN_C()
-int zend_ini_scanner_get_lineno(TSRMLS_D);
-char *zend_ini_scanner_get_filename(TSRMLS_D);
-int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC);
-int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC);
-int ini_lex(zval *ini_lval TSRMLS_DC);
-void shutdown_ini_scanner(TSRMLS_D);
+int zend_ini_scanner_get_lineno(void);
+char *zend_ini_scanner_get_filename(void);
+int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode);
+int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode);
+int ini_lex(zval *ini_lval);
+void shutdown_ini_scanner(void);
END_EXTERN_C()
#endif /* _ZEND_INI_SCANNER_H */
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 79d82764b1..005c216c23 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -187,7 +187,7 @@ static void zend_ini_copy_typed_value(zval *retval, const int type, const char *
}
}
-static void _yy_push_state(int new_state TSRMLS_DC)
+static void _yy_push_state(int new_state)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
@@ -195,14 +195,14 @@ static void _yy_push_state(int new_state TSRMLS_DC)
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
-static void yy_pop_state(TSRMLS_D)
+static void yy_pop_state(void)
{
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
-static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+static void yy_scan_buffer(char *str, unsigned int len)
{
YYCURSOR = (YYCTYPE*)str;
SCNG(yy_start) = YYCURSOR;
@@ -213,7 +213,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
/* {{{ init_ini_scanner()
*/
-static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
+static int init_ini_scanner(int scanner_mode, zend_file_handle *fh)
{
/* Sanity check */
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
@@ -240,7 +240,7 @@ static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
/* {{{ shutdown_ini_scanner()
*/
-void shutdown_ini_scanner(TSRMLS_D)
+void shutdown_ini_scanner(void)
{
zend_stack_destroy(&SCNG(state_stack));
if (ini_filename) {
@@ -251,7 +251,7 @@ void shutdown_ini_scanner(TSRMLS_D)
/* {{{ zend_ini_scanner_get_lineno()
*/
-int zend_ini_scanner_get_lineno(TSRMLS_D)
+int zend_ini_scanner_get_lineno(void)
{
return SCNG(lineno);
}
@@ -259,7 +259,7 @@ int zend_ini_scanner_get_lineno(TSRMLS_D)
/* {{{ zend_ini_scanner_get_filename()
*/
-char *zend_ini_scanner_get_filename(TSRMLS_D)
+char *zend_ini_scanner_get_filename(void)
{
return ini_filename ? ini_filename : "Unknown";
}
@@ -267,21 +267,21 @@ char *zend_ini_scanner_get_filename(TSRMLS_D)
/* {{{ zend_ini_open_file_for_scanning()
*/
-int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC)
+int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode)
{
char *buf;
size_t size;
- if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(fh, &buf, &size) == FAILURE) {
return FAILURE;
}
- if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
- zend_file_handle_dtor(fh TSRMLS_CC);
+ if (init_ini_scanner(scanner_mode, fh) == FAILURE) {
+ zend_file_handle_dtor(fh);
return FAILURE;
}
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
return SUCCESS;
}
@@ -289,15 +289,15 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
/* {{{ zend_ini_prepare_string_for_scanning()
*/
-int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
+int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode)
{
int len = (int)strlen(str);
- if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
+ if (init_ini_scanner(scanner_mode, NULL) == FAILURE) {
return FAILURE;
}
- yy_scan_buffer(str, len TSRMLS_CC);
+ yy_scan_buffer(str, len);
return SUCCESS;
}
@@ -305,7 +305,7 @@ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
/* {{{ zend_ini_escape_string()
*/
-static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC)
+static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type)
{
register char *s, *t;
char *end;
@@ -352,7 +352,7 @@ static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_ty
}
/* }}} */
-int ini_lex(zval *ini_lval TSRMLS_DC)
+int ini_lex(zval *ini_lval)
{
restart:
SCNG(yy_text) = YYCURSOR;
@@ -402,9 +402,9 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
<INITIAL>"[" { /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
- yy_push_state(ST_SECTION_RAW TSRMLS_CC);
+ yy_push_state(ST_SECTION_RAW);
} else {
- yy_push_state(ST_SECTION_VALUE TSRMLS_CC);
+ yy_push_state(ST_SECTION_VALUE);
}
return TC_SECTION;
}
@@ -432,7 +432,7 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
EAT_TRAILING_WHITESPACE_EX('[');
/* Enter offset lookup state */
- yy_push_state(ST_OFFSET TSRMLS_CC);
+ yy_push_state(ST_OFFSET);
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
@@ -443,7 +443,7 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
}
<ST_DOUBLE_QUOTES,ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{DOLLAR_CURLY} { /* Variable start */
- yy_push_state(ST_VARNAME TSRMLS_CC);
+ yy_push_state(ST_VARNAME);
return TC_DOLLAR_CURLY;
}
@@ -458,7 +458,7 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
}
<ST_VARNAME>"}" { /* Variable end */
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return '}';
}
@@ -486,9 +486,9 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
<INITIAL>{TABS_AND_SPACES}*[=]{TABS_AND_SPACES}* { /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
- yy_push_state(ST_RAW TSRMLS_CC);
+ yy_push_state(ST_RAW);
} else {
- yy_push_state(ST_VALUE TSRMLS_CC);
+ yy_push_state(ST_VALUE);
}
return '=';
}
@@ -571,12 +571,12 @@ end_raw_value_chars:
}
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{TABS_AND_SPACES}*["] { /* Double quoted '"' string start */
- yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ yy_push_state(ST_DOUBLE_QUOTES);
return '"';
}
<ST_DOUBLE_QUOTES>["]{TABS_AND_SPACES}* { /* Double quoted '"' string ends */
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return '"';
}
@@ -612,7 +612,7 @@ end_raw_value_chars:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
+ zend_ini_escape_string(ini_lval, yytext, yyleng, '"');
return TC_QUOTED_STRING;
}
@@ -637,7 +637,7 @@ end_raw_value_chars:
}
<INITIAL>{TABS_AND_SPACES}*[#][^\r\n]*{NEWLINE} { /* #Comment */
- zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
+ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(), SCNG(lineno));
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 16ae8ea3c5..7a9b7d0de0 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -31,7 +31,7 @@ ZEND_API zend_class_entry *zend_ce_serializable;
/* {{{ zend_call_method
Only returns the returned zval if retval_ptr != NULL */
-ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
+ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval_ptr, int param_count, zval* arg1, zval* arg2)
{
int result;
zend_fcall_info fci;
@@ -61,7 +61,7 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
/* no interest in caching and no information already present that is
* needed later inside zend_call_function. */
fci.function_table = !object ? EG(function_table) : NULL;
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
zval_ptr_dtor(&fci.function_name);
} else {
zend_fcall_info_cache fcic;
@@ -92,13 +92,13 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
} else if (obj_ce &&
!(EG(current_execute_data) &&
EG(current_execute_data)->called_scope &&
- instanceof_function(EG(current_execute_data)->called_scope, obj_ce TSRMLS_CC))) {
+ instanceof_function(EG(current_execute_data)->called_scope, obj_ce))) {
fcic.called_scope = obj_ce;
} else {
fcic.called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
}
fcic.object = object ? Z_OBJ_P(object) : NULL;
- result = zend_call_function(&fci, &fcic TSRMLS_CC);
+ result = zend_call_function(&fci, &fcic);
zval_ptr_dtor(&fci.function_name);
}
if (result == FAILURE) {
@@ -128,14 +128,14 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
/* iterator interface, c-level functions used by engine */
/* {{{ zend_user_it_new_iterator */
-ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval TSRMLS_DC)
+ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval)
{
zend_call_method_with_0_params(object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", retval);
}
/* }}} */
/* {{{ zend_user_it_invalidate_current */
-ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
@@ -147,18 +147,18 @@ ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS
/* }}} */
/* {{{ zend_user_it_dtor */
-static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
+static void zend_user_it_dtor(zend_object_iterator *_iter)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = &iter->it.data;
- zend_user_it_invalidate_current(_iter TSRMLS_CC);
+ zend_user_it_invalidate_current(_iter);
zval_ptr_dtor(object);
}
/* }}} */
/* {{{ zend_user_it_valid */
-ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API int zend_user_it_valid(zend_object_iterator *_iter)
{
if (_iter) {
zend_user_iterator *iter = (zend_user_iterator*)_iter;
@@ -168,7 +168,7 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (Z_TYPE(more) != IS_UNDEF) {
- result = i_zend_is_true(&more TSRMLS_CC);
+ result = i_zend_is_true(&more);
zval_ptr_dtor(&more);
return result ? SUCCESS : FAILURE;
}
@@ -178,7 +178,7 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
/* }}} */
/* {{{ zend_user_it_get_current_data */
-ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = &iter->it.data;
@@ -192,7 +192,7 @@ ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter TSRMLS_
/* {{{ zend_user_it_get_current_key_default */
#if 0
-static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
+static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key)
{
*int_key = _iter->index;
return HASH_KEY_IS_LONG;
@@ -201,7 +201,7 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha
/* }}} */
/* {{{ zend_user_it_get_current_key */
-ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC)
+ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = &iter->it.data;
@@ -222,23 +222,23 @@ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *ke
/* }}} */
/* {{{ zend_user_it_move_forward */
-ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = &iter->it.data;
- zend_user_it_invalidate_current(_iter TSRMLS_CC);
+ zend_user_it_invalidate_current(_iter);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
}
/* }}} */
/* {{{ zend_user_it_rewind */
-ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = &iter->it.data;
- zend_user_it_invalidate_current(_iter TSRMLS_CC);
+ zend_user_it_invalidate_current(_iter);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
}
/* }}} */
@@ -254,7 +254,7 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
};
/* {{{ zend_user_it_get_iterator */
-static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
zend_user_iterator *iterator;
@@ -264,7 +264,7 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
iterator = emalloc(sizeof(zend_user_iterator));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->it.data, object);
iterator->it.funcs = ce->iterator_funcs.funcs;
@@ -275,31 +275,31 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
/* }}} */
/* {{{ zend_user_it_get_new_iterator */
-ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
zval iterator;
zend_object_iterator *new_iterator;
zend_class_entry *ce_it;
- zend_user_it_new_iterator(ce, object, &iterator TSRMLS_CC);
+ zend_user_it_new_iterator(ce, object, &iterator);
ce_it = (Z_TYPE(iterator) == IS_OBJECT) ? Z_OBJCE(iterator) : NULL;
if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && Z_OBJ(iterator) == Z_OBJ_P(object))) {
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name->val : Z_OBJCE_P(object)->name->val);
+ zend_throw_exception_ex(NULL, 0, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name->val : Z_OBJCE_P(object)->name->val);
}
zval_ptr_dtor(&iterator);
return NULL;
}
- new_iterator = ce_it->get_iterator(ce_it, &iterator, by_ref TSRMLS_CC);
+ new_iterator = ce_it->get_iterator(ce_it, &iterator, by_ref);
zval_ptr_dtor(&iterator);
return new_iterator;
}
/* }}} */
/* {{{ zend_implement_traversable */
-static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type)
{
/* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */
uint32_t i;
@@ -322,7 +322,7 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en
/* }}} */
/* {{{ zend_implement_aggregate */
-static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type)
{
uint32_t i;
int t = -1;
@@ -359,7 +359,7 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr
/* }}} */
/* {{{ zend_implement_iterator */
-static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type)
{
if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) {
if (class_type->type == ZEND_INTERNAL_CLASS) {
@@ -390,7 +390,7 @@ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry
/* }}} */
/* {{{ zend_implement_arrayaccess */
-static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type)
{
#if 0
/* get ht from ce */
@@ -406,7 +406,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
/* }}}*/
/* {{{ zend_user_serialize */
-ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
+ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data)
{
zend_class_entry * ce = Z_OBJCE_P(object);
zval retval;
@@ -436,14 +436,14 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *b
}
if (result == FAILURE && !EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "%s::serialize() must return a string or NULL", ce->name->val);
}
return result;
}
/* }}} */
/* {{{ zend_user_unserialize */
-ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC)
+ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data)
{
zval zdata;
@@ -463,27 +463,27 @@ ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const uns
}
/* }}} */
-ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed", ce->name->val);
return FAILURE;
}
/* }}} */
-ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) /* {{{ */
{
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed", ce->name->val);
return FAILURE;
}
/* }}} */
/* {{{ zend_implement_serializable */
-static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type)
{
if (class_type->parent
&& (class_type->parent->serialize || class_type->parent->unserialize)
- && !instanceof_function_ex(class_type->parent, zend_ce_serializable, 1 TSRMLS_CC)) {
+ && !instanceof_function_ex(class_type->parent, zend_ce_serializable, 1)) {
return FAILURE;
}
if (!class_type->serialize) {
@@ -549,15 +549,15 @@ const zend_function_entry zend_funcs_serializable[] = {
{\
zend_class_entry ce;\
INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \
- zend_ce_ ## class_name = zend_register_internal_interface(&ce TSRMLS_CC);\
+ zend_ce_ ## class_name = zend_register_internal_interface(&ce);\
zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\
}
#define REGISTER_ITERATOR_IMPLEMENT(class_name, interface_name) \
- zend_class_implements(zend_ce_ ## class_name TSRMLS_CC, 1, zend_ce_ ## interface_name)
+ zend_class_implements(zend_ce_ ## class_name, 1, zend_ce_ ## interface_name)
/* {{{ zend_register_interfaces */
-ZEND_API void zend_register_interfaces(TSRMLS_D)
+ZEND_API void zend_register_interfaces(void)
{
REGISTER_ITERATOR_INTERFACE(traversable, Traversable);
diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h
index dff05bc701..3125141315 100644
--- a/Zend/zend_interfaces.h
+++ b/Zend/zend_interfaces.h
@@ -38,34 +38,34 @@ typedef struct _zend_user_iterator {
zval value;
} zend_user_iterator;
-ZEND_API zval* zend_call_method(zval *object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
+ZEND_API zval* zend_call_method(zval *object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval, int param_count, zval* arg1, zval* arg2);
#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
- zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC)
+ zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL)
#define zend_call_method_with_1_params(obj, obj_ce, fn_proxy, function_name, retval, arg1) \
- zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 1, arg1, NULL TSRMLS_CC)
+ zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 1, arg1, NULL)
#define zend_call_method_with_2_params(obj, obj_ce, fn_proxy, function_name, retval, arg1, arg2) \
- zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 2, arg1, arg2 TSRMLS_CC)
+ zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 2, arg1, arg2)
-ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC);
-ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC);
-ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC);
-ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter TSRMLS_DC);
-ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC);
-ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC);
+ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter);
+ZEND_API int zend_user_it_valid(zend_object_iterator *_iter);
+ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key);
+ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter);
+ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter);
+ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter);
-ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *iterator TSRMLS_DC);
-ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *iterator);
+ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref);
-ZEND_API void zend_register_interfaces(TSRMLS_D);
+ZEND_API void zend_register_interfaces(void);
-ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
-ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
+ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data);
-ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
-ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC);
+ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
+ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data);
END_EXTERN_C()
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c
index 8d81eae3b0..7d1ec86f9b 100644
--- a/Zend/zend_iterators.c
+++ b/Zend/zend_iterators.c
@@ -24,8 +24,8 @@
static zend_class_entry zend_iterator_class_entry;
-static void iter_wrapper_free(zend_object *object TSRMLS_DC);
-static void iter_wrapper_dtor(zend_object *object TSRMLS_DC);
+static void iter_wrapper_free(zend_object *object);
+static void iter_wrapper_dtor(zend_object *object);
static zend_object_handlers iterator_object_handlers = {
0,
@@ -58,37 +58,37 @@ static zend_object_handlers iterator_object_handlers = {
NULL /* compare */
};
-ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
+ZEND_API void zend_register_iterator_wrapper(void)
{
INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL);
}
-static void iter_wrapper_free(zend_object *object TSRMLS_DC)
+static void iter_wrapper_free(zend_object *object)
{
zend_object_iterator *iter = (zend_object_iterator*)object;
- iter->funcs->dtor(iter TSRMLS_CC);
+ iter->funcs->dtor(iter);
}
-static void iter_wrapper_dtor(zend_object *object TSRMLS_DC)
+static void iter_wrapper_dtor(zend_object *object)
{
}
-ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC)
+ZEND_API void zend_iterator_init(zend_object_iterator *iter)
{
- zend_object_std_init(&iter->std, &zend_iterator_class_entry TSRMLS_CC);
+ zend_object_std_init(&iter->std, &zend_iterator_class_entry);
iter->std.handlers = &iterator_object_handlers;
}
-ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
+ZEND_API void zend_iterator_dtor(zend_object_iterator *iter)
{
if (--GC_REFCOUNT(iter) > 0) {
return;
}
- zend_objects_store_del(&iter->std TSRMLS_CC);
+ zend_objects_store_del(&iter->std);
}
-ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC)
+ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr)
{
if (Z_TYPE_P(array_ptr) &&
Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) {
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index a1148db214..39dbc7b163 100644
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -30,28 +30,28 @@ typedef struct _zend_object_iterator zend_object_iterator;
typedef struct _zend_object_iterator_funcs {
/* release all resources associated with this iterator instance */
- void (*dtor)(zend_object_iterator *iter TSRMLS_DC);
+ void (*dtor)(zend_object_iterator *iter);
/* check for end of iteration (FAILURE or SUCCESS if data is valid) */
- int (*valid)(zend_object_iterator *iter TSRMLS_DC);
+ int (*valid)(zend_object_iterator *iter);
/* fetch the item data for the current element */
- zval *(*get_current_data)(zend_object_iterator *iter TSRMLS_DC);
+ zval *(*get_current_data)(zend_object_iterator *iter);
/* fetch the key for the current element (optional, may be NULL). The key
* should be written into the provided zval* using the ZVAL_* macros. If
* this handler is not provided auto-incrementing integer keys will be
* used. */
- void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
+ void (*get_current_key)(zend_object_iterator *iter, zval *key);
/* step forwards to next element */
- void (*move_forward)(zend_object_iterator *iter TSRMLS_DC);
+ void (*move_forward)(zend_object_iterator *iter);
/* rewind to start of data (optional, may be NULL) */
- void (*rewind)(zend_object_iterator *iter TSRMLS_DC);
+ void (*rewind)(zend_object_iterator *iter);
/* invalidate current value/key (optional, may be NULL) */
- void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC);
+ void (*invalidate_current)(zend_object_iterator *iter);
} zend_object_iterator_funcs;
struct _zend_object_iterator {
@@ -73,13 +73,13 @@ typedef struct _zend_class_iterator_funcs {
BEGIN_EXTERN_C()
/* given a zval, returns stuff that can be used to iterate it. */
-ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr TSRMLS_DC);
+ZEND_API zend_object_iterator* zend_iterator_unwrap(zval *array_ptr);
/* given an iterator, wrap it up as a zval for use by the engine opcodes */
-ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC);
-ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
+ZEND_API void zend_iterator_init(zend_object_iterator *iter);
+ZEND_API void zend_iterator_dtor(zend_object_iterator *iter);
-ZEND_API void zend_register_iterator_wrapper(TSRMLS_D);
+ZEND_API void zend_register_iterator_wrapper(void);
END_EXTERN_C()
/*
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 4d66648055..da94e0e773 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -54,10 +54,6 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%expect 2
%code requires {
-#ifdef ZTS
-# define YYPARSE_PARAM tsrm_ls
-# define YYLEX_PARAM tsrm_ls
-#endif
}
%destructor { zend_ast_destroy($$); } <ast>
@@ -287,8 +283,8 @@ top_statement:
| class_declaration_statement { $$ = $1; }
| T_HALT_COMPILER '(' ')' ';'
{ $$ = zend_ast_create(ZEND_AST_HALT_COMPILER,
- zend_ast_create_zval_from_long(zend_get_scanned_file_offset(TSRMLS_C)));
- zend_stop_lexing(TSRMLS_C); }
+ zend_ast_create_zval_from_long(zend_get_scanned_file_offset()));
+ zend_stop_lexing(); }
| T_NAMESPACE namespace_name ';'
{ $$ = zend_ast_create(ZEND_AST_NAMESPACE, $2, NULL);
RESET_DOC_COMMENT(); }
@@ -372,7 +368,7 @@ statement:
foreach_statement
{ $$ = zend_ast_create(ZEND_AST_FOREACH, $3, $7, $5, $9); }
| T_DECLARE '(' const_list ')'
- { zend_handle_encoding_declaration($3 TSRMLS_CC); }
+ { zend_handle_encoding_declaration($3); }
declare_statement
{ $$ = zend_ast_create(ZEND_AST_DECLARE, $3, $6); }
| ';' /* empty statement */ { $$ = NULL; }
@@ -610,7 +606,7 @@ class_statement_list:
class_statement:
variable_modifiers property_list ';'
- { $$ = zend_ast_append_doc_comment($2 TSRMLS_CC); $$->attr = $1; }
+ { $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
| T_CONST class_const_list ';'
{ $$ = $2; RESET_DOC_COMMENT(); }
| T_USE name_list trait_adaptations
@@ -1175,8 +1171,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
return yystrlen(yystr);
}
{
- TSRMLS_FETCH();
- if (CG(parse_error) == 0) {
+ if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 7a7c04b0d2..5be11022e9 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -125,34 +125,34 @@ do { \
BEGIN_EXTERN_C()
-static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
ZEND_ASSERT(internal_encoding);
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding));
}
-static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC);
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding));
}
-static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
+LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8);
}
-static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
+internal_encoding, zend_multibyte_encoding_utf8);
}
-static void _yy_push_state(int new_state TSRMLS_DC)
+static void _yy_push_state(int new_state)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
@@ -160,14 +160,14 @@ static void _yy_push_state(int new_state TSRMLS_DC)
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
-static void yy_pop_state(TSRMLS_D)
+static void yy_pop_state(void)
{
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
-static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+static void yy_scan_buffer(char *str, unsigned int len)
{
YYCURSOR = (YYCTYPE*)str;
YYLIMIT = YYCURSOR + len;
@@ -176,7 +176,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
}
}
-void startup_scanner(TSRMLS_D)
+void startup_scanner(void)
{
CG(parse_error) = 0;
CG(doc_comment) = NULL;
@@ -188,7 +188,7 @@ static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) {
efree(heredoc_label->label);
}
-void shutdown_scanner(TSRMLS_D)
+void shutdown_scanner(void)
{
CG(parse_error) = 0;
RESET_DOC_COMMENT();
@@ -197,7 +197,7 @@ void shutdown_scanner(TSRMLS_D)
zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
}
-ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state)
{
lex_state->yy_leng = SCNG(yy_leng);
lex_state->yy_start = SCNG(yy_start);
@@ -214,7 +214,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->in = SCNG(yy_in);
lex_state->yy_state = YYSTATE;
- lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
+ lex_state->filename = zend_get_compiled_filename();
lex_state->lineno = CG(zend_lineno);
lex_state->script_org = SCNG(script_org);
@@ -226,7 +226,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->script_encoding = SCNG(script_encoding);
}
-ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
{
SCNG(yy_leng) = lex_state->yy_leng;
SCNG(yy_start) = lex_state->yy_start;
@@ -245,7 +245,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
SCNG(yy_in) = lex_state->in;
YYSETCONDITION(lex_state->yy_state);
CG(zend_lineno) = lex_state->lineno;
- zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
+ zend_restore_compiled_filename(lex_state->filename);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
@@ -262,7 +262,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
RESET_DOC_COMMENT();
}
-ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
+ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
{
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
@@ -278,7 +278,7 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
#define BOM_UTF16_LE "\xff\xfe"
#define BOM_UTF8 "\xef\xbb\xbf"
-static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC)
+static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size)
{
const unsigned char *p;
int wchar_size = 2;
@@ -326,7 +326,7 @@ static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned ch
return NULL;
}
-static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
+static const zend_encoding* zend_multibyte_detect_unicode(void)
{
const zend_encoding *script_encoding = NULL;
int bom_size;
@@ -403,19 +403,19 @@ static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
}
}
/* make best effort if BOM is missing */
- return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC);
+ return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size));
}
return NULL;
}
-static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
+static const zend_encoding* zend_multibyte_find_script_encoding(void)
{
const zend_encoding *script_encoding;
if (CG(detect_unicode)) {
/* check out bom(byte order mark) and see if containing wchars */
- script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
+ script_encoding = zend_multibyte_detect_unicode();
if (script_encoding != NULL) {
/* bom or wchar detection is prior to 'script_encoding' option */
return script_encoding;
@@ -429,16 +429,16 @@ static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
/* if multiple encodings specified, detect automagically */
if (CG(script_encoding_list_size) > 1) {
- return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC);
+ return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size));
}
return CG(script_encoding_list)[0];
}
-ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC)
+ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
+ const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding();
if (!script_encoding) {
return FAILURE;
@@ -476,7 +476,7 @@ ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSR
return 0;
}
-ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
+ZEND_API int open_file_for_scanning(zend_file_handle *file_handle)
{
const char *file_path = NULL;
char *buf;
@@ -490,7 +490,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
}
- if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(file_handle, &buf, &size) == FAILURE) {
return FAILURE;
}
@@ -512,10 +512,10 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
- zend_multibyte_set_filter(NULL TSRMLS_CC);
+ zend_multibyte_set_filter(NULL);
if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -524,7 +524,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
}
SCNG(yy_start) = (unsigned char *)buf - offset;
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
} else {
zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
}
@@ -538,7 +538,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
compiled_filename = zend_string_init(file_path, strlen(file_path), 0);
- zend_set_compiled_filename(compiled_filename TSRMLS_CC);
+ zend_set_compiled_filename(compiled_filename);
zend_string_release(compiled_filename);
if (CG(start_lineno)) {
@@ -555,7 +555,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
END_EXTERN_C()
-ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
@@ -567,51 +567,51 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
ZVAL_LONG(&retval_zv, 1);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
- if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
+ if (open_file_for_scanning(file_handle)==FAILURE) {
if (type==ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
compilation_successful=0;
} else {
- init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context));
- zend_init_compiler_context(TSRMLS_C);
+ zend_init_compiler_context();
CG(ast_arena) = zend_arena_create(1024 * 32);
- compiler_result = zendparse(TSRMLS_C);
+ compiler_result = zendparse();
if (compiler_result != 0) { /* parser error */
zend_bailout();
}
- zend_compile_top_stmt(CG(ast) TSRMLS_CC);
+ zend_compile_top_stmt(CG(ast));
zend_ast_destroy(CG(ast));
zend_arena_destroy(CG(ast_arena));
- zend_do_end_compilation(TSRMLS_C);
- zend_emit_final_return(&retval_zv TSRMLS_CC);
+ zend_do_end_compilation();
+ zend_emit_final_return(&retval_zv);
CG(in_compilation) = original_in_compilation;
compilation_successful=1;
}
CG(active_op_array) = original_active_op_array;
if (compilation_successful) {
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
+ pass_two(op_array);
+ zend_release_labels(0);
} else {
efree_size(op_array, sizeof(zend_op_array));
op_array = NULL;
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
return op_array;
}
-zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
+zend_op_array *compile_filename(int type, zval *filename)
{
zend_file_handle file_handle;
zval tmp;
@@ -630,7 +630,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
file_handle.opened_path = NULL;
file_handle.handle.fp = NULL;
- retval = zend_compile_file(&file_handle, type TSRMLS_CC);
+ retval = zend_compile_file(&file_handle, type);
if (retval && file_handle.handle.stream.handle) {
if (!file_handle.opened_path) {
file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
@@ -642,7 +642,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
efree(opened_path);
}
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
if (filename==&tmp) {
zval_dtor(&tmp);
@@ -650,7 +650,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
return retval;
}
-ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
+ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename)
{
char *buf;
size_t size, old_len;
@@ -673,10 +673,10 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
- zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+ zend_multibyte_set_filter(zend_multibyte_get_internal_encoding());
if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -685,10 +685,10 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
}
}
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
new_compiled_filename = zend_string_init(filename, strlen(filename), 0);
- zend_set_compiled_filename(new_compiled_filename TSRMLS_CC);
+ zend_set_compiled_filename(new_compiled_filename);
zend_string_release(new_compiled_filename);
CG(zend_lineno) = 1;
CG(increment_lineno) = 0;
@@ -697,14 +697,14 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
}
-ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
+ZEND_API size_t zend_get_scanned_file_offset(void)
{
size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
if (SCNG(input_filter)) {
size_t original_offset = offset, length = 0;
do {
unsigned char *p = NULL;
- if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset)) {
return (size_t)-1;
}
efree(p);
@@ -719,7 +719,7 @@ ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
}
-zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
+zend_op_array *compile_string(zval *source_string, char *filename)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = NULL;
@@ -735,25 +735,25 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
source_string = &tmp;
CG(in_compilation) = 1;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC) == SUCCESS) {
+ zend_save_lexical_state(&original_lex_state);
+ if (zend_prepare_string_for_scanning(source_string, filename) == SUCCESS) {
CG(ast) = NULL;
CG(ast_arena) = zend_arena_create(1024 * 32);
BEGIN(ST_IN_SCRIPTING);
- if (!zendparse(TSRMLS_C)) {
+ if (!zendparse()) {
zend_op_array *original_active_op_array = CG(active_op_array);
op_array = emalloc(sizeof(zend_op_array));
- init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context));
- zend_init_compiler_context(TSRMLS_C);
- zend_compile_top_stmt(CG(ast) TSRMLS_CC);
- zend_do_end_compilation(TSRMLS_C);
- zend_emit_final_return(NULL TSRMLS_CC);
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
+ zend_init_compiler_context();
+ zend_compile_top_stmt(CG(ast));
+ zend_do_end_compilation();
+ zend_emit_final_return(NULL);
+ pass_two(op_array);
+ zend_release_labels(0);
CG(active_op_array) = original_active_op_array;
}
@@ -762,7 +762,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
zend_arena_destroy(CG(ast_arena));
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(&tmp);
CG(in_compilation) = original_in_compilation;
return op_array;
@@ -770,7 +770,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
BEGIN_EXTERN_C()
-int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
+int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
{
zend_lex_state original_lex_state;
zend_file_handle file_handle;
@@ -779,46 +779,46 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
file_handle.filename = filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
- zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
+ if (open_file_for_scanning(&file_handle)==FAILURE) {
+ zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename);
+ zend_restore_lexical_state(&original_lex_state);
return FAILURE;
}
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(syntax_highlighter_ini);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
+ zend_restore_lexical_state(&original_lex_state);
return SUCCESS;
}
-int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
+int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name)
{
zend_lex_state original_lex_state;
zval tmp = *str;
str = &tmp;
zval_copy_ctor(str);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
+ if (zend_prepare_string_for_scanning(str, str_name)==FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
return FAILURE;
}
BEGIN(INITIAL);
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(syntax_highlighter_ini);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(str);
return SUCCESS;
}
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding)
{
size_t length;
unsigned char *new_yy_start;
@@ -833,7 +833,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
length = SCNG(script_org_size);
new_yy_start = SCNG(script_org);
} else {
- if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -858,14 +858,14 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
if (SCNG(output_filter)) { \
size_t sz = 0; \
char *s = NULL; \
- SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
+ SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng); \
ZVAL_STRINGL(zendlval, s, sz); \
efree(s); \
} else { \
ZVAL_STRINGL(zendlval, yytext, yyleng); \
}
-static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
+static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type)
{
register char *s, *t;
char *end;
@@ -980,7 +980,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
unsigned char *str;
// TODO: avoid realocation ???
s = Z_STRVAL_P(zendlval);
- SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval));
zval_ptr_dtor(zendlval);
ZVAL_STRINGL(zendlval, (char *) str, sz);
efree(str);
@@ -988,7 +988,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
}
-int lex_scan(zval *zendlval TSRMLS_DC)
+int lex_scan(zval *zendlval)
{
restart:
SCNG(yy_text) = YYCURSOR;
@@ -1081,7 +1081,7 @@ inline_char_handler:
char *s = NULL;
size_t sz = 0;
// TODO: avoid reallocation ???
- readsize = SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
+ readsize = SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng);
ZVAL_STRINGL(zendlval, s, sz);
efree(s);
if (readsize < yyleng) {
@@ -1276,7 +1276,7 @@ yy19:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng, '`');
return T_ENCAPSED_AND_WHITESPACE;
}
#line 1283 "Zend/zend_language_scanner.c"
@@ -1308,7 +1308,7 @@ yy24:
#line 1975 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
yyless(1);
return T_CURLY_OPEN;
}
@@ -1341,7 +1341,7 @@ yy29:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1464 "Zend/zend_language_scanner.l"
{
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 1348 "Zend/zend_language_scanner.c"
@@ -1361,7 +1361,7 @@ yy33:
#line 1691 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ yy_push_state(ST_VAR_OFFSET);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1386,7 +1386,7 @@ yy36:
#line 1682 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1504,7 +1504,7 @@ yy41:
double_quotes_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng, '"');
return T_ENCAPSED_AND_WHITESPACE;
}
#line 1511 "Zend/zend_language_scanner.c"
@@ -1536,7 +1536,7 @@ yy46:
#line 1975 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
yyless(1);
return T_CURLY_OPEN;
}
@@ -1569,7 +1569,7 @@ yy51:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1464 "Zend/zend_language_scanner.l"
{
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 1576 "Zend/zend_language_scanner.c"
@@ -1589,7 +1589,7 @@ yy55:
#line 1691 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ yy_push_state(ST_VAR_OFFSET);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1614,7 +1614,7 @@ yy58:
#line 1682 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1774,7 +1774,7 @@ yy67:
heredoc_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0);
return T_ENCAPSED_AND_WHITESPACE;
}
#line 1781 "Zend/zend_language_scanner.c"
@@ -1795,7 +1795,7 @@ yy70:
#line 1975 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (zend_long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
yyless(1);
return T_CURLY_OPEN;
}
@@ -1828,7 +1828,7 @@ yy75:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1464 "Zend/zend_language_scanner.l"
{
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
#line 1835 "Zend/zend_language_scanner.c"
@@ -1848,7 +1848,7 @@ yy79:
#line 1691 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ yy_push_state(ST_VAR_OFFSET);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1873,7 +1873,7 @@ yy82:
#line 1682 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -2561,7 +2561,7 @@ yy131:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1458 "Zend/zend_language_scanner.l"
{
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
return '{';
}
#line 2568 "Zend/zend_language_scanner.c"
@@ -2574,7 +2574,7 @@ yy133:
{
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
}
return '}';
}
@@ -2751,7 +2751,7 @@ yy142:
char *str = NULL;
s = Z_STRVAL_P(zendlval);
// TODO: avoid reallocation ???
- SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval));
ZVAL_STRINGL(zendlval, str, sz);
efree(s);
}
@@ -2772,7 +2772,7 @@ yy144:
switch (*YYCURSOR++) {
case '"':
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"');
return T_CONSTANT_ENCAPSED_STRING;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
@@ -4768,7 +4768,7 @@ yy450:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1167 "Zend/zend_language_scanner.l"
{
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
return T_OBJECT_OPERATOR;
}
#line 4775 "Zend/zend_language_scanner.c"
@@ -6821,7 +6821,7 @@ yy765:
#line 1187 "Zend/zend_language_scanner.l"
{
yyless(0);
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
goto restart;
}
#line 6828 "Zend/zend_language_scanner.c"
@@ -6835,7 +6835,7 @@ yy767:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1181 "Zend/zend_language_scanner.l"
{
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
@@ -6952,8 +6952,8 @@ yy778:
#line 1488 "Zend/zend_language_scanner.l"
{
yyless(0);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_pop_state();
+ yy_push_state(ST_IN_SCRIPTING);
goto restart;
}
#line 6960 "Zend/zend_language_scanner.c"
@@ -6985,8 +6985,8 @@ yy783:
{
yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_pop_state();
+ yy_push_state(ST_IN_SCRIPTING);
return T_STRING_VARNAME;
}
#line 6993 "Zend/zend_language_scanner.c"
@@ -7205,7 +7205,7 @@ yy796:
yyleng = YYCURSOR - SCNG(yy_text);
#line 1703 "Zend/zend_language_scanner.l"
{
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return ']';
}
#line 7212 "Zend/zend_language_scanner.c"
@@ -7222,7 +7222,7 @@ yy799:
{
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h
index d434107a9b..bba3163533 100644
--- a/Zend/zend_language_scanner.h
+++ b/Zend/zend_language_scanner.h
@@ -58,11 +58,11 @@ typedef struct _zend_heredoc_label {
BEGIN_EXTERN_C()
int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
-ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
-ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
-ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC);
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC);
-ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC);
+ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state);
+ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state);
+ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename);
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding);
+ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding);
END_EXTERN_C()
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index f87d7bada7..93b3dc4f62 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -123,34 +123,34 @@ do { \
BEGIN_EXTERN_C()
-static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
ZEND_ASSERT(internal_encoding);
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC);
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding));
}
-static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC);
+ return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding));
}
-static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC);
+LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8);
}
-static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
+static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
ZEND_ASSERT(internal_encoding);
return zend_multibyte_encoding_converter(to, to_length, from, from_length,
-internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
+internal_encoding, zend_multibyte_encoding_utf8);
}
-static void _yy_push_state(int new_state TSRMLS_DC)
+static void _yy_push_state(int new_state)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
@@ -158,14 +158,14 @@ static void _yy_push_state(int new_state TSRMLS_DC)
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
-static void yy_pop_state(TSRMLS_D)
+static void yy_pop_state(void)
{
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
-static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+static void yy_scan_buffer(char *str, unsigned int len)
{
YYCURSOR = (YYCTYPE*)str;
YYLIMIT = YYCURSOR + len;
@@ -174,7 +174,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
}
}
-void startup_scanner(TSRMLS_D)
+void startup_scanner(void)
{
CG(parse_error) = 0;
CG(doc_comment) = NULL;
@@ -186,7 +186,7 @@ static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) {
efree(heredoc_label->label);
}
-void shutdown_scanner(TSRMLS_D)
+void shutdown_scanner(void)
{
CG(parse_error) = 0;
RESET_DOC_COMMENT();
@@ -195,7 +195,7 @@ void shutdown_scanner(TSRMLS_D)
zend_ptr_stack_destroy(&SCNG(heredoc_label_stack));
}
-ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state)
{
lex_state->yy_leng = SCNG(yy_leng);
lex_state->yy_start = SCNG(yy_start);
@@ -212,7 +212,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->in = SCNG(yy_in);
lex_state->yy_state = YYSTATE;
- lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
+ lex_state->filename = zend_get_compiled_filename();
lex_state->lineno = CG(zend_lineno);
lex_state->script_org = SCNG(script_org);
@@ -224,7 +224,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->script_encoding = SCNG(script_encoding);
}
-ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
+ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
{
SCNG(yy_leng) = lex_state->yy_leng;
SCNG(yy_start) = lex_state->yy_start;
@@ -243,7 +243,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
SCNG(yy_in) = lex_state->in;
YYSETCONDITION(lex_state->yy_state);
CG(zend_lineno) = lex_state->lineno;
- zend_restore_compiled_filename(lex_state->filename TSRMLS_CC);
+ zend_restore_compiled_filename(lex_state->filename);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
@@ -260,7 +260,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
RESET_DOC_COMMENT();
}
-ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
+ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
{
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
@@ -276,7 +276,7 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
#define BOM_UTF16_LE "\xff\xfe"
#define BOM_UTF8 "\xef\xbb\xbf"
-static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC)
+static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size)
{
const unsigned char *p;
int wchar_size = 2;
@@ -324,7 +324,7 @@ static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned ch
return NULL;
}
-static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
+static const zend_encoding* zend_multibyte_detect_unicode(void)
{
const zend_encoding *script_encoding = NULL;
int bom_size;
@@ -401,19 +401,19 @@ static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D)
}
}
/* make best effort if BOM is missing */
- return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC);
+ return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size));
}
return NULL;
}
-static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
+static const zend_encoding* zend_multibyte_find_script_encoding(void)
{
const zend_encoding *script_encoding;
if (CG(detect_unicode)) {
/* check out bom(byte order mark) and see if containing wchars */
- script_encoding = zend_multibyte_detect_unicode(TSRMLS_C);
+ script_encoding = zend_multibyte_detect_unicode();
if (script_encoding != NULL) {
/* bom or wchar detection is prior to 'script_encoding' option */
return script_encoding;
@@ -427,16 +427,16 @@ static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D)
/* if multiple encodings specified, detect automagically */
if (CG(script_encoding_list_size) > 1) {
- return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC);
+ return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size));
}
return CG(script_encoding_list)[0];
}
-ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC)
+ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding)
{
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
- const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
+ const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding();
if (!script_encoding) {
return FAILURE;
@@ -474,7 +474,7 @@ ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSR
return 0;
}
-ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
+ZEND_API int open_file_for_scanning(zend_file_handle *file_handle)
{
const char *file_path = NULL;
char *buf;
@@ -488,7 +488,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
}
- if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(file_handle, &buf, &size) == FAILURE) {
return FAILURE;
}
@@ -510,10 +510,10 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
- zend_multibyte_set_filter(NULL TSRMLS_CC);
+ zend_multibyte_set_filter(NULL);
if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -522,7 +522,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
}
SCNG(yy_start) = (unsigned char *)buf - offset;
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
} else {
zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed");
}
@@ -536,7 +536,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
compiled_filename = zend_string_init(file_path, strlen(file_path), 0);
- zend_set_compiled_filename(compiled_filename TSRMLS_CC);
+ zend_set_compiled_filename(compiled_filename);
zend_string_release(compiled_filename);
if (CG(start_lineno)) {
@@ -553,7 +553,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
END_EXTERN_C()
-ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
@@ -565,51 +565,51 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
ZVAL_LONG(&retval_zv, 1);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
- if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
+ if (open_file_for_scanning(file_handle)==FAILURE) {
if (type==ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
compilation_successful=0;
} else {
- init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context));
- zend_init_compiler_context(TSRMLS_C);
+ zend_init_compiler_context();
CG(ast_arena) = zend_arena_create(1024 * 32);
- compiler_result = zendparse(TSRMLS_C);
+ compiler_result = zendparse();
if (compiler_result != 0) { /* parser error */
zend_bailout();
}
- zend_compile_top_stmt(CG(ast) TSRMLS_CC);
+ zend_compile_top_stmt(CG(ast));
zend_ast_destroy(CG(ast));
zend_arena_destroy(CG(ast_arena));
- zend_do_end_compilation(TSRMLS_C);
- zend_emit_final_return(&retval_zv TSRMLS_CC);
+ zend_do_end_compilation();
+ zend_emit_final_return(&retval_zv);
CG(in_compilation) = original_in_compilation;
compilation_successful=1;
}
CG(active_op_array) = original_active_op_array;
if (compilation_successful) {
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
+ pass_two(op_array);
+ zend_release_labels(0);
} else {
efree_size(op_array, sizeof(zend_op_array));
op_array = NULL;
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
return op_array;
}
-zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
+zend_op_array *compile_filename(int type, zval *filename)
{
zend_file_handle file_handle;
zval tmp;
@@ -628,7 +628,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
file_handle.opened_path = NULL;
file_handle.handle.fp = NULL;
- retval = zend_compile_file(&file_handle, type TSRMLS_CC);
+ retval = zend_compile_file(&file_handle, type);
if (retval && file_handle.handle.stream.handle) {
if (!file_handle.opened_path) {
file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
@@ -640,7 +640,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
efree(opened_path);
}
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
if (filename==&tmp) {
zval_dtor(&tmp);
@@ -648,7 +648,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
return retval;
}
-ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
+ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename)
{
char *buf;
size_t size, old_len;
@@ -671,10 +671,10 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
- zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+ zend_multibyte_set_filter(zend_multibyte_get_internal_encoding());
if (SCNG(input_filter)) {
- if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -683,10 +683,10 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
}
}
- yy_scan_buffer(buf, (unsigned int)size TSRMLS_CC);
+ yy_scan_buffer(buf, (unsigned int)size);
new_compiled_filename = zend_string_init(filename, strlen(filename), 0);
- zend_set_compiled_filename(new_compiled_filename TSRMLS_CC);
+ zend_set_compiled_filename(new_compiled_filename);
zend_string_release(new_compiled_filename);
CG(zend_lineno) = 1;
CG(increment_lineno) = 0;
@@ -695,14 +695,14 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
}
-ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
+ZEND_API size_t zend_get_scanned_file_offset(void)
{
size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
if (SCNG(input_filter)) {
size_t original_offset = offset, length = 0;
do {
unsigned char *p = NULL;
- if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset)) {
return (size_t)-1;
}
efree(p);
@@ -717,7 +717,7 @@ ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D)
}
-zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
+zend_op_array *compile_string(zval *source_string, char *filename)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = NULL;
@@ -733,25 +733,25 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
source_string = &tmp;
CG(in_compilation) = 1;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC) == SUCCESS) {
+ zend_save_lexical_state(&original_lex_state);
+ if (zend_prepare_string_for_scanning(source_string, filename) == SUCCESS) {
CG(ast) = NULL;
CG(ast_arena) = zend_arena_create(1024 * 32);
BEGIN(ST_IN_SCRIPTING);
- if (!zendparse(TSRMLS_C)) {
+ if (!zendparse()) {
zend_op_array *original_active_op_array = CG(active_op_array);
op_array = emalloc(sizeof(zend_op_array));
- init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
+ init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context));
- zend_init_compiler_context(TSRMLS_C);
- zend_compile_top_stmt(CG(ast) TSRMLS_CC);
- zend_do_end_compilation(TSRMLS_C);
- zend_emit_final_return(NULL TSRMLS_CC);
- pass_two(op_array TSRMLS_CC);
- zend_release_labels(0 TSRMLS_CC);
+ zend_init_compiler_context();
+ zend_compile_top_stmt(CG(ast));
+ zend_do_end_compilation();
+ zend_emit_final_return(NULL);
+ pass_two(op_array);
+ zend_release_labels(0);
CG(active_op_array) = original_active_op_array;
}
@@ -760,7 +760,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
zend_arena_destroy(CG(ast_arena));
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(&tmp);
CG(in_compilation) = original_in_compilation;
return op_array;
@@ -768,7 +768,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
BEGIN_EXTERN_C()
-int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
+int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
{
zend_lex_state original_lex_state;
zend_file_handle file_handle;
@@ -777,46 +777,46 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
file_handle.filename = filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
- zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
+ if (open_file_for_scanning(&file_handle)==FAILURE) {
+ zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename);
+ zend_restore_lexical_state(&original_lex_state);
return FAILURE;
}
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(syntax_highlighter_ini);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
+ zend_restore_lexical_state(&original_lex_state);
return SUCCESS;
}
-int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
+int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name)
{
zend_lex_state original_lex_state;
zval tmp = *str;
str = &tmp;
zval_copy_ctor(str);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
+ if (zend_prepare_string_for_scanning(str, str_name)==FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
return FAILURE;
}
BEGIN(INITIAL);
- zend_highlight(syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(syntax_highlighter_ini);
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
SCNG(script_filtered) = NULL;
}
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(str);
return SUCCESS;
}
-ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC)
+ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding)
{
size_t length;
unsigned char *new_yy_start;
@@ -831,7 +831,7 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
length = SCNG(script_org_size);
new_yy_start = SCNG(script_org);
} else {
- if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
+ if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size))) {
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
@@ -856,14 +856,14 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
if (SCNG(output_filter)) { \
size_t sz = 0; \
char *s = NULL; \
- SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
+ SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng); \
ZVAL_STRINGL(zendlval, s, sz); \
efree(s); \
} else { \
ZVAL_STRINGL(zendlval, yytext, yyleng); \
}
-static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
+static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type)
{
register char *s, *t;
char *end;
@@ -978,7 +978,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
unsigned char *str;
// TODO: avoid realocation ???
s = Z_STRVAL_P(zendlval);
- SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval));
zval_ptr_dtor(zendlval);
ZVAL_STRINGL(zendlval, (char *) str, sz);
efree(str);
@@ -986,7 +986,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
}
-int lex_scan(zval *zendlval TSRMLS_DC)
+int lex_scan(zval *zendlval)
{
restart:
SCNG(yy_text) = YYCURSOR;
@@ -1165,7 +1165,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"->" {
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
return T_OBJECT_OPERATOR;
}
@@ -1179,14 +1179,14 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_LOOKING_FOR_PROPERTY>{LABEL} {
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
zend_copy_value(zendlval, yytext, yyleng);
return T_STRING;
}
<ST_LOOKING_FOR_PROPERTY>{ANY_CHAR} {
yyless(0);
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
goto restart;
}
@@ -1456,13 +1456,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"{" {
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
return '{';
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"${" {
- yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_VARNAME);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
@@ -1470,7 +1470,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"}" {
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
}
return '}';
}
@@ -1479,16 +1479,16 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_LOOKING_FOR_VARNAME>{LABEL}[[}] {
yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_pop_state();
+ yy_push_state(ST_IN_SCRIPTING);
return T_STRING_VARNAME;
}
<ST_LOOKING_FOR_VARNAME>{ANY_CHAR} {
yyless(0);
- yy_pop_state(TSRMLS_C);
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_pop_state();
+ yy_push_state(ST_IN_SCRIPTING);
goto restart;
}
@@ -1662,7 +1662,7 @@ inline_char_handler:
char *s = NULL;
size_t sz = 0;
// TODO: avoid reallocation ???
- readsize = SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
+ readsize = SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng);
ZVAL_STRINGL(zendlval, s, sz);
efree(s);
if (readsize < yyleng) {
@@ -1681,7 +1681,7 @@ inline_char_handler:
*/
<ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL}"->"[a-zA-Z_\x7f-\xff] {
yyless(yyleng - 3);
- yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
+ yy_push_state(ST_LOOKING_FOR_PROPERTY);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1690,7 +1690,7 @@ inline_char_handler:
*/
<ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL}"[" {
yyless(yyleng - 1);
- yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
+ yy_push_state(ST_VAR_OFFSET);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
return T_VARIABLE;
}
@@ -1701,7 +1701,7 @@ inline_char_handler:
}
<ST_VAR_OFFSET>"]" {
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
return ']';
}
@@ -1713,7 +1713,7 @@ inline_char_handler:
<ST_VAR_OFFSET>[ \n\r\t\\'#] {
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
- yy_pop_state(TSRMLS_C);
+ yy_pop_state();
ZVAL_NULL(zendlval);
return T_ENCAPSED_AND_WHITESPACE;
}
@@ -1854,7 +1854,7 @@ inline_char_handler:
char *str = NULL;
s = Z_STRVAL_P(zendlval);
// TODO: avoid reallocation ???
- SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
+ SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval));
ZVAL_STRINGL(zendlval, str, sz);
efree(s);
}
@@ -1869,7 +1869,7 @@ inline_char_handler:
switch (*YYCURSOR++) {
case '"':
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"');
return T_CONSTANT_ENCAPSED_STRING;
case '$':
if (IS_LABEL_START(*YYCURSOR) || *YYCURSOR == '{') {
@@ -1974,7 +1974,7 @@ inline_char_handler:
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
Z_LVAL_P(zendlval) = (zend_long) '{';
- yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
+ yy_push_state(ST_IN_SCRIPTING);
yyless(1);
return T_CURLY_OPEN;
}
@@ -2036,7 +2036,7 @@ inline_char_handler:
double_quotes_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng, '"');
return T_ENCAPSED_AND_WHITESPACE;
}
@@ -2078,7 +2078,7 @@ double_quotes_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng, '`');
return T_ENCAPSED_AND_WHITESPACE;
}
@@ -2152,7 +2152,7 @@ double_quotes_scan_done:
heredoc_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
- zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
+ zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0);
return T_ENCAPSED_AND_WHITESPACE;
}
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index d8141f8664..d8b194b648 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -31,7 +31,7 @@ ZEND_API int le_index_ptr;
/* true global */
static HashTable list_destructors;
-ZEND_API zval *zend_list_insert(void *ptr, int type TSRMLS_DC)
+ZEND_API zval *zend_list_insert(void *ptr, int type)
{
int index;
zval zv;
@@ -44,7 +44,7 @@ ZEND_API zval *zend_list_insert(void *ptr, int type TSRMLS_DC)
return zend_hash_index_add_new(&EG(regular_list), index, &zv);
}
-ZEND_API int _zend_list_delete(zend_resource *res TSRMLS_DC)
+ZEND_API int _zend_list_delete(zend_resource *res)
{
if (--GC_REFCOUNT(res) <= 0) {
return zend_hash_index_del(&EG(regular_list), res->handle);
@@ -53,7 +53,7 @@ ZEND_API int _zend_list_delete(zend_resource *res TSRMLS_DC)
}
}
-ZEND_API int _zend_list_free(zend_resource *res TSRMLS_DC)
+ZEND_API int _zend_list_free(zend_resource *res)
{
if (GC_REFCOUNT(res) <= 0) {
return zend_hash_index_del(&EG(regular_list), res->handle);
@@ -62,14 +62,14 @@ ZEND_API int _zend_list_free(zend_resource *res TSRMLS_DC)
}
}
-static void zend_resource_dtor(zend_resource *res TSRMLS_DC)
+static void zend_resource_dtor(zend_resource *res)
{
zend_rsrc_list_dtors_entry *ld;
ld = zend_hash_index_find_ptr(&list_destructors, res->type);
if (ld) {
if (ld->list_dtor_ex) {
- ld->list_dtor_ex(res TSRMLS_CC);
+ ld->list_dtor_ex(res);
}
} else {
zend_error(E_WARNING,"Unknown list entry type (%d)", res->type);
@@ -79,21 +79,21 @@ static void zend_resource_dtor(zend_resource *res TSRMLS_DC)
}
-ZEND_API int _zend_list_close(zend_resource *res TSRMLS_DC)
+ZEND_API int _zend_list_close(zend_resource *res)
{
if (GC_REFCOUNT(res) <= 0) {
return zend_list_delete(res);
} else if (res->type >= 0) {
- zend_resource_dtor(res TSRMLS_CC);
+ zend_resource_dtor(res);
}
return SUCCESS;
}
-ZEND_API zend_resource* zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
+ZEND_API zend_resource* zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
zval *zv;
- zv = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
+ zv = zend_list_insert(rsrc_pointer, rsrc_type);
if (rsrc_result) {
ZVAL_COPY_VALUE(rsrc_result, zv);
@@ -103,7 +103,7 @@ ZEND_API zend_resource* zend_register_resource(zval *rsrc_result, void *rsrc_poi
}
}
-ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
+ZEND_API void *zend_fetch_resource(zval *passed_id, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int actual_resource_type;
// void *resource;
@@ -116,14 +116,14 @@ ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, co
if (default_id==-1) { /* use id */
if (!passed_id) {
if (resource_type_name) {
- class_name = get_active_class_name(&space TSRMLS_CC);
- zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space);
+ zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(), resource_type_name);
}
return NULL;
} else if (Z_TYPE_P(passed_id) != IS_RESOURCE) {
if (resource_type_name) {
- class_name = get_active_class_name(&space TSRMLS_CC);
- zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space);
+ zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(), resource_type_name);
}
return NULL;
}
@@ -131,8 +131,8 @@ ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, co
passed_id = zend_hash_index_find(&EG(regular_list), default_id);
if (!passed_id) {
if (resource_type_name) {
- class_name = get_active_class_name(&space TSRMLS_CC);
- zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), default_id, resource_type_name);
+ class_name = get_active_class_name(&space);
+ zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(), default_id, resource_type_name);
}
return NULL;
}
@@ -153,8 +153,8 @@ ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, co
va_end(resource_types);
if (resource_type_name) {
- class_name = get_active_class_name(&space TSRMLS_CC);
- zend_error(E_WARNING, "%s%s%s(): supplied resource is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
+ class_name = get_active_class_name(&space);
+ zend_error(E_WARNING, "%s%s%s(): supplied resource is not a valid %s resource", class_name, space, get_active_function_name(), resource_type_name);
}
return NULL;
@@ -165,9 +165,8 @@ void list_entry_destructor(zval *zv)
zend_resource *res = Z_RES_P(zv);
if (res->type >= 0) {
- TSRMLS_FETCH();
-
- zend_resource_dtor(res TSRMLS_CC);
+
+ zend_resource_dtor(res);
}
efree_size(res, sizeof(zend_resource));
}
@@ -178,12 +177,11 @@ void plist_entry_destructor(zval *zv)
if (res->type >= 0) {
zend_rsrc_list_dtors_entry *ld;
- TSRMLS_FETCH();
-
+
ld = zend_hash_index_find_ptr(&list_destructors, res->type);
if (ld) {
if (ld->plist_dtor_ex) {
- ld->plist_dtor_ex(res TSRMLS_CC);
+ ld->plist_dtor_ex(res);
}
} else {
zend_error(E_WARNING,"Unknown list entry type (%d)", res->type);
@@ -192,43 +190,43 @@ void plist_entry_destructor(zval *zv)
free(res);
}
-int zend_init_rsrc_list(TSRMLS_D)
+int zend_init_rsrc_list(void)
{
zend_hash_init(&EG(regular_list), 8, NULL, list_entry_destructor, 0);
return SUCCESS;
}
-int zend_init_rsrc_plist(TSRMLS_D)
+int zend_init_rsrc_plist(void)
{
zend_hash_init_ex(&EG(persistent_list), 8, NULL, plist_entry_destructor, 1, 0);
return SUCCESS;
}
-static int zend_close_rsrc(zval *zv TSRMLS_DC)
+static int zend_close_rsrc(zval *zv)
{
zend_resource *res = Z_PTR_P(zv);
if (res->type >= 0) {
- zend_resource_dtor(res TSRMLS_CC);
+ zend_resource_dtor(res);
}
return ZEND_HASH_APPLY_KEEP;
}
-void zend_close_rsrc_list(HashTable *ht TSRMLS_DC)
+void zend_close_rsrc_list(HashTable *ht)
{
- zend_hash_reverse_apply(ht, zend_close_rsrc TSRMLS_CC);
+ zend_hash_reverse_apply(ht, zend_close_rsrc);
}
-void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC)
+void zend_destroy_rsrc_list(HashTable *ht)
{
zend_hash_graceful_reverse_destroy(ht);
}
-static int clean_module_resource(zval *zv, void *arg TSRMLS_DC)
+static int clean_module_resource(zval *zv, void *arg)
{
int resource_id = *(int *)arg;
if (Z_RES_TYPE_P(zv) == resource_id) {
@@ -239,12 +237,12 @@ static int clean_module_resource(zval *zv, void *arg TSRMLS_DC)
}
-static int zend_clean_module_rsrc_dtors_cb(zval *zv, void *arg TSRMLS_DC)
+static int zend_clean_module_rsrc_dtors_cb(zval *zv, void *arg)
{
zend_rsrc_list_dtors_entry *ld = (zend_rsrc_list_dtors_entry *)Z_PTR_P(zv);
int module_number = *(int *)arg;
if (ld->module_number == module_number) {
- zend_hash_apply_with_argument(&EG(persistent_list), clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), clean_module_resource, (void *) &(ld->resource_id));
return 1;
} else {
return 0;
@@ -252,9 +250,9 @@ static int zend_clean_module_rsrc_dtors_cb(zval *zv, void *arg TSRMLS_DC)
}
-void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC)
+void zend_clean_module_rsrc_dtors(int module_number)
{
- zend_hash_apply_with_argument(&list_destructors, zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(&list_destructors, zend_clean_module_rsrc_dtors_cb, (void *) &module_number);
}
@@ -309,7 +307,7 @@ void zend_destroy_rsrc_list_dtors(void)
}
-const char *zend_rsrc_list_get_rsrc_type(zend_resource *res TSRMLS_DC)
+const char *zend_rsrc_list_get_rsrc_type(zend_resource *res)
{
zend_rsrc_list_dtors_entry *lde;
diff --git a/Zend/zend_list.h b/Zend/zend_list.h
index f4e7d7b04d..fc63c4cb1d 100644
--- a/Zend/zend_list.h
+++ b/Zend/zend_list.h
@@ -27,8 +27,8 @@
BEGIN_EXTERN_C()
-typedef void (*rsrc_dtor_func_t)(zend_resource *res TSRMLS_DC);
-#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_resource *res TSRMLS_DC)
+typedef void (*rsrc_dtor_func_t)(zend_resource *res);
+#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_resource *res)
typedef struct _zend_rsrc_list_dtors_entry {
rsrc_dtor_func_t list_dtor_ex;
@@ -46,27 +46,27 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
void list_entry_destructor(zval *ptr);
void plist_entry_destructor(zval *ptr);
-void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC);
-int zend_init_rsrc_list(TSRMLS_D);
-int zend_init_rsrc_plist(TSRMLS_D);
-void zend_close_rsrc_list(HashTable *ht TSRMLS_DC);
-void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC);
+void zend_clean_module_rsrc_dtors(int module_number);
+int zend_init_rsrc_list(void);
+int zend_init_rsrc_plist(void);
+void zend_close_rsrc_list(HashTable *ht);
+void zend_destroy_rsrc_list(HashTable *ht);
int zend_init_rsrc_list_dtors(void);
void zend_destroy_rsrc_list_dtors(void);
-ZEND_API zval *zend_list_insert(void *ptr, int type TSRMLS_DC);
-ZEND_API int _zend_list_free(zend_resource *res TSRMLS_DC);
-ZEND_API int _zend_list_delete(zend_resource *res TSRMLS_DC);
-ZEND_API int _zend_list_close(zend_resource *res TSRMLS_DC);
+ZEND_API zval *zend_list_insert(void *ptr, int type);
+ZEND_API int _zend_list_free(zend_resource *res);
+ZEND_API int _zend_list_delete(zend_resource *res);
+ZEND_API int _zend_list_close(zend_resource *res);
-#define zend_list_free(res) _zend_list_free(res TSRMLS_CC)
-#define zend_list_delete(res) _zend_list_delete(res TSRMLS_CC)
-#define zend_list_close(res) _zend_list_close(res TSRMLS_CC)
+#define zend_list_free(res) _zend_list_free(res)
+#define zend_list_delete(res) _zend_list_delete(res)
+#define zend_list_close(res) _zend_list_close(res)
-ZEND_API zend_resource *zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
-ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
+ZEND_API zend_resource *zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
+ZEND_API void *zend_fetch_resource(zval *passed_id, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
-ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res TSRMLS_DC);
+ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
ZEND_API int zend_fetch_list_dtor_id(const char *type_name);
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
@@ -77,21 +77,21 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
}
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_FETCH_RESOURCE_NO_RETURN(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
- (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type))
+ (rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type))
#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_FETCH_RESOURCE2_NO_RETURN(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \
- (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2))
+ (rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2))
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
- zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type TSRMLS_CC);
+ zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type);
#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \
if (le_id == 0) { \
diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c
index 0df7e702f1..9028e19dbf 100644
--- a/Zend/zend_llist.c
+++ b/Zend/zend_llist.c
@@ -177,16 +177,16 @@ ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data))
}
-ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC)
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func)
{
zend_llist_element *element;
for (element=l->head; element; element=element->next) {
- func(element->data TSRMLS_CC);
+ func(element->data);
}
}
-ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC)
+ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func)
{
size_t i;
@@ -205,7 +205,7 @@ ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRM
*ptr++ = element;
}
- zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func TSRMLS_CC);
+ zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func);
l->head = elements[0];
elements[0]->prev = NULL;
@@ -220,24 +220,24 @@ ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRM
}
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC)
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg)
{
zend_llist_element *element;
for (element=l->head; element; element=element->next) {
- func(element->data, arg TSRMLS_CC);
+ func(element->data, arg);
}
}
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...)
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...)
{
zend_llist_element *element;
va_list args;
va_start(args, num_args);
for (element=l->head; element; element=element->next) {
- func(element->data, num_args, args TSRMLS_CC);
+ func(element->data, num_args, args);
}
va_end(args);
}
diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h
index ffe0c3cf99..0ecfdb0dec 100644
--- a/Zend/zend_llist.h
+++ b/Zend/zend_llist.h
@@ -29,10 +29,10 @@ typedef struct _zend_llist_element {
} zend_llist_element;
typedef void (*llist_dtor_func_t)(void *);
-typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element ** TSRMLS_DC);
-typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC);
-typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC);
-typedef void (*llist_apply_func_t)(void * TSRMLS_DC);
+typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element **);
+typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
+typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg);
+typedef void (*llist_apply_func_t)(void *);
typedef struct _zend_llist {
zend_llist_element *head;
@@ -55,12 +55,12 @@ ZEND_API void zend_llist_destroy(zend_llist *l);
ZEND_API void zend_llist_clean(zend_llist *l);
ZEND_API void zend_llist_remove_tail(zend_llist *l);
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
-ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC);
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func);
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC);
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...);
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg);
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
ZEND_API size_t zend_llist_count(zend_llist *l);
-ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC);
+ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
/* traversal */
ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos);
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index 0cd9ca4d16..96f1e7598f 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -26,14 +26,14 @@
#include "zend_compile.h"
#include "zend_build.h"
-#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC
-#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
-#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC
-#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
-#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
-#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
-
-#define ZEND_MODULE_API_NO 20140815
+#define INIT_FUNC_ARGS int type, int module_number
+#define INIT_FUNC_ARGS_PASSTHRU type, module_number
+#define SHUTDOWN_FUNC_ARGS int type, int module_number
+#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number
+#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
+#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
+
+#define ZEND_MODULE_API_NO 20141001
#ifdef ZTS
#define USING_ZTS 1
#else
@@ -91,8 +91,8 @@ struct _zend_module_entry {
#else
void* globals_ptr;
#endif
- void (*globals_ctor)(void *global TSRMLS_DC);
- void (*globals_dtor)(void *global TSRMLS_DC);
+ void (*globals_ctor)(void *global);
+ void (*globals_dtor)(void *global);
int (*post_deactivate_func)(void);
int module_started;
unsigned char type;
@@ -125,8 +125,8 @@ struct _zend_module_dep {
extern ZEND_API HashTable module_registry;
void module_destructor(zend_module_entry *module);
-int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
-int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC);
+int module_registry_request_startup(zend_module_entry *module);
+int module_registry_unload_temp(const zend_module_entry *module);
#endif
diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c
index 49056cfad4..9f7f72e274 100644
--- a/Zend/zend_multibyte.c
+++ b/Zend/zend_multibyte.c
@@ -25,7 +25,7 @@
#include "zend_multibyte.h"
#include "zend_ini.h"
-static const zend_encoding *dummy_encoding_fetcher(const char *encoding_name TSRMLS_DC)
+static const zend_encoding *dummy_encoding_fetcher(const char *encoding_name)
{
return NULL;
}
@@ -40,29 +40,29 @@ static int dummy_encoding_lexer_compatibility_checker(const zend_encoding *encod
return 0;
}
-static const zend_encoding *dummy_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC)
+static const zend_encoding *dummy_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size)
{
return NULL;
}
-static size_t dummy_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC)
+static size_t dummy_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from)
{
return (size_t)-1;
}
-static int dummy_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+static int dummy_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent)
{
*return_list = pemalloc(0, persistent);
*return_size = 0;
return SUCCESS;
}
-static const zend_encoding *dummy_internal_encoding_getter(TSRMLS_D)
+static const zend_encoding *dummy_internal_encoding_getter(void)
{
return NULL;
}
-static int dummy_internal_encoding_setter(const zend_encoding *encoding TSRMLS_DC)
+static int dummy_internal_encoding_setter(const zend_encoding *encoding)
{
return FAILURE;
}
@@ -85,25 +85,25 @@ ZEND_API const zend_encoding *zend_multibyte_encoding_utf16be = (const zend_enco
ZEND_API const zend_encoding *zend_multibyte_encoding_utf16le = (const zend_encoding*)"UTF-32LE";
ZEND_API const zend_encoding *zend_multibyte_encoding_utf8 = (const zend_encoding*)"UTF-8";
-ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functions TSRMLS_DC)
+ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functions)
{
- zend_multibyte_encoding_utf32be = functions->encoding_fetcher("UTF-32BE" TSRMLS_CC);
+ zend_multibyte_encoding_utf32be = functions->encoding_fetcher("UTF-32BE");
if (!zend_multibyte_encoding_utf32be) {
return FAILURE;
}
- zend_multibyte_encoding_utf32le = functions->encoding_fetcher("UTF-32LE" TSRMLS_CC);
+ zend_multibyte_encoding_utf32le = functions->encoding_fetcher("UTF-32LE");
if (!zend_multibyte_encoding_utf32le) {
return FAILURE;
}
- zend_multibyte_encoding_utf16be = functions->encoding_fetcher("UTF-16BE" TSRMLS_CC);
+ zend_multibyte_encoding_utf16be = functions->encoding_fetcher("UTF-16BE");
if (!zend_multibyte_encoding_utf16be) {
return FAILURE;
}
- zend_multibyte_encoding_utf16le = functions->encoding_fetcher("UTF-16LE" TSRMLS_CC);
+ zend_multibyte_encoding_utf16le = functions->encoding_fetcher("UTF-16LE");
if (!zend_multibyte_encoding_utf16le) {
return FAILURE;
}
- zend_multibyte_encoding_utf8 = functions->encoding_fetcher("UTF-8" TSRMLS_CC);
+ zend_multibyte_encoding_utf8 = functions->encoding_fetcher("UTF-8");
if (!zend_multibyte_encoding_utf8) {
return FAILURE;
}
@@ -115,19 +115,19 @@ ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functi
*/
{
const char *value = zend_ini_string("zend.script_encoding", sizeof("zend.script_encoding") - 1, 0);
- zend_multibyte_set_script_encoding_by_string(value, strlen(value) TSRMLS_CC);
+ zend_multibyte_set_script_encoding_by_string(value, strlen(value));
}
return SUCCESS;
}
-ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(TSRMLS_D)
+ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(void)
{
return multibyte_functions.provider_name ? &multibyte_functions: NULL;
}
-ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name TSRMLS_DC)
+ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name)
{
- return multibyte_functions.encoding_fetcher(name TSRMLS_CC);
+ return multibyte_functions.encoding_fetcher(name);
}
ZEND_API const char *zend_multibyte_get_encoding_name(const zend_encoding *encoding)
@@ -140,32 +140,32 @@ ZEND_API int zend_multibyte_check_lexer_compatibility(const zend_encoding *encod
return multibyte_functions.lexer_compatibility_checker(encoding);
}
-ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC)
+ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size)
{
- return multibyte_functions.encoding_detector(string, length, list, list_size TSRMLS_CC);
+ return multibyte_functions.encoding_detector(string, length, list, list_size);
}
-ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC)
+ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from)
{
- return multibyte_functions.encoding_converter(to, to_length, from, from_length, encoding_to, encoding_from TSRMLS_CC);
+ return multibyte_functions.encoding_converter(to, to_length, from, from_length, encoding_to, encoding_from);
}
-ZEND_API int zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+ZEND_API int zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent)
{
- return multibyte_functions.encoding_list_parser(encoding_list, encoding_list_len, return_list, return_size, persistent TSRMLS_CC);
+ return multibyte_functions.encoding_list_parser(encoding_list, encoding_list_len, return_list, return_size, persistent);
}
-ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(TSRMLS_D)
+ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(void)
{
- return multibyte_functions.internal_encoding_getter(TSRMLS_C);
+ return multibyte_functions.internal_encoding_getter();
}
-ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
+ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(void)
{
return LANG_SCNG(script_encoding);
}
-ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
+ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size)
{
if (CG(script_encoding_list)) {
free((char*)CG(script_encoding_list));
@@ -175,22 +175,22 @@ ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_l
return SUCCESS;
}
-ZEND_API int zend_multibyte_set_internal_encoding(const zend_encoding *encoding TSRMLS_DC)
+ZEND_API int zend_multibyte_set_internal_encoding(const zend_encoding *encoding)
{
- return multibyte_functions.internal_encoding_setter(encoding TSRMLS_CC);
+ return multibyte_functions.internal_encoding_setter(encoding);
}
-ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length TSRMLS_DC)
+ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length)
{
const zend_encoding **list = 0;
size_t size = 0;
if (!new_value) {
- zend_multibyte_set_script_encoding(NULL, 0 TSRMLS_CC);
+ zend_multibyte_set_script_encoding(NULL, 0);
return SUCCESS;
}
- if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == zend_multibyte_parse_encoding_list(new_value, new_value_length, &list, &size, 1)) {
return FAILURE;
}
@@ -199,7 +199,7 @@ ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value,
return FAILURE;
}
- if (FAILURE == zend_multibyte_set_script_encoding(list, size TSRMLS_CC)) {
+ if (FAILURE == zend_multibyte_set_script_encoding(list, size)) {
return FAILURE;
}
diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h
index db2db1a971..7d6f45280f 100644
--- a/Zend/zend_multibyte.h
+++ b/Zend/zend_multibyte.h
@@ -24,16 +24,16 @@
typedef struct _zend_encoding zend_encoding;
-typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length TSRMLS_DC);
+typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length);
-typedef const zend_encoding* (*zend_encoding_fetcher)(const char *encoding_name TSRMLS_DC);
+typedef const zend_encoding* (*zend_encoding_fetcher)(const char *encoding_name);
typedef const char* (*zend_encoding_name_getter)(const zend_encoding *encoding);
typedef int (*zend_encoding_lexer_compatibility_checker)(const zend_encoding *encoding);
-typedef const zend_encoding *(*zend_encoding_detector)(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC);
-typedef size_t (*zend_encoding_converter)(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC);
-typedef int (*zend_encoding_list_parser)(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC);
-typedef const zend_encoding *(*zend_encoding_internal_encoding_getter)(TSRMLS_D);
-typedef int (*zend_encoding_internal_encoding_setter)(const zend_encoding *encoding TSRMLS_DC);
+typedef const zend_encoding *(*zend_encoding_detector)(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size);
+typedef size_t (*zend_encoding_converter)(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from);
+typedef int (*zend_encoding_list_parser)(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent);
+typedef const zend_encoding *(*zend_encoding_internal_encoding_getter)(void);
+typedef int (*zend_encoding_internal_encoding_setter)(const zend_encoding *encoding);
typedef struct _zend_multibyte_functions {
const char *provider_name;
@@ -59,21 +59,21 @@ ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf16le;
ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf8;
/* multibyte utility functions */
-ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functions TSRMLS_DC);
-ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(TSRMLS_D);
+ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functions);
+ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(void);
-ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name TSRMLS_DC);
+ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name);
ZEND_API const char *zend_multibyte_get_encoding_name(const zend_encoding *encoding);
ZEND_API int zend_multibyte_check_lexer_compatibility(const zend_encoding *encoding);
-ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC);
-ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC);
-ZEND_API int zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC);
+ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size);
+ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from);
+ZEND_API int zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent);
-ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(TSRMLS_D);
-ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D);
-ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC);
-ZEND_API int zend_multibyte_set_internal_encoding(const zend_encoding *encoding TSRMLS_DC);
-ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length TSRMLS_DC);
+ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(void);
+ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(void);
+ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size);
+ZEND_API int zend_multibyte_set_internal_encoding(const zend_encoding *encoding);
+ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length);
END_EXTERN_C()
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index c474fa8662..d18ee1c8ee 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -106,7 +106,7 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
}
/* }}} */
-ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC) /* {{{ */
+ZEND_API HashTable *zend_std_get_properties(zval *object) /* {{{ */
{
zend_object *zobj;
zobj = Z_OBJ_P(object);
@@ -117,12 +117,12 @@ ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API HashTable *zend_std_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+ZEND_API HashTable *zend_std_get_gc(zval *object, zval **table, int *n) /* {{{ */
{
if (Z_OBJ_HANDLER_P(object, get_properties) != zend_std_get_properties) {
*table = NULL;
*n = 0;
- return Z_OBJ_HANDLER_P(object, get_properties)(object TSRMLS_CC);
+ return Z_OBJ_HANDLER_P(object, get_properties)(object);
} else {
zend_object *zobj = Z_OBJ_P(object);
@@ -133,7 +133,7 @@ ZEND_API HashTable *zend_std_get_gc(zval *object, zval **table, int *n TSRMLS_DC
}
/* }}} */
-ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval retval;
@@ -142,7 +142,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC
if (!ce->__debugInfo) {
*is_temp = 0;
return Z_OBJ_HANDLER_P(object, get_properties)
- ? Z_OBJ_HANDLER_P(object, get_properties)(object TSRMLS_CC)
+ ? Z_OBJ_HANDLER_P(object, get_properties)(object)
: NULL;
}
@@ -177,7 +177,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC
}
/* }}} */
-static void zend_std_call_getter(zval *object, zval *member, zval *retval TSRMLS_DC) /* {{{ */
+static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
@@ -194,7 +194,7 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval TSRMLS
}
/* }}} */
-static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */
+static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{ */
{
zval retval;
int result;
@@ -215,7 +215,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
zval_ptr_dtor(value);
if (Z_TYPE(retval) != IS_UNDEF) {
- result = i_zend_is_true(&retval TSRMLS_CC) ? SUCCESS : FAILURE;
+ result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
return result;
} else {
@@ -224,7 +224,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
}
/* }}} */
-static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static void zend_std_call_unsetter(zval *object, zval *member) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
@@ -240,7 +240,7 @@ static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) /* {{{
}
/* }}} */
-static void zend_std_call_issetter(zval *object, zval *member, zval *retval TSRMLS_DC) /* {{{ */
+static void zend_std_call_issetter(zval *object, zval *member, zval *retval) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
@@ -258,7 +258,7 @@ static void zend_std_call_issetter(zval *object, zval *member, zval *retval TSRM
}
/* }}} */
-static zend_always_inline int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static zend_always_inline int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce) /* {{{ */
{
switch (property_info->flags & ZEND_ACC_PPP_MASK) {
case ZEND_ACC_PUBLIC:
@@ -286,7 +286,7 @@ static zend_always_inline zend_bool is_derived_class(zend_class_entry *child_cla
}
/* }}} */
-static zend_always_inline zend_property_info *zend_get_property_info_quick(zend_class_entry *ce, zend_string *member, int silent, int allow_static, void **cache_slot TSRMLS_DC) /* {{{ */
+static zend_always_inline zend_property_info *zend_get_property_info_quick(zend_class_entry *ce, zend_string *member, int silent, int allow_static, void **cache_slot) /* {{{ */
{
zval *zv;
zend_property_info *property_info = NULL;
@@ -319,7 +319,7 @@ static zend_always_inline zend_property_info *zend_get_property_info_quick(zend_
/* if it's a shadow - go to access it's private */
property_info = NULL;
} else {
- if (EXPECTED(zend_verify_property_access(property_info, ce TSRMLS_CC) != 0)) {
+ if (EXPECTED(zend_verify_property_access(property_info, ce) != 0)) {
if (UNEXPECTED(!(flags & ZEND_ACC_CHANGED))
|| UNEXPECTED((flags & ZEND_ACC_PRIVATE))) {
if (UNEXPECTED((flags & ZEND_ACC_STATIC) != 0)) {
@@ -370,13 +370,13 @@ exit:
}
/* }}} */
-ZEND_API zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC) /* {{{ */
+ZEND_API zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent) /* {{{ */
{
- return zend_get_property_info_quick(ce, member, silent, 1, NULL TSRMLS_CC);
+ return zend_get_property_info_quick(ce, member, silent, 1, NULL);
}
/* }}} */
-ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name TSRMLS_DC) /* {{{ */
+ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name) /* {{{ */
{
zend_property_info *property_info;
const char *class_name = NULL;
@@ -390,7 +390,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
} else {
member = zend_string_copy(prop_info_name);
}
- property_info = zend_get_property_info_quick(zobj->ce, member, 1, 1, NULL TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, member, 1, 1, NULL);
zend_string_release(member);
if (property_info == NULL) {
/* undefined public property */
@@ -411,7 +411,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
return FAILURE;
}
}
- return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE;
+ return zend_verify_property_access(property_info, zobj->ce) ? SUCCESS : FAILURE;
}
/* }}} */
@@ -432,7 +432,7 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
}
/* }}} */
-zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
@@ -453,7 +453,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
#endif
/* make zend_get_property_info silent if we have getter - we may want to use it */
- property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (type == BP_VAR_IS) || (zobj->ce->__get != NULL), 0, cache_slot TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (type == BP_VAR_IS) || (zobj->ce->__get != NULL), 0, cache_slot);
if (EXPECTED(property_info != ZEND_WRONG_PROPERTY_INFO)) {
if (EXPECTED(property_info != NULL)) {
@@ -476,7 +476,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
/* have getter - try with it! */
ZVAL_COPY(&tmp_object, object);
*guard |= IN_GET; /* prevent circular getting */
- zend_std_call_getter(&tmp_object, member, rv TSRMLS_CC);
+ zend_std_call_getter(&tmp_object, member, rv);
*guard &= ~IN_GET;
if (Z_TYPE_P(rv) != IS_UNDEF) {
@@ -518,7 +518,7 @@ exit:
}
/* }}} */
-ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
@@ -534,7 +534,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
cache_slot = NULL;
}
- property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (zobj->ce->__set != NULL), 0, cache_slot TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (zobj->ce->__set != NULL), 0, cache_slot);
if (EXPECTED(property_info != ZEND_WRONG_PROPERTY_INFO)) {
if (EXPECTED(property_info != NULL)) {
@@ -545,7 +545,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
} else if (EXPECTED(zobj->properties != NULL)) {
if ((variable_ptr = zend_hash_find(zobj->properties, Z_STR_P(member))) != NULL) {
found:
- zend_assign_to_variable(variable_ptr, value, (IS_VAR|IS_TMP_VAR) TSRMLS_CC);
+ zend_assign_to_variable(variable_ptr, value, (IS_VAR|IS_TMP_VAR));
goto exit;
}
}
@@ -560,7 +560,7 @@ found:
ZVAL_COPY(&tmp_object, object);
(*guard) |= IN_SET; /* prevent circular setting */
- if (zend_std_call_setter(&tmp_object, member, value TSRMLS_CC) != SUCCESS) {
+ if (zend_std_call_setter(&tmp_object, member, value) != SUCCESS) {
/* for now, just ignore it - __set should take care of warnings, etc. */
}
(*guard) &= ~IN_SET;
@@ -608,12 +608,12 @@ exit:
}
/* }}} */
-zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
- if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC) != 0)) {
+ if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if(offset == NULL) {
/* [] construct */
ZVAL_UNDEF(&tmp);
@@ -639,12 +639,12 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv TSR
}
/* }}} */
-static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
- if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC) != 0)) {
+ if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if (!offset) {
ZVAL_NULL(&tmp);
offset = &tmp;
@@ -659,22 +659,22 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSR
}
/* }}} */
-static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval retval;
int result;
- if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC) != 0)) {
+ if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", &retval, offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
- result = i_zend_is_true(&retval TSRMLS_CC);
+ result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (check_empty && result && EXPECTED(!EG(exception))) {
zend_call_method_with_1_params(object, ce, NULL, "offsetget", &retval, offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
- result = i_zend_is_true(&retval TSRMLS_CC);
+ result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
}
}
@@ -690,7 +690,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
}
/* }}} */
-static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
zend_object *zobj;
zend_string *name;
@@ -708,7 +708,7 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), name->val);
#endif
- property_info = zend_get_property_info_quick(zobj->ce, name, (zobj->ce->__get != NULL), 0, cache_slot TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, name, (zobj->ce->__get != NULL), 0, cache_slot);
if (EXPECTED(property_info != ZEND_WRONG_PROPERTY_INFO)) {
if (EXPECTED(property_info != NULL)) {
@@ -753,7 +753,7 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
}
/* }}} */
-static void zend_std_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void zend_std_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
@@ -768,7 +768,7 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo
cache_slot = NULL;
}
- property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (zobj->ce->__unset != NULL), 0, cache_slot TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (zobj->ce->__unset != NULL), 0, cache_slot);
if (EXPECTED(property_info != ZEND_WRONG_PROPERTY_INFO)) {
if (EXPECTED(property_info != NULL)) {
@@ -794,7 +794,7 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo
/* have unseter - try with it! */
ZVAL_COPY(&tmp_object, object);
(*guard) |= IN_UNSET; /* prevent circular unsetting */
- zend_std_call_unsetter(&tmp_object, member TSRMLS_CC);
+ zend_std_call_unsetter(&tmp_object, member);
(*guard) &= ~IN_UNSET;
zval_ptr_dtor(&tmp_object);
} else {
@@ -815,11 +815,11 @@ exit:
}
/* }}} */
-static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
- if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
+ if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
zval_ptr_dtor(offset);
@@ -838,7 +838,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
array_init_size(&method_args, ZEND_NUM_ARGS());
- if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args TSRMLS_CC) == FAILURE)) {
+ if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args) == FAILURE)) {
zval_dtor(&method_args);
zend_error_noreturn(E_ERROR, "Cannot get arguments for __call");
RETURN_FALSE;
@@ -871,7 +871,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
* Returns the function address that should be called, or NULL
* if no such function exists.
*/
-static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, zend_string *function_name TSRMLS_DC) /* {{{ */
+static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, zend_string *function_name) /* {{{ */
{
zval *func;
@@ -910,9 +910,9 @@ static inline zend_function *zend_check_private_int(zend_function *fbc, zend_cla
}
/* }}} */
-ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name TSRMLS_DC) /* {{{ */
+ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name) /* {{{ */
{
- return zend_check_private_int(fbc, ce, function_name TSRMLS_CC) != NULL;
+ return zend_check_private_int(fbc, ce, function_name) != NULL;
}
/* }}} */
@@ -967,7 +967,7 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry
}
/* }}} */
-static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key TSRMLS_DC) /* {{{ */
+static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key) /* {{{ */
{
zend_object *zobj = *obj_ptr;
zval *func;
@@ -1001,7 +1001,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
/* Ensure that if we're calling a private function, we're allowed to do so.
* If we're not and __call() handler exists, invoke it, otherwise error out.
*/
- updated_fbc = zend_check_private_int(fbc, zobj->ce, lc_method_name TSRMLS_CC);
+ updated_fbc = zend_check_private_int(fbc, zobj->ce, lc_method_name);
if (EXPECTED(updated_fbc != NULL)) {
fbc = updated_fbc;
} else {
@@ -1056,7 +1056,7 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
array_init_size(&method_args, ZEND_NUM_ARGS());
- if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args TSRMLS_CC) == FAILURE)) {
+ if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args) == FAILURE)) {
zval_dtor(&method_args);
zend_error_noreturn(E_ERROR, "Cannot get arguments for " ZEND_CALLSTATIC_FUNC_NAME);
RETURN_FALSE;
@@ -1108,7 +1108,7 @@ static inline union _zend_function *zend_get_user_callstatic_function(zend_class
/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */
-ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name, const zval *key TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name, const zval *key) /* {{{ */
{
zend_function *fbc = NULL;
char *lc_class_name;
@@ -1142,7 +1142,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
}
if (ce->__call &&
Z_OBJ(EG(current_execute_data)->This) &&
- instanceof_function(Z_OBJCE(EG(current_execute_data)->This), ce TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(EG(current_execute_data)->This), ce)) {
return zend_get_user_call_function(ce, function_name);
} else if (ce->__callstatic) {
return zend_get_user_callstatic_function(ce, function_name);
@@ -1166,7 +1166,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- updated_fbc = zend_check_private_int(fbc, EG(scope), lc_function_name TSRMLS_CC);
+ updated_fbc = zend_check_private_int(fbc, EG(scope), lc_function_name);
if (EXPECTED(updated_fbc != NULL)) {
fbc = updated_fbc;
} else {
@@ -1196,7 +1196,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
}
/* }}} */
-ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC) /* {{{ */
+ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot) /* {{{ */
{
zend_property_info *property_info;
@@ -1210,7 +1210,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
return NULL;
}
- if (UNEXPECTED(!zend_verify_property_access(property_info, ce TSRMLS_CC))) {
+ if (UNEXPECTED(!zend_verify_property_access(property_info, ce))) {
if (!silent) {
zend_error_noreturn(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name->val, property_name->val);
}
@@ -1224,7 +1224,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
return NULL;
}
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
if (EXPECTED(cache_slot != NULL)) {
CACHE_POLYMORPHIC_PTR_EX(cache_slot, ce, property_info);
@@ -1243,14 +1243,14 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p
}
/* }}} */
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot) /* {{{ */
{
zend_error_noreturn(E_ERROR, "Attempt to unset static property %s::$%s", ce->name->val, property_name->val);
return 0;
}
/* }}} */
-ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj TSRMLS_DC) /* {{{ */
+ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj) /* {{{ */
{
zend_function *constructor = zobj->ce->constructor;
@@ -1286,9 +1286,9 @@ ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj TSRMLS
}
/* }}} */
-int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC);
+int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2);
-static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int zend_std_compare_objects(zval *o1, zval *o2) /* {{{ */
{
zend_object *zobj1, *zobj2;
@@ -1310,7 +1310,7 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
zval *p1 = &zobj1->properties_table[i];
zval *p2 = &zobj2->properties_table[i];
- if (compare_function(&result, p1, p2 TSRMLS_CC)==FAILURE) {
+ if (compare_function(&result, p1, p2)==FAILURE) {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
@@ -1343,12 +1343,12 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
if (!zobj2->properties) {
rebuild_object_properties(zobj2);
}
- return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC);
+ return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties);
}
}
/* }}} */
-static int zend_std_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int zend_std_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
zend_object *zobj;
int result;
@@ -1365,7 +1365,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists,
cache_slot = NULL;
}
- property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), 1, 0, cache_slot TSRMLS_CC);
+ property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), 1, 0, cache_slot);
if (EXPECTED(property_info != ZEND_WRONG_PROPERTY_INFO)) {
if (EXPECTED(property_info != NULL)) {
@@ -1382,7 +1382,7 @@ found:
result = (Z_TYPE_P(value) != IS_NULL);
break;
default:
- result = zend_is_true(value TSRMLS_CC);
+ result = zend_is_true(value);
break;
case 2:
result = 1;
@@ -1403,17 +1403,17 @@ found:
/* have issetter - try with it! */
ZVAL_COPY(&tmp_object, object);
(*guard) |= IN_ISSET; /* prevent circular getting */
- zend_std_call_issetter(&tmp_object, member, &rv TSRMLS_CC);
+ zend_std_call_issetter(&tmp_object, member, &rv);
if (Z_TYPE(rv) != IS_UNDEF) {
- result = zend_is_true(&rv TSRMLS_CC);
+ result = zend_is_true(&rv);
zval_ptr_dtor(&rv);
if (has_set_exists && result) {
if (EXPECTED(!EG(exception)) && zobj->ce->__get && !((*guard) & IN_GET)) {
(*guard) |= IN_GET;
- zend_std_call_getter(&tmp_object, member, &rv TSRMLS_CC);
+ zend_std_call_getter(&tmp_object, member, &rv);
(*guard) &= ~IN_GET;
if (Z_TYPE(rv) != IS_UNDEF) {
- result = i_zend_is_true(&rv TSRMLS_CC);
+ result = i_zend_is_true(&rv);
zval_ptr_dtor(&rv);
} else {
result = 0;
@@ -1436,13 +1436,13 @@ exit:
}
/* }}} */
-zend_string *zend_std_object_get_class_name(const zend_object *zobj TSRMLS_DC) /* {{{ */
+zend_string *zend_std_object_get_class_name(const zend_object *zobj) /* {{{ */
{
return zend_string_copy(zobj->ce->name);
}
/* }}} */
-ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC) /* {{{ */
+ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type) /* {{{ */
{
zval retval;
zend_class_entry *ce;
@@ -1502,7 +1502,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
}
/* }}} */
-int zend_std_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr TSRMLS_DC) /* {{{ */
+int zend_std_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */
{
zval *func;
zend_class_entry *ce;
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index ac0965ad57..a669077c3e 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -33,10 +33,10 @@ struct _zend_property_info;
symbol table, its reference count should be 0.
*/
/* Used to fetch property from the object, read-only */
-typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
+typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, void **cache_slot, zval *rv);
/* Used to fetch dimension from the object, read-only */
-typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type, zval *rv TSRMLS_DC);
+typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type, zval *rv);
/* The following rule applies to write_property() and write_dimension() implementations:
@@ -45,23 +45,23 @@ typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int ty
any changes. You should NOT modify the reference count of the value passed to you.
*/
/* Used to set property of the object */
-typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
+typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, void **cache_slot);
/* Used to set dimension of the object */
-typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC);
+typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value);
/* Used to create pointer to the property of the object, for future direct r/w access */
-typedef zval *(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC);
+typedef zval *(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, void **cache_slot);
/* Used to set object value. Can be used to override assignments and scalar
write ops (like ++, +=) on the object */
-typedef void (*zend_object_set_t)(zval *object, zval *value TSRMLS_DC);
+typedef void (*zend_object_set_t)(zval *object, zval *value);
/* Used to get object value. Can be used when converting object value to
* one of the basic types and when using scalar ops (like ++, +=) on the object
*/
-typedef zval* (*zend_object_get_t)(zval *object, zval *rv TSRMLS_DC);
+typedef zval* (*zend_object_get_t)(zval *object, zval *rv);
/* Used to check if a property of the object exists */
/* param has_set_exists:
@@ -69,55 +69,55 @@ typedef zval* (*zend_object_get_t)(zval *object, zval *rv TSRMLS_DC);
* 1 (set) whether property exists and is true
* 2 (exists) whether property exists
*/
-typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC);
+typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, void **cache_slot);
/* Used to check if a dimension of the object exists */
-typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC);
+typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty);
/* Used to remove a property of the object */
-typedef void (*zend_object_unset_property_t)(zval *object, zval *member, void **cache_slot TSRMLS_DC);
+typedef void (*zend_object_unset_property_t)(zval *object, zval *member, void **cache_slot);
/* Used to remove a dimension of the object */
-typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
+typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset);
/* Used to get hash of the properties of the object, as hash of zval's */
-typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC);
+typedef HashTable *(*zend_object_get_properties_t)(zval *object);
-typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TSRMLS_DC);
+typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp);
/* Used to call methods */
/* args on stack! */
/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
*/
typedef int (*zend_object_call_method_t)(zend_string *method, zend_object *object, INTERNAL_FUNCTION_PARAMETERS);
-typedef union _zend_function *(*zend_object_get_method_t)(zend_object **object, zend_string *method, const zval *key TSRMLS_DC);
-typedef union _zend_function *(*zend_object_get_constructor_t)(zend_object *object TSRMLS_DC);
+typedef union _zend_function *(*zend_object_get_method_t)(zend_object **object, zend_string *method, const zval *key);
+typedef union _zend_function *(*zend_object_get_constructor_t)(zend_object *object);
/* Object maintenance/destruction */
-typedef void (*zend_object_dtor_obj_t)(zend_object *object TSRMLS_DC);
-typedef void (*zend_object_free_obj_t)(zend_object *object TSRMLS_DC);
-typedef zend_object* (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
+typedef void (*zend_object_dtor_obj_t)(zend_object *object);
+typedef void (*zend_object_free_obj_t)(zend_object *object);
+typedef zend_object* (*zend_object_clone_obj_t)(zval *object);
/* Get class name for display in var_dump and other debugging functions.
* Must be defined and must return a non-NULL value. */
-typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object TSRMLS_DC);
+typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object);
-typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
-typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC);
+typedef int (*zend_object_compare_t)(zval *object1, zval *object2);
+typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2);
/* Cast an object to some other type
*/
-typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
+typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type);
/* updates *count to hold the number of elements present and returns SUCCESS.
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
-typedef int (*zend_object_count_elements_t)(zval *object, zend_long *count TSRMLS_DC);
+typedef int (*zend_object_count_elements_t)(zval *object, zend_long *count);
-typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zend_object **obj_ptr TSRMLS_DC);
+typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zend_object **obj_ptr);
-typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval **table, int *n TSRMLS_DC);
+typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval **table, int *n);
-typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC);
+typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2);
struct _zend_object_handlers {
/* offset of real object header (usually zero) */
@@ -159,22 +159,22 @@ extern ZEND_API zend_object_handlers std_object_handlers;
((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
BEGIN_EXTERN_C()
-ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key TSRMLS_DC);
-ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC);
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC);
-ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC);
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent TSRMLS_DC);
-ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
-ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
-ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
-ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
+ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
+ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot);
+ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot);
+ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object);
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent);
+ZEND_API HashTable *zend_std_get_properties(zval *object);
+ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp);
+ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type);
+ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot);
ZEND_API void rebuild_object_properties(zend_object *zobj);
-ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, zend_string *function_name TSRMLS_DC);
+ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, zend_string *function_name);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
-ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name TSRMLS_DC);
+ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name);
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
END_EXTERN_C()
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 69b5df2eab..76f923e977 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -26,14 +26,14 @@
#include "zend_interfaces.h"
#include "zend_exceptions.h"
-ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce)
{
GC_REFCOUNT(object) = 1;
GC_TYPE_INFO(object) = IS_OBJECT;
object->ce = ce;
object->properties = NULL;
object->guards = NULL;
- zend_objects_store_put(object TSRMLS_CC);
+ zend_objects_store_put(object);
if (EXPECTED(ce->default_properties_count != 0)) {
zval *p = object->properties_table;
zval *end = p + ce->default_properties_count;
@@ -45,7 +45,7 @@ ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSR
}
}
-ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
+ZEND_API void zend_object_std_dtor(zend_object *object)
{
int i, count;
@@ -54,16 +54,16 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
FREE_HASHTABLE(object->guards);
}
if (object->properties) {
- zend_array_destroy(object->properties TSRMLS_CC);
+ zend_array_destroy(object->properties);
FREE_HASHTABLE(object->properties);
}
count = object->ce->default_properties_count;
for (i = 0; i < count; i++) {
- i_zval_ptr_dtor(&object->properties_table[i] ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(&object->properties_table[i] ZEND_FILE_LINE_CC);
}
}
-ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC)
+ZEND_API void zend_objects_destroy_object(zend_object *object)
{
zend_function *destructor = object ? object->ce->destructor : NULL;
@@ -120,7 +120,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC)
zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL);
if (old_exception) {
if (EG(exception)) {
- zend_exception_set_previous(EG(exception), old_exception TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), old_exception);
} else {
EG(exception) = old_exception;
}
@@ -129,16 +129,16 @@ ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC)
}
}
-ZEND_API zend_object *zend_objects_new(zend_class_entry *ce TSRMLS_DC)
+ZEND_API zend_object *zend_objects_new(zend_class_entry *ce)
{
zend_object *object = emalloc(sizeof(zend_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(object, ce TSRMLS_CC);
+ zend_object_std_init(object, ce);
object->handlers = &std_object_handlers;
return object;
}
-ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object TSRMLS_DC)
+ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object)
{
int i;
@@ -184,7 +184,7 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *o
}
}
-ZEND_API zend_object *zend_objects_clone_obj(zval *zobject TSRMLS_DC)
+ZEND_API zend_object *zend_objects_clone_obj(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
@@ -192,9 +192,9 @@ ZEND_API zend_object *zend_objects_clone_obj(zval *zobject TSRMLS_DC)
/* assume that create isn't overwritten, so when clone depends on the
* overwritten one then it must itself be overwritten */
old_object = Z_OBJ_P(zobject);
- new_object = zend_objects_new(old_object->ce TSRMLS_CC);
+ new_object = zend_objects_new(old_object->ce);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h
index 1521d9756b..b8c766164a 100644
--- a/Zend/zend_objects.h
+++ b/Zend/zend_objects.h
@@ -25,12 +25,12 @@
#include "zend.h"
BEGIN_EXTERN_C()
-ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC);
-ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC);
-ZEND_API zend_object *zend_objects_new(zend_class_entry *ce TSRMLS_DC);
-ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC);
-ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object TSRMLS_DC);
-ZEND_API zend_object *zend_objects_clone_obj(zval *object TSRMLS_DC);
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce);
+ZEND_API void zend_object_std_dtor(zend_object *object);
+ZEND_API zend_object *zend_objects_new(zend_class_entry *ce);
+ZEND_API void zend_objects_destroy_object(zend_object *object);
+ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object);
+ZEND_API zend_object *zend_objects_clone_obj(zval *object);
END_EXTERN_C()
#endif /* ZEND_OBJECTS_H */
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 04dd82b6a0..c131dc9383 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -40,7 +40,7 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
objects->object_buckets = NULL;
}
-ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC)
+ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
{
uint32_t i;
@@ -51,14 +51,14 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
GC_REFCOUNT(obj)++;
- obj->handlers->dtor_obj(obj TSRMLS_CC);
+ obj->handlers->dtor_obj(obj);
GC_REFCOUNT(obj)--;
}
}
}
}
-ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
+ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects)
{
uint32_t i;
@@ -74,7 +74,7 @@ ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSR
}
}
-ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC)
+ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects)
{
uint32_t i;
@@ -87,7 +87,7 @@ ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj) {
GC_REFCOUNT(obj)++;
- obj->handlers->free_obj(obj TSRMLS_CC);
+ obj->handlers->free_obj(obj);
GC_REFCOUNT(obj)--;
}
}
@@ -110,7 +110,7 @@ ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects
/* Store objects API */
-ZEND_API void zend_objects_store_put(zend_object *object TSRMLS_DC)
+ZEND_API void zend_objects_store_put(zend_object *object)
{
int handle;
@@ -132,7 +132,7 @@ ZEND_API void zend_objects_store_put(zend_object *object TSRMLS_DC)
SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle], EG(objects_store).free_list_head); \
EG(objects_store).free_list_head = handle;
-ZEND_API void zend_objects_store_free(zend_object *object TSRMLS_DC) /* {{{ */
+ZEND_API void zend_objects_store_free(zend_object *object) /* {{{ */
{
uint32_t handle = object->handle;
void *ptr = ((char*)object) - object->handlers->offset;
@@ -143,7 +143,7 @@ ZEND_API void zend_objects_store_free(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */
+ZEND_API void zend_objects_store_del(zend_object *object) /* {{{ */
{
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
@@ -160,7 +160,7 @@ ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */
if (object->handlers->dtor_obj) {
GC_REFCOUNT(object)++;
zend_try {
- object->handlers->dtor_obj(object TSRMLS_CC);
+ object->handlers->dtor_obj(object);
} zend_catch {
failure = 1;
} zend_end_try();
@@ -178,7 +178,7 @@ ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */
if (object->handlers->free_obj) {
zend_try {
GC_REFCOUNT(object)++;
- object->handlers->free_obj(object TSRMLS_CC);
+ object->handlers->free_obj(object);
GC_REFCOUNT(object)--;
} zend_catch {
failure = 1;
@@ -208,13 +208,13 @@ ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */
* from the constructor function. You MUST NOT use this function for any other
* weird games, or call it at any other time after the object is constructed.
* */
-ZEND_API void zend_object_store_set_object(zval *zobject, zend_object *object TSRMLS_DC)
+ZEND_API void zend_object_store_set_object(zval *zobject, zend_object *object)
{
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zobject)] = object;
}
/* Called when the ctor was terminated by an exception */
-ZEND_API void zend_object_store_ctor_failed(zend_object *obj TSRMLS_DC)
+ZEND_API void zend_object_store_ctor_failed(zend_object *obj)
{
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
}
diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h
index 362d79a68c..741bb82899 100644
--- a/Zend/zend_objects_API.h
+++ b/Zend/zend_objects_API.h
@@ -37,7 +37,7 @@
} while (0)
-#define OBJ_RELEASE(obj) zend_object_release(obj TSRMLS_CC)
+#define OBJ_RELEASE(obj) zend_object_release(obj)
typedef struct _zend_objects_store {
zend_object **object_buckets;
@@ -49,34 +49,34 @@ typedef struct _zend_objects_store {
/* Global store handling functions */
BEGIN_EXTERN_C()
ZEND_API void zend_objects_store_init(zend_objects_store *objects, uint32_t init_size);
-ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC);
-ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC);
+ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects);
+ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects);
ZEND_API void zend_objects_store_destroy(zend_objects_store *objects);
/* Store API functions */
-ZEND_API void zend_objects_store_put(zend_object *object TSRMLS_DC);
-ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC);
-ZEND_API void zend_objects_store_free(zend_object *object TSRMLS_DC);
+ZEND_API void zend_objects_store_put(zend_object *object);
+ZEND_API void zend_objects_store_del(zend_object *object);
+ZEND_API void zend_objects_store_free(zend_object *object);
/* See comment in zend_objects_API.c before you use this */
-ZEND_API void zend_object_store_set_object(zval *zobject, zend_object *object TSRMLS_DC);
-ZEND_API void zend_object_store_ctor_failed(zend_object *object TSRMLS_DC);
+ZEND_API void zend_object_store_set_object(zval *zobject, zend_object *object);
+ZEND_API void zend_object_store_ctor_failed(zend_object *object);
-ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC);
+ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects);
#define ZEND_OBJECTS_STORE_HANDLERS 0, zend_object_std_dtor, zend_objects_destroy_object, zend_objects_clone_obj
-ZEND_API zend_object *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);
+ZEND_API zend_object *zend_object_create_proxy(zval *object, zval *member);
ZEND_API zend_object_handlers *zend_get_std_object_handlers(void);
END_EXTERN_C()
-static zend_always_inline void zend_object_release(zend_object *obj TSRMLS_DC)
+static zend_always_inline void zend_object_release(zend_object *obj)
{
if (--GC_REFCOUNT(obj) == 0) {
- zend_objects_store_del(obj TSRMLS_CC);
+ zend_objects_store_del(obj);
} else if (UNEXPECTED(!GC_INFO(obj))) {
- gc_possible_root(&obj->gc TSRMLS_CC);
+ gc_possible_root(&obj->gc);
}
}
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 1bc788a644..82c87c5cd2 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -29,14 +29,14 @@
#include "zend_vm.h"
-static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array)
{
if (extension->op_array_ctor) {
extension->op_array_ctor(op_array);
}
}
-static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array)
{
if (extension->op_array_dtor) {
extension->op_array_dtor(op_array);
@@ -48,7 +48,7 @@ static void op_array_alloc_ops(zend_op_array *op_array, uint32_t size)
op_array->opcodes = erealloc(op_array->opcodes, size * sizeof(zend_op));
}
-void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC)
+void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size)
{
op_array->type = type;
@@ -64,7 +64,7 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
op_array->T = 0;
op_array->function_name = NULL;
- op_array->filename = zend_get_compiled_filename(TSRMLS_C);
+ op_array->filename = zend_get_compiled_filename();
op_array->doc_comment = NULL;
op_array->arg_info = NULL;
@@ -95,13 +95,13 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array);
}
-ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC)
+ZEND_API void destroy_zend_function(zend_function *function)
{
if (function->type == ZEND_USER_FUNCTION) {
- destroy_op_array(&function->op_array TSRMLS_CC);
+ destroy_op_array(&function->op_array);
} else {
ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION);
ZEND_ASSERT(function->common.function_name);
@@ -112,11 +112,10 @@ ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC)
ZEND_API void zend_function_dtor(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
- TSRMLS_FETCH();
if (function->type == ZEND_USER_FUNCTION) {
ZEND_ASSERT(function->common.function_name);
- destroy_op_array(&function->op_array TSRMLS_CC);
+ destroy_op_array(&function->op_array);
/* op_arrays are allocated on arena, so we don't have to free them */
//??? efree_size(function, sizeof(zend_op_array));
} else {
@@ -136,7 +135,7 @@ ZEND_API void zend_cleanup_op_array_data(zend_op_array *op_array)
}
}
-ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
+ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce)
{
/* Clean all parts that can contain run-time data */
/* Note that only run-time accessed data need to be cleaned up, pre-defined data can
@@ -166,7 +165,7 @@ ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
}
}
-ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC)
+ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce)
{
if (CE_STATIC_MEMBERS(ce)) {
int i;
@@ -313,7 +312,7 @@ void zend_class_add_ref(zval *zv)
ce->refcount++;
}
-ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
+ZEND_API void destroy_op_array(zend_op_array *op_array)
{
zval *literal = op_array->literals;
zval *end;
@@ -366,7 +365,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
efree(op_array->try_catch_array);
}
if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array);
}
if (op_array->arg_info) {
for (i=0; i<op_array->num_args; i++) {
@@ -379,14 +378,14 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
}
}
-void init_op(zend_op *op TSRMLS_DC)
+void init_op(zend_op *op)
{
memset(op, 0, sizeof(zend_op));
op->lineno = CG(zend_lineno);
SET_UNUSED(op->result);
}
-zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC)
+zend_op *get_next_op(zend_op_array *op_array)
{
uint32_t next_op_num = op_array->last++;
zend_op *next_op;
@@ -398,7 +397,7 @@ zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC)
next_op = &(op_array->opcodes[next_op_num]);
- init_op(next_op TSRMLS_CC);
+ init_op(next_op);
return next_op;
}
@@ -415,7 +414,7 @@ zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array)
return &op_array->brk_cont_array[op_array->last_brk_cont-1];
}
-static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC)
+static void zend_update_extended_info(zend_op_array *op_array)
{
zend_op *opline = op_array->opcodes, *end=opline+op_array->last;
@@ -438,14 +437,14 @@ static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC)
}
}
-static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
+static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array)
{
if (extension->op_array_handler) {
extension->op_array_handler(op_array);
}
}
-static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC)
+static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num)
{
int i;
@@ -470,7 +469,7 @@ static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num
}
}
-static void zend_adjust_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t start, uint32_t end TSRMLS_DC)
+static void zend_adjust_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t start, uint32_t end)
{
int i;
uint32_t op_num = 0;
@@ -491,7 +490,7 @@ static void zend_adjust_fast_call(zend_op_array *op_array, uint32_t fast_call, u
}
}
-static void zend_resolve_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t op_num TSRMLS_DC)
+static void zend_resolve_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t op_num)
{
int i;
uint32_t finally_op_num = 0;
@@ -513,14 +512,14 @@ static void zend_resolve_fast_call(zend_op_array *op_array, uint32_t fast_call,
}
}
-static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC)
+static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num)
{
uint32_t start_op;
zend_op *opline;
uint32_t i = op_array->last_try_catch;
if (dst_num != (uint32_t)-1) {
- zend_check_finally_breakout(op_array, op_num, dst_num TSRMLS_CC);
+ zend_check_finally_breakout(op_array, op_num, dst_num);
}
/* the backward order is mater */
@@ -541,7 +540,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
/* generate a FAST_CALL to finally block */
start_op = get_next_op_number(op_array);
- opline = get_next_op(op_array TSRMLS_CC);
+ opline = get_next_op(op_array);
opline->opcode = ZEND_FAST_CALL;
opline->result_type = IS_TMP_VAR;
opline->result.var = fast_call_var;
@@ -549,21 +548,21 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
SET_UNUSED(opline->op2);
zend_adjust_fast_call(op_array, start_op,
op_array->try_catch_array[i].finally_op,
- op_array->try_catch_array[i].finally_end TSRMLS_CC);
+ op_array->try_catch_array[i].finally_end);
if (op_array->try_catch_array[i].catch_op) {
opline->extended_value = ZEND_FAST_CALL_FROM_CATCH;
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
opline->op1.opline_num = get_next_op_number(op_array);
/* generate a FAST_CALL to hole CALL_FROM_FINALLY */
- opline = get_next_op(op_array TSRMLS_CC);
+ opline = get_next_op(op_array);
opline->opcode = ZEND_FAST_CALL;
opline->result_type = IS_TMP_VAR;
opline->result.var = fast_call_var;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
+ zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2);
} else {
- zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
+ zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2);
}
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
@@ -576,7 +575,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
(dst_num < op_array->try_catch_array[i].try_op ||
dst_num > op_array->try_catch_array[i].finally_end)) {
- opline = get_next_op(op_array TSRMLS_CC);
+ opline = get_next_op(op_array);
opline->opcode = ZEND_FAST_CALL;
opline->result_type = IS_TMP_VAR;
opline->result.var = fast_call_var;
@@ -587,7 +586,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
}
/* Finish the sequence with original opcode */
- opline = get_next_op(op_array TSRMLS_CC);
+ opline = get_next_op(op_array);
*opline = op_array->opcodes[op_num];
/* Replace original opcode with jump to this sequence */
@@ -602,7 +601,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
}
}
-static void zend_resolve_finally_ret(zend_op_array *op_array, uint32_t op_num TSRMLS_DC)
+static void zend_resolve_finally_ret(zend_op_array *op_array, uint32_t op_num)
{
int i;
uint32_t catch_op_num = 0, finally_op_num = 0;
@@ -630,7 +629,7 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, uint32_t op_num TS
}
}
-static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
+static void zend_resolve_finally_calls(zend_op_array *op_array)
{
uint32_t i, j;
zend_op *opline;
@@ -641,7 +640,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
case ZEND_RETURN:
case ZEND_RETURN_BY_REF:
case ZEND_GENERATOR_RETURN:
- zend_resolve_finally_call(op_array, i, (uint32_t)-1 TSRMLS_CC);
+ zend_resolve_finally_call(op_array, i, (uint32_t)-1);
break;
case ZEND_BRK:
case ZEND_CONT:
@@ -657,7 +656,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
array_offset = jmp_to->parent;
}
} while (--nest_levels > 0);
- zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
+ zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont);
break;
}
}
@@ -666,18 +665,18 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
uint32_t num = opline->op2.constant;
ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
- zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
+ zend_resolve_goto_label(op_array, opline, 1);
opline->op2.constant = num;
}
/* break omitted intentionally */
case ZEND_JMP:
- zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
+ zend_resolve_finally_call(op_array, i, opline->op1.opline_num);
break;
case ZEND_FAST_CALL:
- zend_resolve_fast_call(op_array, i, i TSRMLS_CC);
+ zend_resolve_fast_call(op_array, i, i);
break;
case ZEND_FAST_RET:
- zend_resolve_finally_ret(op_array, i TSRMLS_CC);
+ zend_resolve_finally_ret(op_array, i);
break;
default:
break;
@@ -685,7 +684,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
}
}
-ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
+ZEND_API int pass_two(zend_op_array *op_array)
{
zend_op *opline, *end;
@@ -693,13 +692,13 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
return 0;
}
if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) {
- zend_resolve_finally_calls(op_array TSRMLS_CC);
+ zend_resolve_finally_calls(op_array);
}
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
- zend_update_extended_info(op_array TSRMLS_CC);
+ zend_update_extended_info(op_array);
}
if (CG(compiler_options) & ZEND_COMPILE_HANDLE_OP_ARRAY) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array);
}
if (CG(context).vars_size != op_array->last_var) {
@@ -737,7 +736,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
break;
case ZEND_GOTO:
if (Z_TYPE_P(RT_CONSTANT(op_array, opline->op2)) != IS_LONG) {
- zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);
+ zend_resolve_goto_label(op_array, opline, 1);
}
/* break omitted intentionally */
case ZEND_JMP:
@@ -779,15 +778,15 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
return 0;
}
-int pass_two_wrapper(zval *el TSRMLS_DC)
+int pass_two_wrapper(zval *el)
{
- return pass_two((zend_op_array *) Z_PTR_P(el) TSRMLS_CC);
+ return pass_two((zend_op_array *) Z_PTR_P(el));
}
-int print_class(zend_class_entry *class_entry TSRMLS_DC)
+int print_class(zend_class_entry *class_entry)
{
printf("Class %s:\n", class_entry->name->val);
- zend_hash_apply(&class_entry->function_table, pass_two_wrapper TSRMLS_CC);
+ zend_hash_apply(&class_entry->function_table, pass_two_wrapper);
printf("End of class %s.\n\n", class_entry->name->val);
return 0;
}
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index b43c672526..70de104975 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -135,7 +135,7 @@ ZEND_API zend_long zend_atol(const char *str, int str_len) /* {{{ */
}
/* }}} */
-ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API void convert_scalar_to_number(zval *op) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
@@ -183,7 +183,7 @@ try_again:
#define zendi_convert_scalar_to_number(op, holder, result) \
if (op==result) { \
if (Z_TYPE_P(op) != IS_LONG) { \
- convert_scalar_to_number(op TSRMLS_CC); \
+ convert_scalar_to_number(op); \
} \
} else { \
switch (Z_TYPE_P(op)) { \
@@ -224,13 +224,13 @@ try_again:
#define convert_object_to_type(op, dst, ctype, conv_func) \
ZVAL_UNDEF(dst); \
if (Z_OBJ_HT_P(op)->cast_object) { \
- if (Z_OBJ_HT_P(op)->cast_object(op, dst, ctype TSRMLS_CC) == FAILURE) { \
+ if (Z_OBJ_HT_P(op)->cast_object(op, dst, ctype) == FAILURE) { \
zend_error(E_RECOVERABLE_ERROR, \
"Object of class %s could not be converted to %s", Z_OBJCE_P(op)->name->val,\
zend_get_type_by_const(ctype)); \
} \
} else if (Z_OBJ_HT_P(op)->get) { \
- zval *newop = Z_OBJ_HT_P(op)->get(op, dst TSRMLS_CC); \
+ zval *newop = Z_OBJ_HT_P(op)->get(op, dst); \
if (Z_TYPE_P(newop) != IS_OBJECT) { \
/* for safety - avoid loop */ \
ZVAL_COPY_VALUE(dst, newop); \
@@ -289,8 +289,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */
case IS_OBJECT:
{
zval dst;
- TSRMLS_FETCH();
-
+
convert_object_to_type(op, &dst, IS_LONG, convert_to_long);
zval_dtor(op);
@@ -347,8 +346,7 @@ ZEND_API void convert_to_double(zval *op) /* {{{ */
case IS_OBJECT:
{
zval dst;
- TSRMLS_FETCH();
-
+
convert_object_to_type(op, &dst, IS_DOUBLE, convert_to_double);
zval_dtor(op);
@@ -371,10 +369,9 @@ ZEND_API void convert_to_null(zval *op) /* {{{ */
if (Z_TYPE_P(op) == IS_OBJECT) {
if (Z_OBJ_HT_P(op)->cast_object) {
zval org;
- TSRMLS_FETCH();
-
+
ZVAL_COPY_VALUE(&org, op);
- if (Z_OBJ_HT_P(op)->cast_object(&org, op, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(op)->cast_object(&org, op, IS_NULL) == SUCCESS) {
zval_dtor(&org);
return;
}
@@ -432,8 +429,7 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
case IS_OBJECT:
{
zval dst;
- TSRMLS_FETCH();
-
+
convert_object_to_type(op, &dst, _IS_BOOL, convert_to_boolean);
zval_dtor(op);
@@ -461,8 +457,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
case IS_UNDEF:
case IS_NULL:
case IS_FALSE: {
- TSRMLS_FETCH();
- ZVAL_EMPTY_STRING(op);
+ ZVAL_EMPTY_STRING(op);
break;
}
case IS_TRUE:
@@ -483,8 +478,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
case IS_DOUBLE: {
zend_string *str;
double dval = Z_DVAL_P(op);
- TSRMLS_FETCH();
-
+
str = zend_strpprintf(0, "%.*G", (int) EG(precision), dval);
/* %G already handles removing trailing zeros from the fractional part, yay */
ZVAL_NEW_STR(op, str);
@@ -497,8 +491,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
break;
case IS_OBJECT: {
zval dst;
- TSRMLS_FETCH();
-
+
convert_object_to_type(op, &dst, IS_STRING, convert_to_string);
if (Z_TYPE(dst) == IS_STRING) {
@@ -516,7 +509,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
}
/* }}} */
-static void convert_scalar_to_array(zval *op TSRMLS_DC) /* {{{ */
+static void convert_scalar_to_array(zval *op) /* {{{ */
{
zval entry;
@@ -530,7 +523,6 @@ static void convert_scalar_to_array(zval *op TSRMLS_DC) /* {{{ */
ZEND_API void convert_to_array(zval *op) /* {{{ */
{
- TSRMLS_FETCH();
switch (Z_TYPE_P(op)) {
case IS_ARRAY:
@@ -538,10 +530,10 @@ ZEND_API void convert_to_array(zval *op) /* {{{ */
/* OBJECTS_OPTIMIZE */
case IS_OBJECT:
if (Z_OBJCE_P(op) == zend_ce_closure) {
- convert_scalar_to_array(op TSRMLS_CC);
+ convert_scalar_to_array(op);
} else {
if (Z_OBJ_HT_P(op)->get_properties) {
- HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC);
+ HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op);
if (obj_ht) {
zval arr;
ZVAL_NEW_ARR(&arr);
@@ -570,7 +562,7 @@ ZEND_API void convert_to_array(zval *op) /* {{{ */
zend_hash_init(Z_ARRVAL_P(op), 8, NULL, ZVAL_PTR_DTOR, 0);
break;
default:
- convert_scalar_to_array(op TSRMLS_CC);
+ convert_scalar_to_array(op);
break;
}
}
@@ -578,7 +570,6 @@ ZEND_API void convert_to_array(zval *op) /* {{{ */
ZEND_API void convert_to_object(zval *op) /* {{{ */
{
- TSRMLS_FETCH();
switch (Z_TYPE_P(op)) {
case IS_ARRAY:
@@ -657,7 +648,7 @@ ZEND_API void multi_convert_to_string_ex(int argc, ...) /* {{{ */
}
/* }}} */
-ZEND_API zend_long _zval_get_long_func(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API zend_long _zval_get_long_func(zval *op) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
@@ -696,7 +687,7 @@ try_again:
}
/* }}} */
-ZEND_API double _zval_get_double_func(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API double _zval_get_double_func(zval *op) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
@@ -737,7 +728,7 @@ try_again:
}
/* }}} */
-ZEND_API zend_string *_zval_get_string_func(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API zend_string *_zval_get_string_func(zval *op) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op)) {
@@ -766,11 +757,11 @@ try_again:
case IS_OBJECT: {
zval tmp;
if (Z_OBJ_HT_P(op)->cast_object) {
- if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_STRING) == SUCCESS) {
return Z_STR(tmp);
}
} else if (Z_OBJ_HT_P(op)->get) {
- zval *z = Z_OBJ_HT_P(op)->get(op, &tmp TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(op)->get(op, &tmp);
if (Z_TYPE_P(z) != IS_OBJECT) {
zend_string *str = zval_get_string(z);
zval_ptr_dtor(z);
@@ -792,7 +783,7 @@ try_again:
}
/* }}} */
-ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int add_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int converted = 0;
@@ -856,7 +847,7 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int sub_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int converted = 0;
@@ -909,7 +900,7 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int mul_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int converted = 0;
@@ -956,7 +947,7 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int pow_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int converted = 0;
@@ -1044,7 +1035,7 @@ ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int div_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int converted = 0;
@@ -1115,7 +1106,7 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int mod_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1129,7 +1120,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
}
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_MOD, mod_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
@@ -1144,7 +1135,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
}
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_MOD);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1170,7 +1161,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
}
/* }}} */
-ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
int op1_val, op2_val;
@@ -1220,7 +1211,7 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
/* }}} */
-ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
+ZEND_API int boolean_not_function(zval *result, zval *op1) /* {{{ */
{
if (Z_TYPE_P(op1) < IS_TRUE) {
ZVAL_TRUE(result);
@@ -1245,7 +1236,7 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */
+ZEND_API int bitwise_not_function(zval *result, zval *op1) /* {{{ */
{
try_again:
switch (Z_TYPE_P(op1)) {
@@ -1277,7 +1268,7 @@ try_again:
}
/* }}} */
-ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1316,13 +1307,13 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_OR, bitwise_or_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_OR);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1335,7 +1326,7 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
/* }}} */
-ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1374,13 +1365,13 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_AND, bitwise_or_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_AND);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1393,7 +1384,7 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
/* }}} */
-ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1432,13 +1423,13 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) {
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_XOR, bitwise_or_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) {
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_XOR);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1451,7 +1442,7 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
/* }}} */
-ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1465,7 +1456,7 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
}
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_SL, mod_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
@@ -1480,7 +1471,7 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
}
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_SL);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1506,7 +1497,7 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
/* }}} */
-ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_long op1_lval, op2_lval;
@@ -1520,7 +1511,7 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
}
ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_SR, mod_function);
- op1_lval = _zval_get_long_func(op1 TSRMLS_CC);
+ op1_lval = _zval_get_long_func(op1);
} else {
op1_lval = Z_LVAL_P(op1);
}
@@ -1535,7 +1526,7 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
}
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_SR);
- op2_lval = _zval_get_long_func(op2 TSRMLS_CC);
+ op2_lval = _zval_get_long_func(op2);
} else {
op2_lval = Z_LVAL_P(op2);
}
@@ -1588,7 +1579,7 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2
}
/* }}} */
-ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int concat_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy, op2_copy;
int use_copy1 = 0, use_copy2 = 0;
@@ -1600,7 +1591,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
if (Z_TYPE_P(op1) == IS_STRING) break;
}
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT, concat_function);
- use_copy1 = zend_make_printable_zval(op1, &op1_copy TSRMLS_CC);
+ use_copy1 = zend_make_printable_zval(op1, &op1_copy);
if (use_copy1) {
/* We have created a converted copy of op1. Therefore, op1 won't become the result so
* we have to free it.
@@ -1622,7 +1613,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
if (Z_TYPE_P(op2) == IS_STRING) break;
}
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_CONCAT);
- use_copy2 = zend_make_printable_zval(op2, &op2_copy TSRMLS_CC);
+ use_copy2 = zend_make_printable_zval(op2, &op2_copy);
if (use_copy2) {
op2 = &op2_copy;
}
@@ -1666,7 +1657,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
}
/* }}} */
-ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */
+ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
{
zend_string *str1 = zval_get_string(op1);
zend_string *str2 = zval_get_string(op2);
@@ -1683,7 +1674,7 @@ ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend
}
/* }}} */
-ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) &&
EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
@@ -1705,7 +1696,7 @@ ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_D
}
/* }}} */
-ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) &&
EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
@@ -1728,7 +1719,7 @@ ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSR
/* }}} */
#if HAVE_STRCOLL
-ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
zend_string *str1 = zval_get_string(op1);
zend_string *str2 = zval_get_string(op2);
@@ -1742,7 +1733,7 @@ ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 T
/* }}} */
#endif
-ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
double d1, d2;
@@ -1755,7 +1746,7 @@ ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_
}
/* }}} */
-static inline void zend_free_obj_get_result(zval *op TSRMLS_DC) /* {{{ */
+static inline void zend_free_obj_get_result(zval *op) /* {{{ */
{
if (Z_REFCOUNTED_P(op)) {
if (Z_REFCOUNT_P(op) == 0) {
@@ -1767,7 +1758,7 @@ static inline void zend_free_obj_get_result(zval *op TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
int ret;
int converted = 0;
@@ -1800,7 +1791,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
return SUCCESS;
case TYPE_PAIR(IS_ARRAY, IS_ARRAY):
- zend_compare_arrays(result, op1, op2 TSRMLS_CC);
+ zend_compare_arrays(result, op1, op2);
return SUCCESS;
case TYPE_PAIR(IS_NULL, IS_NULL):
@@ -1853,9 +1844,9 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
}
if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, compare)) {
- return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC);
+ return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2);
} else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) {
- return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2 TSRMLS_CC);
+ return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2);
}
if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) {
@@ -1865,45 +1856,45 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
return SUCCESS;
}
if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) {
- ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2 TSRMLS_CC));
+ ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2));
return SUCCESS;
}
}
if (Z_TYPE_P(op1) == IS_OBJECT) {
if (Z_OBJ_HT_P(op1)->get) {
zval rv;
- op_free = Z_OBJ_HT_P(op1)->get(op1, &rv TSRMLS_CC);
- ret = compare_function(result, op_free, op2 TSRMLS_CC);
- zend_free_obj_get_result(op_free TSRMLS_CC);
+ op_free = Z_OBJ_HT_P(op1)->get(op1, &rv);
+ ret = compare_function(result, op_free, op2);
+ zend_free_obj_get_result(op_free);
return ret;
} else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) {
ZVAL_UNDEF(&tmp_free);
- if (Z_OBJ_HT_P(op1)->cast_object(op1, &tmp_free, ((Z_TYPE_P(op2) == IS_FALSE || Z_TYPE_P(op2) == IS_TRUE) ? _IS_BOOL : Z_TYPE_P(op2)) TSRMLS_CC) == FAILURE) {
+ if (Z_OBJ_HT_P(op1)->cast_object(op1, &tmp_free, ((Z_TYPE_P(op2) == IS_FALSE || Z_TYPE_P(op2) == IS_TRUE) ? _IS_BOOL : Z_TYPE_P(op2))) == FAILURE) {
ZVAL_LONG(result, 1);
- zend_free_obj_get_result(&tmp_free TSRMLS_CC);
+ zend_free_obj_get_result(&tmp_free);
return SUCCESS;
}
- ret = compare_function(result, &tmp_free, op2 TSRMLS_CC);
- zend_free_obj_get_result(&tmp_free TSRMLS_CC);
+ ret = compare_function(result, &tmp_free, op2);
+ zend_free_obj_get_result(&tmp_free);
return ret;
}
}
if (Z_TYPE_P(op2) == IS_OBJECT) {
if (Z_OBJ_HT_P(op2)->get) {
zval rv;
- op_free = Z_OBJ_HT_P(op2)->get(op2, &rv TSRMLS_CC);
- ret = compare_function(result, op1, op_free TSRMLS_CC);
- zend_free_obj_get_result(op_free TSRMLS_CC);
+ op_free = Z_OBJ_HT_P(op2)->get(op2, &rv);
+ ret = compare_function(result, op1, op_free);
+ zend_free_obj_get_result(op_free);
return ret;
} else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) {
ZVAL_UNDEF(&tmp_free);
- if (Z_OBJ_HT_P(op2)->cast_object(op2, &tmp_free, ((Z_TYPE_P(op1) == IS_FALSE || Z_TYPE_P(op1) == IS_TRUE) ? _IS_BOOL : Z_TYPE_P(op1)) TSRMLS_CC) == FAILURE) {
+ if (Z_OBJ_HT_P(op2)->cast_object(op2, &tmp_free, ((Z_TYPE_P(op1) == IS_FALSE || Z_TYPE_P(op1) == IS_TRUE) ? _IS_BOOL : Z_TYPE_P(op1))) == FAILURE) {
ZVAL_LONG(result, -1);
- zend_free_obj_get_result(&tmp_free TSRMLS_CC);
+ zend_free_obj_get_result(&tmp_free);
return SUCCESS;
}
- ret = compare_function(result, op1, &tmp_free TSRMLS_CC);
- zend_free_obj_get_result(&tmp_free TSRMLS_CC);
+ ret = compare_function(result, op1, &tmp_free);
+ zend_free_obj_get_result(&tmp_free);
return ret;
} else if (Z_TYPE_P(op1) == IS_OBJECT) {
ZVAL_LONG(result, 1);
@@ -1949,7 +1940,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
}
/* }}} */
-static int hash_zval_identical_function(zval *z1, zval *z2 TSRMLS_DC) /* {{{ */
+static int hash_zval_identical_function(zval *z1, zval *z2) /* {{{ */
{
zval result;
@@ -1960,14 +1951,14 @@ static int hash_zval_identical_function(zval *z1, zval *z2 TSRMLS_DC) /* {{{ */
*/
ZVAL_DEREF(z1);
ZVAL_DEREF(z2);
- if (is_identical_function(&result, z1, z2 TSRMLS_CC)==FAILURE) {
+ if (is_identical_function(&result, z1, z2)==FAILURE) {
return 1;
}
return Z_TYPE(result) != IS_TRUE;
}
/* }}} */
-ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
ZVAL_BOOL(result, 0);
@@ -1998,7 +1989,7 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
break;
case IS_ARRAY:
ZVAL_BOOL(result, Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
- zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
+ zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1)==0);
break;
case IS_OBJECT:
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
@@ -2015,9 +2006,9 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
/* }}} */
-ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
+ if (is_identical_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
ZVAL_BOOL(result, Z_TYPE_P(result) != IS_TRUE);
@@ -2025,9 +2016,9 @@ ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS
}
/* }}} */
-ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
+ if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
@@ -2035,9 +2026,9 @@ ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /*
}
/* }}} */
-ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
+ if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
@@ -2045,9 +2036,9 @@ ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
/* }}} */
-ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
+ if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
@@ -2055,9 +2046,9 @@ ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
/* }}} */
-ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
+ if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
@@ -2065,12 +2056,12 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR
}
/* }}} */
-ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only) /* {{{ */
{
uint32_t i;
for (i=0; i<instance_ce->num_interfaces; i++) {
- if (instanceof_function(instance_ce->interfaces[i], ce TSRMLS_CC)) {
+ if (instanceof_function(instance_ce->interfaces[i], ce)) {
return 1;
}
}
@@ -2087,9 +2078,9 @@ ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, c
}
/* }}} */
-ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC) /* {{{ */
+ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce) /* {{{ */
{
- return instanceof_function_ex(instance_ce, ce, 0 TSRMLS_CC);
+ return instanceof_function_ex(instance_ce, ce, 0);
}
/* }}} */
@@ -2234,20 +2225,18 @@ try_again:
/* proxy object */
zval rv;
zval *val;
- TSRMLS_FETCH();
-
- val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC);
+
+ val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
fast_increment_function(val);
- Z_OBJ_HANDLER_P(op1, set)(op1, val TSRMLS_CC);
+ Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
} else if (Z_OBJ_HANDLER_P(op1, do_operation)) {
zval op2;
int res;
- TSRMLS_FETCH();
-
+
ZVAL_LONG(&op2, 1);
- res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2 TSRMLS_CC);
+ res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2);
zval_ptr_dtor(&op2);
return res;
@@ -2309,20 +2298,18 @@ try_again:
/* proxy object */
zval rv;
zval *val;
- TSRMLS_FETCH();
-
- val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC);
+
+ val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
fast_decrement_function(val);
- Z_OBJ_HANDLER_P(op1, set)(op1, val TSRMLS_CC);
+ Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
} else if (Z_OBJ_HANDLER_P(op1, do_operation)) {
zval op2;
int res;
- TSRMLS_FETCH();
-
+
ZVAL_LONG(&op2, 1);
- res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2 TSRMLS_CC);
+ res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2);
zval_ptr_dtor(&op2);
return res;
@@ -2339,28 +2326,28 @@ try_again:
}
/* }}} */
-ZEND_API int zend_is_true(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API int zend_is_true(zval *op) /* {{{ */
{
- return i_zend_is_true(op TSRMLS_CC);
+ return i_zend_is_true(op);
}
/* }}} */
-ZEND_API int zend_object_is_true(zval *op TSRMLS_DC) /* {{{ */
+ZEND_API int zend_object_is_true(zval *op) /* {{{ */
{
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
- if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, _IS_BOOL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, _IS_BOOL) == SUCCESS) {
return Z_TYPE(tmp) == IS_TRUE;
}
zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
} else if (Z_OBJ_HT_P(op)->get) {
int result;
zval rv;
- zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv TSRMLS_CC);
+ zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv);
if (Z_TYPE_P(tmp) != IS_OBJECT) {
/* for safety - avoid loop */
- result = i_zend_is_true(tmp TSRMLS_CC);
+ result = i_zend_is_true(tmp);
zval_ptr_dtor(tmp);
return result;
}
@@ -2604,36 +2591,36 @@ string_cmp:
}
/* }}} */
-static int hash_zval_compare_function(zval *z1, zval *z2 TSRMLS_DC) /* {{{ */
+static int hash_zval_compare_function(zval *z1, zval *z2) /* {{{ */
{
zval result;
- if (compare_function(&result, z1, z2 TSRMLS_CC)==FAILURE) {
+ if (compare_function(&result, z1, z2)==FAILURE) {
return 1;
}
return Z_LVAL(result);
}
/* }}} */
-ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
+ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2) /* {{{ */
{
- return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
+ return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0);
}
/* }}} */
-ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
+ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2) /* {{{ */
{
- ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
+ ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0));
}
/* }}} */
-ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) /* {{{ */
+ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2) /* {{{ */
{
- zend_compare_symbol_tables(result, Z_ARRVAL_P(a1), Z_ARRVAL_P(a2) TSRMLS_CC);
+ zend_compare_symbol_tables(result, Z_ARRVAL_P(a1), Z_ARRVAL_P(a2));
}
/* }}} */
-ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2) /* {{{ */
{
if (Z_OBJ_P(o1) == Z_OBJ_P(o2)) {
ZVAL_LONG(result, 0);
@@ -2643,7 +2630,7 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) /
if (Z_OBJ_HT_P(o1)->compare_objects == NULL) {
ZVAL_LONG(result, 1);
} else {
- ZVAL_LONG(result, Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC));
+ ZVAL_LONG(result, Z_OBJ_HT_P(o1)->compare_objects(o1, o2));
}
}
/* }}} */
@@ -2651,7 +2638,6 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) /
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
zend_string *str;
- TSRMLS_FETCH();
str = zend_strpprintf(0, "%.*G", (int) EG(precision), (double)Z_DVAL_P(op));
ZVAL_NEW_STR(op, str);
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index d27f5bf6f6..b9baa5bd9a 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -44,31 +44,31 @@
#define LONG_SIGN_MASK (((zend_long)1) << (8*sizeof(zend_long)-1))
BEGIN_EXTERN_C()
-ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC);
-ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC);
-ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-
-ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-
-ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC);
-ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC);
+ZEND_API int add_function(zval *result, zval *op1, zval *op2);
+ZEND_API int sub_function(zval *result, zval *op1, zval *op2);
+ZEND_API int mul_function(zval *result, zval *op1, zval *op2);
+ZEND_API int pow_function(zval *result, zval *op1, zval *op2);
+ZEND_API int div_function(zval *result, zval *op1, zval *op2);
+ZEND_API int mod_function(zval *result, zval *op1, zval *op2);
+ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2);
+ZEND_API int boolean_not_function(zval *result, zval *op1);
+ZEND_API int bitwise_not_function(zval *result, zval *op1);
+ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2);
+ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2);
+ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2);
+ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2);
+ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2);
+ZEND_API int concat_function(zval *result, zval *op1, zval *op2);
+
+ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2);
+ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2);
+ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2);
+ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2);
+ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2);
+ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
+
+ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only);
+ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce);
/**
* Checks whether the string "str" with length "length" is numeric. The value
@@ -221,7 +221,7 @@ BEGIN_EXTERN_C()
ZEND_API int increment_function(zval *op1);
ZEND_API int decrement_function(zval *op2);
-ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
+ZEND_API void convert_scalar_to_number(zval *op);
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
@@ -235,23 +235,23 @@ ZEND_API void multi_convert_to_long_ex(int argc, ...);
ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
-ZEND_API zend_long _zval_get_long_func(zval *op TSRMLS_DC);
-ZEND_API double _zval_get_double_func(zval *op TSRMLS_DC);
-ZEND_API zend_string *_zval_get_string_func(zval *op TSRMLS_DC);
+ZEND_API zend_long _zval_get_long_func(zval *op);
+ZEND_API double _zval_get_double_func(zval *op);
+ZEND_API zend_string *_zval_get_string_func(zval *op);
-static zend_always_inline zend_long _zval_get_long(zval *op TSRMLS_DC) {
- return Z_TYPE_P(op) == IS_LONG ? Z_LVAL_P(op) : _zval_get_long_func(op TSRMLS_CC);
+static zend_always_inline zend_long _zval_get_long(zval *op) {
+ return Z_TYPE_P(op) == IS_LONG ? Z_LVAL_P(op) : _zval_get_long_func(op);
}
-static zend_always_inline double _zval_get_double(zval *op TSRMLS_DC) {
- return Z_TYPE_P(op) == IS_DOUBLE ? Z_DVAL_P(op) : _zval_get_double_func(op TSRMLS_CC);
+static zend_always_inline double _zval_get_double(zval *op) {
+ return Z_TYPE_P(op) == IS_DOUBLE ? Z_DVAL_P(op) : _zval_get_double_func(op);
}
-static zend_always_inline zend_string *_zval_get_string(zval *op TSRMLS_DC) {
- return Z_TYPE_P(op) == IS_STRING ? zend_string_copy(Z_STR_P(op)) : _zval_get_string_func(op TSRMLS_CC);
+static zend_always_inline zend_string *_zval_get_string(zval *op) {
+ return Z_TYPE_P(op) == IS_STRING ? zend_string_copy(Z_STR_P(op)) : _zval_get_string_func(op);
}
-#define zval_get_long(op) _zval_get_long((op) TSRMLS_CC)
-#define zval_get_double(op) _zval_get_double((op) TSRMLS_CC)
-#define zval_get_string(op) _zval_get_string((op) TSRMLS_CC)
+#define zval_get_long(op) _zval_get_long((op))
+#define zval_get_double(op) _zval_get_double((op))
+#define zval_get_string(op) _zval_get_string((op))
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2);
@@ -259,13 +259,13 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2
#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
-ZEND_API int zend_is_true(zval *op TSRMLS_DC);
-ZEND_API int zend_object_is_true(zval *op TSRMLS_DC);
+ZEND_API int zend_is_true(zval *op);
+ZEND_API int zend_object_is_true(zval *op);
#define zval_is_true(op) \
- zend_is_true(op TSRMLS_CC)
+ zend_is_true(op)
-static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
+static zend_always_inline int i_zend_is_true(zval *op)
{
int result;
@@ -300,7 +300,7 @@ again:
result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
break;
case IS_OBJECT:
- result = zend_object_is_true(op TSRMLS_CC);
+ result = zend_object_is_true(op);
break;
case IS_REFERENCE:
op = Z_REFVAL_P(op);
@@ -313,13 +313,13 @@ again:
return result;
}
-ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC);
-ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int compare_function(zval *result, zval *op1, zval *op2);
+ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2);
+ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive);
+ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2);
+ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2);
#if HAVE_STRCOLL
-ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2);
#endif
ZEND_API void zend_str_tolower(char *str, size_t length);
@@ -338,9 +338,9 @@ ZEND_API int zend_binary_strcasecmp_l(const char *s1, size_t len1, const char *s
ZEND_API int zend_binary_strncasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2, size_t length);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
-ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC);
-ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
-ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
+ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2);
+ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
+ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
ZEND_API int zend_atoi(const char *str, int str_len);
ZEND_API zend_long zend_atol(const char *str, int str_len);
@@ -400,7 +400,7 @@ ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
#define convert_scalar_to_number_ex(pzv) \
if (Z_TYPE_P(pzv)!=IS_LONG && Z_TYPE_P(pzv)!=IS_DOUBLE) { \
SEPARATE_ZVAL_IF_NOT_REF(pzv); \
- convert_scalar_to_number(pzv TSRMLS_CC); \
+ convert_scalar_to_number(pzv); \
}
#if HAVE_SETLOCALE && defined(ZEND_WIN32) && !defined(ZTS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
@@ -558,7 +558,7 @@ static zend_always_inline int fast_decrement_function(zval *op1)
return decrement_function(op1);
}
-static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -666,10 +666,10 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
return SUCCESS;
}
}
- return add_function(result, op1, op2 TSRMLS_CC);
+ return add_function(result, op1, op2);
}
-static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -779,10 +779,10 @@ static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *o
return SUCCESS;
}
}
- return sub_function(result, op1, op2 TSRMLS_CC);
+ return sub_function(result, op1, op2);
}
-static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -804,10 +804,10 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o
return SUCCESS;
}
}
- return mul_function(result, op1, op2 TSRMLS_CC);
+ return mul_function(result, op1, op2);
}
-static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2)
{
#if 0
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
@@ -855,10 +855,10 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o
}
}
#endif
- return div_function(result, op1, op2 TSRMLS_CC);
+ return div_function(result, op1, op2);
}
-static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -875,10 +875,10 @@ static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *o
return SUCCESS;
}
}
- return mod_function(result, op1, op2 TSRMLS_CC);
+ return mod_function(result, op1, op2);
}
-static zend_always_inline int fast_equal_check_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline int fast_equal_check_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -908,11 +908,11 @@ static zend_always_inline int fast_equal_check_function(zval *result, zval *op1,
}
}
}
- compare_function(result, op1, op2 TSRMLS_CC);
+ compare_function(result, op1, op2);
return Z_LVAL_P(result) == 0;
}
-static zend_always_inline void fast_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_equal_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -950,11 +950,11 @@ static zend_always_inline void fast_equal_function(zval *result, zval *op1, zval
}
}
}
- compare_function(result, op1, op2 TSRMLS_CC);
+ compare_function(result, op1, op2);
ZVAL_BOOL(result, Z_LVAL_P(result) == 0);
}
-static zend_always_inline void fast_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_not_equal_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -992,11 +992,11 @@ static zend_always_inline void fast_not_equal_function(zval *result, zval *op1,
}
}
}
- compare_function(result, op1, op2 TSRMLS_CC);
+ compare_function(result, op1, op2);
ZVAL_BOOL(result, Z_LVAL_P(result) != 0);
}
-static zend_always_inline void fast_is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_is_smaller_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -1015,11 +1015,11 @@ static zend_always_inline void fast_is_smaller_function(zval *result, zval *op1,
return;
}
}
- compare_function(result, op1, op2 TSRMLS_CC);
+ compare_function(result, op1, op2);
ZVAL_BOOL(result, Z_LVAL_P(result) < 0);
}
-static zend_always_inline void fast_is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
@@ -1038,26 +1038,26 @@ static zend_always_inline void fast_is_smaller_or_equal_function(zval *result, z
return;
}
}
- compare_function(result, op1, op2 TSRMLS_CC);
+ compare_function(result, op1, op2);
ZVAL_BOOL(result, Z_LVAL_P(result) <= 0);
}
-static zend_always_inline void fast_is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_is_identical_function(zval *result, zval *op1, zval *op2)
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
ZVAL_BOOL(result, 0);
return;
}
- is_identical_function(result, op1, op2 TSRMLS_CC);
+ is_identical_function(result, op1, op2);
}
-static zend_always_inline void fast_is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static zend_always_inline void fast_is_not_identical_function(zval *result, zval *op1, zval *op2)
{
if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
ZVAL_BOOL(result, 1);
return;
}
- is_identical_function(result, op1, op2 TSRMLS_CC);
+ is_identical_function(result, op1, op2);
ZVAL_BOOL(result, Z_TYPE_P(result) != IS_TRUE);
}
@@ -1068,15 +1068,15 @@ static zend_always_inline void fast_is_not_identical_function(zval *result, zval
&& EXPECTED(Z_OBJ_HANDLER_P(op1, set))) { \
int ret; \
zval rv; \
- zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC); \
+ zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv); \
Z_ADDREF_P(objval); \
- ret = binary_op(objval, objval, op2 TSRMLS_CC); \
- Z_OBJ_HANDLER_P(op1, set)(op1, objval TSRMLS_CC); \
+ ret = binary_op(objval, objval, op2); \
+ Z_OBJ_HANDLER_P(op1, set)(op1, objval); \
zval_ptr_dtor(objval); \
return ret; \
} else if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
&& UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation))) { \
- if (EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2 TSRMLS_CC))) { \
+ if (EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2))) { \
return SUCCESS; \
} \
}
@@ -1084,7 +1084,7 @@ static zend_always_inline void fast_is_not_identical_function(zval *result, zval
#define ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(opcode) \
if (UNEXPECTED(Z_TYPE_P(op2) == IS_OBJECT) \
&& UNEXPECTED(Z_OBJ_HANDLER_P(op2, do_operation)) \
- && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2 TSRMLS_CC))) { \
+ && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2))) { \
return SUCCESS; \
}
@@ -1096,7 +1096,7 @@ static zend_always_inline void fast_is_not_identical_function(zval *result, zval
#define ZEND_TRY_UNARY_OBJECT_OPERATION(opcode) \
if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
&& UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation)) \
- && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL TSRMLS_CC))) { \
+ && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL))) { \
return SUCCESS; \
}
diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c
index a27a3c281f..fe6da4b309 100644
--- a/Zend/zend_qsort.c
+++ b/Zend/zend_qsort.c
@@ -54,7 +54,7 @@ static void _zend_qsort_swap(void *a, void *b, size_t siz)
}
}
-ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC)
+ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg)
{
void *begin_stack[QSORT_STACK_SIZE];
void *end_stack[QSORT_STACK_SIZE];
@@ -81,10 +81,10 @@ ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_
seg2 = end;
while (1) {
- for (; seg1 < seg2 && compare(begin, seg1 TSRMLS_CC, arg) > 0;
+ for (; seg1 < seg2 && compare(begin, seg1, arg) > 0;
seg1 += siz);
- for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC, arg) > 0;
+ for (; seg2 >= seg1 && compare(seg2, begin, arg) > 0;
seg2 -= siz);
if (seg1 >= seg2)
@@ -118,9 +118,9 @@ ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_
}
}
-ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC)
+ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare)
{
- zend_qsort_r(base, nmemb, siz, (compare_r_func_t)compare, NULL TSRMLS_CC);
+ zend_qsort_r(base, nmemb, siz, (compare_r_func_t)compare, NULL);
}
/*
diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h
index c61a85d18e..a822930d8a 100644
--- a/Zend/zend_qsort.h
+++ b/Zend/zend_qsort.h
@@ -22,9 +22,9 @@
#define ZEND_QSORT_H
BEGIN_EXTERN_C()
-typedef int (*compare_r_func_t)(const void *, const void * TSRMLS_DC, void *);
-ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC);
-ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC);
+typedef int (*compare_r_func_t)(const void *, const void *, void *);
+ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare);
+ZEND_API void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg);
END_EXTERN_C()
#endif /* ZEND_QSORT_H */
diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c
index 6105fb1119..bf061b36ca 100644
--- a/Zend/zend_signal.c
+++ b/Zend/zend_signal.c
@@ -51,8 +51,8 @@ ZEND_API int zend_signal_globals_id;
zend_signal_globals_t zend_signal_globals;
#endif
-static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context TSRMLS_DC);
-static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*) TSRMLS_DC);
+static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
+static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
#ifdef __CYGWIN__
#define TIMEOUT_SIG SIGALRM
@@ -74,7 +74,6 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
{
int errno_save = errno;
zend_signal_queue_t *queue, *qtmp;
- TSRMLS_FETCH();
if (SIGG(active)) {
if (SIGG(depth) == 0) { /* try to handle signal */
@@ -83,13 +82,13 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
}
if (SIGG(running) == 0) {
SIGG(running) = 1;
- zend_signal_handler(signo, siginfo, context TSRMLS_CC);
+ zend_signal_handler(signo, siginfo, context);
queue = SIGG(phead);
SIGG(phead) = NULL;
while (queue) {
- zend_signal_handler(queue->zend_signal.signo, queue->zend_signal.siginfo, queue->zend_signal.context TSRMLS_CC);
+ zend_signal_handler(queue->zend_signal.signo, queue->zend_signal.siginfo, queue->zend_signal.context);
qtmp = queue->next;
queue->next = SIGG(pavail);
queue->zend_signal.signo = 0;
@@ -123,7 +122,7 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
}
} else {
/* need to just run handler if we're inactive and getting a signal */
- zend_signal_handler(signo, siginfo, context TSRMLS_CC);
+ zend_signal_handler(signo, siginfo, context);
}
errno = errno_save;
@@ -131,7 +130,7 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
/* {{{ zend_signal_handler_unblock
* Handle deferred signal from HANDLE_UNBLOCK_ALARMS */
-ZEND_API void zend_signal_handler_unblock(TSRMLS_D)
+ZEND_API void zend_signal_handler_unblock(void)
{
zend_signal_queue_t *queue;
zend_signal_t zend_signal;
@@ -154,7 +153,7 @@ ZEND_API void zend_signal_handler_unblock(TSRMLS_D)
/* {{{ zend_signal_handler
* Call the previously registered handler for a signal
*/
-static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context TSRMLS_DC)
+static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
{
int errno_save = errno;
struct sigaction sa = {{0}};
@@ -192,7 +191,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context TSR
/* {{{ zend_sigaction
* Register a signal handler that will be deferred in critical sections */
-ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact TSRMLS_DC)
+ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact)
{
struct sigaction sa = {{0}};
sigset_t sigset;
@@ -230,7 +229,7 @@ ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigac
/* {{{ zend_signal
* Register a signal handler that will be deferred in critical sections */
-ZEND_API int zend_signal(int signo, void (*handler)(int) TSRMLS_DC)
+ZEND_API int zend_signal(int signo, void (*handler)(int))
{
struct sigaction sa = {{0}};
@@ -238,7 +237,7 @@ ZEND_API int zend_signal(int signo, void (*handler)(int) TSRMLS_DC)
sa.sa_handler = handler;
sa.sa_mask = global_sigmask;
- return zend_sigaction(signo, &sa, NULL TSRMLS_CC);
+ return zend_sigaction(signo, &sa, NULL);
}
/* }}} */
@@ -246,7 +245,7 @@ ZEND_API int zend_signal(int signo, void (*handler)(int) TSRMLS_DC)
* Set a handler for a signal we want to defer.
* Previously set handler must have been saved before.
*/
-static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*) TSRMLS_DC)
+static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*))
{
struct sigaction sa = {{0}};
@@ -277,14 +276,14 @@ static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void
/* {{{ zend_signal_activate
* Install our signal handlers, per request */
-void zend_signal_activate(TSRMLS_D)
+void zend_signal_activate(void)
{
int x;
memcpy(&SIGG(handlers), &global_orig_handlers, sizeof(global_orig_handlers));
for (x=0; x < sizeof(zend_sigs) / sizeof(*zend_sigs); x++) {
- zend_signal_register(zend_sigs[x], zend_signal_handler_defer TSRMLS_CC);
+ zend_signal_register(zend_sigs[x], zend_signal_handler_defer);
}
SIGG(active) = 1;
@@ -293,7 +292,7 @@ void zend_signal_activate(TSRMLS_D)
/* {{{ zend_signal_deactivate
* */
-void zend_signal_deactivate(TSRMLS_D)
+void zend_signal_deactivate(void)
{
int x;
struct sigaction sa = {{0}};
@@ -320,7 +319,7 @@ void zend_signal_deactivate(TSRMLS_D)
}
/* }}} */
-static void zend_signal_globals_ctor(zend_signal_globals_t *zend_signal_globals TSRMLS_DC)
+static void zend_signal_globals_ctor(zend_signal_globals_t *zend_signal_globals)
{
size_t x;
@@ -335,7 +334,7 @@ static void zend_signal_globals_ctor(zend_signal_globals_t *zend_signal_globals
}
}
-static void zend_signal_globals_dtor(zend_signal_globals_t *zend_signal_globals TSRMLS_DC)
+static void zend_signal_globals_dtor(zend_signal_globals_t *zend_signal_globals)
{
zend_signal_globals->blocked = -1;
}
@@ -392,7 +391,7 @@ void zend_signal_startup()
/* {{{ zend_signal_shutdown
* called by zend_shutdown */
-void zend_signal_shutdown(TSRMLS_D)
+void zend_signal_shutdown(void)
{
#ifndef ZTS
zend_signal_globals_dtor(&zend_signal_globals);
diff --git a/Zend/zend_signal.h b/Zend/zend_signal.h
index 02d6495437..2f33ccb5b7 100644
--- a/Zend/zend_signal.h
+++ b/Zend/zend_signal.h
@@ -65,17 +65,17 @@ typedef struct _zend_signal_globals_t {
} zend_signal_globals_t;
#ifdef ZTS
-# define SIGG(v) TSRMG(zend_signal_globals_id, zend_signal_globals_t *, v)
+# define SIGG(v) ZEND_TSRMG(zend_signal_globals_id, zend_signal_globals_t *, v)
BEGIN_EXTERN_C()
ZEND_API extern int zend_signal_globals_id;
END_EXTERN_C()
# define ZEND_SIGNAL_BLOCK_INTERRUPUTIONS() if (EXPECTED(zend_signal_globals_id)) { SIGG(depth)++; }
-# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (EXPECTED(zend_signal_globals_id) && UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(TSRMLS_C); }
+# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (EXPECTED(zend_signal_globals_id) && UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(); }
#else /* ZTS */
# define SIGG(v) (zend_signal_globals.v)
extern ZEND_API zend_signal_globals_t zend_signal_globals;
# define ZEND_SIGNAL_BLOCK_INTERRUPUTIONS() SIGG(depth)++;
-# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(TSRMLS_C); }
+# define ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS() if (UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(); }
#endif /* not ZTS */
# define SIGNAL_BEGIN_CRITICAL() sigset_t oldmask; \
@@ -84,12 +84,12 @@ extern ZEND_API zend_signal_globals_t zend_signal_globals;
void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context);
ZEND_API void zend_signal_handler_unblock();
-void zend_signal_activate(TSRMLS_D);
-void zend_signal_deactivate(TSRMLS_D);
+void zend_signal_activate(void);
+void zend_signal_deactivate(void);
void zend_signal_startup();
-void zend_signal_shutdown(TSRMLS_D);
-ZEND_API int zend_signal(int signo, void (*handler)(int) TSRMLS_DC);
-ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact TSRMLS_DC);
+void zend_signal_shutdown(void);
+ZEND_API int zend_signal(int signo, void (*handler)(int));
+ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact);
#ifdef ZTS
#define zend_sigprocmask(signo, set, oldset) tsrm_sigmask((signo), (set), (oldset))
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index f67f59af4a..63d9879412 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -49,19 +49,19 @@
ZEND_DLIMPORT int isatty(int fd);
-static size_t zend_stream_stdio_reader(void *handle, char *buf, size_t len TSRMLS_DC) /* {{{ */
+static size_t zend_stream_stdio_reader(void *handle, char *buf, size_t len) /* {{{ */
{
return fread(buf, 1, len, (FILE*)handle);
} /* }}} */
-static void zend_stream_stdio_closer(void *handle TSRMLS_DC) /* {{{ */
+static void zend_stream_stdio_closer(void *handle) /* {{{ */
{
if (handle && (FILE*)handle != stdin) {
fclose((FILE*)handle);
}
} /* }}} */
-static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */
+static size_t zend_stream_stdio_fsizer(void *handle) /* {{{ */
{
zend_stat_t buf;
if (handle && zend_fstat(fileno((FILE*)handle), &buf) == 0) {
@@ -75,7 +75,7 @@ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */
return 0;
} /* }}} */
-static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */
+static void zend_stream_unmap(zend_stream *stream) { /* {{{ */
#if HAVE_MMAP
if (stream->mmap.map) {
munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD);
@@ -91,11 +91,11 @@ static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */
stream->handle = stream->mmap.old_handle;
} /* }}} */
-static void zend_stream_mmap_closer(zend_stream *stream TSRMLS_DC) /* {{{ */
+static void zend_stream_mmap_closer(zend_stream *stream) /* {{{ */
{
- zend_stream_unmap(stream TSRMLS_CC);
+ zend_stream_unmap(stream);
if (stream->mmap.old_closer && stream->handle) {
- stream->mmap.old_closer(stream->handle TSRMLS_CC);
+ stream->mmap.old_closer(stream->handle);
}
} /* }}} */
@@ -103,7 +103,7 @@ static inline int zend_stream_is_mmap(zend_file_handle *file_handle) { /* {{{ */
return file_handle->type == ZEND_HANDLE_MAPPED;
} /* }}} */
-static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{ */
+static size_t zend_stream_fsize(zend_file_handle *file_handle) /* {{{ */
{
zend_stat_t buf;
@@ -111,7 +111,7 @@ static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{
return file_handle->handle.stream.mmap.len;
}
if (file_handle->type == ZEND_HANDLE_STREAM || file_handle->type == ZEND_HANDLE_MAPPED) {
- return file_handle->handle.stream.fsizer(file_handle->handle.stream.handle TSRMLS_CC);
+ return file_handle->handle.stream.fsizer(file_handle->handle.stream.handle);
}
if (file_handle->handle.fp && zend_fstat(fileno(file_handle->handle.fp), &buf) == 0) {
#ifdef S_ISREG
@@ -125,14 +125,14 @@ static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{
return -1;
} /* }}} */
-ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC) /* {{{ */
+ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /* {{{ */
{
if (zend_stream_open_function) {
- return zend_stream_open_function(filename, handle TSRMLS_CC);
+ return zend_stream_open_function(filename, handle);
}
handle->type = ZEND_HANDLE_FP;
handle->opened_path = NULL;
- handle->handle.fp = zend_fopen(filename, &handle->opened_path TSRMLS_CC);
+ handle->handle.fp = zend_fopen(filename, &handle->opened_path);
handle->filename = filename;
handle->free_filename = 0;
memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap));
@@ -140,17 +140,17 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSR
return (handle->handle.fp) ? SUCCESS : FAILURE;
} /* }}} */
-static int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC) /* {{{ */
+static int zend_stream_getc(zend_file_handle *file_handle) /* {{{ */
{
char buf;
- if (file_handle->handle.stream.reader(file_handle->handle.stream.handle, &buf, sizeof(buf) TSRMLS_CC)) {
+ if (file_handle->handle.stream.reader(file_handle->handle.stream.handle, &buf, sizeof(buf))) {
return (int)buf;
}
return EOF;
} /* }}} */
-static size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) /* {{{ */
+static size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len) /* {{{ */
{
if (!zend_stream_is_mmap(file_handle) && file_handle->handle.stream.isatty) {
int c = '*';
@@ -162,9 +162,9 @@ static size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t
Ascii value 4 is actually EOT character which is not defined anywhere in the LibC
or else we can use instead of hardcoded 4.
*/
- for (n = 0; n < len && (c = zend_stream_getc(file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n) {
+ for (n = 0; n < len && (c = zend_stream_getc(file_handle)) != EOF && c != 4 && c != '\n'; ++n) {
#else
- for (n = 0; n < len && (c = zend_stream_getc(file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n) {
+ for (n = 0; n < len && (c = zend_stream_getc(file_handle)) != EOF && c != '\n'; ++n) {
#endif
buf[n] = (char)c;
}
@@ -174,16 +174,16 @@ static size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t
return n;
}
- return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC);
+ return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len);
} /* }}} */
-ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len TSRMLS_DC) /* {{{ */
+ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len) /* {{{ */
{
size_t size;
zend_stream_type old_type;
if (file_handle->type == ZEND_HANDLE_FILENAME) {
- if (zend_stream_open(file_handle->filename, file_handle TSRMLS_CC) == FAILURE) {
+ if (zend_stream_open(file_handle->filename, file_handle) == FAILURE) {
return FAILURE;
}
}
@@ -218,7 +218,7 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
return FAILURE;
}
- size = zend_stream_fsize(file_handle TSRMLS_CC);
+ size = zend_stream_fsize(file_handle);
if (size == (size_t)-1) {
return FAILURE;
}
@@ -252,13 +252,13 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
#endif
file_handle->handle.stream.mmap.map = 0;
file_handle->handle.stream.mmap.buf = *buf = safe_emalloc(1, size, ZEND_MMAP_AHEAD);
- file_handle->handle.stream.mmap.len = zend_stream_read(file_handle, *buf, size TSRMLS_CC);
+ file_handle->handle.stream.mmap.len = zend_stream_read(file_handle, *buf, size);
} else {
size_t read, remain = 4*1024;
*buf = emalloc(remain);
size = 0;
- while ((read = zend_stream_read(file_handle, *buf + size, remain TSRMLS_CC)) > 0) {
+ while ((read = zend_stream_read(file_handle, *buf + size, remain)) > 0) {
size += read;
remain -= read;
@@ -299,7 +299,7 @@ return_mapped:
return SUCCESS;
} /* }}} */
-ZEND_API void zend_file_handle_dtor(zend_file_handle *fh TSRMLS_DC) /* {{{ */
+ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
{
switch (fh->type) {
case ZEND_HANDLE_FD:
@@ -311,7 +311,7 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh TSRMLS_DC) /* {{{ */
case ZEND_HANDLE_STREAM:
case ZEND_HANDLE_MAPPED:
if (fh->handle.stream.closer && fh->handle.stream.handle) {
- fh->handle.stream.closer(fh->handle.stream.handle TSRMLS_CC);
+ fh->handle.stream.closer(fh->handle.stream.handle);
}
fh->handle.stream.handle = NULL;
break;
diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h
index 84dc2e00b8..7009e9cf01 100644
--- a/Zend/zend_stream.h
+++ b/Zend/zend_stream.h
@@ -30,9 +30,9 @@
/* Lightweight stream implementation for the ZE scanners.
* These functions are private to the engine.
* */
-typedef size_t (*zend_stream_fsizer_t)(void* handle TSRMLS_DC);
-typedef size_t (*zend_stream_reader_t)(void* handle, char *buf, size_t len TSRMLS_DC);
-typedef void (*zend_stream_closer_t)(void* handle TSRMLS_DC);
+typedef size_t (*zend_stream_fsizer_t)(void* handle);
+typedef size_t (*zend_stream_reader_t)(void* handle, char *buf, size_t len);
+typedef void (*zend_stream_closer_t)(void* handle);
#define ZEND_MMAP_AHEAD 32
@@ -75,9 +75,9 @@ typedef struct _zend_file_handle {
} zend_file_handle;
BEGIN_EXTERN_C()
-ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC);
-ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len TSRMLS_DC);
-ZEND_API void zend_file_handle_dtor(zend_file_handle *fh TSRMLS_DC);
+ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle);
+ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len);
+ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
ZEND_API int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
END_EXTERN_C()
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index 1833bbd241..4e1745e25d 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -21,13 +21,13 @@
#include "zend.h"
#include "zend_globals.h"
-ZEND_API zend_string *(*zend_new_interned_string)(zend_string *str TSRMLS_DC);
-ZEND_API void (*zend_interned_strings_snapshot)(TSRMLS_D);
-ZEND_API void (*zend_interned_strings_restore)(TSRMLS_D);
+ZEND_API zend_string *(*zend_new_interned_string)(zend_string *str);
+ZEND_API void (*zend_interned_strings_snapshot)(void);
+ZEND_API void (*zend_interned_strings_restore)(void);
-static zend_string *zend_new_interned_string_int(zend_string *str TSRMLS_DC);
-static void zend_interned_strings_snapshot_int(TSRMLS_D);
-static void zend_interned_strings_restore_int(TSRMLS_D);
+static zend_string *zend_new_interned_string_int(zend_string *str);
+static void zend_interned_strings_snapshot_int(void);
+static void zend_interned_strings_restore_int(void);
ZEND_API zend_ulong zend_hash_func(const char *str, size_t len)
{
@@ -43,7 +43,7 @@ static void _str_dtor(zval *zv)
}
#endif
-void zend_interned_strings_init(TSRMLS_D)
+void zend_interned_strings_init(void)
{
#ifndef ZTS
zend_string *str;
@@ -58,7 +58,7 @@ void zend_interned_strings_init(TSRMLS_D)
/* interned empty string */
str = zend_string_alloc(sizeof("")-1, 1);
str->val[0] = '\000';
- CG(empty_string) = zend_new_interned_string_int(str TSRMLS_CC);
+ CG(empty_string) = zend_new_interned_string_int(str);
#endif
/* one char strings (the actual interned strings are going to be created by ext/opcache) */
@@ -69,14 +69,14 @@ void zend_interned_strings_init(TSRMLS_D)
zend_interned_strings_restore = zend_interned_strings_restore_int;
}
-void zend_interned_strings_dtor(TSRMLS_D)
+void zend_interned_strings_dtor(void)
{
#ifndef ZTS
zend_hash_destroy(&CG(interned_strings));
#endif
}
-static zend_string *zend_new_interned_string_int(zend_string *str TSRMLS_DC)
+static zend_string *zend_new_interned_string_int(zend_string *str)
{
#ifndef ZTS
zend_ulong h;
@@ -143,7 +143,7 @@ static zend_string *zend_new_interned_string_int(zend_string *str TSRMLS_DC)
#endif
}
-static void zend_interned_strings_snapshot_int(TSRMLS_D)
+static void zend_interned_strings_snapshot_int(void)
{
#ifndef ZTS
uint idx;
@@ -159,7 +159,7 @@ static void zend_interned_strings_snapshot_int(TSRMLS_D)
#endif
}
-static void zend_interned_strings_restore_int(TSRMLS_D)
+static void zend_interned_strings_restore_int(void)
{
#ifndef ZTS
uint nIndex;
diff --git a/Zend/zend_string.h b/Zend/zend_string.h
index 9a4eb8329c..bd871e29e2 100644
--- a/Zend/zend_string.h
+++ b/Zend/zend_string.h
@@ -25,13 +25,13 @@
BEGIN_EXTERN_C()
-ZEND_API extern zend_string *(*zend_new_interned_string)(zend_string *str TSRMLS_DC);
-ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D);
-ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D);
+ZEND_API extern zend_string *(*zend_new_interned_string)(zend_string *str);
+ZEND_API extern void (*zend_interned_strings_snapshot)(void);
+ZEND_API extern void (*zend_interned_strings_restore)(void);
ZEND_API zend_ulong zend_hash_func(const char *str, size_t len);
-void zend_interned_strings_init(TSRMLS_D);
-void zend_interned_strings_dtor(TSRMLS_D);
+void zend_interned_strings_init(void);
+void zend_interned_strings_dtor(void);
END_EXTERN_C()
@@ -284,7 +284,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
return hash;
}
-static zend_always_inline void zend_interned_empty_string_init(zend_string **s TSRMLS_DC)
+static zend_always_inline void zend_interned_empty_string_init(zend_string **s)
{
zend_string *str;
@@ -292,7 +292,7 @@ static zend_always_inline void zend_interned_empty_string_init(zend_string **s T
str->val[0] = '\000';
#ifndef ZTS
- *s = zend_new_interned_string(str TSRMLS_CC);
+ *s = zend_new_interned_string(str);
#else
zend_string_hash_val(str);
str->gc.u.v.flags |= IS_STR_INTERNED;
@@ -300,7 +300,7 @@ static zend_always_inline void zend_interned_empty_string_init(zend_string **s T
#endif
}
-static zend_always_inline void zend_interned_empty_string_free(zend_string **s TSRMLS_DC)
+static zend_always_inline void zend_interned_empty_string_free(zend_string **s)
{
if (NULL != *s) {
free(*s);
diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c
index dd7aaeb9a7..2d3eb74dd4 100644
--- a/Zend/zend_ts_hash.c
+++ b/Zend/zend_ts_hash.c
@@ -144,35 +144,35 @@ ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht)
#endif
}
-ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC)
+ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func)
{
begin_write(ht);
- zend_hash_apply(TS_HASH(ht), apply_func TSRMLS_CC);
+ zend_hash_apply(TS_HASH(ht), apply_func);
end_write(ht);
}
-ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC)
+ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *argument)
{
begin_write(ht);
- zend_hash_apply_with_argument(TS_HASH(ht), apply_func, argument TSRMLS_CC);
+ zend_hash_apply_with_argument(TS_HASH(ht), apply_func, argument);
end_write(ht);
}
-ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...)
+ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int num_args, ...)
{
va_list args;
va_start(args, num_args);
begin_write(ht);
- zend_hash_apply_with_arguments(TS_HASH(ht) TSRMLS_CC, apply_func, num_args, args);
+ zend_hash_apply_with_arguments(TS_HASH(ht), apply_func, num_args, args);
end_write(ht);
va_end(args);
}
-ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC)
+ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func)
{
begin_write(ht);
- zend_hash_reverse_apply(TS_HASH(ht), apply_func TSRMLS_CC);
+ zend_hash_reverse_apply(TS_HASH(ht), apply_func);
end_write(ht);
}
@@ -276,36 +276,36 @@ ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, co
end_read(source);
}
-ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC)
+ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber)
{
int retval;
begin_write(ht);
- retval = zend_hash_sort(TS_HASH(ht), sort_func, compare_func, renumber TSRMLS_CC);
+ retval = zend_hash_sort(TS_HASH(ht), sort_func, compare_func, renumber);
end_write(ht);
return retval;
}
-ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
+ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered)
{
int retval;
begin_read(ht1);
begin_read(ht2);
- retval = zend_hash_compare(TS_HASH(ht1), TS_HASH(ht2), compar, ordered TSRMLS_CC);
+ retval = zend_hash_compare(TS_HASH(ht1), TS_HASH(ht2), compar, ordered);
end_read(ht2);
end_read(ht1);
return retval;
}
-ZEND_API zval *zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag TSRMLS_DC)
+ZEND_API zval *zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag)
{
zval *retval;
begin_read(ht);
- retval = zend_hash_minmax(TS_HASH(ht), compar, flag TSRMLS_CC);
+ retval = zend_hash_minmax(TS_HASH(ht), compar, flag);
end_read(ht);
return retval;
diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h
index 4bac7db205..b916e459a5 100644
--- a/Zend/zend_ts_hash.h
+++ b/Zend/zend_ts_hash.h
@@ -64,11 +64,11 @@ ZEND_API zval *_zend_ts_hash_index_add_or_update(TsHashTable *ht, zend_ulong h,
ZEND_API zval* zend_ts_hash_add_empty_element(TsHashTable *ht, zend_string *key);
ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht);
-ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC);
-ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
-ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int, ...);
+ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func);
+ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *);
+ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int, ...);
-ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC);
+ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func);
/* Deletes */
@@ -88,9 +88,9 @@ ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_c
ZEND_API void zend_ts_hash_copy_to_hash(HashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor);
ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite);
ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
-ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC);
-ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
-ZEND_API zval *zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag TSRMLS_DC);
+ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
+ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered);
+ZEND_API zval *zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag);
ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht);
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 7d89b4d2d5..1f7978b688 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -83,8 +83,8 @@ typedef struct _zend_reference zend_reference;
typedef struct _zend_ast_ref zend_ast_ref;
typedef struct _zend_ast zend_ast;
-typedef int (*compare_func_t)(const void *, const void * TSRMLS_DC);
-typedef void (*sort_func_t)(void *, size_t, size_t, compare_func_t TSRMLS_DC);
+typedef int (*compare_func_t)(const void *, const void *);
+typedef void (*sort_func_t)(void *, size_t, size_t, compare_func_t);
typedef void (*dtor_func_t)(zval *pDest);
typedef void (*copy_ctor_func_t)(zval *pElement);
@@ -427,10 +427,10 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_OBJCE(zval) (Z_OBJ(zval)->ce)
#define Z_OBJCE_P(zval_p) Z_OBJCE(*(zval_p))
-#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC)
+#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval))
#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*(zval_p))
-#define Z_OBJDEBUG(zval,tmp) (Z_OBJ_HANDLER((zval),get_debug_info)?Z_OBJ_HANDLER((zval),get_debug_info)(&(zval),&tmp TSRMLS_CC):(tmp=0,Z_OBJ_HANDLER((zval),get_properties)?Z_OBJPROP(zval):NULL))
+#define Z_OBJDEBUG(zval,tmp) (Z_OBJ_HANDLER((zval),get_debug_info)?Z_OBJ_HANDLER((zval),get_debug_info)(&(zval),&tmp):(tmp=0,Z_OBJ_HANDLER((zval),get_properties)?Z_OBJPROP(zval):NULL))
#define Z_OBJDEBUG_P(zval_p,tmp) Z_OBJDEBUG(*(zval_p), tmp)
#define Z_RES(zval) (zval).value.res
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 548d191cfd..56b9b67598 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -39,13 +39,12 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_ARRAY: {
zend_array *arr = (zend_array*)p;
- TSRMLS_FETCH();
-
+
if (arr != &EG(symbol_table)) {
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_array_destroy(&arr->ht TSRMLS_CC);
+ zend_array_destroy(&arr->ht);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -59,15 +58,13 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_OBJECT: {
zend_object *obj = (zend_object*)p;
- TSRMLS_FETCH();
-
+
OBJ_RELEASE(obj);
break;
}
case IS_RESOURCE: {
zend_resource *res = (zend_resource*)p;
- TSRMLS_FETCH();
-
+
if (--GC_REFCOUNT(res) == 0) {
/* destroy resource */
zend_list_free(res);
@@ -77,9 +74,8 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
if (--GC_REFCOUNT(ref) == 0) {
- TSRMLS_FETCH();
-
- i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
efree_size(ref, sizeof(zend_reference));
}
break;
@@ -101,13 +97,12 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_ARRAY: {
zend_array *arr = (zend_array*)p;
- TSRMLS_FETCH();
-
+
if (arr != &EG(symbol_table)) {
/* break possible cycles */
GC_TYPE(arr) = IS_NULL;
GC_REMOVE_FROM_BUFFER(arr);
- zend_array_destroy(&arr->ht TSRMLS_CC);
+ zend_array_destroy(&arr->ht);
efree_size(arr, sizeof(zend_array));
}
break;
@@ -121,24 +116,21 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_OBJECT: {
zend_object *obj = (zend_object*)p;
- TSRMLS_FETCH();
-
- zend_objects_store_del(obj TSRMLS_CC);
+
+ zend_objects_store_del(obj);
break;
}
case IS_RESOURCE: {
zend_resource *res = (zend_resource*)p;
- TSRMLS_FETCH();
-
+
/* destroy resource */
zend_list_free(res);
break;
}
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
- TSRMLS_FETCH();
-
- i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
+
+ i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
efree_size(ref, sizeof(zend_reference));
break;
}
@@ -241,8 +233,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
break;
case IS_ARRAY: {
HashTable *ht;
- TSRMLS_FETCH();
-
+
if (Z_ARR_P(zvalue) == &EG(symbol_table)) {
return; /* do nothing */
}
@@ -269,9 +260,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
-ZEND_API size_t zend_print_variable(zval *var TSRMLS_DC)
+ZEND_API size_t zend_print_variable(zval *var)
{
- return zend_print_zval(var, 0 TSRMLS_CC);
+ return zend_print_zval(var, 0);
}
@@ -296,9 +287,8 @@ ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue)
ZEND_API void _zval_ptr_dtor_wrapper(zval *zval_ptr)
{
- TSRMLS_FETCH();
- i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_CC TSRMLS_CC);
+ i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_CC);
}
@@ -308,7 +298,7 @@ ZEND_API void _zval_internal_ptr_dtor_wrapper(zval *zval_ptr)
}
#endif
-ZEND_API int zval_copy_static_var(zval *p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
+ZEND_API int zval_copy_static_var(zval *p, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
zend_array *symbol_table;
HashTable *target = va_arg(args, HashTable*);
@@ -318,7 +308,7 @@ ZEND_API int zval_copy_static_var(zval *p TSRMLS_DC, int num_args, va_list args,
if (Z_CONST_FLAGS_P(p) & (IS_LEXICAL_VAR|IS_LEXICAL_REF)) {
is_ref = Z_CONST_FLAGS_P(p) & IS_LEXICAL_REF;
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
p = zend_hash_find(&symbol_table->ht, key->key);
if (!p) {
p = &tmp;
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index ea0434dc0b..a0c007670c 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -45,7 +45,7 @@ static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE
}
}
-static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
+static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
{
if (Z_REFCOUNTED_P(zval_ptr)) {
if (!Z_DELREF_P(zval_ptr)) {
@@ -104,9 +104,9 @@ static zend_always_inline void _zval_opt_copy_ctor_no_imm(zval *zvalue ZEND_FILE
}
}
-ZEND_API int zval_copy_static_var(zval *p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key);
+ZEND_API int zval_copy_static_var(zval *p, int num_args, va_list args, zend_hash_key *key);
-ZEND_API size_t zend_print_variable(zval *var TSRMLS_DC);
+ZEND_API size_t zend_print_variable(zval *var);
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_dtor_for_ptr(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC);
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 33bfddc3f9..9ff2fd7452 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -428,7 +428,7 @@ static int php_is_file_ok(const cwd_state *state) /* {{{ */
}
/* }}} */
-static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
+static void cwd_globals_ctor(virtual_cwd_globals *cwd_g) /* {{{ */
{
CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state);
cwd_g->realpath_cache_size = 0;
@@ -438,9 +438,9 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
+static void cwd_globals_dtor(virtual_cwd_globals *cwd_g) /* {{{ */
{
- realpath_cache_clean(TSRMLS_C);
+ realpath_cache_clean();
}
/* }}} */
@@ -478,7 +478,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
#ifdef ZTS
ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
#else
- cwd_globals_ctor(&cwd_globals TSRMLS_CC);
+ cwd_globals_ctor(&cwd_globals);
#endif
#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
@@ -490,7 +490,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
CWD_API void virtual_cwd_shutdown(void) /* {{{ */
{
#ifndef ZTS
- cwd_globals_dtor(&cwd_globals TSRMLS_CC);
+ cwd_globals_dtor(&cwd_globals);
#endif
#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS)
tsrm_mutex_free(cwd_mutex);
@@ -500,7 +500,7 @@ CWD_API void virtual_cwd_shutdown(void) /* {{{ */
}
/* }}} */
-CWD_API int virtual_cwd_activate(TSRMLS_D) /* {{{ */
+CWD_API int virtual_cwd_activate(void) /* {{{ */
{
if (CWDG(cwd).cwd == NULL) {
CWD_STATE_COPY(&CWDG(cwd), &main_cwd_state);
@@ -509,7 +509,7 @@ CWD_API int virtual_cwd_activate(TSRMLS_D) /* {{{ */
}
/* }}} */
-CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */
+CWD_API int virtual_cwd_deactivate(void) /* {{{ */
{
if (CWDG(cwd).cwd != NULL) {
CWD_STATE_FREE(&CWDG(cwd));
@@ -519,7 +519,7 @@ CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */
}
/* }}} */
-CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
+CWD_API char *virtual_getcwd_ex(size_t *length) /* {{{ */
{
cwd_state *state;
@@ -561,12 +561,12 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
/* }}} */
/* Same semantics as UNIX getcwd() */
-CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
+CWD_API char *virtual_getcwd(char *buf, size_t size) /* {{{ */
{
size_t length;
char *cwd;
- cwd = virtual_getcwd_ex(&length TSRMLS_CC);
+ cwd = virtual_getcwd_ex(&length);
if (buf == NULL) {
return cwd;
@@ -583,10 +583,10 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef PHP_WIN32
-static inline zend_ulong realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
+static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {{{ */
{
register zend_ulong h;
- char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
+ char *bucket_key_start = tsrm_win32_get_path_sid_key(path);
char *bucket_key = (char *)bucket_key_start;
const char *e = bucket_key + strlen(bucket_key);
@@ -618,7 +618,7 @@ static inline zend_ulong realpath_cache_key(const char *path, int path_len) /* {
/* }}} */
#endif /* defined(PHP_WIN32) */
-CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
+CWD_API void realpath_cache_clean(void) /* {{{ */
{
uint32_t i;
@@ -635,10 +635,10 @@ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
}
/* }}} */
-CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
+CWD_API void realpath_cache_del(const char *path, int path_len) /* {{{ */
{
#ifdef PHP_WIN32
- zend_ulong key = realpath_cache_key(path, path_len TSRMLS_CC);
+ zend_ulong key = realpath_cache_key(path, path_len);
#else
zend_ulong key = realpath_cache_key(path, path_len);
#endif
@@ -667,7 +667,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
}
/* }}} */
-static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, int is_dir, time_t t TSRMLS_DC) /* {{{ */
+static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, int is_dir, time_t t) /* {{{ */
{
zend_long size = sizeof(realpath_cache_bucket) + path_len + 1;
int same = 1;
@@ -687,7 +687,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
}
#ifdef PHP_WIN32
- bucket->key = realpath_cache_key(path, path_len TSRMLS_CC);
+ bucket->key = realpath_cache_key(path, path_len);
#else
bucket->key = realpath_cache_key(path, path_len);
#endif
@@ -717,10 +717,10 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
}
/* }}} */
-static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
+static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t) /* {{{ */
{
#ifdef PHP_WIN32
- zend_ulong key = realpath_cache_key(path, path_len TSRMLS_CC);
+ zend_ulong key = realpath_cache_key(path, path_len);
#else
zend_ulong key = realpath_cache_key(path, path_len);
#endif
@@ -751,23 +751,23 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
}
/* }}} */
-CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
+CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t) /* {{{ */
{
- return realpath_cache_find(path, path_len, t TSRMLS_CC);
+ return realpath_cache_find(path, path_len, t);
}
/* }}} */
-CWD_API zend_long realpath_cache_size(TSRMLS_D)
+CWD_API zend_long realpath_cache_size(void)
{
return CWDG(realpath_cache_size);
}
-CWD_API zend_long realpath_cache_max_buckets(TSRMLS_D)
+CWD_API zend_long realpath_cache_max_buckets(void)
{
return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
}
-CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
+CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void)
{
return CWDG(realpath_cache);
}
@@ -776,7 +776,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
#undef LINK_MAX
#define LINK_MAX 32
-static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir TSRMLS_DC) /* {{{ */
+static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir) /* {{{ */
{
int i, j, save;
int directory = 0;
@@ -819,7 +819,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (i - 1 <= start) {
return start ? start : len;
}
- j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC);
+ j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL);
if (j > start) {
j--;
while (j > start && !IS_SLASH(path[j])) {
@@ -861,7 +861,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!*t) {
*t = time(0);
}
- if ((bucket = realpath_cache_find(path, len, *t TSRMLS_CC)) != NULL) {
+ if ((bucket = realpath_cache_find(path, len, *t)) != NULL) {
if (is_dir && !bucket->is_dir) {
/* not a directory */
return -1;
@@ -1034,7 +1034,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if(isabsolute == 1) {
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
/* use_realpath is 0 in the call below coz path is absolute*/
- j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
+ j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory);
if(j < 0) {
free_alloca(tmp, use_heap);
return -1;
@@ -1050,7 +1050,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
memmove(path+i, path, j+1);
memcpy(path, tmp, i-1);
path[i-1] = DEFAULT_SLASH;
- j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory);
if(j < 0) {
free_alloca(tmp, use_heap);
return -1;
@@ -1096,7 +1096,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
path[j] = 0;
if (IS_ABSOLUTE_PATH(path, j)) {
- j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory);
if (j < 0) {
free_alloca(tmp, use_heap);
return -1;
@@ -1109,7 +1109,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
memmove(path+i, path, j+1);
memcpy(path, tmp, i-1);
path[i-1] = DEFAULT_SLASH;
- j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
+ j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory);
if (j < 0) {
free_alloca(tmp, use_heap);
return -1;
@@ -1135,7 +1135,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
j = start;
} else {
/* some leading directories may be unaccessable */
- j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL TSRMLS_CC);
+ j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL);
if (j > start) {
path[j++] = DEFAULT_SLASH;
}
@@ -1167,7 +1167,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (save && start && CWDG(realpath_cache_size_limit)) {
/* save absolute path in the cache */
- realpath_cache_add(tmp, len, path, j, directory, *t TSRMLS_CC);
+ realpath_cache_add(tmp, len, path, j, directory, *t);
}
free_alloca(tmp, use_heap);
@@ -1178,7 +1178,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* Resolve path relatively to state and put the real path into state */
/* returns 0 for ok, 1 for error */
-CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC) /* {{{ */
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */
{
int path_length = (int)strlen(path);
char resolved_path[MAXPATHLEN];
@@ -1319,7 +1319,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]);
t = CWDG(realpath_cache_ttl) ? 0 : -1;
- path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC);
+ path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL);
if (path_length < 0) {
errno = ENOENT;
@@ -1386,13 +1386,13 @@ verify:
}
/* }}} */
-CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */
+CWD_API int virtual_chdir(const char *path) /* {{{ */
{
- return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH TSRMLS_CC)?-1:0;
+ return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0;
}
/* }}} */
-CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) /* {{{ */
+CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path)) /* {{{ */
{
int length = (int)strlen(path);
char *temp;
@@ -1420,13 +1420,13 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "Changing directory to %s\n", temp);
#endif
- retval = p_chdir(temp TSRMLS_CC);
+ retval = p_chdir(temp);
free_alloca(temp, use_heap);
return retval;
}
/* }}} */
-CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
+CWD_API char *virtual_realpath(const char *path, char *real_path) /* {{{ */
{
cwd_state new_state;
char *retval;
@@ -1456,7 +1456,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
@@ -1472,13 +1472,13 @@ end:
}
/* }}} */
-CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) /* {{{ */
+CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC);
+ retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH);
*filepath = new_state.cwd;
@@ -1487,13 +1487,13 @@ CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_f
}
/* }}} */
-CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) /* {{{ */
+CWD_API int virtual_filepath(const char *path, char **filepath) /* {{{ */
{
- return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC);
+ return virtual_filepath_ex(path, filepath, php_is_file_ok);
}
/* }}} */
-CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ */
+CWD_API FILE *virtual_fopen(const char *path, const char *mode) /* {{{ */
{
cwd_state new_state;
FILE *f;
@@ -1503,7 +1503,7 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{
}
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&new_state);
return NULL;
}
@@ -1516,19 +1516,19 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{
}
/* }}} */
-CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
+CWD_API int virtual_access(const char *pathname, int mode) /* {{{ */
{
cwd_state new_state;
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
#if defined(TSRM_WIN32)
- ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC);
+ ret = tsrm_win32_access(new_state.cwd, mode);
#else
ret = access(new_state.cwd, mode);
#endif
@@ -1540,13 +1540,13 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
/* }}} */
#if HAVE_UTIME
-CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */
+CWD_API int virtual_utime(const char *filename, struct utimbuf *buf) /* {{{ */
{
cwd_state new_state;
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1563,13 +1563,13 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /
/* }}} */
#endif
-CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
+CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
{
cwd_state new_state;
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1582,13 +1582,13 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
/* }}} */
#if !defined(TSRM_WIN32) && !defined(NETWARE)
-CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC) /* {{{ */
+CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link) /* {{{ */
{
cwd_state new_state;
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1609,13 +1609,13 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
/* }}} */
#endif
-CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
+CWD_API int virtual_open(const char *path, int flags, ...) /* {{{ */
{
cwd_state new_state;
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1637,13 +1637,13 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
}
/* }}} */
-CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
+CWD_API int virtual_creat(const char *path, mode_t mode) /* {{{ */
{
cwd_state new_state;
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1655,21 +1655,21 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
}
/* }}} */
-CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /* {{{ */
+CWD_API int virtual_rename(const char *oldname, const char *newname) /* {{{ */
{
cwd_state old_state;
cwd_state new_state;
int retval;
CWD_STATE_COPY(&old_state, &CWDG(cwd));
- if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&old_state);
return -1;
}
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&old_state);
CWD_STATE_FREE_ERR(&new_state);
return -1;
@@ -1692,13 +1692,13 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /
}
/* }}} */
-CWD_API int virtual_stat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ */
+CWD_API int virtual_stat(const char *path, zend_stat_t *buf) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1710,13 +1710,13 @@ CWD_API int virtual_stat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ */
}
/* }}} */
-CWD_API int virtual_lstat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ */
+CWD_API int virtual_lstat(const char *path, zend_stat_t *buf) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1728,13 +1728,13 @@ CWD_API int virtual_lstat(const char *path, zend_stat_t *buf TSRMLS_DC) /* {{{ *
}
/* }}} */
-CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
+CWD_API int virtual_unlink(const char *path) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1746,13 +1746,13 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
}
/* }}} */
-CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
+CWD_API int virtual_mkdir(const char *pathname, mode_t mode) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1767,13 +1767,13 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
}
/* }}} */
-CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
+CWD_API int virtual_rmdir(const char *pathname) /* {{{ */
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) {
CWD_STATE_FREE_ERR(&new_state);
return -1;
}
@@ -1789,13 +1789,13 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
DIR *opendir(const char *name);
#endif
-CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
+CWD_API DIR *virtual_opendir(const char *pathname) /* {{{ */
{
cwd_state new_state;
DIR *retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE_ERR(&new_state);
return NULL;
}
@@ -1808,16 +1808,16 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef TSRM_WIN32
-CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
- return popen_ex(command, type, CWDG(cwd).cwd, NULL TSRMLS_CC);
+ return popen_ex(command, type, CWDG(cwd).cwd, NULL);
}
/* }}} */
#elif defined(NETWARE)
/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform
a VCWD_CHDIR() and mutex it
*/
-CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
char prev_cwd[MAXPATHLEN];
char *getcwd_result;
@@ -1844,7 +1844,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
}
/* }}} */
#else /* Unix */
-CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
+CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
int command_length;
int dir_length, extra = 0;
@@ -1904,7 +1904,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
/* }}} */
#endif
-CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */
+CWD_API char *tsrm_realpath(const char *path, char *real_path) /* {{{ */
{
cwd_state new_state;
char cwd[MAXPATHLEN];
@@ -1933,7 +1933,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
new_state.cwd_length = 0;
}
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
efree(new_state.cwd);
return NULL;
}
diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h
index 96ac6faa30..243081fec5 100644
--- a/Zend/zend_virtual_cwd.h
+++ b/Zend/zend_virtual_cwd.h
@@ -151,27 +151,27 @@ typedef int (*verify_path_func)(const cwd_state *);
CWD_API void virtual_cwd_startup(void);
CWD_API void virtual_cwd_shutdown(void);
-CWD_API int virtual_cwd_activate(TSRMLS_D);
-CWD_API int virtual_cwd_deactivate(TSRMLS_D);
-CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC);
-CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC);
-CWD_API int virtual_chdir(const char *path TSRMLS_DC);
-CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC);
-CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC);
-CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC);
-CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC);
-CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
-CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
-CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
-CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC);
-CWD_API int virtual_stat(const char *path, zend_stat_t *buf TSRMLS_DC);
-CWD_API int virtual_lstat(const char *path, zend_stat_t *buf TSRMLS_DC);
-CWD_API int virtual_unlink(const char *path TSRMLS_DC);
-CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC);
-CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC);
-CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC);
-CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
-CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
+CWD_API int virtual_cwd_activate(void);
+CWD_API int virtual_cwd_deactivate(void);
+CWD_API char *virtual_getcwd_ex(size_t *length);
+CWD_API char *virtual_getcwd(char *buf, size_t size);
+CWD_API int virtual_chdir(const char *path);
+CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path));
+CWD_API int virtual_filepath(const char *path, char **filepath);
+CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path);
+CWD_API char *virtual_realpath(const char *path, char *real_path);
+CWD_API FILE *virtual_fopen(const char *path, const char *mode);
+CWD_API int virtual_open(const char *path, int flags, ...);
+CWD_API int virtual_creat(const char *path, mode_t mode);
+CWD_API int virtual_rename(const char *oldname, const char *newname);
+CWD_API int virtual_stat(const char *path, zend_stat_t *buf);
+CWD_API int virtual_lstat(const char *path, zend_stat_t *buf);
+CWD_API int virtual_unlink(const char *path);
+CWD_API int virtual_mkdir(const char *pathname, mode_t mode);
+CWD_API int virtual_rmdir(const char *pathname);
+CWD_API DIR *virtual_opendir(const char *pathname);
+CWD_API FILE *virtual_popen(const char *command, const char *type);
+CWD_API int virtual_access(const char *pathname, int mode);
#if defined(TSRM_WIN32)
/* these are not defined in win32 headers */
#ifndef W_OK
@@ -189,11 +189,11 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
#endif
#if HAVE_UTIME
-CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
+CWD_API int virtual_utime(const char *filename, struct utimbuf *buf);
#endif
-CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
+CWD_API int virtual_chmod(const char *filename, mode_t mode);
#if !defined(TSRM_WIN32) && !defined(NETWARE)
-CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC);
+CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link);
#endif
/* One of the following constants must be used as the last argument
@@ -203,9 +203,9 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
-CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC);
+CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath);
-CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
+CWD_API char *tsrm_realpath(const char *path, char *real_path);
#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */
#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
@@ -237,18 +237,18 @@ typedef struct _virtual_cwd_globals {
#ifdef ZTS
extern ts_rsrc_id cwd_globals_id;
-# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v)
+# define CWDG(v) ZEND_TSRMG(cwd_globals_id, virtual_cwd_globals *, v)
#else
extern virtual_cwd_globals cwd_globals;
# define CWDG(v) (cwd_globals.v)
#endif
-CWD_API void realpath_cache_clean(TSRMLS_D);
-CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
-CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
-CWD_API zend_long realpath_cache_size(TSRMLS_D);
-CWD_API zend_long realpath_cache_max_buckets(TSRMLS_D);
-CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
+CWD_API void realpath_cache_clean(void);
+CWD_API void realpath_cache_del(const char *path, int path_len);
+CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t);
+CWD_API zend_long realpath_cache_size(void);
+CWD_API zend_long realpath_cache_max_buckets(void);
+CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
/* The actual macros to be used in programs using TSRM
* If the program defines VIRTUAL_DIR it will use the
@@ -257,33 +257,33 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
#ifdef VIRTUAL_DIR
-#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC)
-#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC)
+#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size)
+#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode)
/* Because open() has two modes, we have to macros to replace it */
-#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags)
-#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode)
-#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC)
-#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC)
-#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC)
+#define VCWD_OPEN(path, flags) virtual_open(path, flags)
+#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path, flags, mode)
+#define VCWD_CREAT(path, mode) virtual_creat(path, mode)
+#define VCWD_CHDIR(path) virtual_chdir(path)
+#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
#define VCWD_GETWD(buf)
-#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
-#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
-#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
-# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
-#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
-#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC)
-#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC)
-#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC)
-#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC)
-#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC)
+#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path)
+#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname)
+#define VCWD_STAT(path, buff) virtual_stat(path, buff)
+# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff)
+#define VCWD_UNLINK(path) virtual_unlink(path)
+#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode)
+#define VCWD_RMDIR(pathname) virtual_rmdir(pathname)
+#define VCWD_OPENDIR(pathname) virtual_opendir(pathname)
+#define VCWD_POPEN(command, type) virtual_popen(command, type)
+#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode)
#if HAVE_UTIME
-#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC)
+#define VCWD_UTIME(path, time) virtual_utime(path, time)
#endif
-#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
+#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
-#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC)
+#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0)
#if HAVE_LCHOWN
-#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC)
+#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1)
#endif
#endif
@@ -312,12 +312,12 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
#define VCWD_OPENDIR(pathname) opendir(pathname)
#define VCWD_POPEN(command, type) popen(command, type)
#if defined(TSRM_WIN32)
-#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode TSRMLS_CC)
+#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode)
#else
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
#endif
-#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
+#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path)
#if HAVE_UTIME
# ifdef TSRM_WIN32
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8bf7986eeb..d9f6f3ef69 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -33,7 +33,7 @@ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -48,7 +48,7 @@ ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -63,7 +63,7 @@ ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -78,7 +78,7 @@ ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -93,7 +93,7 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -108,7 +108,7 @@ ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -123,7 +123,7 @@ ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -138,7 +138,7 @@ ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -153,7 +153,7 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R),
- GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -169,7 +169,7 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
SAVE_OPLINE();
fast_is_not_identical_function(result,
GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R),
- GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR_DEREF(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -185,7 +185,7 @@ ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -201,7 +201,7 @@ ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_not_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -217,7 +217,7 @@ ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_is_smaller_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -233,7 +233,7 @@ ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -248,7 +248,7 @@ ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -263,7 +263,7 @@ ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -278,7 +278,7 @@ ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -293,7 +293,7 @@ ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -307,7 +307,7 @@ ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMPVAR|CV, ANY)
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP1_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -326,14 +326,14 @@ ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val));
FREE_OP1();
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC))
+ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, int (*binary_op)(zval *result, zval *op1, zval *op2))
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
@@ -350,7 +350,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -361,12 +361,12 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -375,20 +375,20 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -409,7 +409,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC))
+ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2))
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
@@ -432,13 +432,13 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|
#if !defined(ZEND_VM_SPEC) || (OP2_TYPE != IS_UNUSED)
if (OP1_TYPE == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, OP2_TYPE);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -455,7 +455,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -471,7 +471,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_dim_helper, VAR|UNUSED|CV, CONST|TMPVAR|
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|CV, CONST|TMPVAR|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC))
+ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|CV, CONST|TMPVAR|CV, int (*binary_op)(zval *result, zval *op1, zval *op2))
{
USE_OPLINE
zend_free_op free_op1, free_op2;
@@ -494,7 +494,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|CV, CONST|TMPVAR|CV, int (*b
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -747,7 +747,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
do {
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -759,7 +759,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -772,14 +772,14 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -789,7 +789,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -836,7 +836,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
do {
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -846,7 +846,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -856,15 +856,15 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -872,7 +872,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -1072,7 +1072,7 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMPVAR|CV, ANY)
zend_write(str->val, str->len);
}
} else {
- zend_string *str = _zval_get_string_func(z TSRMLS_CC);
+ zend_string *str = _zval_get_string_func(z);
if (str->len != 0) {
zend_write(str->val, str->len);
@@ -1121,7 +1121,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
@@ -1135,10 +1135,10 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
FREE_OP1();
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -1181,7 +1181,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
FREE_OP1();
@@ -1224,7 +1224,7 @@ ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_W);
} else {
ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_R);
@@ -1249,7 +1249,7 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
container = GET_OP1_ZVAL_PTR(BP_VAR_R);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
FREE_OP1();
CHECK_EXCEPTION();
@@ -1268,7 +1268,7 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMPVAR|UNUSED|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1290,7 +1290,7 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMPVAR|UNUSED|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1308,7 +1308,7 @@ ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
container = GET_OP1_ZVAL_PTR(BP_VAR_IS);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
FREE_OP1();
CHECK_EXCEPTION();
@@ -1323,7 +1323,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -1331,7 +1331,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -1342,7 +1342,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUS
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = GET_OP1_ZVAL_PTR(BP_VAR_R);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
FREE_OP1();
}
@@ -1362,7 +1362,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMPVAR|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1423,7 +1423,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_no_object):
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -1452,7 +1452,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMPVAR|CV)
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1476,7 +1476,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMPVAR|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1536,7 +1536,7 @@ ZEND_VM_C_LABEL(fetch_obj_is_no_object):
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -1555,7 +1555,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMPV
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -1570,7 +1570,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|CV, CONST|TMPV
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1596,7 +1596,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMPVAR|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
FREE_OP2();
if (OP1_TYPE == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -1618,13 +1618,13 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_LIST, CONST|TMPVAR|CV, CONST)
ZEND_VM_C_LABEL(try_fetch_list):
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
zend_free_op free_op2;
- zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
+ zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R);
ZVAL_COPY(EX_VAR(opline->result.var), value);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT) &&
EXPECTED(Z_OBJ_HT_P(container)->read_dimension)) {
zval *result = EX_VAR(opline->result.var);
- zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, GET_OP2_ZVAL_PTR(BP_VAR_R), BP_VAR_R, result TSRMLS_CC);
+ zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, GET_OP2_ZVAL_PTR(BP_VAR_R), BP_VAR_R, result);
if (retval) {
if (result != retval) {
@@ -1657,7 +1657,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV)
if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, OP1_TYPE, property_name, OP2_TYPE, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, OP1_TYPE, property_name, OP2_TYPE, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
FREE_OP2();
FREE_OP1_VAR_PTR();
/* assign_obj has two opcodes! */
@@ -1688,7 +1688,7 @@ ZEND_VM_C_LABEL(try_assign_dim):
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
ZEND_VM_C_LABEL(try_assign_dim_array):
dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, OP2_TYPE TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, OP2_TYPE);
FREE_OP2();
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -1699,7 +1699,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -1711,17 +1711,17 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
zend_free_op free_op2;
zval *property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
FREE_OP2();
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
FREE_OP2();
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -1755,7 +1755,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, OP2_TYPE TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, OP2_TYPE);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -1814,7 +1814,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
(OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr == &EG(error_zval)))) {
variable_ptr = &EG(uninitialized_zval);
} else {
- zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value_ptr);
}
if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
@@ -1841,17 +1841,17 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (call_kind == ZEND_CALL_NESTED_FUNCTION) {
zend_object *object;
- i_free_compiled_variables(execute_data TSRMLS_CC);
+ i_free_compiled_variables(execute_data);
if (UNEXPECTED(EX(symbol_table) != NULL)) {
- zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
+ zend_clean_and_cache_symbol_table(EX(symbol_table));
}
- zend_vm_stack_free_extra_args(execute_data TSRMLS_CC);
+ zend_vm_stack_free_extra_args(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
}
object = Z_OBJ(EX(This));
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
execute_data = EG(current_execute_data);
@@ -1861,7 +1861,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
GC_REFCOUNT(object)--;
}
if (GC_REFCOUNT(object) == 1) {
- zend_object_store_ctor_failed(object TSRMLS_CC);
+ zend_object_store_ctor_failed(object);
}
}
OBJ_RELEASE(object);
@@ -1870,7 +1870,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *opline = EX(opline);
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(EX_VAR(opline->result.var));
}
@@ -1882,15 +1882,15 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
ZEND_VM_LEAVE();
} else if (call_kind == ZEND_CALL_NESTED_CODE) {
zend_detach_symbol_table(execute_data);
- destroy_op_array(&EX(func)->op_array TSRMLS_CC);
+ destroy_op_array(&EX(func)->op_array);
efree_size(EX(func), sizeof(zend_op_array));
EG(current_execute_data) = EX(prev_execute_data);
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
execute_data = EG(current_execute_data);
zend_attach_symbol_table(execute_data);
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION_LEAVE();
}
@@ -1899,11 +1899,11 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
ZEND_VM_LEAVE();
} else {
if (call_kind == ZEND_CALL_TOP_FUNCTION) {
- i_free_compiled_variables(execute_data TSRMLS_CC);
+ i_free_compiled_variables(execute_data);
if (UNEXPECTED(EX(symbol_table) != NULL)) {
- zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
+ zend_clean_and_cache_symbol_table(EX(symbol_table));
}
- zend_vm_stack_free_extra_args(execute_data TSRMLS_CC);
+ zend_vm_stack_free_extra_args(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if ((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
@@ -1925,7 +1925,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
}
EG(current_execute_data) = EX(prev_execute_data);
}
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
ZEND_VM_RETURN();
}
@@ -1960,7 +1960,7 @@ ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMPVAR|CV, ANY)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline++;
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -1993,7 +1993,7 @@ ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMPVAR|CV, ANY)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
opline++;
@@ -2026,7 +2026,7 @@ ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMPVAR|CV, ANY)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -2061,7 +2061,7 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMPVAR|CV, ANY)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
FREE_OP1();
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
@@ -2098,7 +2098,7 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMPVAR|CV, ANY)
ZEND_VM_CONTINUE();
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
@@ -2178,7 +2178,7 @@ ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMPVAR|CV)
}
if (Z_TYPE_P(var) != IS_STRING) {
- use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(var, &var_copy);
if (use_copy) {
var = &var_copy;
@@ -2207,10 +2207,10 @@ ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMPVAR|UNUSED|CV)
SAVE_OPLINE();
if (EG(exception)) {
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
}
if (OP2_TYPE == IS_UNUSED) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -2222,13 +2222,13 @@ ZEND_VM_C_LABEL(try_class_name):
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
Z_CE_P(EX_VAR(opline->result.var)) = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
} else {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), Z_CE_P(EX_VAR(opline->result.var)));
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
} else if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
class_name = Z_REFVAL_P(class_name);
ZEND_VM_C_GOTO(try_class_name);
@@ -2335,7 +2335,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMPVAR|UNUSED|CV, CONST|TMPVAR|CV)
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -2354,7 +2354,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMPVAR|UNUSED|CV, CONST|TMPVAR|CV)
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
FREE_OP2();
FREE_OP1();
@@ -2378,7 +2378,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -2413,9 +2413,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -2449,7 +2449,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -2477,7 +2477,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (OP2_TYPE == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -2506,7 +2506,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMPVAR|CV)
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
@@ -2540,7 +2540,7 @@ ZEND_VM_C_LABEL(try_function_name):
} else if (OP2_TYPE != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
- Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object TSRMLS_CC) == SUCCESS) {
+ Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (object) {
GC_REFCOUNT(object)++;
}
@@ -2574,16 +2574,16 @@ ZEND_VM_C_LABEL(try_function_name):
if (Z_TYPE_P(obj) == IS_STRING) {
object = NULL;
- called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0 TSRMLS_CC);
+ called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0);
if (UNEXPECTED(called_scope == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
if (called_scope->get_static_method) {
- fbc = called_scope->get_static_method(called_scope, Z_STR_P(method) TSRMLS_CC);
+ fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
} else {
- fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
@@ -2604,7 +2604,7 @@ ZEND_VM_C_LABEL(try_function_name):
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
- fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method));
}
@@ -2627,7 +2627,7 @@ ZEND_VM_C_LABEL(try_function_name):
ZEND_VM_CONTINUE(); /* Never reached */
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2645,7 +2645,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
zend_class_entry *called_scope;
zend_object *object;
- if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error TSRMLS_CC)) {
+ if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
}
@@ -2681,7 +2681,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ func, opline->extended_value, called_scope, object, EX(call));
FREE_OP2();
CHECK_EXCEPTION();
@@ -2713,7 +2713,7 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
ZEND_VM_NEXT_OPCODE();
}
@@ -2738,7 +2738,7 @@ ZEND_VM_HANDLER(61, ZEND_INIT_FCALL, ANY, CONST)
EX(call) = zend_vm_stack_push_call_frame_ex(
opline->op1.num, ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
FREE_OP2();
@@ -2797,13 +2797,13 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
zval *p = ZEND_CALL_ARG(call, 1);
for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
- zend_verify_internal_arg_type(fbc, i + 1, p TSRMLS_CC);
+ zend_verify_internal_arg_type(fbc, i + 1, p);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
EG(current_execute_data) = call->prev_execute_data;
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
if (RETURN_VALUE_USED(opline)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
}
@@ -2821,13 +2821,13 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- fbc->internal_function.handler(call, ret TSRMLS_CC);
+ fbc->internal_function.handler(call, ret);
} else {
- zend_execute_internal(call, ret TSRMLS_CC);
+ zend_execute_internal(call, ret);
}
EG(current_execute_data) = call->prev_execute_data;
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(ret);
@@ -2842,12 +2842,12 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
EG(scope) = fbc->common.scope;
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
- zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
+ zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var));
} else {
- zend_vm_stack_free_args(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
}
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
} else {
zval *return_value = NULL;
@@ -2860,13 +2860,13 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
}
call->prev_execute_data = execute_data;
- i_init_func_execute_data(call, &fbc->op_array, return_value TSRMLS_CC);
+ i_init_func_execute_data(call, &fbc->op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
}
} else { /* ZEND_OVERLOADED_FUNCTION */
@@ -2878,15 +2878,15 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
if (EXPECTED(object != NULL)) {
call->prev_execute_data = execute_data;
EG(current_execute_data) = call;
- object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC);
+ object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var));
EG(current_execute_data) = call->prev_execute_data;
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
- zend_vm_stack_free_args(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
zend_string_release(fbc->common.function_name);
@@ -2909,7 +2909,7 @@ ZEND_VM_C_LABEL(fcall_end_change_scope):
GC_REFCOUNT(object)--;
}
if (GC_REFCOUNT(object) == 1) {
- zend_object_store_ctor_failed(object TSRMLS_CC);
+ zend_object_store_ctor_failed(object);
}
}
OBJ_RELEASE(object);
@@ -2918,7 +2918,7 @@ ZEND_VM_C_LABEL(fcall_end_change_scope):
ZEND_VM_C_LABEL(fcall_end):
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(EX_VAR(opline->result.var));
}
@@ -3027,7 +3027,7 @@ ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, ANY, ANY)
zend_generator *generator = (zend_generator *) EX(return_value);
/* Close the generator to free up resources */
- zend_generator_close(generator, 1 TSRMLS_CC);
+ zend_generator_close(generator, 1);
/* Pass execution back to handling code */
ZEND_VM_RETURN();
@@ -3057,13 +3057,13 @@ ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY)
}
} while (0);
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
if (OP1_TYPE != IS_TMP_VAR) {
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- zend_throw_exception_object(value TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_throw_exception_object(value);
+ zend_exception_restore();
FREE_OP1_IF_VAR();
HANDLE_EXCEPTION();
}
@@ -3076,7 +3076,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
SAVE_OPLINE();
/* Check whether an exception has been thrown, if not, jump over code */
- zend_exception_restore(TSRMLS_C);
+ zend_exception_restore();
if (EG(exception) == NULL) {
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
@@ -3084,7 +3084,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), catch_ce);
}
@@ -3097,9 +3097,9 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
#endif /* HAVE_DTRACE */
if (ce != catch_ce) {
- if (!instanceof_function(ce, catch_ce TSRMLS_CC)) {
+ if (!instanceof_function(ce, catch_ce)) {
if (opline->result.num) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
@@ -3292,7 +3292,7 @@ ZEND_VM_C_LABEL(send_again):
zval *arg, *top;
zend_string *name;
- zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
uint32_t i;
@@ -3349,39 +3349,39 @@ ZEND_VM_C_LABEL(send_again):
break;
}
- iter = ce->get_iterator(ce, args, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, args, 0);
if (UNEXPECTED(!iter)) {
FREE_OP1();
if (!EG(exception)) {
zend_throw_exception_ex(
- NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val
+ NULL, 0, "Object of type %s did not create an Iterator", ce->name->val
);
}
HANDLE_EXCEPTION();
}
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
}
- for (; iter->funcs->valid(iter TSRMLS_CC) == SUCCESS; ++arg_num) {
+ for (; iter->funcs->valid(iter) == SUCCESS; ++arg_num) {
zval *arg, *top;
if (UNEXPECTED(EG(exception) != NULL)) {
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
- arg = iter->funcs->get_current_data(iter TSRMLS_CC);
+ arg = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (UNEXPECTED(EG(exception) != NULL)) {
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
@@ -3412,19 +3412,19 @@ ZEND_VM_C_LABEL(send_again):
if (Z_REFCOUNTED_P(arg)) Z_ADDREF_P(arg);
}
- zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1);
top = ZEND_CALL_ARG(EX(call), arg_num);
ZVAL_COPY_VALUE(top, arg);
ZEND_CALL_NUM_ARGS(EX(call))++;
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
ZEND_VM_C_GOTO(unpack_iter_dtor);
}
}
ZEND_VM_C_LABEL(unpack_iter_dtor):
- zend_iterator_dtor(iter TSRMLS_CC);
+ zend_iterator_dtor(iter);
break;
}
case IS_REFERENCE:
@@ -3473,7 +3473,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
ZEND_VM_C_LABEL(send_array):
ht = Z_ARRVAL_P(args);
- zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
uint32_t i;
@@ -3649,12 +3649,12 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
SAVE_OPLINE();
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
- zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
+ zend_verify_missing_arg(execute_data, arg_num);
CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
- zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL);
CHECK_EXCEPTION();
}
@@ -3668,11 +3668,11 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
zval *param;
SAVE_OPLINE();
- param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
if (arg_num > EX_NUM_ARGS()) {
ZVAL_COPY_VALUE(param, EX_CONSTANT(opline->op2));
if (Z_OPT_CONSTANT_P(param)) {
- zval_update_constant(param, 0 TSRMLS_CC);
+ zval_update_constant(param, 0);
} else {
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
if (UNEXPECTED(Z_OPT_COPYABLE_P(param))) {
@@ -3682,7 +3682,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param, EX_CONSTANT(opline->op2) TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, EX_CONSTANT(opline->op2));
}
CHECK_EXCEPTION();
@@ -3698,7 +3698,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
SAVE_OPLINE();
- params = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ params = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
if (arg_num <= arg_count) {
zval *param;
@@ -3707,7 +3707,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -3740,7 +3740,7 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val));
FREE_OP1();
CHECK_EXCEPTION();
}
@@ -3754,7 +3754,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->op1.opline_num,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
ZEND_VM_JMP(EX(func)->op_array.opcodes + el->brk);
}
@@ -3765,7 +3765,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->op1.opline_num,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
ZEND_VM_JMP(EX(func)->op_array.opcodes + el->cont);
}
@@ -3777,7 +3777,7 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->extended_value,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
brk_opline = EX(func)->op_array.opcodes + el->brk;
@@ -3798,7 +3798,7 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
fast_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP2();
CHECK_EXCEPTION();
@@ -3817,7 +3817,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3837,7 +3837,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
}
}
object_init_ex(&object_zval, ce);
- constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval) TSRMLS_CC);
+ constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval));
if (constructor == NULL) {
if (EXPECTED(RETURN_VALUE_USED(opline))) {
@@ -3855,7 +3855,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
opline->extended_value,
ce,
Z_OBJ(object_zval),
- EX(call) TSRMLS_CC);
+ EX(call));
if (EXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
@@ -3925,7 +3925,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|CV, ANY)
}
if (EXPECTED(EG(exception) == NULL)) {
- ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
+ ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
@@ -3946,7 +3946,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
if (!actual) {
@@ -3990,7 +3990,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
} else if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -4012,7 +4012,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
ZVAL_DEREF(value);
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
- zval_update_constant(value, 1 TSRMLS_CC);
+ zval_update_constant(value, 1);
EG(scope) = EX(func)->op_array.scope;
}
if (OP1_TYPE == IS_CONST) {
@@ -4172,7 +4172,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
ZVAL_DEREF(expr);
}
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
break;
}
}
@@ -4181,7 +4181,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
ZVAL_NULL(result);
break;
case _IS_BOOL:
- ZVAL_BOOL(result, zend_is_true(expr TSRMLS_CC));
+ ZVAL_BOOL(result, zend_is_true(expr));
break;
case IS_LONG:
ZVAL_LONG(result, zval_get_long(expr));
@@ -4277,9 +4277,9 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
} else {
switch (opline->extended_value) {
@@ -4288,7 +4288,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
if (resolved_path) {
failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
@@ -4297,24 +4297,24 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
if (failure_retval) {
/* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE));
+ zend_destroy_file_handle(&file_handle);
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
failure_retval=1;
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
@@ -4324,12 +4324,12 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename);
break;
case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code");
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ new_op_array = zend_compile_string(inc_filename, eval_desc);
efree(eval_desc);
}
break;
@@ -4353,27 +4353,27 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
new_op_array->scope = EG(scope); /* ??? */
call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
- (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
+ (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL);
if (EX(symbol_table)) {
call->symbol_table = EX(symbol_table);
} else {
- call->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ call->symbol_table = zend_rebuild_symbol_table();
}
call->prev_execute_data = execute_data;
- i_init_code_execute_data(call, new_op_array, return_value TSRMLS_CC);
+ i_init_code_execute_data(call, new_op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
@@ -4428,7 +4428,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -4444,9 +4444,9 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -4497,7 +4497,7 @@ ZEND_VM_C_LABEL(num_index_dim):
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -4530,7 +4530,7 @@ ZEND_VM_C_LABEL(num_index_dim):
//??? if (OP2_TYPE == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
FREE_OP2();
} else if (OP1_TYPE != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -4572,7 +4572,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV)
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -4683,7 +4683,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF);
if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
FREE_OP1_IF_VAR();
@@ -4696,9 +4696,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
FREE_OP1_VAR_PTR();
}
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ce->name->val);
}
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
}
@@ -4708,7 +4708,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
if (iter) {
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -4717,7 +4717,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
HANDLE_EXCEPTION();
}
}
- is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
+ is_empty = iter->funcs->valid(iter) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -4748,7 +4748,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
if (!ce ||
!p->key ||
- zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS) {
break;
}
pos++;
@@ -4875,7 +4875,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
} else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) {
zend_object_iterator *iter;
- if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) {
+ if ((iter = zend_iterator_unwrap(array)) == NULL) {
/* plain object */
zend_object *zobj = Z_OBJ_P(array);
@@ -4928,7 +4928,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
}
break;
- } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) {
+ } else if (zend_check_property_access(zobj, p->key) == SUCCESS) {
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (p->key->val[0]) {
ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
@@ -4963,7 +4963,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
(Z_TYPE(p->val) == IS_INDIRECT &&
Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) ||
(EXPECTED(p->key != NULL) &&
- zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE));
+ zend_check_property_access(zobj, p->key) == FAILURE));
fe_ht->nInternalPointer = ptr->pos = pos;
ptr->h = fe_ht->arData[pos].h;
ptr->key = fe_ht->arData[pos].key;
@@ -4974,14 +4974,14 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
if (iter && ++iter->index > 0) {
/* This could cause an endless loop if index becomes zero again.
* In case that ever happens we need an additional flag. */
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
}
}
/* If index is zero we come from FE_RESET and checked valid() already. */
- if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
+ if (!iter || (iter->index > 0 && iter->funcs->valid(iter) == FAILURE)) {
/* reached end of iteration */
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
@@ -4989,7 +4989,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
- value = iter->funcs->get_current_data(iter TSRMLS_CC);
+ value = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
@@ -5007,7 +5007,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
}
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (iter->funcs->get_current_key) {
- iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC);
+ iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var));
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
@@ -5041,7 +5041,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -5062,7 +5062,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5072,9 +5072,9 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((OP1_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -5089,7 +5089,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -5162,11 +5162,11 @@ ZEND_VM_C_LABEL(num_index_prop):
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (OP1_TYPE == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -5242,7 +5242,7 @@ ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED|CV, CONST|
ZEND_VM_C_LABEL(isset_no_object):
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((OP2_TYPE == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -5276,7 +5276,7 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMPVAR|UNUSED|CV, ANY)
break;
}
}
- zend_print_variable(ptr TSRMLS_CC);
+ zend_print_variable(ptr);
}
} while (0);
FREE_OP1();
@@ -5346,7 +5346,7 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
is_ref = 1;
value = Z_REFVAL_P(value);
}
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if (i_zend_is_true(value)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -5430,7 +5430,7 @@ ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY)
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5440,7 +5440,7 @@ ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY)
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5450,7 +5450,7 @@ ZEND_VM_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY)
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5461,7 +5461,7 @@ ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY)
USE_OPLINE
SAVE_OPLINE();
- Z_CE_P(EX_VAR(opline->result.var)) = do_bind_class(&EX(func)->op_array, opline, EG(class_table), 0 TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = do_bind_class(&EX(func)->op_array, opline, EG(class_table), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5471,7 +5471,7 @@ ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY)
USE_OPLINE
SAVE_OPLINE();
- Z_CE_P(EX_VAR(opline->result.var)) = do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0 TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5485,7 +5485,7 @@ ZEND_VM_HANDLER(145, ZEND_DECLARE_INHERITED_CLASS_DELAYED, ANY, ANY)
if ((zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op2)))) == NULL ||
((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)))) != NULL &&
Z_CE_P(zce) != Z_CE_P(orig_zce))) {
- do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0 TSRMLS_CC);
+ do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5496,7 +5496,7 @@ ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY)
USE_OPLINE
SAVE_OPLINE();
- do_bind_function(&EX(func)->op_array, opline, EG(function_table), 0 TSRMLS_CC);
+ do_bind_function(&EX(func)->op_array, opline, EG(function_table), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5509,7 +5509,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
EG(ticks_count) = 0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value TSRMLS_CC);
+ zend_ticks_function(opline->extended_value);
}
}
CHECK_EXCEPTION();
@@ -5534,7 +5534,7 @@ ZEND_VM_C_LABEL(try_instanceof):
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
FREE_OP1();
@@ -5546,7 +5546,7 @@ ZEND_VM_C_LABEL(try_instanceof):
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- result = instanceof_function(Z_OBJCE_P(expr), ce TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), ce);
} else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) {
expr = Z_REFVAL_P(expr);
ZEND_VM_C_GOTO(try_instanceof);
@@ -5579,7 +5579,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
iface = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE TSRMLS_CC);
+ iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
if (UNEXPECTED(iface == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5590,7 +5590,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name->val, iface->name->val);
}
- zend_do_implement_interface(ce, iface TSRMLS_CC);
+ zend_do_implement_interface(ce, iface);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5608,7 +5608,7 @@ ZEND_VM_HANDLER(154, ZEND_ADD_TRAIT, ANY, ANY)
} else {
trait = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)),
EX_CONSTANT(opline->op2) + 1,
- ZEND_FETCH_CLASS_TRAIT TSRMLS_CC);
+ ZEND_FETCH_CLASS_TRAIT);
if (UNEXPECTED(trait == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5619,7 +5619,7 @@ ZEND_VM_HANDLER(154, ZEND_ADD_TRAIT, ANY, ANY)
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), trait);
}
- zend_do_implement_trait(ce, trait TSRMLS_CC);
+ zend_do_implement_trait(ce, trait);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5631,7 +5631,7 @@ ZEND_VM_HANDLER(155, ZEND_BIND_TRAITS, ANY, ANY)
zend_class_entry *ce = Z_CE_P(EX_VAR(opline->op1.var));
SAVE_OPLINE();
- zend_do_bind_traits(ce TSRMLS_CC);
+ zend_do_bind_traits(ce);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5743,7 +5743,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
} while (!do_exit);
}
- zend_vm_stack_free_args(EX(call) TSRMLS_CC);
+ zend_vm_stack_free_args(EX(call));
if (Z_OBJ(call->This)) {
if (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR) {
@@ -5751,13 +5751,13 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
GC_REFCOUNT(Z_OBJ(call->This))--;
}
if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
- zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(call->This));
}
}
OBJ_RELEASE(Z_OBJ(call->This));
}
EX(call) = call->prev_execute_data;
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
call = EX(call);
} while (call);
}
@@ -5791,7 +5791,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
if (in_finally && Z_OBJ_P(fast_call)) {
- zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
Z_OBJ_P(fast_call) = EG(exception);
EG(exception) = NULL;
@@ -5804,7 +5804,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
if (Z_OBJ_P(fast_call)) {
- zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
Z_OBJ_P(fast_call) = NULL;
}
}
@@ -5824,7 +5824,7 @@ ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
USE_OPLINE
SAVE_OPLINE();
- zend_verify_abstract_class(Z_CE_P(EX_VAR(opline->op1.var)) TSRMLS_CC);
+ zend_verify_abstract_class(Z_CE_P(EX_VAR(opline->op1.var)));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5872,7 +5872,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
ZVAL_COPY_VALUE(&c.value, val);
if (Z_OPT_CONSTANT(c.value)) {
- zval_update_constant(&c.value, 0 TSRMLS_CC);
+ zval_update_constant(&c.value, 0);
} else {
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
if (UNEXPECTED(Z_OPT_COPYABLE(c.value))) {
@@ -5883,7 +5883,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
c.name = zend_string_dup(Z_STR_P(name), 0);
c.module_number = PHP_USER_CONSTANT;
- if (zend_register_constant(&c TSRMLS_CC) == FAILURE) {
+ if (zend_register_constant(&c) == FAILURE) {
}
FREE_OP1();
@@ -5908,9 +5908,9 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
closure_is_static = Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC;
closure_is_being_defined_inside_static_context = EX(func)->common.fn_flags & ZEND_ACC_STATIC;
if (closure_is_static || closure_is_being_defined_inside_static_context) {
- zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL);
} else {
- zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL);
}
CHECK_EXCEPTION();
@@ -6143,7 +6143,7 @@ ZEND_VM_HANDLER(166, ZEND_POW, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
GET_OP1_ZVAL_PTR(BP_VAR_R),
- GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
+ GET_OP2_ZVAL_PTR(BP_VAR_R));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -6205,7 +6205,7 @@ ZEND_VM_C_LABEL(check_indirect):
}
variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W);
- zend_assign_to_variable_reference(variable_ptr, value TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6239,7 +6239,7 @@ ZEND_VM_C_LABEL(try_strlen):
zval tmp;
ZVAL_COPY(&tmp, value);
- if (parse_arg_object_to_str(&tmp, &str, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (parse_arg_object_to_str(&tmp, &str, IS_STRING) == FAILURE) {
ZEND_VM_C_GOTO(strlen_error);
}
ZVAL_LONG(EX_VAR(opline->result.var), str->len);
@@ -6289,7 +6289,7 @@ ZEND_VM_HANDLER(123, ZEND_TYPE_CHECK, CONST|TMP|VAR|CV, ANY)
break;
case IS_RESOURCE:
if (Z_TYPE_P(value) == opline->extended_value) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
ZVAL_BOOL(EX_VAR(opline->result.var), type_name != NULL);
} else {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -6310,7 +6310,7 @@ ZEND_VM_HANDLER(122, ZEND_DEFINED, CONST, ANY)
SAVE_OPLINE();
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ZVAL_TRUE(EX_VAR(opline->result.var));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0 TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0)) == NULL) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), c);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index f3fb43db96..1c2700e3b5 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -331,9 +331,9 @@ static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, const zend
#define ZEND_VM_LEAVE() return 2
#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
-#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC
+#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data
-ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC)
+ZEND_API void execute_ex(zend_execute_data *execute_data)
{
DCL_OPLINE
@@ -349,7 +349,7 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC)
}
#endif
- if (UNEXPECTED((ret = OPLINE->handler(execute_data TSRMLS_CC)) != 0)) {
+ if (UNEXPECTED((ret = OPLINE->handler(execute_data)) != 0)) {
if (EXPECTED(ret > 0)) {
execute_data = EG(current_execute_data);
} else {
@@ -361,7 +361,7 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC)
zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen");
}
-ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC)
+ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value)
{
zend_execute_data *execute_data;
@@ -370,15 +370,15 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC
}
execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
- (zend_function*)op_array, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC);
+ (zend_function*)op_array, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL);
if (EG(current_execute_data)) {
- execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ execute_data->symbol_table = zend_rebuild_symbol_table();
} else {
execute_data->symbol_table = &EG(symbol_table);
}
EX(prev_execute_data) = EG(current_execute_data);
- i_init_execute_data(execute_data, op_array, return_value TSRMLS_CC);
- zend_execute_ex(execute_data TSRMLS_CC);
+ i_init_execute_data(execute_data, op_array, return_value);
+ zend_execute_ex(execute_data);
}
static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
@@ -388,17 +388,17 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
if (call_kind == ZEND_CALL_NESTED_FUNCTION) {
zend_object *object;
- i_free_compiled_variables(execute_data TSRMLS_CC);
+ i_free_compiled_variables(execute_data);
if (UNEXPECTED(EX(symbol_table) != NULL)) {
- zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
+ zend_clean_and_cache_symbol_table(EX(symbol_table));
}
- zend_vm_stack_free_extra_args(execute_data TSRMLS_CC);
+ zend_vm_stack_free_extra_args(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
}
object = Z_OBJ(EX(This));
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
execute_data = EG(current_execute_data);
@@ -408,7 +408,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
GC_REFCOUNT(object)--;
}
if (GC_REFCOUNT(object) == 1) {
- zend_object_store_ctor_failed(object TSRMLS_CC);
+ zend_object_store_ctor_failed(object);
}
}
OBJ_RELEASE(object);
@@ -417,7 +417,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
if (UNEXPECTED(EG(exception) != NULL)) {
const zend_op *opline = EX(opline);
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(EX_VAR(opline->result.var));
}
@@ -429,15 +429,15 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_LEAVE();
} else if (call_kind == ZEND_CALL_NESTED_CODE) {
zend_detach_symbol_table(execute_data);
- destroy_op_array(&EX(func)->op_array TSRMLS_CC);
+ destroy_op_array(&EX(func)->op_array);
efree_size(EX(func), sizeof(zend_op_array));
EG(current_execute_data) = EX(prev_execute_data);
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
execute_data = EG(current_execute_data);
zend_attach_symbol_table(execute_data);
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION_LEAVE();
}
@@ -446,11 +446,11 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_LEAVE();
} else {
if (call_kind == ZEND_CALL_TOP_FUNCTION) {
- i_free_compiled_variables(execute_data TSRMLS_CC);
+ i_free_compiled_variables(execute_data);
if (UNEXPECTED(EX(symbol_table) != NULL)) {
- zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
+ zend_clean_and_cache_symbol_table(EX(symbol_table));
}
- zend_vm_stack_free_extra_args(execute_data TSRMLS_CC);
+ zend_vm_stack_free_extra_args(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if ((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) && EX(func)->op_array.prototype) {
OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
@@ -472,7 +472,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
}
EG(current_execute_data) = EX(prev_execute_data);
}
- zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
+ zend_vm_stack_free_call_frame(execute_data);
ZEND_VM_RETURN();
}
@@ -538,13 +538,13 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *p = ZEND_CALL_ARG(call, 1);
for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
- zend_verify_internal_arg_type(fbc, i + 1, p TSRMLS_CC);
+ zend_verify_internal_arg_type(fbc, i + 1, p);
p++;
}
if (UNEXPECTED(EG(exception) != NULL)) {
EG(current_execute_data) = call->prev_execute_data;
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
if (RETURN_VALUE_USED(opline)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
}
@@ -562,13 +562,13 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
- fbc->internal_function.handler(call, ret TSRMLS_CC);
+ fbc->internal_function.handler(call, ret);
} else {
- zend_execute_internal(call, ret TSRMLS_CC);
+ zend_execute_internal(call, ret);
}
EG(current_execute_data) = call->prev_execute_data;
- zend_vm_stack_free_args(call TSRMLS_CC);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
+ zend_vm_stack_free_call_frame(call);
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(ret);
@@ -583,12 +583,12 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
EG(scope) = fbc->common.scope;
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
- zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
+ zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var));
} else {
- zend_vm_stack_free_args(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
}
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
} else {
zval *return_value = NULL;
@@ -601,13 +601,13 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
call->prev_execute_data = execute_data;
- i_init_func_execute_data(call, &fbc->op_array, return_value TSRMLS_CC);
+ i_init_func_execute_data(call, &fbc->op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
}
} else { /* ZEND_OVERLOADED_FUNCTION */
@@ -619,15 +619,15 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EXPECTED(object != NULL)) {
call->prev_execute_data = execute_data;
EG(current_execute_data) = call;
- object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC);
+ object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var));
EG(current_execute_data) = call->prev_execute_data;
} else {
zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
}
- zend_vm_stack_free_args(call TSRMLS_CC);
+ zend_vm_stack_free_args(call);
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
zend_string_release(fbc->common.function_name);
@@ -650,7 +650,7 @@ fcall_end_change_scope:
GC_REFCOUNT(object)--;
}
if (GC_REFCOUNT(object) == 1) {
- zend_object_store_ctor_failed(object TSRMLS_CC);
+ zend_object_store_ctor_failed(object);
}
}
OBJ_RELEASE(object);
@@ -659,7 +659,7 @@ fcall_end_change_scope:
fcall_end:
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
if (RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(EX_VAR(opline->result.var));
}
@@ -675,7 +675,7 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER
zend_generator *generator = (zend_generator *) EX(return_value);
/* Close the generator to free up resources */
- zend_generator_close(generator, 1 TSRMLS_CC);
+ zend_generator_close(generator, 1);
/* Pass execution back to handling code */
ZEND_VM_RETURN();
@@ -699,7 +699,7 @@ send_again:
zval *arg, *top;
zend_string *name;
- zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht) TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
uint32_t i;
@@ -756,39 +756,39 @@ send_again:
break;
}
- iter = ce->get_iterator(ce, args, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, args, 0);
if (UNEXPECTED(!iter)) {
FREE_OP(free_op1);
if (!EG(exception)) {
zend_throw_exception_ex(
- NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val
+ NULL, 0, "Object of type %s did not create an Iterator", ce->name->val
);
}
HANDLE_EXCEPTION();
}
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
goto unpack_iter_dtor;
}
}
- for (; iter->funcs->valid(iter TSRMLS_CC) == SUCCESS; ++arg_num) {
+ for (; iter->funcs->valid(iter) == SUCCESS; ++arg_num) {
zval *arg, *top;
if (UNEXPECTED(EG(exception) != NULL)) {
goto unpack_iter_dtor;
}
- arg = iter->funcs->get_current_data(iter TSRMLS_CC);
+ arg = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
goto unpack_iter_dtor;
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (UNEXPECTED(EG(exception) != NULL)) {
goto unpack_iter_dtor;
}
@@ -819,19 +819,19 @@ send_again:
if (Z_REFCOUNTED_P(arg)) Z_ADDREF_P(arg);
}
- zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1);
top = ZEND_CALL_ARG(EX(call), arg_num);
ZVAL_COPY_VALUE(top, arg);
ZEND_CALL_NUM_ARGS(EX(call))++;
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
goto unpack_iter_dtor;
}
}
unpack_iter_dtor:
- zend_iterator_dtor(iter TSRMLS_CC);
+ zend_iterator_dtor(iter);
break;
}
case IS_REFERENCE:
@@ -880,7 +880,7 @@ static int ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
send_array:
ht = Z_ARRVAL_P(args);
- zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);
+ zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
uint32_t i;
@@ -979,12 +979,12 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
- zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
+ zend_verify_missing_arg(execute_data, arg_num);
CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
- zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL);
CHECK_EXCEPTION();
}
@@ -1000,7 +1000,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
- params = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ params = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
if (arg_num <= arg_count) {
zval *param;
@@ -1009,7 +1009,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
do {
- zend_verify_arg_type(EX(func), arg_num, param, NULL TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, NULL);
zend_hash_next_index_insert_new(Z_ARRVAL_P(params), param);
if (Z_REFCOUNTED_P(param)) Z_ADDREF_P(param);
param++;
@@ -1068,7 +1068,7 @@ static int ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1078,7 +1078,7 @@ static int ZEND_FASTCALL ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1088,7 +1088,7 @@ static int ZEND_FASTCALL ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
{
SAVE_OPLINE();
if (!EG(no_extensions)) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(func) TSRMLS_CC);
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(func));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1099,7 +1099,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
USE_OPLINE
SAVE_OPLINE();
- Z_CE_P(EX_VAR(opline->result.var)) = do_bind_class(&EX(func)->op_array, opline, EG(class_table), 0 TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = do_bind_class(&EX(func)->op_array, opline, EG(class_table), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1109,7 +1109,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_
USE_OPLINE
SAVE_OPLINE();
- Z_CE_P(EX_VAR(opline->result.var)) = do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0 TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1123,7 +1123,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER(ZEND
if ((zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op2)))) == NULL ||
((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)))) != NULL &&
Z_CE_P(zce) != Z_CE_P(orig_zce))) {
- do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0 TSRMLS_CC);
+ do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1134,7 +1134,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
USE_OPLINE
SAVE_OPLINE();
- do_bind_function(&EX(func)->op_array, opline, EG(function_table), 0 TSRMLS_CC);
+ do_bind_function(&EX(func)->op_array, opline, EG(function_table), 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1147,7 +1147,7 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
EG(ticks_count) = 0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value TSRMLS_CC);
+ zend_ticks_function(opline->extended_value);
}
}
CHECK_EXCEPTION();
@@ -1176,7 +1176,7 @@ static int ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
trait = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)),
EX_CONSTANT(opline->op2) + 1,
- ZEND_FETCH_CLASS_TRAIT TSRMLS_CC);
+ ZEND_FETCH_CLASS_TRAIT);
if (UNEXPECTED(trait == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1187,7 +1187,7 @@ static int ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), trait);
}
- zend_do_implement_trait(ce, trait TSRMLS_CC);
+ zend_do_implement_trait(ce, trait);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1199,7 +1199,7 @@ static int ZEND_FASTCALL ZEND_BIND_TRAITS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_class_entry *ce = Z_CE_P(EX_VAR(opline->op1.var));
SAVE_OPLINE();
- zend_do_bind_traits(ce TSRMLS_CC);
+ zend_do_bind_traits(ce);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1311,7 +1311,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
} while (!do_exit);
}
- zend_vm_stack_free_args(EX(call) TSRMLS_CC);
+ zend_vm_stack_free_args(EX(call));
if (Z_OBJ(call->This)) {
if (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR) {
@@ -1319,13 +1319,13 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
GC_REFCOUNT(Z_OBJ(call->This))--;
}
if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
- zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(call->This));
}
}
OBJ_RELEASE(Z_OBJ(call->This));
}
EX(call) = call->prev_execute_data;
- zend_vm_stack_free_call_frame(call TSRMLS_CC);
+ zend_vm_stack_free_call_frame(call);
call = EX(call);
} while (call);
}
@@ -1359,7 +1359,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
if (in_finally && Z_OBJ_P(fast_call)) {
- zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
Z_OBJ_P(fast_call) = EG(exception);
EG(exception) = NULL;
@@ -1372,7 +1372,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
if (Z_OBJ_P(fast_call)) {
- zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call) TSRMLS_CC);
+ zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
Z_OBJ_P(fast_call) = NULL;
}
}
@@ -1392,7 +1392,7 @@ static int ZEND_FASTCALL ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HA
USE_OPLINE
SAVE_OPLINE();
- zend_verify_abstract_class(Z_CE_P(EX_VAR(opline->op1.var)) TSRMLS_CC);
+ zend_verify_abstract_class(Z_CE_P(EX_VAR(opline->op1.var)));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -1500,10 +1500,10 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
if (EG(exception)) {
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
}
if (IS_CONST == IS_UNUSED) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1515,13 +1515,13 @@ try_class_name:
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
Z_CE_P(EX_VAR(opline->result.var)) = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
} else {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), Z_CE_P(EX_VAR(opline->result.var)));
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
} else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
class_name = Z_REFVAL_P(class_name);
goto try_class_name;
@@ -1556,7 +1556,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
@@ -1589,7 +1589,7 @@ try_function_name:
} else if (IS_CONST != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
- Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object TSRMLS_CC) == SUCCESS) {
+ Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (object) {
GC_REFCOUNT(object)++;
}
@@ -1623,16 +1623,16 @@ try_function_name:
if (Z_TYPE_P(obj) == IS_STRING) {
object = NULL;
- called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0 TSRMLS_CC);
+ called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0);
if (UNEXPECTED(called_scope == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
if (called_scope->get_static_method) {
- fbc = called_scope->get_static_method(called_scope, Z_STR_P(method) TSRMLS_CC);
+ fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
} else {
- fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
@@ -1653,7 +1653,7 @@ try_function_name:
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
- fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method));
}
@@ -1676,7 +1676,7 @@ try_function_name:
ZEND_VM_CONTINUE(); /* Never reached */
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1708,7 +1708,7 @@ static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPC
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
ZEND_VM_NEXT_OPCODE();
}
@@ -1733,7 +1733,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER
EX(call) = zend_vm_stack_push_call_frame_ex(
opline->op1.num, ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
ZEND_VM_NEXT_OPCODE();
}
@@ -1745,11 +1745,11 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
zval *param;
SAVE_OPLINE();
- param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
if (arg_num > EX_NUM_ARGS()) {
ZVAL_COPY_VALUE(param, EX_CONSTANT(opline->op2));
if (Z_OPT_CONSTANT_P(param)) {
- zval_update_constant(param, 0 TSRMLS_CC);
+ zval_update_constant(param, 0);
} else {
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
if (UNEXPECTED(Z_OPT_COPYABLE_P(param))) {
@@ -1759,7 +1759,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zend_verify_arg_type(EX(func), arg_num, param, EX_CONSTANT(opline->op2) TSRMLS_CC);
+ zend_verify_arg_type(EX(func), arg_num, param, EX_CONSTANT(opline->op2));
}
CHECK_EXCEPTION();
@@ -1773,7 +1773,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->op1.opline_num,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
ZEND_VM_JMP(EX(func)->op_array.opcodes + el->brk);
}
@@ -1784,7 +1784,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->op1.opline_num,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
ZEND_VM_JMP(EX(func)->op_array.opcodes + el->cont);
}
@@ -1796,7 +1796,7 @@ static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(EX_CONSTANT(opline->op2)), opline->extended_value,
- &EX(func)->op_array, execute_data TSRMLS_CC);
+ &EX(func)->op_array, execute_data);
brk_opline = EX(func)->op_array.opcodes + el->brk;
@@ -1818,7 +1818,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
iface = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE TSRMLS_CC);
+ iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
if (UNEXPECTED(iface == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1829,7 +1829,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name->val, iface->name->val);
}
- zend_do_implement_interface(ce, iface TSRMLS_CC);
+ zend_do_implement_interface(ce, iface);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -1841,10 +1841,10 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
if (EG(exception)) {
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
}
if (IS_UNUSED == IS_UNUSED) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1856,13 +1856,13 @@ try_class_name:
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
Z_CE_P(EX_VAR(opline->result.var)) = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
} else {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), Z_CE_P(EX_VAR(opline->result.var)));
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
} else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
class_name = Z_REFVAL_P(class_name);
goto try_class_name;
@@ -1884,28 +1884,28 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
if (EG(exception)) {
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
}
if (IS_CV == IS_UNUSED) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
- zval *class_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *class_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
try_class_name:
if (IS_CV == IS_CONST) {
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
Z_CE_P(EX_VAR(opline->result.var)) = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
} else {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), Z_CE_P(EX_VAR(opline->result.var)));
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
} else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
class_name = Z_REFVAL_P(class_name);
goto try_class_name;
@@ -1940,7 +1940,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
@@ -1951,7 +1951,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
zend_object *object;
SAVE_OPLINE();
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
try_function_name:
if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
@@ -1973,7 +1973,7 @@ try_function_name:
} else if (IS_CV != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
- Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object TSRMLS_CC) == SUCCESS) {
+ Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (object) {
GC_REFCOUNT(object)++;
}
@@ -2007,16 +2007,16 @@ try_function_name:
if (Z_TYPE_P(obj) == IS_STRING) {
object = NULL;
- called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0 TSRMLS_CC);
+ called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0);
if (UNEXPECTED(called_scope == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
if (called_scope->get_static_method) {
- fbc = called_scope->get_static_method(called_scope, Z_STR_P(method) TSRMLS_CC);
+ fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
} else {
- fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
@@ -2037,7 +2037,7 @@ try_function_name:
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
- fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method));
}
@@ -2060,7 +2060,7 @@ try_function_name:
ZEND_VM_CONTINUE(); /* Never reached */
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2073,10 +2073,10 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
if (EG(exception)) {
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
}
if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -2088,13 +2088,13 @@ try_class_name:
if (CACHED_PTR(Z_CACHE_SLOT_P(class_name))) {
Z_CE_P(EX_VAR(opline->result.var)) = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
} else {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), Z_CE_P(EX_VAR(opline->result.var)));
}
} else if (Z_TYPE_P(class_name) == IS_OBJECT) {
Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
} else if (Z_TYPE_P(class_name) == IS_STRING) {
- Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value TSRMLS_CC);
+ Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
} else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
class_name = Z_REFVAL_P(class_name);
goto try_class_name;
@@ -2130,7 +2130,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMPVAR_HANDLER(ZEND_OPCOD
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, NULL, NULL, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, NULL, NULL, EX(call));
/*CHECK_EXCEPTION();*/
ZEND_VM_NEXT_OPCODE();
@@ -2164,7 +2164,7 @@ try_function_name:
} else if ((IS_TMP_VAR|IS_VAR) != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
- Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object TSRMLS_CC) == SUCCESS) {
+ Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
if (object) {
GC_REFCOUNT(object)++;
}
@@ -2198,16 +2198,16 @@ try_function_name:
if (Z_TYPE_P(obj) == IS_STRING) {
object = NULL;
- called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0 TSRMLS_CC);
+ called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, 0);
if (UNEXPECTED(called_scope == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
if (called_scope->get_static_method) {
- fbc = called_scope->get_static_method(called_scope, Z_STR_P(method) TSRMLS_CC);
+ fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
} else {
- fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method));
@@ -2228,7 +2228,7 @@ try_function_name:
called_scope = Z_OBJCE_P(obj);
object = Z_OBJ_P(obj);
- fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL TSRMLS_CC);
+ fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method));
}
@@ -2251,7 +2251,7 @@ try_function_name:
ZEND_VM_CONTINUE(); /* Never reached */
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2265,7 +2265,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- EX_CONSTANT(opline->op1) TSRMLS_CC);
+ EX_CONSTANT(opline->op1));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2284,7 +2284,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val));
CHECK_EXCEPTION();
}
@@ -2307,7 +2307,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_write(str->val, str->len);
}
} else {
- zend_string *str = _zval_get_string_func(z TSRMLS_CC);
+ zend_string *str = _zval_get_string_func(z);
if (str->len != 0) {
zend_write(str->val, str->len);
@@ -2348,7 +2348,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline++;
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -2381,7 +2381,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
opline++;
@@ -2414,7 +2414,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -2449,7 +2449,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
@@ -2486,7 +2486,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
ZEND_VM_CONTINUE();
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
@@ -2616,13 +2616,13 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} while (0);
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
if (IS_CONST != IS_TMP_VAR) {
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- zend_throw_exception_object(value TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_throw_exception_object(value);
+ zend_exception_restore();
HANDLE_EXCEPTION();
}
@@ -2679,7 +2679,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val));
CHECK_EXCEPTION();
}
@@ -2698,7 +2698,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -2718,7 +2718,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
object_init_ex(&object_zval, ce);
- constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval) TSRMLS_CC);
+ constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval));
if (constructor == NULL) {
if (EXPECTED(RETURN_VALUE_USED(opline))) {
@@ -2736,7 +2736,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
opline->extended_value,
ce,
Z_OBJ(object_zval),
- EX(call) TSRMLS_CC);
+ EX(call));
if (EXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
@@ -2806,7 +2806,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (EXPECTED(EG(exception) == NULL)) {
- ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
+ ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
@@ -2836,7 +2836,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_DEREF(expr);
}
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
break;
}
}
@@ -2845,7 +2845,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_NULL(result);
break;
case _IS_BOOL:
- ZVAL_BOOL(result, zend_is_true(expr TSRMLS_CC));
+ ZVAL_BOOL(result, zend_is_true(expr));
break;
case IS_LONG:
ZVAL_LONG(result, zval_get_long(expr));
@@ -2939,9 +2939,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
} else {
switch (opline->extended_value) {
@@ -2950,7 +2950,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
if (resolved_path) {
failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
@@ -2959,24 +2959,24 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
if (failure_retval) {
/* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE));
+ zend_destroy_file_handle(&file_handle);
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
failure_retval=1;
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
@@ -2986,12 +2986,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename);
break;
case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code");
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ new_op_array = zend_compile_string(inc_filename, eval_desc);
efree(eval_desc);
}
break;
@@ -3015,27 +3015,27 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
new_op_array->scope = EG(scope); /* ??? */
call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
- (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
+ (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL);
if (EX(symbol_table)) {
call->symbol_table = EX(symbol_table);
} else {
- call->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ call->symbol_table = zend_rebuild_symbol_table();
}
call->prev_execute_data = execute_data;
- i_init_code_execute_data(call, new_op_array, return_value TSRMLS_CC);
+ i_init_code_execute_data(call, new_op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
@@ -3144,7 +3144,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF);
if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
@@ -3157,9 +3157,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ce->name->val);
}
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
}
@@ -3169,7 +3169,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if (iter) {
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -3178,7 +3178,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
HANDLE_EXCEPTION();
}
}
- is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
+ is_empty = iter->funcs->valid(iter) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -3209,7 +3209,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (!ce ||
!p->key ||
- zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS) {
break;
}
pos++;
@@ -3257,7 +3257,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
break;
}
}
- zend_print_variable(ptr TSRMLS_CC);
+ zend_print_variable(ptr);
}
} while (0);
@@ -3281,7 +3281,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
is_ref = 1;
value = Z_REFVAL_P(value);
}
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if (i_zend_is_true(value)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -3387,7 +3387,7 @@ try_strlen:
zval tmp;
ZVAL_COPY(&tmp, value);
- if (parse_arg_object_to_str(&tmp, &str, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (parse_arg_object_to_str(&tmp, &str, IS_STRING) == FAILURE) {
goto strlen_error;
}
ZVAL_LONG(EX_VAR(opline->result.var), str->len);
@@ -3437,7 +3437,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER
break;
case IS_RESOURCE:
if (Z_TYPE_P(value) == opline->extended_value) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
ZVAL_BOOL(EX_VAR(opline->result.var), type_name != NULL);
} else {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -3458,7 +3458,7 @@ static int ZEND_FASTCALL ZEND_DEFINED_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ZVAL_TRUE(EX_VAR(opline->result.var));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0 TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0)) == NULL) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), c);
@@ -3476,7 +3476,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3491,7 +3491,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3506,7 +3506,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3521,7 +3521,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3536,7 +3536,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3551,7 +3551,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3566,7 +3566,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3581,7 +3581,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3596,7 +3596,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3612,7 +3612,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
fast_is_not_identical_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3628,7 +3628,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3644,7 +3644,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_not_equal_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3660,7 +3660,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_smaller_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3676,7 +3676,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3691,7 +3691,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3706,7 +3706,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3721,7 +3721,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3736,7 +3736,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -3771,7 +3771,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -3785,10 +3785,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -3831,7 +3831,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -3874,7 +3874,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -3899,7 +3899,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
CHECK_EXCEPTION();
@@ -3914,7 +3914,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
CHECK_EXCEPTION();
@@ -3929,7 +3929,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -3937,7 +3937,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -3948,7 +3948,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
}
@@ -4007,7 +4007,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -4070,7 +4070,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -4088,7 +4088,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -4103,7 +4103,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -4128,13 +4128,13 @@ static int ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H
try_fetch_list:
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
- zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R TSRMLS_CC);
+ zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R);
ZVAL_COPY(EX_VAR(opline->result.var), value);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT) &&
EXPECTED(Z_OBJ_HT_P(container)->read_dimension)) {
zval *result = EX_VAR(opline->result.var);
- zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result TSRMLS_CC);
+ zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result);
if (retval) {
if (result != retval) {
@@ -4168,7 +4168,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -4203,9 +4203,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -4239,7 +4239,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -4267,7 +4267,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_CONST == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -4288,7 +4288,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
zend_class_entry *called_scope;
zend_object *object;
- if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error TSRMLS_CC)) {
+ if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
}
@@ -4324,7 +4324,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ func, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4339,7 +4339,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4356,7 +4356,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
if (!actual) {
@@ -4400,7 +4400,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
} else if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -4422,7 +4422,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
ZVAL_DEREF(value);
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
- zval_update_constant(value, 1 TSRMLS_CC);
+ zval_update_constant(value, 1);
EG(scope) = EX(func)->op_array.scope;
}
if (IS_CONST == IS_CONST) {
@@ -4607,7 +4607,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -4623,9 +4623,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -4653,7 +4653,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -4674,7 +4674,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -4684,9 +4684,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -4700,7 +4700,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -4773,11 +4773,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -4852,7 +4852,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_HANDLER(Z
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -4878,7 +4878,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
ZVAL_COPY_VALUE(&c.value, val);
if (Z_OPT_CONSTANT(c.value)) {
- zval_update_constant(&c.value, 0 TSRMLS_CC);
+ zval_update_constant(&c.value, 0);
} else {
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
if (UNEXPECTED(Z_OPT_COPYABLE(c.value))) {
@@ -4889,7 +4889,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
c.name = zend_string_dup(Z_STR_P(name), 0);
c.module_number = PHP_USER_CONSTANT;
- if (zend_register_constant(&c TSRMLS_CC) == FAILURE) {
+ if (zend_register_constant(&c) == FAILURE) {
}
@@ -5036,7 +5036,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -5051,7 +5051,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -5067,7 +5067,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -5213,7 +5213,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -5229,7 +5229,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -5264,7 +5264,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -5278,10 +5278,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -5324,7 +5324,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -5367,7 +5367,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -5429,7 +5429,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -5445,9 +5445,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -5475,7 +5475,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -5496,7 +5496,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5506,9 +5506,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -5522,7 +5522,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -5689,7 +5689,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -5703,10 +5703,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -5749,7 +5749,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -5792,7 +5792,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPC
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -5817,7 +5817,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -5825,7 +5825,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -5836,7 +5836,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
}
@@ -5859,7 +5859,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -5894,9 +5894,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -5930,7 +5930,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -5958,7 +5958,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_UNUSED == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -6132,7 +6132,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -6148,9 +6148,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -6178,7 +6178,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -6199,7 +6199,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6209,9 +6209,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -6225,7 +6225,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -6249,9 +6249,9 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
closure_is_static = Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC;
closure_is_being_defined_inside_static_context = EX(func)->common.fn_flags & ZEND_ACC_STATIC;
if (closure_is_static || closure_is_being_defined_inside_static_context) {
- zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL);
} else {
- zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
+ zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL);
}
CHECK_EXCEPTION();
@@ -6397,7 +6397,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6412,7 +6412,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6427,7 +6427,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6442,7 +6442,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6457,7 +6457,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6472,7 +6472,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6487,7 +6487,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6502,7 +6502,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6517,7 +6517,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6533,7 +6533,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
fast_is_not_identical_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6549,7 +6549,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6565,7 +6565,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_not_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6581,7 +6581,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_smaller_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6597,7 +6597,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OP
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6612,7 +6612,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6627,7 +6627,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6642,7 +6642,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6657,7 +6657,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -6672,7 +6672,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
CHECK_EXCEPTION();
@@ -6687,7 +6687,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
CHECK_EXCEPTION();
@@ -6702,7 +6702,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -6710,7 +6710,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -6721,7 +6721,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
}
@@ -6739,7 +6739,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -6780,7 +6780,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -6803,7 +6803,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -6843,7 +6843,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -6861,13 +6861,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = NULL;
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
@@ -6876,7 +6876,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPC
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -6904,7 +6904,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -6928,7 +6928,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
} else if (IS_CV != IS_UNUSED) {
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -6939,9 +6939,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -6975,7 +6975,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -7003,7 +7003,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_CV == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -7017,14 +7017,14 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_
{
USE_OPLINE
- zval *function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zend_fcall_info_cache fcc;
char *error = NULL;
zend_function *func;
zend_class_entry *called_scope;
zend_object *object;
- if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error TSRMLS_CC)) {
+ if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
}
@@ -7060,7 +7060,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ func, opline->extended_value, called_scope, object, EX(call));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -7074,7 +7074,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
/* Check whether an exception has been thrown, if not, jump over code */
- zend_exception_restore(TSRMLS_C);
+ zend_exception_restore();
if (EG(exception) == NULL) {
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
ZEND_VM_CONTINUE(); /* CHECK_ME */
@@ -7082,7 +7082,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), catch_ce);
}
@@ -7095,9 +7095,9 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
#endif /* HAVE_DTRACE */
if (ce != catch_ce) {
- if (!instanceof_function(ce, catch_ce TSRMLS_CC)) {
+ if (!instanceof_function(ce, catch_ce)) {
if (opline->result.num) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
@@ -7126,7 +7126,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -7169,7 +7169,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO
if (IS_CV != IS_UNUSED) {
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zend_string *str;
zend_ulong hval;
@@ -7262,7 +7262,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CV_HANDLER(ZEND_
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
isset_dim_obj_again:
if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -7316,11 +7316,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -7378,7 +7378,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_HANDLER(ZEND
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -7395,7 +7395,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CV_HANDLER(ZEND
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -7490,7 +7490,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
/* Set the new yielded key */
if (IS_CV != IS_UNUSED) {
- zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -7546,7 +7546,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -7561,7 +7561,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7576,7 +7576,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7591,7 +7591,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7606,7 +7606,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7621,7 +7621,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7636,7 +7636,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7651,7 +7651,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7666,7 +7666,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7682,7 +7682,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7698,7 +7698,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
fast_not_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7714,7 +7714,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_smaller_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7730,7 +7730,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVAR_HANDLER(ZEN
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7745,7 +7745,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7760,7 +7760,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7775,7 +7775,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7790,7 +7790,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7805,7 +7805,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7820,7 +7820,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -7835,7 +7835,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -7843,7 +7843,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -7854,7 +7854,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
}
@@ -7913,7 +7913,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -7977,7 +7977,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -7996,7 +7996,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -8011,7 +8011,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_TMPVAR_HANDLER(ZEND
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -8039,7 +8039,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -8074,9 +8074,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -8110,7 +8110,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -8138,7 +8138,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -8159,7 +8159,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPC
zend_class_entry *called_scope;
zend_object *object;
- if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error TSRMLS_CC)) {
+ if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
}
@@ -8195,7 +8195,7 @@ static int ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPC
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- func, opline->extended_value, called_scope, object, EX(call) TSRMLS_CC);
+ func, opline->extended_value, called_scope, object, EX(call));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -8211,7 +8211,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_equal_function(result,
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -8402,11 +8402,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -8482,7 +8482,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_TMPVAR_HANDLER(
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -8503,7 +8503,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
EX_CONSTANT(opline->op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -8626,13 +8626,13 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} while (0);
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
if (IS_TMP_VAR != IS_TMP_VAR) {
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- zend_throw_exception_object(value TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_throw_exception_object(value);
+ zend_exception_restore();
HANDLE_EXCEPTION();
}
@@ -8696,7 +8696,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_DEREF(expr);
}
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
break;
}
}
@@ -8705,7 +8705,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_NULL(result);
break;
case _IS_BOOL:
- ZVAL_BOOL(result, zend_is_true(expr TSRMLS_CC));
+ ZVAL_BOOL(result, zend_is_true(expr));
break;
case IS_LONG:
ZVAL_LONG(result, zval_get_long(expr));
@@ -8879,7 +8879,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF);
if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
@@ -8892,9 +8892,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ce->name->val);
}
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
}
@@ -8904,7 +8904,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (iter) {
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -8913,7 +8913,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
HANDLE_EXCEPTION();
}
}
- is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
+ is_empty = iter->funcs->valid(iter) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -8944,7 +8944,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (!ce ||
!p->key ||
- zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS) {
break;
}
pos++;
@@ -8996,7 +8996,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
is_ref = 1;
value = Z_REFVAL_P(value);
}
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if (i_zend_is_true(value)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_TMP_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -9110,7 +9110,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
break;
case IS_RESOURCE:
if (Z_TYPE_P(value) == opline->extended_value) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
ZVAL_BOOL(EX_VAR(opline->result.var), type_name != NULL);
} else {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -9131,7 +9131,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -9147,7 +9147,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -9162,7 +9162,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -9170,7 +9170,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -9181,7 +9181,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
zval_ptr_dtor_nogc(free_op1);
}
@@ -9240,7 +9240,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -9258,7 +9258,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -9273,7 +9273,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OP
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -9582,7 +9582,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -9598,7 +9598,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -9744,7 +9744,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -9760,7 +9760,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -9906,7 +9906,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -9914,7 +9914,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -9925,7 +9925,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_O
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
zval_ptr_dtor_nogc(free_op1);
}
@@ -10191,7 +10191,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -10207,7 +10207,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -10222,7 +10222,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -10230,7 +10230,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -10241,7 +10241,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
zval_ptr_dtor_nogc(free_op1);
}
@@ -10259,7 +10259,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -10300,7 +10300,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -10318,13 +10318,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = NULL;
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
@@ -10333,7 +10333,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCOD
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -10356,7 +10356,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_TMP_VAR == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -10364,7 +10364,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A
}
if (Z_TYPE_P(var) != IS_STRING) {
- use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(var, &var_copy);
if (use_copy) {
var = &var_copy;
@@ -10423,7 +10423,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE
if (IS_CV != IS_UNUSED) {
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zend_string *str;
zend_ulong hval;
@@ -10588,7 +10588,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Set the new yielded key */
if (IS_CV != IS_UNUSED) {
- zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -10644,7 +10644,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_O
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -10652,7 +10652,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_O
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -10663,7 +10663,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_O
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
}
@@ -10722,7 +10722,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -10741,7 +10741,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_O
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -10756,7 +10756,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TMPVAR_HANDLER(ZEND_O
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -10787,7 +10787,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
}
if (Z_TYPE_P(var) != IS_STRING) {
- use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(var, &var_copy);
if (use_copy) {
var = &var_copy;
@@ -11204,13 +11204,13 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} while (0);
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
if (IS_VAR != IS_TMP_VAR) {
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- zend_throw_exception_object(value TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_throw_exception_object(value);
+ zend_exception_restore();
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
@@ -11420,7 +11420,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -11440,7 +11440,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
object_init_ex(&object_zval, ce);
- constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval) TSRMLS_CC);
+ constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval));
if (constructor == NULL) {
if (EXPECTED(RETURN_VALUE_USED(opline))) {
@@ -11458,7 +11458,7 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
opline->extended_value,
ce,
Z_OBJ(object_zval),
- EX(call) TSRMLS_CC);
+ EX(call));
if (EXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
@@ -11492,7 +11492,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_DEREF(expr);
}
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
break;
}
}
@@ -11501,7 +11501,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_NULL(result);
break;
case _IS_BOOL:
- ZVAL_BOOL(result, zend_is_true(expr TSRMLS_CC));
+ ZVAL_BOOL(result, zend_is_true(expr));
break;
case IS_LONG:
ZVAL_LONG(result, zval_get_long(expr));
@@ -11676,7 +11676,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF);
if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
zval_ptr_dtor_nogc(free_op1);
@@ -11689,9 +11689,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
}
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ce->name->val);
}
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
}
@@ -11701,7 +11701,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (iter) {
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -11710,7 +11710,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
HANDLE_EXCEPTION();
}
}
- is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
+ is_empty = iter->funcs->valid(iter) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -11741,7 +11741,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (!ce ||
!p->key ||
- zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS) {
break;
}
pos++;
@@ -11868,7 +11868,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) {
zend_object_iterator *iter;
- if ((iter = zend_iterator_unwrap(array TSRMLS_CC)) == NULL) {
+ if ((iter = zend_iterator_unwrap(array)) == NULL) {
/* plain object */
zend_object *zobj = Z_OBJ_P(array);
@@ -11921,7 +11921,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_LONG(EX_VAR((opline+1)->result.var), p->h);
}
break;
- } else if (zend_check_property_access(zobj, p->key TSRMLS_CC) == SUCCESS) {
+ } else if (zend_check_property_access(zobj, p->key) == SUCCESS) {
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (p->key->val[0]) {
ZVAL_STR_COPY(EX_VAR((opline+1)->result.var), p->key);
@@ -11956,7 +11956,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
(Z_TYPE(p->val) == IS_INDIRECT &&
Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) ||
(EXPECTED(p->key != NULL) &&
- zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE));
+ zend_check_property_access(zobj, p->key) == FAILURE));
fe_ht->nInternalPointer = ptr->pos = pos;
ptr->h = fe_ht->arData[pos].h;
ptr->key = fe_ht->arData[pos].key;
@@ -11967,14 +11967,14 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (iter && ++iter->index > 0) {
/* This could cause an endless loop if index becomes zero again.
* In case that ever happens we need an additional flag. */
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
}
}
/* If index is zero we come from FE_RESET and checked valid() already. */
- if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
+ if (!iter || (iter->index > 0 && iter->funcs->valid(iter) == FAILURE)) {
/* reached end of iteration */
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
@@ -11982,7 +11982,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
- value = iter->funcs->get_current_data(iter TSRMLS_CC);
+ value = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
@@ -12000,7 +12000,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (opline->extended_value & ZEND_FE_FETCH_WITH_KEY) {
if (iter->funcs->get_current_key) {
- iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var) TSRMLS_CC);
+ iter->funcs->get_current_key(iter, EX_VAR((opline+1)->result.var));
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
HANDLE_EXCEPTION();
@@ -12032,7 +12032,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
is_ref = 1;
value = Z_REFVAL_P(value);
}
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if (i_zend_is_true(value)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_VAR == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -12146,7 +12146,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
break;
case IS_RESOURCE:
if (Z_TYPE_P(value) == opline->extended_value) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
ZVAL_BOOL(EX_VAR(opline->result.var), type_name != NULL);
} else {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -12167,7 +12167,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -12183,14 +12183,14 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
@@ -12207,7 +12207,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -12218,12 +12218,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -12232,20 +12232,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -12266,7 +12266,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
@@ -12289,13 +12289,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
#if 0 || (IS_CONST != IS_UNUSED)
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -12312,7 +12312,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -12327,7 +12327,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CONST(int (*b
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
@@ -12350,7 +12350,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -12602,7 +12602,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -12614,7 +12614,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -12627,14 +12627,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -12644,7 +12644,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -12690,7 +12690,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -12700,7 +12700,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -12710,15 +12710,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -12726,7 +12726,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -12763,7 +12763,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -12785,7 +12785,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -12803,7 +12803,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -12811,7 +12811,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -12822,7 +12822,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
zval_ptr_dtor_nogc(free_op1);
}
@@ -12842,7 +12842,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -12903,7 +12903,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -12931,7 +12931,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -12955,7 +12955,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -12970,7 +12970,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -12985,7 +12985,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -13011,7 +13011,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -13035,7 +13035,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
@@ -13066,7 +13066,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = EX_CONSTANT(opline->op2);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CONST);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -13077,7 +13077,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -13089,17 +13089,17 @@ try_assign_dim_array:
zval *property_name = EX_CONSTANT(opline->op2);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = EX_CONSTANT(opline->op2);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -13133,7 +13133,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -13161,7 +13161,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -13196,9 +13196,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -13232,7 +13232,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -13260,7 +13260,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_CONST == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -13281,7 +13281,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
if (!actual) {
@@ -13325,7 +13325,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
} else if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -13347,7 +13347,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
ZVAL_DEREF(value);
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
- zval_update_constant(value, 1 TSRMLS_CC);
+ zval_update_constant(value, 1);
EG(scope) = EX(func)->op_array.scope;
}
if (IS_VAR == IS_CONST) {
@@ -13526,7 +13526,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -13559,7 +13559,7 @@ num_index_dim:
//??? if (IS_CONST == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_VAR != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -13601,7 +13601,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -13757,7 +13757,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -13773,7 +13773,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -13799,7 +13799,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -13952,7 +13952,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -13968,7 +13968,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -13994,7 +13994,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_VAR);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -14053,7 +14053,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
(IS_VAR == IS_VAR && UNEXPECTED(value_ptr == &EG(error_zval)))) {
variable_ptr = &EG(uninitialized_zval);
} else {
- zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value_ptr);
}
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
@@ -14205,7 +14205,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZEND_VM_RETURN();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
@@ -14228,13 +14228,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
#if 0 || (IS_UNUSED != IS_UNUSED)
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -14251,7 +14251,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_UNUSED(int (*
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -14498,7 +14498,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -14520,7 +14520,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -14538,7 +14538,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -14546,7 +14546,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -14557,7 +14557,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
zval_ptr_dtor_nogc(free_op1);
}
@@ -14587,7 +14587,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = NULL;
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_UNUSED);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -14598,7 +14598,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -14610,17 +14610,17 @@ try_assign_dim_array:
zval *property_name = NULL;
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = NULL;
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -14650,7 +14650,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -14685,9 +14685,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -14721,7 +14721,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -14749,7 +14749,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_UNUSED == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -15036,7 +15036,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -15052,19 +15052,19 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
zval *object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
- zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zval *value;
zval *zptr;
@@ -15076,7 +15076,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -15087,12 +15087,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -15101,20 +15101,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -15135,7 +15135,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op_data1;
@@ -15148,7 +15148,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
@@ -15158,13 +15158,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
#if 0 || (IS_CV != IS_UNUSED)
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -15181,7 +15181,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -15196,7 +15196,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_CV(int (*bina
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
@@ -15204,7 +15204,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
@@ -15219,7 +15219,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -15462,7 +15462,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
SAVE_OPLINE();
object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -15471,7 +15471,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -15483,7 +15483,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -15496,14 +15496,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -15513,7 +15513,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -15550,7 +15550,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
SAVE_OPLINE();
object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -15559,7 +15559,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -15569,7 +15569,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -15579,15 +15579,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -15595,7 +15595,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -15632,7 +15632,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15654,7 +15654,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15672,7 +15672,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -15680,7 +15680,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -15691,7 +15691,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
zval_ptr_dtor_nogc(free_op1);
}
@@ -15711,7 +15711,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15731,7 +15731,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -15772,7 +15772,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -15793,14 +15793,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15818,13 +15818,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15839,13 +15839,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
@@ -15854,7 +15854,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15875,12 +15875,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -15899,12 +15899,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
- property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
@@ -15934,8 +15934,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CV TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CV);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -15946,7 +15946,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -15956,19 +15956,19 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -15991,7 +15991,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var);
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1);
if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
@@ -16002,7 +16002,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_CV);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -16023,7 +16023,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *value_ptr;
SAVE_OPLINE();
- value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC);
+ value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
@@ -16060,7 +16060,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
(IS_CV == IS_VAR && UNEXPECTED(value_ptr == &EG(error_zval)))) {
variable_ptr = &EG(uninitialized_zval);
} else {
- zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value_ptr);
}
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
@@ -16094,7 +16094,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -16118,7 +16118,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
} else if (IS_CV != IS_UNUSED) {
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -16129,9 +16129,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -16165,7 +16165,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -16193,7 +16193,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if (IS_CV == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -16240,7 +16240,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE
if (IS_CV != IS_UNUSED) {
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zend_string *str;
zend_ulong hval;
@@ -16335,7 +16335,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
unset_dim_again:
if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -16361,7 +16361,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -16394,7 +16394,7 @@ num_index_dim:
//??? if (IS_CV == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_VAR != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -16422,7 +16422,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -16436,7 +16436,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -16531,7 +16531,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* Set the new yielded key */
if (IS_CV != IS_UNUSED) {
- zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -16584,7 +16584,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_POW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
return zend_binary_assign_op_helper_SPEC_VAR_CV(pow_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
@@ -16601,7 +16601,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -16612,12 +16612,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -16626,20 +16626,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -16660,7 +16660,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op2, free_op_data1;
@@ -16683,13 +16683,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMPVAR(int (*
#if 0 || ((IS_TMP_VAR|IS_VAR) != IS_UNUSED)
if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR));
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -16706,7 +16706,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMPVAR(int (*
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -16722,7 +16722,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_VAR_TMPVAR(int (*
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1, free_op2;
@@ -16745,7 +16745,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMPVAR(int (*bina
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -16998,7 +16998,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMPVAR(incdec_
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -17010,7 +17010,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMPVAR(incdec_
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -17023,14 +17023,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMPVAR(incdec_
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -17040,7 +17040,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMPVAR(incdec_
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -17087,7 +17087,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMPVAR(incdec
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -17097,7 +17097,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMPVAR(incdec
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -17107,15 +17107,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMPVAR(incdec
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -17123,7 +17123,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMPVAR(incdec
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -17161,7 +17161,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_H
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17183,7 +17183,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17201,7 +17201,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_O
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
@@ -17209,7 +17209,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_O
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -17220,7 +17220,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_O
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
}
@@ -17240,7 +17240,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCO
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17301,7 +17301,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -17330,7 +17330,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17354,7 +17354,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17369,7 +17369,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_O
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -17384,7 +17384,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMPVAR_HANDLER(ZEND_O
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17410,7 +17410,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCO
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
zval_ptr_dtor_nogc(free_op2);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -17434,7 +17434,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HA
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
zval_ptr_dtor_nogc(free_op2);
if (free_op1) {zval_ptr_dtor_nogc(free_op1);};
/* assign_obj has two opcodes! */
@@ -17465,7 +17465,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -17476,7 +17476,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -17488,17 +17488,17 @@ try_assign_dim_array:
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
zval_ptr_dtor_nogc(free_op2);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -17528,7 +17528,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(Z
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -17563,9 +17563,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(Z
}
if (ce->get_static_method) {
- fbc = ce->get_static_method(ce, Z_STR_P(function_name) TSRMLS_CC);
+ fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name));
@@ -17599,7 +17599,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(Z
GC_REFCOUNT(object)++;
}
if (!object ||
- !instanceof_function(object->ce, ce TSRMLS_CC)) {
+ !instanceof_function(object->ce, ce)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
@@ -17627,7 +17627,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMPVAR_HANDLER(Z
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, ce, object, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, ce, object, EX(call));
if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
EX(call)->return_value = NULL;
@@ -17795,7 +17795,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -17828,7 +17828,7 @@ num_index_dim:
//??? if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
zval_ptr_dtor_nogc(free_op2);
} else if (IS_VAR != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -17870,7 +17870,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HAN
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -17943,7 +17943,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (EXPECTED(EG(exception) == NULL)) {
- ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
+ ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
@@ -17974,7 +17974,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS
break;
}
}
- zend_print_variable(ptr TSRMLS_CC);
+ zend_print_variable(ptr);
}
} while (0);
@@ -17984,7 +17984,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -18001,7 +18001,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -18012,12 +18012,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -18026,20 +18026,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -18059,7 +18059,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -18082,13 +18082,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int
#if 0 || (IS_CONST != IS_UNUSED)
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -18105,7 +18105,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -18360,7 +18360,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -18372,7 +18372,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -18385,14 +18385,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18402,7 +18402,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -18448,7 +18448,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -18458,7 +18458,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -18468,15 +18468,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -18484,7 +18484,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -18560,7 +18560,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -18588,7 +18588,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18612,7 +18612,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18672,7 +18672,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -18690,7 +18690,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
@@ -18705,7 +18705,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18731,7 +18731,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18755,7 +18755,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
/* assign_obj has two opcodes! */
@@ -18891,7 +18891,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -18910,7 +18910,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
CHECK_EXCEPTION();
@@ -18928,7 +18928,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value TSRMLS_CC)) == NULL) {
+ } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
if (!actual) {
@@ -18972,7 +18972,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
} else if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
@@ -18994,7 +18994,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
ZVAL_DEREF(value);
if (Z_CONSTANT_P(value)) {
EG(scope) = ce;
- zval_update_constant(value, 1 TSRMLS_CC);
+ zval_update_constant(value, 1);
EG(scope) = EX(func)->op_array.scope;
}
if (IS_UNUSED == IS_CONST) {
@@ -19085,7 +19085,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -19118,7 +19118,7 @@ num_index_dim:
//??? if (IS_CONST == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_UNUSED != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -19160,7 +19160,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -19236,11 +19236,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -19315,7 +19315,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -19720,7 +19720,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_RETURN();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -19743,13 +19743,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int
#if 0 || (IS_UNUSED != IS_UNUSED)
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -19766,7 +19766,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -20163,12 +20163,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_RETURN();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
zval *object = _get_obj_zval_ptr_unused(execute_data);
- zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zval *value;
zval *zptr;
@@ -20180,7 +20180,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -20191,12 +20191,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -20205,20 +20205,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -20238,7 +20238,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -20251,7 +20251,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
@@ -20261,13 +20261,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
#if 0 || (IS_CV != IS_UNUSED)
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -20284,7 +20284,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -20530,7 +20530,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
SAVE_OPLINE();
object = _get_obj_zval_ptr_unused(execute_data);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -20539,7 +20539,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -20551,7 +20551,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -20564,14 +20564,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20581,7 +20581,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -20618,7 +20618,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
SAVE_OPLINE();
object = _get_obj_zval_ptr_unused(execute_data);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -20627,7 +20627,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -20637,7 +20637,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -20647,15 +20647,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -20663,7 +20663,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -20698,7 +20698,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(execute_data);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -20739,7 +20739,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -20760,14 +20760,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -20785,13 +20785,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -20811,7 +20811,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(execute_data);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -20851,7 +20851,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -20869,13 +20869,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
container = _get_obj_zval_ptr_unused(execute_data);
if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
@@ -20884,7 +20884,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -20905,12 +20905,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(execute_data);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -20929,12 +20929,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
object = _get_obj_zval_ptr_unused(execute_data);
- property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
/* assign_obj has two opcodes! */
@@ -20953,7 +20953,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
int use_copy = 0;
SAVE_OPLINE();
- var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED == IS_UNUSED) {
/* Initialize for erealloc in add_string_to_string */
@@ -20961,7 +20961,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
}
if (Z_TYPE_P(var) != IS_STRING) {
- use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(var, &var_copy);
if (use_copy) {
var = &var_copy;
@@ -20995,7 +20995,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
SAVE_OPLINE();
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -21072,7 +21072,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -21091,7 +21091,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
CHECK_EXCEPTION();
@@ -21142,7 +21142,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
unset_dim_again:
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -21168,7 +21168,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -21201,7 +21201,7 @@ num_index_dim:
//??? if (IS_CV == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_UNUSED != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -21229,7 +21229,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -21243,7 +21243,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -21265,7 +21265,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(execute_data);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
isset_dim_obj_again:
if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -21319,11 +21319,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -21381,7 +21381,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEN
SAVE_OPLINE();
container = _get_obj_zval_ptr_unused(execute_data);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -21398,7 +21398,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEN
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -21493,7 +21493,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
/* Set the new yielded key */
if (IS_CV != IS_UNUSED) {
- zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -21541,7 +21541,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_RETURN();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op2, free_op_data1;
@@ -21558,7 +21558,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -21569,12 +21569,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -21583,20 +21583,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -21616,7 +21616,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op2, free_op_data1;
@@ -21639,13 +21639,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMPVAR(int
#if 0 || ((IS_TMP_VAR|IS_VAR) != IS_UNUSED)
if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR));
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -21662,7 +21662,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMPVAR(int
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -21918,7 +21918,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMPVAR(incd
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -21930,7 +21930,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMPVAR(incd
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -21943,14 +21943,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMPVAR(incd
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -21960,7 +21960,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMPVAR(incd
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -22007,7 +22007,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMPVAR(inc
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -22017,7 +22017,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMPVAR(inc
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -22027,15 +22027,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMPVAR(inc
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -22043,7 +22043,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMPVAR(inc
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -22120,7 +22120,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -22149,7 +22149,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -22173,7 +22173,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCO
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
zval_ptr_dtor_nogc(free_op2);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -22233,7 +22233,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -22252,7 +22252,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER(ZEN
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
@@ -22267,7 +22267,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMPVAR_HANDLER(ZEN
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -22293,7 +22293,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_O
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
zval_ptr_dtor_nogc(free_op2);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -22317,7 +22317,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
@@ -22344,7 +22344,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HA
}
if (Z_TYPE_P(var) != IS_STRING) {
- use_copy = zend_make_printable_zval(var, &var_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(var, &var_copy);
if (use_copy) {
var = &var_copy;
@@ -22456,7 +22456,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -22475,7 +22475,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
zval_ptr_dtor_nogc(free_op2);
@@ -22553,7 +22553,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -22586,7 +22586,7 @@ num_index_dim:
//??? if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
zval_ptr_dtor_nogc(free_op2);
} else if (IS_UNUSED != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -22628,7 +22628,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -22705,11 +22705,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -22785,7 +22785,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMPVAR_HANDLER
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -22805,7 +22805,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -22818,13 +22818,13 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val));
CHECK_EXCEPTION();
}
@@ -22838,7 +22838,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -22880,7 +22880,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -22922,7 +22922,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -22957,7 +22957,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *var_ptr;
SAVE_OPLINE();
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
@@ -22992,7 +22992,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *z;
SAVE_OPLINE();
- z = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ z = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(z) == IS_STRING) {
zend_string *str = Z_STR_P(z);
@@ -23001,7 +23001,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_write(str->val, str->len);
}
} else {
- zend_string *str = _zval_get_string_func(z TSRMLS_CC);
+ zend_string *str = _zval_get_string_func(z);
if (str->len != 0) {
zend_write(str->val, str->len);
@@ -23028,7 +23028,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZEND_VM_SET_OPCODE(opline + 1);
@@ -23042,7 +23042,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline++;
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -23061,7 +23061,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
@@ -23075,7 +23075,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
opline++;
@@ -23094,7 +23094,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (EXPECTED(Z_TYPE_P(val) == IS_TRUE)) {
ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
@@ -23108,7 +23108,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -23127,7 +23127,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
@@ -23143,7 +23143,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
@@ -23165,7 +23165,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *val;
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
@@ -23180,7 +23180,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_CONTINUE();
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
@@ -23201,7 +23201,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
- retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (!EX(return_value)) {
@@ -23240,7 +23240,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
- retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (!EX(return_value)) {
if (IS_CV == IS_TMP_VAR) {
@@ -23255,7 +23255,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
break;
}
- retval_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ retval_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
@@ -23293,7 +23293,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (IS_CV == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
@@ -23310,13 +23310,13 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} while (0);
- zend_exception_save(TSRMLS_C);
+ zend_exception_save();
if (IS_CV != IS_TMP_VAR) {
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
- zend_throw_exception_object(value TSRMLS_CC);
- zend_exception_restore(TSRMLS_C);
+ zend_throw_exception_object(value);
+ zend_exception_restore();
HANDLE_EXCEPTION();
}
@@ -23327,7 +23327,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *varptr, *arg;
- varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -23355,7 +23355,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
}
}
- varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
(Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) &&
(Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
@@ -23386,7 +23386,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval *varptr, *arg;
SAVE_OPLINE();
- varptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ varptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(varptr == NULL)) {
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
@@ -23422,7 +23422,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
- varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
if (Z_ISREF_P(varptr)) {
ZVAL_COPY(arg, Z_REFVAL_P(varptr));
@@ -23442,7 +23442,7 @@ static int ZEND_FASTCALL ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *arg, *param, tmp;
- arg = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ arg = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
@@ -23518,13 +23518,13 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
- val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (Z_TYPE_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val));
CHECK_EXCEPTION();
}
@@ -23541,7 +23541,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_object_clone_obj_t clone_call;
SAVE_OPLINE();
- obj = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ obj = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (IS_CV == IS_CONST ||
@@ -23587,7 +23587,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (EXPECTED(EG(exception) == NULL)) {
- ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
+ ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
@@ -23605,7 +23605,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *result = EX_VAR(opline->result.var);
SAVE_OPLINE();
- expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
switch (opline->extended_value) {
case IS_NULL:
@@ -23617,7 +23617,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_DEREF(expr);
}
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
- if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
break;
}
}
@@ -23626,7 +23626,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZVAL_NULL(result);
break;
case _IS_BOOL:
- ZVAL_BOOL(result, zend_is_true(expr TSRMLS_CC));
+ ZVAL_BOOL(result, zend_is_true(expr));
break;
case IS_LONG:
ZVAL_LONG(result, zval_get_long(expr));
@@ -23710,7 +23710,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
zend_bool failure_retval=0;
SAVE_OPLINE();
- inc_filename = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ inc_filename = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
@@ -23720,9 +23720,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
} else {
switch (opline->extended_value) {
@@ -23731,7 +23731,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
if (resolved_path) {
failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
@@ -23740,24 +23740,24 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if (failure_retval) {
/* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE));
+ zend_destroy_file_handle(&file_handle);
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
failure_retval=1;
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
@@ -23767,12 +23767,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename);
break;
case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code");
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ new_op_array = zend_compile_string(inc_filename, eval_desc);
efree(eval_desc);
}
break;
@@ -23796,27 +23796,27 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
new_op_array->scope = EG(scope); /* ??? */
call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
- (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
+ (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL);
if (EX(symbol_table)) {
call->symbol_table = EX(symbol_table);
} else {
- call->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ call->symbol_table = zend_rebuild_symbol_table();
}
call->prev_execute_data = execute_data;
- i_init_code_execute_data(call, new_op_array, return_value TSRMLS_CC);
+ i_init_code_execute_data(call, new_op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
@@ -23840,7 +23840,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
- array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_DEREF(array_ptr);
if (Z_TYPE_P(array_ptr) == IS_ARRAY) {
SEPARATE_ARRAY(array_ptr);
@@ -23859,7 +23859,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref);
}
} else {
- array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ array_ptr = array_ref = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV & (IS_VAR|IS_CV)) {
ZVAL_DEREF(array_ptr);
}
@@ -23925,7 +23925,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_FETCH_BYREF);
if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_FETCH_BYREF)) {
@@ -23938,9 +23938,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (!EG(exception)) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name->val);
+ zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ce->name->val);
}
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
}
@@ -23950,7 +23950,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (iter) {
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -23959,7 +23959,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
HANDLE_EXCEPTION();
}
}
- is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
+ is_empty = iter->funcs->valid(iter) != SUCCESS;
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor(array_ref);
if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_FETCH_BYREF) {
@@ -23990,7 +23990,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (!ce ||
!p->key ||
- zend_check_property_access(Z_OBJ_P(array_ptr), p->key TSRMLS_CC) == SUCCESS) {
+ zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS) {
break;
}
pos++;
@@ -24025,7 +24025,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (IS_CV != IS_UNUSED) {
- zval *ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (Z_TYPE_P(ptr) == IS_LONG) {
@@ -24038,7 +24038,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
break;
}
}
- zend_print_variable(ptr TSRMLS_CC);
+ zend_print_variable(ptr);
}
} while (0);
@@ -24056,13 +24056,13 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
value = Z_REFVAL_P(value);
}
- if (i_zend_is_true(value TSRMLS_CC)) {
+ if (i_zend_is_true(value)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (IS_CV == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
@@ -24089,7 +24089,7 @@ static int ZEND_FASTCALL ZEND_COALESCE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
int is_ref = 0;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) {
is_ref = 1;
@@ -24122,7 +24122,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if ((IS_CV == IS_VAR || IS_CV == IS_CV) && Z_ISREF_P(value)) {
ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
@@ -24147,7 +24147,7 @@ static int ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
try_strlen:
if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value));
@@ -24168,7 +24168,7 @@ try_strlen:
zval tmp;
ZVAL_COPY(&tmp, value);
- if (parse_arg_object_to_str(&tmp, &str, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (parse_arg_object_to_str(&tmp, &str, IS_STRING) == FAILURE) {
goto strlen_error;
}
ZVAL_LONG(EX_VAR(opline->result.var), str->len);
@@ -24191,7 +24191,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
- value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var);
switch (opline->extended_value) {
case IS_NULL:
case IS_LONG:
@@ -24218,7 +24218,7 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
break;
case IS_RESOURCE:
if (Z_TYPE_P(value) == opline->extended_value) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
ZVAL_BOOL(EX_VAR(opline->result.var), type_name != NULL);
} else {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -24238,8 +24238,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24253,8 +24253,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24268,8 +24268,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24283,8 +24283,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24298,8 +24298,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24313,8 +24313,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24328,8 +24328,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24343,8 +24343,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24358,8 +24358,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24374,8 +24374,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24390,8 +24390,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24406,8 +24406,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24422,8 +24422,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24438,8 +24438,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24453,8 +24453,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24468,8 +24468,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24483,8 +24483,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -24498,19 +24498,19 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
- zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
zval *property = EX_CONSTANT(opline->op2);
zval *value;
zval *zptr;
@@ -24523,7 +24523,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -24534,12 +24534,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -24548,20 +24548,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -24581,7 +24581,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -24589,7 +24589,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
zval *value, *container, *dim;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -24604,13 +24604,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
#if 0 || (IS_CONST != IS_UNUSED)
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CONST);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -24627,7 +24627,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -24642,7 +24642,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CONST(int (*bi
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -24651,7 +24651,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary
SAVE_OPLINE();
value = EX_CONSTANT(opline->op2);
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -24665,7 +24665,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -24907,7 +24907,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
property = EX_CONSTANT(opline->op2);
retval = EX_VAR(opline->result.var);
@@ -24917,7 +24917,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -24929,7 +24929,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -24942,14 +24942,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -24959,7 +24959,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -24995,7 +24995,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
property = EX_CONSTANT(opline->op2);
retval = EX_VAR(opline->result.var);
@@ -25005,7 +25005,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -25015,7 +25015,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -25025,15 +25025,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -25041,7 +25041,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -25076,7 +25076,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_CONST) {
name = Z_STR_P(varname);
@@ -25094,7 +25094,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -25108,10 +25108,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -25154,7 +25154,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -25197,7 +25197,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -25221,8 +25221,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
CHECK_EXCEPTION();
@@ -25236,12 +25236,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25258,12 +25258,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25280,8 +25280,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
CHECK_EXCEPTION();
@@ -25296,15 +25296,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -25314,8 +25314,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
if (IS_CONST == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
}
@@ -25330,12 +25330,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25354,7 +25354,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
offset = EX_CONSTANT(opline->op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -25396,7 +25396,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -25419,12 +25419,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
property = EX_CONSTANT(opline->op2);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25443,12 +25443,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
property = EX_CONSTANT(opline->op2);
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25467,7 +25467,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = EX_CONSTANT(opline->op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -25508,7 +25508,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -25526,14 +25526,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
property = EX_CONSTANT(opline->op2);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -25541,7 +25541,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25561,13 +25561,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
property = EX_CONSTANT(opline->op2);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -25584,18 +25584,18 @@ static int ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
try_fetch_list:
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
- zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R TSRMLS_CC);
+ zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R);
ZVAL_COPY(EX_VAR(opline->result.var), value);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT) &&
EXPECTED(Z_OBJ_HT_P(container)->read_dimension)) {
zval *result = EX_VAR(opline->result.var);
- zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result TSRMLS_CC);
+ zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result);
if (retval) {
if (result != retval) {
@@ -25622,13 +25622,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
property_name = EX_CONSTANT(opline->op2);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
/* assign_obj has two opcodes! */
@@ -25649,7 +25649,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
zval *dim;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -25659,7 +25659,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = EX_CONSTANT(opline->op2);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CONST);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -25670,7 +25670,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -25682,17 +25682,17 @@ try_assign_dim_array:
zval *property_name = EX_CONSTANT(opline->op2);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = EX_CONSTANT(opline->op2);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -25716,7 +25716,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
value = EX_CONSTANT(opline->op2);
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_CONST == IS_TMP_VAR) {
@@ -25726,7 +25726,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_CONST TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -25761,7 +25761,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -25828,7 +25828,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -25847,7 +25847,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
CHECK_EXCEPTION();
@@ -25862,8 +25862,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -25878,7 +25878,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO
SAVE_OPLINE();
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
@@ -25886,7 +25886,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -26018,7 +26018,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -26033,7 +26033,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -26049,9 +26049,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -26072,7 +26072,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
@@ -26102,7 +26102,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -26135,7 +26135,7 @@ num_index_dim:
//??? if (IS_CONST == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_CV != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -26159,7 +26159,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
@@ -26177,7 +26177,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -26204,13 +26204,13 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
} else {
- zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -26225,7 +26225,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26235,9 +26235,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -26251,7 +26251,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -26269,7 +26269,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = EX_CONSTANT(opline->op2);
isset_dim_obj_again:
@@ -26324,11 +26324,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -26385,7 +26385,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = EX_CONSTANT(opline->op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -26403,7 +26403,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -26423,7 +26423,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
try_instanceof:
if (Z_TYPE_P(expr) == IS_OBJECT) {
@@ -26433,7 +26433,7 @@ try_instanceof:
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -26445,7 +26445,7 @@ try_instanceof:
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- result = instanceof_function(Z_OBJCE_P(expr), ce TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), ce);
} else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) {
expr = Z_REFVAL_P(expr);
goto try_instanceof;
@@ -26487,7 +26487,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -26496,7 +26496,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -26516,7 +26516,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
} else {
- zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -26596,8 +26596,8 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
@@ -26658,8 +26658,8 @@ check_indirect:
}
}
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- zend_assign_to_variable_reference(variable_ptr, value TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
+ zend_assign_to_variable_reference(variable_ptr, value);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -26672,8 +26672,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -26688,8 +26688,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -26705,7 +26705,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_TMP_VAR == IS_TMP_VAR) {
@@ -26715,7 +26715,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -26757,7 +26757,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -26766,7 +26766,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -26786,7 +26786,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -26866,8 +26866,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -26882,8 +26882,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -26900,7 +26900,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_CONST) {
name = Z_STR_P(varname);
@@ -26918,7 +26918,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -26932,10 +26932,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -26978,7 +26978,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -27021,7 +27021,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HA
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -27047,7 +27047,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
value = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_VAR == IS_TMP_VAR) {
@@ -27057,7 +27057,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_VAR TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_VAR);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -27103,7 +27103,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
}
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
@@ -27116,7 +27116,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
(IS_VAR == IS_VAR && UNEXPECTED(value_ptr == &EG(error_zval)))) {
variable_ptr = &EG(uninitialized_zval);
} else {
- zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value_ptr);
}
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
@@ -27165,7 +27165,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -27180,7 +27180,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -27196,9 +27196,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -27226,13 +27226,13 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
} else {
- zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -27247,7 +27247,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -27257,9 +27257,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -27273,7 +27273,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -27289,7 +27289,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_bool result;
SAVE_OPLINE();
- expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
try_instanceof:
if (Z_TYPE_P(expr) == IS_OBJECT) {
@@ -27299,7 +27299,7 @@ try_instanceof:
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
@@ -27311,7 +27311,7 @@ try_instanceof:
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- result = instanceof_function(Z_OBJCE_P(expr), ce TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), ce);
} else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) {
expr = Z_REFVAL_P(expr);
goto try_instanceof;
@@ -27353,7 +27353,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -27362,7 +27362,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -27382,7 +27382,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -27455,7 +27455,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_RETURN();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -27463,7 +27463,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b
zval *value, *container, *dim;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -27478,13 +27478,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b
#if 0 || (IS_UNUSED != IS_UNUSED)
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_UNUSED);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -27501,7 +27501,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_UNUSED(int (*b
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -27746,7 +27746,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_CONST) {
name = Z_STR_P(varname);
@@ -27764,7 +27764,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -27778,10 +27778,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -27824,7 +27824,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
@@ -27867,7 +27867,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_CV_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -27891,12 +27891,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -27913,12 +27913,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -27936,15 +27936,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -27954,8 +27954,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP
if (IS_UNUSED == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
}
@@ -27975,7 +27975,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
zval *dim;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -27985,7 +27985,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = NULL;
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_UNUSED TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_UNUSED);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -27996,7 +27996,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -28008,17 +28008,17 @@ try_assign_dim_array:
zval *property_name = NULL;
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = NULL;
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -28042,7 +28042,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
SAVE_OPLINE();
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
@@ -28050,7 +28050,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -28182,7 +28182,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
ZEND_VM_NEXT_OPCODE();
}
- varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -28197,7 +28197,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -28213,9 +28213,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -28243,13 +28243,13 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
} else {
- zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
ZVAL_UNDEF(&tmp);
if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -28264,7 +28264,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -28274,9 +28274,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -28290,7 +28290,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -28327,7 +28327,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -28336,7 +28336,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -28356,7 +28356,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
}
} else {
- zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -28436,8 +28436,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28451,8 +28451,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28466,8 +28466,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28481,8 +28481,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28496,8 +28496,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28511,8 +28511,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28526,8 +28526,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28541,8 +28541,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28556,8 +28556,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_is_identical_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28572,8 +28572,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_is_not_identical_function(result,
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28588,8 +28588,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28604,8 +28604,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28620,8 +28620,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28636,8 +28636,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28651,8 +28651,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28666,8 +28666,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28681,8 +28681,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -28696,20 +28696,20 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
- zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
+ zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zval *value;
zval *zptr;
@@ -28721,7 +28721,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -28732,12 +28732,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -28746,20 +28746,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -28779,7 +28779,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op_data1;
@@ -28787,12 +28787,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
zval *value, *container, *dim;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) {
@@ -28802,13 +28802,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
#if 0 || (IS_CV != IS_UNUSED)
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, IS_CV);
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -28825,7 +28825,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -28840,7 +28840,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_CV(int (*binar
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -28848,8 +28848,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op
zval *value;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -28863,7 +28863,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -29105,8 +29105,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -29115,7 +29115,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -29127,7 +29127,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -29140,14 +29140,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29157,7 +29157,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -29193,8 +29193,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
retval = EX_VAR(opline->result.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -29203,7 +29203,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -29213,7 +29213,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -29223,15 +29223,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -29239,7 +29239,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -29271,8 +29271,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
CHECK_EXCEPTION();
@@ -29286,12 +29286,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29308,12 +29308,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29330,8 +29330,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
CHECK_EXCEPTION();
@@ -29346,15 +29346,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -29364,8 +29364,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
if (IS_CV == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
}
@@ -29380,12 +29380,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29404,8 +29404,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -29446,7 +29446,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -29467,14 +29467,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29492,13 +29492,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
zval *container;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29517,8 +29517,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -29558,7 +29558,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -29576,14 +29576,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1;
zval *property;
SAVE_OPLINE();
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -29591,7 +29591,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29611,13 +29611,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
- property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
+ property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -29635,13 +29635,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
- property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
+ property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
/* assign_obj has two opcodes! */
@@ -29662,7 +29662,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
zval *dim;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -29671,8 +29671,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CV TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, IS_CV);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -29683,7 +29683,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -29693,19 +29693,19 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
- dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -29728,8 +29728,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
zval *variable_ptr;
SAVE_OPLINE();
- value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == &EG(error_zval))) {
if (IS_CV == IS_TMP_VAR) {
@@ -29739,7 +29739,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, IS_CV TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, IS_CV);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
@@ -29760,7 +29760,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
zval *value_ptr;
SAVE_OPLINE();
- value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC);
+ value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op2.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
@@ -29784,7 +29784,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
}
}
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
@@ -29797,7 +29797,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
(IS_CV == IS_VAR && UNEXPECTED(value_ptr == &EG(error_zval)))) {
variable_ptr = &EG(uninitialized_zval);
} else {
- zend_assign_to_variable_reference(variable_ptr, value_ptr TSRMLS_CC);
+ zend_assign_to_variable_reference(variable_ptr, value_ptr);
}
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
@@ -29827,7 +29827,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -29837,7 +29837,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -29904,7 +29904,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -29923,7 +29923,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
CHECK_EXCEPTION();
@@ -29938,8 +29938,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -29954,7 +29954,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
@@ -29962,7 +29962,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -29982,7 +29982,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_
if (IS_CV != IS_UNUSED) {
- zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
zend_string *str;
zend_ulong hval;
@@ -30073,11 +30073,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
unset_dim_again:
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -30103,7 +30103,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -30136,7 +30136,7 @@ num_index_dim:
//??? if (IS_CV == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
} else if (IS_CV != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -30160,11 +30160,11 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -30178,7 +30178,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -30199,8 +30199,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPC
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
isset_dim_obj_again:
if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -30254,11 +30254,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -30315,8 +30315,8 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OP
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -30333,7 +30333,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OP
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -30374,7 +30374,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
ZVAL_COPY_VALUE(&generator->value, value);
if (Z_OPT_REFCOUNTED(generator->value)) Z_SET_REFCOUNT(generator->value, 1);
@@ -30383,7 +30383,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zval_opt_copy_ctor(&generator->value);
}
} else {
- zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference");
@@ -30403,7 +30403,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} else {
- zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -30428,7 +30428,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
/* Set the new yielded key */
if (IS_CV != IS_UNUSED) {
- zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
/* Consts, temporary variables and references need copying */
if (IS_CV == IS_CONST) {
@@ -30483,8 +30483,8 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
@@ -30503,8 +30503,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30518,8 +30518,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30533,8 +30533,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30548,8 +30548,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30563,8 +30563,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30578,8 +30578,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30593,8 +30593,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30608,8 +30608,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30624,8 +30624,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30640,8 +30640,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30656,8 +30656,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30672,8 +30672,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMPVAR_HANDLER(ZEND_O
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30687,8 +30687,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30702,8 +30702,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30717,8 +30717,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -30732,19 +30732,19 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op2, free_op_data1;
- zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ zval *object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
zval *value;
zval *zptr;
@@ -30757,7 +30757,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -30768,12 +30768,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
- binary_op(zptr, zptr, value TSRMLS_CC);
+ binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
@@ -30782,20 +30782,20 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
zval rv;
if (Z_OBJ_HT_P(object)->read_property &&
- (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC)) != NULL) {
+ (z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv)) != NULL) {
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
ZVAL_DEREF(z);
SEPARATE_ZVAL_NOREF(z);
- binary_op(z, z, value TSRMLS_CC);
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ binary_op(z, z, value);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
@@ -30815,7 +30815,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op2, free_op_data1;
@@ -30823,7 +30823,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*b
zval *value, *container, *dim;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
@@ -30838,13 +30838,13 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*b
#if 0 || ((IS_TMP_VAR|IS_VAR) != IS_UNUSED)
if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op TSRMLS_CC);
+ zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op);
break;
}
#endif
}
- zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_RW(&rv, container, dim, (IS_TMP_VAR|IS_VAR));
value = get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
var_ptr = Z_INDIRECT(rv);
@@ -30861,7 +30861,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*b
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -30877,7 +30877,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_CV_TMPVAR(int (*b
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMPVAR(int (*binary_op)(zval *result, zval *op1, zval *op2), ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op2;
@@ -30886,7 +30886,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMPVAR(int (*binar
SAVE_OPLINE();
value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ var_ptr = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -30900,7 +30900,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMPVAR(int (*binar
ZVAL_DEREF(var_ptr);
SEPARATE_ZVAL_NOREF(var_ptr);
- binary_op(var_ptr, var_ptr, value TSRMLS_CC);
+ binary_op(var_ptr, var_ptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), var_ptr);
@@ -31143,7 +31143,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
@@ -31153,7 +31153,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(retval);
@@ -31165,7 +31165,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
@@ -31178,14 +31178,14 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31195,7 +31195,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(retval, z);
}
- Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(z);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
@@ -31232,7 +31232,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
zval *zptr;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
retval = EX_VAR(opline->result.var);
@@ -31242,7 +31242,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
- if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
+ if (UNEXPECTED(!make_real_object(&object))) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
break;
@@ -31252,7 +31252,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
- && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC)) != NULL)) {
+ && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(retval, zptr);
@@ -31262,15 +31262,15 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
} else {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval rv;
- zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv TSRMLS_CC);
+ zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), &rv);
zval z_copy;
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval rv;
- zval *value = Z_OBJ_HT_P(z)->get(z, &rv TSRMLS_CC);
+ zval *value = Z_OBJ_HT_P(z)->get(z, &rv);
if (Z_REFCOUNT_P(z) == 0) {
- zend_objects_store_del(Z_OBJ_P(z) TSRMLS_CC);
+ zend_objects_store_del(Z_OBJ_P(z));
}
ZVAL_COPY_VALUE(z, value);
}
@@ -31278,7 +31278,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
ZVAL_DUP(&z_copy, z);
incdec_op(&z_copy);
if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z);
- Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(object)->write_property(object, property, &z_copy, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL));
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(z);
} else {
@@ -31311,8 +31311,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -31326,12 +31326,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HA
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31348,12 +31348,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31370,8 +31370,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_H
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -31386,15 +31386,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OP
SAVE_OPLINE();
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
}
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -31404,8 +31404,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OP
if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
}
@@ -31420,12 +31420,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCOD
zval *container;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31444,7 +31444,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HA
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -31486,7 +31486,7 @@ fetch_obj_r_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -31510,12 +31510,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31534,12 +31534,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31558,7 +31558,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_H
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -31599,7 +31599,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -31618,14 +31618,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OP
USE_OPLINE
zval *container;
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
/* Behave like FETCH_OBJ_W */
zend_free_op free_op1, free_op2;
zval *property;
SAVE_OPLINE();
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -31633,7 +31633,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMPVAR_HANDLER(ZEND_OP
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31653,13 +31653,13 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCOD
zval *container, *property;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
zval_ptr_dtor_nogc(free_op2);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -31677,13 +31677,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAN
zval *property_name;
SAVE_OPLINE();
- object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(property_name)) : NULL));
zval_ptr_dtor_nogc(free_op2);
/* assign_obj has two opcodes! */
@@ -31704,7 +31704,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAN
zval *dim;
SAVE_OPLINE();
- object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ object_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
@@ -31714,7 +31714,7 @@ try_assign_dim:
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
try_assign_dim_array:
dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- zend_fetch_dimension_address_W(&rv, object_ptr, dim, (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_W(&rv, object_ptr, dim, (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
ZEND_ASSERT(Z_TYPE(rv) == IS_INDIRECT);
@@ -31725,7 +31725,7 @@ try_assign_dim_array:
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
- value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type TSRMLS_CC);
+ value = zend_assign_to_variable(variable_ptr, value, (opline+1)->op1_type);
if ((opline+1)->op1_type == IS_VAR) {
FREE_OP(free_op_data1);
}
@@ -31737,17 +31737,17 @@ try_assign_dim_array:
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data TSRMLS_CC);
+ zend_assign_to_object_dim(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object_ptr, property_name, (opline+1)->op1_type, (opline+1)->op1, execute_data);
zval_ptr_dtor_nogc(free_op2);
} else if (EXPECTED(Z_TYPE_P(object_ptr) == IS_STRING) &&
EXPECTED(Z_STRLEN_P(object_ptr) != 0)) {
zend_long offset;
dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
- offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W TSRMLS_CC);
+ offset = zend_fetch_string_offset(object_ptr, dim, BP_VAR_W);
zval_ptr_dtor_nogc(free_op2);
value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) TSRMLS_CC);
+ zend_assign_to_string_offset(object_ptr, offset, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
FREE_OP(free_op_data1);
} else if (EXPECTED(Z_ISREF_P(object_ptr))) {
object_ptr = Z_REFVAL_P(object_ptr);
@@ -31784,7 +31784,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCO
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -31851,7 +31851,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCO
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -31870,7 +31870,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCO
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
zval_ptr_dtor_nogc(free_op2);
@@ -31886,8 +31886,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -31903,7 +31903,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPC
SAVE_OPLINE();
if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
@@ -31911,7 +31911,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMPVAR_HANDLER(ZEND_OPC
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
+ expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
if (IS_CV == IS_TMP_VAR) {
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
@@ -32022,7 +32022,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAND
zend_ulong hval;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
@@ -32052,7 +32052,7 @@ num_index_dim:
}
}
if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ zend_delete_global_variable(Z_STR_P(offset));
} else {
zend_hash_del(ht, Z_STR_P(offset));
}
@@ -32085,7 +32085,7 @@ num_index_dim:
//??? if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
//??? zval_copy_ctor(offset);
//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset);
zval_ptr_dtor_nogc(free_op2);
} else if (IS_CV != IS_UNUSED && Z_ISREF_P(container)) {
container = Z_REFVAL_P(container);
@@ -32109,7 +32109,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
}
@@ -32127,7 +32127,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HAND
}
}
if (Z_OBJ_HT_P(container)->unset_property) {
- Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
} else {
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
@@ -32149,7 +32149,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEND
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
isset_dim_obj_again:
@@ -32204,11 +32204,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -32266,7 +32266,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEN
zval *offset;
SAVE_OPLINE();
- container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
+ container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -32284,7 +32284,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMPVAR_HANDLER(ZEN
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -32304,8 +32304,8 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var),
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -32324,7 +32324,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -32343,7 +32343,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
}
@@ -32366,7 +32366,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_write(str->val, str->len);
}
} else {
- zend_string *str = _zval_get_string_func(z TSRMLS_CC);
+ zend_string *str = _zval_get_string_func(z);
if (str->len != 0) {
zend_write(str->val, str->len);
@@ -32408,7 +32408,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline++;
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -32441,7 +32441,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
opline++;
@@ -32474,7 +32474,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_AR
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
} else {
opline = OP_JMP_ADDR(opline, opline->op2);
@@ -32509,7 +32509,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_A
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
zval_ptr_dtor_nogc(free_op1);
ZVAL_TRUE(EX_VAR(opline->result.var));
opline++;
@@ -32546,7 +32546,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_
ZEND_VM_CONTINUE();
}
}
- if (i_zend_is_true(val TSRMLS_CC)) {
+ if (i_zend_is_true(val)) {
ZVAL_TRUE(EX_VAR(opline->result.var));
opline = OP_JMP_ADDR(opline, opline->op2);
} else {
@@ -32583,7 +32583,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else if (EXPECTED(Z_TYPE_P(val) <= IS_TRUE)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else {
- ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val TSRMLS_CC));
+ ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
}
@@ -32646,7 +32646,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (EXPECTED(EG(exception) == NULL)) {
- ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj TSRMLS_CC));
+ ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
}
@@ -32676,9 +32676,9 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_H
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
} else {
switch (opline->extended_value) {
@@ -32687,7 +32687,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_H
zend_file_handle file_handle;
char *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
if (resolved_path) {
failure_retval = zend_hash_str_exists(&EG(included_files), resolved_path, (int)strlen(resolved_path));
} else {
@@ -32696,24 +32696,24 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_H
if (failure_retval) {
/* do nothing, file already included */
- } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, (int)strlen(file_handle.opened_path))) {
- new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE));
+ zend_destroy_file_handle(&file_handle);
} else {
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
failure_retval=1;
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
@@ -32723,12 +32723,12 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_H
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(opline->extended_value, inc_filename);
break;
case ZEND_EVAL: {
- char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
+ char *eval_desc = zend_make_compiled_string_description("eval()'d code");
- new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
+ new_op_array = zend_compile_string(inc_filename, eval_desc);
efree(eval_desc);
}
break;
@@ -32752,27 +32752,27 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_H
new_op_array->scope = EG(scope); /* ??? */
call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
- (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
+ (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)), NULL);
if (EX(symbol_table)) {
call->symbol_table = EX(symbol_table);
} else {
- call->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ call->symbol_table = zend_rebuild_symbol_table();
}
call->prev_execute_data = execute_data;
- i_init_code_execute_data(call, new_op_array, return_value TSRMLS_CC);
+ i_init_code_execute_data(call, new_op_array, return_value);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
} else {
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
- zend_execute_ex(call TSRMLS_CC);
+ zend_execute_ex(call);
}
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
if (UNEXPECTED(EG(exception) != NULL)) {
- zend_throw_exception_internal(NULL TSRMLS_CC);
+ zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
@@ -32803,7 +32803,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
break;
}
}
- zend_print_variable(ptr TSRMLS_CC);
+ zend_print_variable(ptr);
}
} while (0);
zval_ptr_dtor_nogc(free_op1);
@@ -32841,7 +32841,7 @@ try_strlen:
zval tmp;
ZVAL_COPY(&tmp, value);
- if (parse_arg_object_to_str(&tmp, &str, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (parse_arg_object_to_str(&tmp, &str, IS_STRING) == FAILURE) {
goto strlen_error;
}
ZVAL_LONG(EX_VAR(opline->result.var), str->len);
@@ -32865,7 +32865,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32880,7 +32880,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32895,7 +32895,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32910,7 +32910,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32925,7 +32925,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32940,7 +32940,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32955,7 +32955,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32970,7 +32970,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -32986,7 +32986,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33002,7 +33002,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33018,7 +33018,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_
SAVE_OPLINE();
fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33034,7 +33034,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVAR_CONST_HANDLER(ZEN
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33049,7 +33049,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33064,7 +33064,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33079,7 +33079,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33094,7 +33094,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33129,7 +33129,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_CONST(int typ
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -33143,10 +33143,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_CONST(int typ
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
zval_ptr_dtor_nogc(free_op1);
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -33189,7 +33189,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_CONST(int typ
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
zval_ptr_dtor_nogc(free_op1);
@@ -33232,7 +33232,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPC
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_TMPVAR_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_TMPVAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -33257,7 +33257,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33272,7 +33272,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33329,7 +33329,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -33354,13 +33354,13 @@ static int ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_
try_fetch_list:
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
- zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R TSRMLS_CC);
+ zval *value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), EX_CONSTANT(opline->op2), IS_CONST, BP_VAR_R);
ZVAL_COPY(EX_VAR(opline->result.var), value);
} else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT) &&
EXPECTED(Z_OBJ_HT_P(container)->read_dimension)) {
zval *result = EX_VAR(opline->result.var);
- zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result TSRMLS_CC);
+ zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result);
if (retval) {
if (result != retval) {
@@ -33469,7 +33469,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER(ZEND_O
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -33488,7 +33488,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CONST_HANDLER(ZEND_O
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
zval_ptr_dtor_nogc(free_op1);
@@ -33505,7 +33505,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -33556,7 +33556,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_H
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -33572,9 +33572,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_H
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -33602,7 +33602,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -33623,7 +33623,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -33633,9 +33633,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -33650,7 +33650,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_CONST_HANDLER(ZEND_
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -33723,11 +33723,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -33802,7 +33802,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CONST_HANDLER(
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -33832,7 +33832,7 @@ try_instanceof:
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
zval_ptr_dtor_nogc(free_op1);
@@ -33844,7 +33844,7 @@ try_instanceof:
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- result = instanceof_function(Z_OBJCE_P(expr), ce TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), ce);
} else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) {
expr = Z_REFVAL_P(expr);
goto try_instanceof;
@@ -33865,7 +33865,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- EX_CONSTANT(opline->op2) TSRMLS_CC);
+ EX_CONSTANT(opline->op2));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -33900,7 +33900,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_VAR(int type,
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -33914,10 +33914,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_VAR(int type,
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
zval_ptr_dtor_nogc(free_op1);
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -33960,7 +33960,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_VAR(int type,
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
zval_ptr_dtor_nogc(free_op1);
@@ -34003,7 +34003,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_VAR_HANDLER(ZEND_OPCOD
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_TMPVAR_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_TMPVAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -34065,7 +34065,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OPCODE_HAN
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -34081,9 +34081,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OPCODE_HAN
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -34111,7 +34111,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OP
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -34132,7 +34132,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OP
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -34142,9 +34142,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OP
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -34159,7 +34159,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_VAR_HANDLER(ZEND_OP
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -34185,7 +34185,7 @@ try_instanceof:
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (UNEXPECTED(ce == NULL)) {
ZVAL_FALSE(EX_VAR(opline->result.var));
zval_ptr_dtor_nogc(free_op1);
@@ -34197,7 +34197,7 @@ try_instanceof:
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- result = instanceof_function(Z_OBJCE_P(expr), ce TSRMLS_CC);
+ result = instanceof_function(Z_OBJCE_P(expr), ce);
} else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(expr) == IS_REFERENCE) {
expr = Z_REFVAL_P(expr);
goto try_instanceof;
@@ -34238,7 +34238,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(int ty
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -34252,10 +34252,10 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(int ty
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ retval = zend_std_get_static_property(ce, name, 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
zval_ptr_dtor_nogc(free_op1);
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
retval = zend_hash_find(target_symbol_table, name);
if (retval == NULL) {
switch (type) {
@@ -34298,7 +34298,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(int ty
}
if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
if (Z_CONSTANT_P(retval)) {
- zval_update_constant(retval, 1 TSRMLS_CC);
+ zval_update_constant(retval, 1);
}
} else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
zval_ptr_dtor_nogc(free_op1);
@@ -34341,7 +34341,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OP
{
USE_OPLINE
- if (zend_is_by_ref_func_arg_fetch(opline, EX(call) TSRMLS_CC)) {
+ if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
return zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else {
return zend_fetch_var_address_helper_SPEC_TMPVAR_UNUSED(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@@ -34403,7 +34403,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(EG(exception) != NULL)) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
zend_string_release(Z_STR(tmp));
@@ -34419,9 +34419,9 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND_OPCODE_
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ zend_std_unset_static_property(ce, Z_STR_P(varname), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -34449,7 +34449,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !i_zend_is_true(value TSRMLS_CC));
+ !i_zend_is_true(value));
CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
@@ -34470,7 +34470,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND
if (CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) {
ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0 TSRMLS_CC);
+ ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, 0);
if (UNEXPECTED(ce == NULL)) {
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -34480,9 +34480,9 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND
} else {
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
- value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL) TSRMLS_CC);
+ value = zend_std_get_static_property(ce, Z_STR_P(varname), 1, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(varname)) : NULL));
} else {
- HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
+ HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
}
@@ -34497,7 +34497,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_UNUSED_HANDLER(ZEND
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL));
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
ZVAL_BOOL(EX_VAR(opline->result.var),
- !value || !i_zend_is_true(value TSRMLS_CC));
+ !value || !i_zend_is_true(value));
}
CHECK_EXCEPTION();
@@ -34513,7 +34513,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34528,7 +34528,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34543,7 +34543,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34558,7 +34558,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34573,7 +34573,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34588,7 +34588,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34603,7 +34603,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34618,7 +34618,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34634,7 +34634,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34650,7 +34650,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34666,7 +34666,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34682,7 +34682,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVAR_CV_HANDLER(ZEND_O
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34697,7 +34697,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34712,7 +34712,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34727,7 +34727,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34742,7 +34742,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34757,7 +34757,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HA
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34772,7 +34772,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -34789,7 +34789,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -34829,7 +34829,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -34854,7 +34854,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCO
SAVE_OPLINE();
- function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (IS_CV != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -34932,7 +34932,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCO
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -34951,7 +34951,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCO
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
zval_ptr_dtor_nogc(free_op1);
@@ -34968,7 +34968,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -34985,7 +34985,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEND
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
isset_dim_obj_again:
if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -35039,11 +35039,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -35101,7 +35101,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEN
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
@@ -35118,7 +35118,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_CV_HANDLER(ZEN
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -35138,7 +35138,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC);
+ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var));
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -35153,7 +35153,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_add_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35168,7 +35168,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_sub_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35183,7 +35183,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_mul_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35198,7 +35198,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_div_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35213,7 +35213,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
fast_mod_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35228,7 +35228,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
shift_left_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35243,7 +35243,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER
SAVE_OPLINE();
shift_right_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35258,7 +35258,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
concat_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35274,7 +35274,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35290,7 +35290,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
fast_not_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35306,7 +35306,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE
SAVE_OPLINE();
fast_is_smaller_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35322,7 +35322,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVAR_TMPVAR_HANDLER(ZE
SAVE_OPLINE();
fast_is_smaller_or_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35337,7 +35337,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HAND
SAVE_OPLINE();
bitwise_or_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35352,7 +35352,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
bitwise_and_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35367,7 +35367,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HAN
SAVE_OPLINE();
bitwise_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35382,7 +35382,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_H
SAVE_OPLINE();
boolean_xor_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35397,7 +35397,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCOD
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -35412,7 +35412,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR) TSRMLS_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2), (IS_TMP_VAR|IS_VAR));
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
CHECK_EXCEPTION();
@@ -35469,7 +35469,7 @@ fetch_obj_is_no_object:
}
}
- retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var) TSRMLS_CC);
+ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -35573,7 +35573,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL) TSRMLS_CC);
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name));
}
@@ -35592,7 +35592,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_
}
EX(call) = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
- fbc, opline->extended_value, called_scope, obj, EX(call) TSRMLS_CC);
+ fbc, opline->extended_value, called_scope, obj, EX(call));
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
@@ -35610,7 +35610,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDL
SAVE_OPLINE();
fast_equal_function(result,
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
@@ -35682,11 +35682,11 @@ num_index_prop:
result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
+ result = (value == NULL || !i_zend_is_true(value));
}
} else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
- result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
result = 0;
@@ -35762,7 +35762,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TMPVAR_TMPVAR_HANDLER
isset_no_object:
result = ((opline->extended_value & ZEND_ISSET) == 0);
} else {
- result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_RUN_TIME_CACHE() + Z_CACHE_SLOT_P(offset)) : NULL));
if ((opline->extended_value & ZEND_ISSET) == 0) {
result = !result;
}
@@ -35783,7 +35783,7 @@ static int ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
pow_function(EX_VAR(opline->result.var),
_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1),
- _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2) TSRMLS_CC);
+ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2));
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
CHECK_EXCEPTION();
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
index 42da7aee85..5a5c6a9965 100644
--- a/Zend/zend_vm_execute.skl
+++ b/Zend/zend_vm_execute.skl
@@ -1,6 +1,6 @@
{%DEFINES%}
-ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC)
+ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data)
{
DCL_OPLINE
@@ -26,7 +26,7 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC)
zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen");
}
-ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value TSRMLS_DC)
+ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value)
{
zend_execute_data *execute_data;
@@ -35,15 +35,15 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value
}
execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
- (zend_function*)op_array, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC);
+ (zend_function*)op_array, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL);
if (EG(current_execute_data)) {
- execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ execute_data->symbol_table = zend_rebuild_symbol_table();
} else {
execute_data->symbol_table = &EG(symbol_table);
}
EX(prev_execute_data) = EG(current_execute_data);
- i_init_execute_data(execute_data, op_array, return_value TSRMLS_CC);
- zend_{%EXECUTOR_NAME%}_ex(execute_data TSRMLS_CC);
+ i_init_execute_data(execute_data, op_array, return_value);
+ zend_{%EXECUTOR_NAME%}_ex(execute_data);
}
{%EXTERNAL_EXECUTOR%}
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 331286b3d8..4d2ba3a706 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -139,7 +139,7 @@ $op1_get_zval_ptr = array(
"VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "EX_CONSTANT(opline->op1)",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
);
@@ -149,7 +149,7 @@ $op2_get_zval_ptr = array(
"VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "EX_CONSTANT(opline->op2)",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
);
@@ -159,7 +159,7 @@ $op1_get_zval_ptr_ptr = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -169,7 +169,7 @@ $op2_get_zval_ptr_ptr = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -179,7 +179,7 @@ $op1_get_zval_ptr_deref = array(
"VAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1)",
"CONST" => "EX_CONSTANT(opline->op1)",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -189,7 +189,7 @@ $op2_get_zval_ptr_deref = array(
"VAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2)",
"CONST" => "EX_CONSTANT(opline->op2)",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -199,7 +199,7 @@ $op1_get_zval_ptr_ptr_undef = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -209,7 +209,7 @@ $op2_get_zval_ptr_ptr_undef = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "NULL",
- "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -219,7 +219,7 @@ $op1_get_obj_zval_ptr = array(
"VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "EX_CONSTANT(opline->op1)",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1)",
);
@@ -229,7 +229,7 @@ $op2_get_obj_zval_ptr = array(
"VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "EX_CONSTANT(opline->op2)",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2)",
);
@@ -239,7 +239,7 @@ $op1_get_obj_zval_ptr_deref = array(
"VAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1)",
"CONST" => "EX_CONSTANT(opline->op1)",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -249,7 +249,7 @@ $op2_get_obj_zval_ptr_deref = array(
"VAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2)",
"CONST" => "EX_CONSTANT(opline->op2)",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -259,7 +259,7 @@ $op1_get_obj_zval_ptr_ptr = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -269,7 +269,7 @@ $op2_get_obj_zval_ptr_ptr = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -279,7 +279,7 @@ $op1_get_obj_zval_ptr_ptr_undef = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1)",
"CONST" => "NULL",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op1.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op1.var)",
"TMPVAR" => "???",
);
@@ -289,7 +289,7 @@ $op2_get_obj_zval_ptr_ptr_undef = array(
"VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2)",
"CONST" => "NULL",
"UNUSED" => "_get_obj_zval_ptr_unused(execute_data)",
- "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op2.var TSRMLS_CC)",
+ "CV" => "_get_zval_ptr_cv_undef_\\1(execute_data, opline->op2.var)",
"TMPVAR" => "???",
);
@@ -956,7 +956,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
out($f,"#define ZEND_VM_ENTER() return 1\n");
out($f,"#define ZEND_VM_LEAVE() return 2\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n");
- out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
+ out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data
+");
break;
case ZEND_VM_KIND_SWITCH:
out($f,"\n");
@@ -981,7 +982,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n\n");
- out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
+ out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data
+");
break;
case ZEND_VM_KIND_GOTO:
out($f,"\n");
@@ -1012,7 +1014,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode, opline));\n\n");
- out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
+ out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data
+");
break;
}
break;
@@ -1063,7 +1066,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
// Emit code that dispatches to opcode handler
switch ($kind) {
case ZEND_VM_KIND_CALL:
- out($f, $m[1]."if (UNEXPECTED((ret = OPLINE->handler(execute_data TSRMLS_CC)) != 0))".$m[3]."\n");
+ out($f, $m[1]."if (UNEXPECTED((ret = OPLINE->handler(execute_data)) != 0))".$m[3]."\n");
break;
case ZEND_VM_KIND_SWITCH:
out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)dispatch_handler)".$m[3]."\n");
@@ -1105,8 +1108,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
if ($kind == ZEND_VM_KIND_GOTO) {
// Labels are defined in the executor itself, so we call it
// with execute_data NULL and it sets zend_opcode_handlers array
- out($f,$prolog."TSRMLS_FETCH();\n");
- out($f,$prolog.$executor_name."_ex(NULL TSRMLS_CC);\n");
+ out($f,$prolog."");
+ out($f,$prolog.$executor_name."_ex(NULL);\n");
} else {
if ($old) {
// Reserving space for user-defined opcodes
@@ -1452,7 +1455,8 @@ function gen_vm($def, $skel) {
out($f,"#define ZEND_VM_ENTER() return 1\n");
out($f,"#define ZEND_VM_LEAVE() return 2\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n");
- out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n\n");
+ out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data
+\n");
}
foreach ($export as $dsk) {
list($kind, $func, $name) = $dsk;
diff --git a/acinclude.m4 b/acinclude.m4
index 678296aac7..a4d4d509e0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2736,7 +2736,7 @@ AC_DEFUN([PHP_CHECK_CONFIGURE_OPTIONS],[
enable-libtool-lock | with-pic | with-tags | enable-shared | enable-static | enable-fast-install | with-gnu-ld[)];;
# Allow certain TSRM options
- with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads[)];;
+ with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads [)];;
# Allow certain Zend options
with-zend-vm | enable-maintainer-zts | enable-inline-optimization[)];;
diff --git a/configure.in b/configure.in
index f947d2f9de..bf770dddc7 100644
--- a/configure.in
+++ b/configure.in
@@ -333,8 +333,8 @@ case $host_alias in
;;
*netware*)
PHP_BUILD_PROGRAM
- PHP_ADD_SOURCES(/main, internal_functions.c,,PHP_GLOBAL_OBJS)
- PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS, PHP_GLOBAL_OBJS)
+ PHP_ADD_SOURCES(/main, internal_functions.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_GLOBAL_OBJS)
+ PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_GLOBAL_OBJS)
PHP7LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\)
EXTENSION_DIR=sys:/php$PHP_MAJOR_VERSION/ext
PHP_SUBST(PHP7LIB_SHARED_LIBADD)
@@ -1454,20 +1454,20 @@ PHP_SUBST(install_binary_targets)
PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/])
-PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c)
+PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
fopen_wrappers.c alloca.c php_scandir.c \
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
network.c php_open_temporary_file.c \
- output.c getopt.c)
+ output.c getopt.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \
- glob_wrapper.c)
+ glob_wrapper.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
+PHP_ADD_SOURCES(/main, internal_functions.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, sapi)
case $host_alias in
*netware*)
@@ -1475,7 +1475,7 @@ case $host_alias in
PHP_ADD_BUILD_DIR(netware)
;;
*)
- PHP_ADD_SOURCES_X(/main, internal_functions_cli.c,, PHP_BINARY_OBJS)
+ PHP_ADD_SOURCES_X(/main, internal_functions_cli.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_BINARY_OBJS)
;;
esac
@@ -1491,7 +1491,8 @@ PHP_ADD_SOURCES(Zend, \
zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c \
zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \
- zend_default_classes.c zend_inheritance.c)
+ zend_default_classes.c zend_inheritance.c, \
+ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
dnl Selectively disable optimization due to high RAM usage during
dnl compiling the executor.
@@ -1501,7 +1502,7 @@ else
flag=
fi
-PHP_ADD_SOURCES_X(Zend, zend_execute.c,,PHP_GLOBAL_OBJS,,$flag)
+PHP_ADD_SOURCES_X(Zend, zend_execute.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,PHP_GLOBAL_OBJS,,$flag)
PHP_ADD_BUILD_DIR(main main/streams)
PHP_ADD_BUILD_DIR(TSRM)
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 5c4e8740e4..b72b2ac1fe 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -127,6 +127,9 @@ zend_module_entry bcmath_module_entry = {
};
#ifdef COMPILE_DL_BCMATH
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(bcmath)
#endif
@@ -140,8 +143,11 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(bcmath)
{
+#if defined(COMPILE_DL_BCMATH) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
bcmath_globals->bc_precision = 0;
- bc_init_numbers(TSRMLS_C);
+ bc_init_numbers();
}
/* }}} */
@@ -188,16 +194,16 @@ PHP_MINFO_FUNCTION(bcmath)
/* {{{ php_str2num
Convert to bc_num detecting scale */
-static void php_str2num(bc_num *num, char *str TSRMLS_DC)
+static void php_str2num(bc_num *num, char *str)
{
char *p;
if (!(p = strchr(str, '.'))) {
- bc_str2num(num, str, 0 TSRMLS_CC);
+ bc_str2num(num, str, 0);
return;
}
- bc_str2num(num, str, strlen(p+1) TSRMLS_CC);
+ bc_str2num(num, str, strlen(p+1));
}
/* }}} */
@@ -211,7 +217,7 @@ PHP_FUNCTION(bcadd)
size_t left_len, right_len;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -219,11 +225,11 @@ PHP_FUNCTION(bcadd)
scale = (int) (scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
bc_add (first, second, &result, scale);
if (result->n_scale > scale) {
@@ -248,7 +254,7 @@ PHP_FUNCTION(bcsub)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -256,11 +262,11 @@ PHP_FUNCTION(bcsub)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
bc_sub (first, second, &result, scale);
if (result->n_scale > scale) {
@@ -285,7 +291,7 @@ PHP_FUNCTION(bcmul)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -293,12 +299,12 @@ PHP_FUNCTION(bcmul)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- bc_multiply (first, second, &result, scale TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ bc_multiply (first, second, &result, scale);
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -322,7 +328,7 @@ PHP_FUNCTION(bcdiv)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -330,13 +336,13 @@ PHP_FUNCTION(bcdiv)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
- switch (bc_divide(first, second, &result, scale TSRMLS_CC)) {
+ switch (bc_divide(first, second, &result, scale)) {
case 0: /* OK */
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -344,7 +350,7 @@ PHP_FUNCTION(bcdiv)
RETVAL_STR(bc_num2str(result));
break;
case -1: /* division by zero */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
break;
}
@@ -363,22 +369,22 @@ PHP_FUNCTION(bcmod)
size_t left_len, right_len;
bc_num first, second, result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &left, &left_len, &right, &right_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &left, &left_len, &right, &right_len) == FAILURE) {
return;
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- bc_str2num(&first, left, 0 TSRMLS_CC);
- bc_str2num(&second, right, 0 TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ bc_str2num(&first, left, 0);
+ bc_str2num(&second, right, 0);
- switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) {
+ switch (bc_modulo(first, second, &result, 0)) {
case 0:
RETVAL_STR(bc_num2str(result));
break;
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
break;
}
@@ -399,21 +405,21 @@ PHP_FUNCTION(bcpowmod)
zend_long scale = BCG(bc_precision);
int scale_int;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
return;
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&mod TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- php_str2num(&mod, modulous TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&mod);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ php_str2num(&mod, modulous);
scale_int = (int) ((int)scale < 0 ? 0 : scale);
- if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) {
+ if (bc_raisemod(first, second, mod, &result, scale_int) != -1) {
if (result->n_scale > scale) {
result->n_scale = (int)scale;
}
@@ -440,7 +446,7 @@ PHP_FUNCTION(bcpow)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -448,12 +454,12 @@ PHP_FUNCTION(bcpow)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- bc_raise (first, second, &result, scale TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ bc_raise (first, second, &result, scale);
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -477,7 +483,7 @@ PHP_FUNCTION(bcsqrt)
bc_num result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|l", &left, &left_len, &scale_param) == FAILURE) {
return;
}
@@ -485,16 +491,16 @@ PHP_FUNCTION(bcsqrt)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&result, left TSRMLS_CC);
+ bc_init_num(&result);
+ php_str2num(&result, left);
- if (bc_sqrt (&result, scale TSRMLS_CC) != 0) {
+ if (bc_sqrt (&result, scale) != 0) {
if (result->n_scale > scale) {
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number");
+ php_error_docref(NULL, E_WARNING, "Square root of negative number");
}
bc_free_num(&result);
@@ -512,7 +518,7 @@ PHP_FUNCTION(bccomp)
bc_num first, second;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -520,11 +526,11 @@ PHP_FUNCTION(bccomp)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
- bc_str2num(&first, left, scale TSRMLS_CC);
- bc_str2num(&second, right, scale TSRMLS_CC);
+ bc_str2num(&first, left, scale);
+ bc_str2num(&second, right, scale);
RETVAL_LONG(bc_compare(first, second));
bc_free_num(&first);
@@ -539,7 +545,7 @@ PHP_FUNCTION(bcscale)
{
zend_long new_scale;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_scale) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &new_scale) == FAILURE) {
return;
}
diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4
index 3a4ad8c3b3..bc126454b4 100644
--- a/ext/bcmath/config.m4
+++ b/ext/bcmath/config.m4
@@ -11,7 +11,7 @@ libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c,
- $ext_shared,,-I@ext_srcdir@/libbcmath/src)
+ $ext_shared,,-I@ext_srcdir@/libbcmath/src -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath])
fi
diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32
index 3579eadfae..3973c10cbf 100644
--- a/ext/bcmath/config.w32
+++ b/ext/bcmath/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
if (PHP_BCMATH == "yes") {
- EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src");
+ EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \
num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h
index 1e75cbdca3..f091f8ba31 100644
--- a/ext/bcmath/libbcmath/src/bcmath.h
+++ b/ext/bcmath/libbcmath/src/bcmath.h
@@ -99,7 +99,7 @@ typedef struct bc_struct
#endif
#endif
-_PROTOTYPE(void bc_init_numbers, (TSRMLS_D));
+_PROTOTYPE(void bc_init_numbers, (void));
_PROTOTYPE(bc_num _bc_new_num_ex, (int length, int scale, int persistent));
@@ -107,9 +107,9 @@ _PROTOTYPE(void _bc_free_num_ex, (bc_num *num, int persistent));
_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
-_PROTOTYPE(void bc_init_num, (bc_num *num TSRMLS_DC));
+_PROTOTYPE(void bc_init_num, (bc_num *num));
-_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale TSRMLS_DC));
+_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
_PROTOTYPE(zend_string *bc_num2str, (bc_num num));
@@ -119,7 +119,7 @@ _PROTOTYPE(long bc_num2long, (bc_num num));
_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
-_PROTOTYPE(char bc_is_zero, (bc_num num TSRMLS_DC));
+_PROTOTYPE(char bc_is_zero, (bc_num num));
_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
@@ -129,26 +129,26 @@ _PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
-_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC));
+_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
-_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC));
+_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
- int scale TSRMLS_DC));
+ int scale));
_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
- bc_num *rem, int scale TSRMLS_DC));
+ bc_num *rem, int scale));
_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
- bc_num *result, int scale TSRMLS_DC));
+ bc_num *result, int scale));
_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
- int scale TSRMLS_DC));
+ int scale));
-_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale TSRMLS_DC));
+_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
- int leading_zero TSRMLS_DC));
+ int leading_zero));
/* Prototypes needed for external utility routines. */
diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c
index 52e4e044d5..0e3b64ac01 100644
--- a/ext/bcmath/libbcmath/src/debug.c
+++ b/ext/bcmath/libbcmath/src/debug.c
@@ -48,9 +48,9 @@ out_char (int c)
void
-pn (bc_num num TSRMLS_DC)
+pn (bc_num num)
{
- bc_out_num (num, 10, out_char, 0 TSRMLS_CC);
+ bc_out_num (num, 10, out_char, 0);
out_char ('\n');
}
diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c
index 8c05170c7e..61d9496617 100644
--- a/ext/bcmath/libbcmath/src/div.c
+++ b/ext/bcmath/libbcmath/src/div.c
@@ -85,7 +85,7 @@ _one_mult (num, size, digit, result)
by zero is tried. The algorithm is found in Knuth Vol 2. p237. */
int
-bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
+bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale)
{
bc_num qval;
unsigned char *num1, *num2;
@@ -98,7 +98,7 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
unsigned int norm;
/* Test for divide by zero. */
- if (bc_is_zero (n2 TSRMLS_CC)) return -1;
+ if (bc_is_zero (n2)) return -1;
/* Test for divide by 1. If it is we must truncate. */
if (n2->n_scale == 0)
@@ -259,7 +259,7 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
/* Clean up and return the number. */
qval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS );
- if (bc_is_zero (qval TSRMLS_CC)) qval->n_sign = PLUS;
+ if (bc_is_zero (qval)) qval->n_sign = PLUS;
_bc_rm_leading_zeros (qval);
bc_free_num (quot);
*quot = qval;
diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c
index 2949bd10d4..09d43756c2 100644
--- a/ext/bcmath/libbcmath/src/divmod.c
+++ b/ext/bcmath/libbcmath/src/divmod.c
@@ -45,24 +45,24 @@
*/
int
-bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC)
+bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
{
bc_num quotient = NULL;
bc_num temp;
int rscale;
/* Check for correct numbers. */
- if (bc_is_zero (num2 TSRMLS_CC)) return -1;
+ if (bc_is_zero (num2)) return -1;
/* Calculate final scale. */
rscale = MAX (num1->n_scale, num2->n_scale+scale);
- bc_init_num(&temp TSRMLS_CC);
+ bc_init_num(&temp);
/* Calculate it. */
- bc_divide (num1, num2, &temp, scale TSRMLS_CC);
+ bc_divide (num1, num2, &temp, scale);
if (quot)
quotient = bc_copy_num (temp);
- bc_multiply (temp, num2, &temp, rscale TSRMLS_CC);
+ bc_multiply (temp, num2, &temp, rscale);
bc_sub (num1, temp, rem, rscale);
bc_free_num (&temp);
@@ -80,8 +80,8 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS
result in RESULT. */
int
-bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
+bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale)
{
- return bc_divmod (num1, num2, NULL, result, scale TSRMLS_CC);
+ return bc_divmod (num1, num2, NULL, result, scale);
}
diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c
index 986ad1df24..6ceb480d8c 100644
--- a/ext/bcmath/libbcmath/src/init.c
+++ b/ext/bcmath/libbcmath/src/init.c
@@ -101,7 +101,7 @@ _bc_free_num_ex (num, persistent)
/* Intitialize the number package! */
void
-bc_init_numbers (TSRMLS_D)
+bc_init_numbers (void)
{
BCG(_zero_) = _bc_new_num_ex (1,0,1);
BCG(_one_) = _bc_new_num_ex (1,0,1);
@@ -124,7 +124,7 @@ bc_copy_num (bc_num num)
/* Initialize a number NUM by making it a copy of zero. */
void
-bc_init_num (bc_num *num TSRMLS_DC)
+bc_init_num (bc_num *num)
{
*num = bc_copy_num (BCG(_zero_));
}
diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c
index ad4e375467..9358c6b1f5 100644
--- a/ext/bcmath/libbcmath/src/output.c
+++ b/ext/bcmath/libbcmath/src/output.c
@@ -87,9 +87,9 @@ bc_out_long (val, size, space, out_char)
void
#ifdef __STDC__
-bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero TSRMLS_DC)
+bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero)
#else
-bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_DC)
+bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero)
#endif
{
char *nptr;
@@ -101,7 +101,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
if (num->n_sign == MINUS) (*out_char) ('-');
/* Output the number. */
- if (bc_is_zero (num TSRMLS_CC))
+ if (bc_is_zero (num))
(*out_char) ('0');
else
if (o_base == 10)
@@ -114,7 +114,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
else
nptr++;
- if (leading_zero && bc_is_zero (num TSRMLS_CC))
+ if (leading_zero && bc_is_zero (num))
(*out_char) ('0');
/* Now the fraction. */
@@ -128,36 +128,36 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
else
{
/* special case ... */
- if (leading_zero && bc_is_zero (num TSRMLS_CC))
+ if (leading_zero && bc_is_zero (num))
(*out_char) ('0');
/* The number is some other base. */
digits = NULL;
- bc_init_num (&int_part TSRMLS_CC);
- bc_divide (num, BCG(_one_), &int_part, 0 TSRMLS_CC);
- bc_init_num (&frac_part TSRMLS_CC);
- bc_init_num (&cur_dig TSRMLS_CC);
- bc_init_num (&base TSRMLS_CC);
+ bc_init_num (&int_part);
+ bc_divide (num, BCG(_one_), &int_part, 0);
+ bc_init_num (&frac_part);
+ bc_init_num (&cur_dig);
+ bc_init_num (&base);
bc_sub (num, int_part, &frac_part, 0);
/* Make the INT_PART and FRAC_PART positive. */
int_part->n_sign = PLUS;
frac_part->n_sign = PLUS;
bc_int2num (&base, o_base);
- bc_init_num (&max_o_digit TSRMLS_CC);
+ bc_init_num (&max_o_digit);
bc_int2num (&max_o_digit, o_base-1);
/* Get the digits of the integer part and push them on a stack. */
- while (!bc_is_zero (int_part TSRMLS_CC))
+ while (!bc_is_zero (int_part))
{
- bc_modulo (int_part, base, &cur_dig, 0 TSRMLS_CC);
+ bc_modulo (int_part, base, &cur_dig, 0);
/* PHP Change: malloc() -> emalloc() */
temp = (stk_rec *) emalloc (sizeof(stk_rec));
if (temp == NULL) bc_out_of_memory();
temp->digit = bc_num2long (cur_dig);
temp->next = digits;
digits = temp;
- bc_divide (int_part, base, &int_part, 0 TSRMLS_CC);
+ bc_divide (int_part, base, &int_part, 0);
}
/* Print the digits on the stack. */
@@ -183,7 +183,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
pre_space = 0;
t_num = bc_copy_num (BCG(_one_));
while (t_num->n_len <= num->n_scale) {
- bc_multiply (frac_part, base, &frac_part, num->n_scale TSRMLS_CC);
+ bc_multiply (frac_part, base, &frac_part, num->n_scale);
fdigit = bc_num2long (frac_part);
bc_int2num (&int_part, fdigit);
bc_sub (frac_part, int_part, &frac_part, 0);
@@ -193,7 +193,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
bc_out_long (fdigit, max_o_digit->n_len, pre_space, out_char);
pre_space = 1;
}
- bc_multiply (t_num, base, &t_num, 0 TSRMLS_CC);
+ bc_multiply (t_num, base, &t_num, 0);
}
bc_free_num (&t_num);
}
diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c
index f2f4f4a1d7..ee454fa5d2 100644
--- a/ext/bcmath/libbcmath/src/raise.c
+++ b/ext/bcmath/libbcmath/src/raise.c
@@ -44,7 +44,7 @@
only the integer part is used. */
void
-bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
+bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale)
{
bc_num temp, power;
long exponent;
@@ -87,7 +87,7 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
while ((exponent & 1) == 0)
{
pwrscale = 2*pwrscale;
- bc_multiply (power, power, &power, pwrscale TSRMLS_CC);
+ bc_multiply (power, power, &power, pwrscale);
exponent = exponent >> 1;
}
temp = bc_copy_num (power);
@@ -98,10 +98,10 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
while (exponent > 0)
{
pwrscale = 2*pwrscale;
- bc_multiply (power, power, &power, pwrscale TSRMLS_CC);
+ bc_multiply (power, power, &power, pwrscale);
if ((exponent & 1) == 1) {
calcscale = pwrscale + calcscale;
- bc_multiply (temp, power, &temp, calcscale TSRMLS_CC);
+ bc_multiply (temp, power, &temp, calcscale);
}
exponent = exponent >> 1;
}
@@ -109,7 +109,7 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
/* Assign the value. */
if (neg)
{
- bc_divide (BCG(_one_), temp, result, rscale TSRMLS_CC);
+ bc_divide (BCG(_one_), temp, result, rscale);
bc_free_num (&temp);
}
else
diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c
index 58964bec58..4c3c417760 100644
--- a/ext/bcmath/libbcmath/src/raisemod.c
+++ b/ext/bcmath/libbcmath/src/raisemod.c
@@ -43,20 +43,20 @@
only the integer part is used. */
int
-bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC)
+bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
{
bc_num power, exponent, parity, temp;
int rscale;
/* Check for correct numbers. */
- if (bc_is_zero(mod TSRMLS_CC)) return -1;
+ if (bc_is_zero(mod)) return -1;
if (bc_is_neg(expo)) return -1;
/* Set initial values. */
power = bc_copy_num (base);
exponent = bc_copy_num (expo);
temp = bc_copy_num (BCG(_one_));
- bc_init_num(&parity TSRMLS_CC);
+ bc_init_num(&parity);
/* Check the base for scale digits. */
if (base->n_scale != 0)
@@ -66,7 +66,7 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSR
if (exponent->n_scale != 0)
{
bc_rt_warn ("non-zero scale in exponent");
- bc_divide (exponent, BCG(_one_), &exponent, 0 TSRMLS_CC); /*truncate */
+ bc_divide (exponent, BCG(_one_), &exponent, 0); /*truncate */
}
/* Check the modulus for scale digits. */
@@ -75,17 +75,17 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSR
/* Do the calculation. */
rscale = MAX(scale, base->n_scale);
- while ( !bc_is_zero(exponent TSRMLS_CC) )
+ while ( !bc_is_zero(exponent) )
{
- (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0 TSRMLS_CC);
- if ( !bc_is_zero(parity TSRMLS_CC) )
+ (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
+ if ( !bc_is_zero(parity) )
{
- bc_multiply (temp, power, &temp, rscale TSRMLS_CC);
- (void) bc_modulo (temp, mod, &temp, scale TSRMLS_CC);
+ bc_multiply (temp, power, &temp, rscale);
+ (void) bc_modulo (temp, mod, &temp, scale);
}
- bc_multiply (power, power, &power, rscale TSRMLS_CC);
- (void) bc_modulo (power, mod, &power, scale TSRMLS_CC);
+ bc_multiply (power, power, &power, rscale);
+ (void) bc_modulo (power, mod, &power, scale);
}
/* Assign the value. */
diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c
index 64014f3a6e..65e3a623c5 100644
--- a/ext/bcmath/libbcmath/src/recmul.c
+++ b/ext/bcmath/libbcmath/src/recmul.c
@@ -180,7 +180,7 @@ _bc_shift_addsub (bc_num accum, bc_num val, int shift, int sub)
*/
static void
_bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
- int full_scale TSRMLS_DC)
+ int full_scale)
{
bc_num u0, u1, v0, v1;
bc_num m1, m2, m3, d1, d2;
@@ -218,12 +218,12 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
_bc_rm_leading_zeros (v1);
_bc_rm_leading_zeros (v0);
- m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC);
+ m1zero = bc_is_zero(u1) || bc_is_zero(v1);
/* Calculate sub results ... */
- bc_init_num(&d1 TSRMLS_CC);
- bc_init_num(&d2 TSRMLS_CC);
+ bc_init_num(&d1);
+ bc_init_num(&d2);
bc_sub (u1, u0, &d1, 0);
d1len = d1->n_len;
bc_sub (v0, v1, &d2, 0);
@@ -234,17 +234,17 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
if (m1zero)
m1 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0 TSRMLS_CC);
+ _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0);
- if (bc_is_zero(d1 TSRMLS_CC) || bc_is_zero(d2 TSRMLS_CC))
+ if (bc_is_zero(d1) || bc_is_zero(d2))
m2 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0 TSRMLS_CC);
+ _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0);
- if (bc_is_zero(u0 TSRMLS_CC) || bc_is_zero(v0 TSRMLS_CC))
+ if (bc_is_zero(u0) || bc_is_zero(v0))
m3 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0 TSRMLS_CC);
+ _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0);
/* Initialize product */
prodlen = ulen+vlen+1;
@@ -275,7 +275,7 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
*/
void
-bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
+bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale)
{
bc_num pval;
int len1, len2;
@@ -288,7 +288,7 @@ bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
prod_scale = MIN(full_scale,MAX(scale,MAX(n1->n_scale,n2->n_scale)));
/* Do the multiply */
- _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale TSRMLS_CC);
+ _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale);
/* Assign to prod and clean up the number. */
pval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS );
@@ -296,7 +296,7 @@ bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
pval->n_len = len2 + len1 + 1 - full_scale;
pval->n_scale = prod_scale;
_bc_rm_leading_zeros (pval);
- if (bc_is_zero (pval TSRMLS_CC))
+ if (bc_is_zero (pval))
pval->n_sign = PLUS;
bc_free_num (prod);
*prod = pval;
diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c
index 5db5113eb5..61d3d9484f 100644
--- a/ext/bcmath/libbcmath/src/sqrt.c
+++ b/ext/bcmath/libbcmath/src/sqrt.c
@@ -42,7 +42,7 @@
after the decimal place. */
int
-bc_sqrt (bc_num *num, int scale TSRMLS_DC)
+bc_sqrt (bc_num *num, int scale)
{
int rscale, cmp_res, done;
int cscale;
@@ -71,9 +71,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
/* Initialize the variables. */
rscale = MAX (scale, (*num)->n_scale);
- bc_init_num(&guess TSRMLS_CC);
- bc_init_num(&guess1 TSRMLS_CC);
- bc_init_num(&diff TSRMLS_CC);
+ bc_init_num(&guess);
+ bc_init_num(&guess1);
+ bc_init_num(&diff);
point5 = bc_new_num (1,1);
point5->n_value[1] = 5;
@@ -91,9 +91,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
bc_int2num (&guess,10);
bc_int2num (&guess1,(*num)->n_len);
- bc_multiply (guess1, point5, &guess1, 0 TSRMLS_CC);
+ bc_multiply (guess1, point5, &guess1, 0);
guess1->n_scale = 0;
- bc_raise (guess, guess1, &guess, 0 TSRMLS_CC);
+ bc_raise (guess, guess1, &guess, 0);
bc_free_num (&guess1);
cscale = 3;
}
@@ -104,9 +104,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
{
bc_free_num (&guess1);
guess1 = bc_copy_num (guess);
- bc_divide (*num, guess, &guess, cscale TSRMLS_CC);
+ bc_divide (*num, guess, &guess, cscale);
bc_add (guess, guess1, &guess, 0);
- bc_multiply (guess, point5, &guess, cscale TSRMLS_CC);
+ bc_multiply (guess, point5, &guess, cscale);
bc_sub (guess, guess1, &diff, cscale+1);
if (bc_is_near_zero (diff, cscale))
{
@@ -119,7 +119,7 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
/* Assign the number and clean up. */
bc_free_num (num);
- bc_divide (guess,BCG(_one_),num,rscale TSRMLS_CC);
+ bc_divide (guess,BCG(_one_),num,rscale);
bc_free_num (&guess);
bc_free_num (&guess1);
bc_free_num (&point5);
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index c484c158e5..18776c6308 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -41,7 +41,7 @@
/* Convert strings to bc numbers. Base 10 only.*/
void
-bc_str2num (bc_num *num, char *str, int scale TSRMLS_DC)
+bc_str2num (bc_num *num, char *str, int scale)
{
int digits, strscale;
char *ptr, *nptr;
diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c
index 4ee249ee71..4a7589eb96 100644
--- a/ext/bcmath/libbcmath/src/zero.c
+++ b/ext/bcmath/libbcmath/src/zero.c
@@ -41,7 +41,7 @@
/* In some places we need to check if the number NUM is zero. */
char
-bc_is_zero (bc_num num TSRMLS_DC)
+bc_is_zero (bc_num num)
{
int count;
char *nptr;
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index 12098cff89..6647894bf0 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -49,7 +49,10 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
ZEND_END_MODULE_GLOBALS(bcmath)
#ifdef ZTS
-# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
+# define BCG(v) ZEND_TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
+# ifdef COMPILE_DL_BCMATH
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define BCG(v) (bcmath_globals.v)
#endif
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index d49be40d35..8a3eb7f6b0 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -135,7 +135,7 @@ struct php_bz2_stream_data_t {
/* {{{ BZip2 stream implementation */
-static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
size_t ret = 0;
@@ -158,7 +158,7 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS
return ret;
}
-static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count)
{
size_t wrote = 0;
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
@@ -182,7 +182,7 @@ static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count
return wrote;
}
-static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_bz2iop_close(php_stream *stream, int close_handle)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
int ret = EOF;
@@ -200,7 +200,7 @@ static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
return ret;
}
-static int php_bz2iop_flush(php_stream *stream TSRMLS_DC)
+static int php_bz2iop_flush(php_stream *stream)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
return BZ2_bzflush(self->bz_file);
@@ -219,7 +219,7 @@ php_stream_ops php_stream_bz2io_ops = {
/* {{{ Bzip2 stream openers */
PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
- const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
+ const char *mode, php_stream *innerstream STREAMS_DC)
{
struct php_bz2_stream_data_t *self;
@@ -236,7 +236,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
const char *mode,
int options,
char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *retstream = NULL, *stream = NULL;
char *path_copy = NULL;
@@ -250,12 +250,12 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
}
#ifdef VIRTUAL_DIR
- virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC);
+ virtual_filepath_ex(path, &path_copy, NULL);
#else
path_copy = path;
#endif
- if (php_check_open_basedir(path_copy TSRMLS_CC)) {
+ if (php_check_open_basedir(path_copy)) {
#ifdef VIRTUAL_DIR
efree(path_copy);
#endif
@@ -301,7 +301,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
}
if (bz_file) {
- retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
+ retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC);
if (retstream) {
return retstream;
}
@@ -341,15 +341,15 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
static PHP_MINIT_FUNCTION(bz2)
{
- php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
- php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper);
+ php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory);
return SUCCESS;
}
static PHP_MSHUTDOWN_FUNCTION(bz2)
{
- php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
- php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("compress.bzip2");
+ php_stream_filter_unregister_factory("bzip2.*");
return SUCCESS;
}
@@ -373,14 +373,14 @@ static PHP_FUNCTION(bzread)
php_stream *stream;
zend_string *data;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &bz, &len)) {
RETURN_FALSE;
}
php_stream_from_zval(stream, bz);
if ((len + 1) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
+ php_error_docref(NULL, E_WARNING, "length may not be negative");
RETURN_FALSE;
}
data = zend_string_alloc(len, 0);
@@ -402,19 +402,19 @@ static PHP_FUNCTION(bzopen)
BZFILE *bz; /* The compressed file stream */
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &file, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &file, &mode, &mode_len) == FAILURE) {
return;
}
if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode);
+ php_error_docref(NULL, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode);
RETURN_FALSE;
}
/* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_P(file) == IS_STRING) {
if (Z_STRLEN_P(file) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
+ php_error_docref(NULL, E_WARNING, "filename cannot be empty");
RETURN_FALSE;
}
@@ -432,10 +432,10 @@ static PHP_FUNCTION(bzopen)
stream_mode_len = strlen(stream->mode);
if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
RETURN_FALSE;
} else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
RETURN_FALSE;
}
@@ -443,7 +443,7 @@ static PHP_FUNCTION(bzopen)
case 'r':
/* only "r" and "rb" are supported */
if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read from a stream opened in write only mode");
+ php_error_docref(NULL, E_WARNING, "cannot read from a stream opened in write only mode");
RETURN_FALSE;
}
break;
@@ -452,7 +452,7 @@ static PHP_FUNCTION(bzopen)
if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])
&& stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a')
&& stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write to a stream opened in read only mode");
+ php_error_docref(NULL, E_WARNING, "cannot write to a stream opened in read only mode");
RETURN_FALSE;
}
break;
@@ -469,7 +469,7 @@ static PHP_FUNCTION(bzopen)
stream = php_stream_bz2open_from_BZFILE(bz, mode, stream);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "first parameter has to be string or file-resource");
+ php_error_docref(NULL, E_WARNING, "first parameter has to be string or file-resource");
RETURN_FALSE;
}
@@ -522,7 +522,7 @@ static PHP_FUNCTION(bzcompress)
argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
return;
}
@@ -573,7 +573,7 @@ static PHP_FUNCTION(bzdecompress)
#endif
bz_stream bzs;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) {
RETURN_FALSE;
}
@@ -624,7 +624,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
int errnum; /* Error number */
struct php_bz2_stream_data_t *self;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &bzp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &bzp) == FAILURE) {
return;
}
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index a2a21d765b..7f7c53cff3 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -71,7 +71,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_bz2_filter_data *data;
php_stream_bucket *bucket;
@@ -91,13 +91,13 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < bucket->buflen) {
if (data->status == PHP_BZ2_UNITIALIZED) {
status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint);
if (BZ_OK != status) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
@@ -127,7 +127,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
}
} else if (status != BZ_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -139,19 +139,19 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
} else if (status == BZ_STREAM_END && data->strm.avail_out >= data->outbuf_len) {
/* no more data to decompress, and nothing was spat out */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_PASS_ON;
}
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if ((data->status == PHP_BZ2_RUNNING) && (flags & PSFS_FLAG_FLUSH_CLOSE)) {
@@ -162,8 +162,8 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -180,7 +180,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
return exit_status;
}
-static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_bz2_decompress_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_bz2_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -209,7 +209,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_bz2_filter_data *data;
php_stream_bucket *bucket;
@@ -227,7 +227,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < bucket->buflen) {
desired = bucket->buflen - bin;
@@ -240,7 +240,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN));
if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -253,14 +253,14 @@ static php_stream_filter_status_t php_bz2_compress_filter(
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -271,8 +271,8 @@ static php_stream_filter_status_t php_bz2_compress_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -286,7 +286,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
return exit_status;
}
-static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_bz2_compress_dtor(php_stream_filter *thisfilter)
{
if (Z_PTR(thisfilter->abstract)) {
php_bz2_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -307,7 +307,7 @@ static php_stream_filter_ops php_bz2_compress_ops = {
/* {{{ bzip2.* common factory */
-static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_bz2_filter_data *data;
@@ -316,7 +316,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
/* Create this filter */
data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data));
return NULL;
}
@@ -329,14 +329,14 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048;
data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent);
if (!data->inbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len);
pefree(data, persistent);
return NULL;
}
data->strm.avail_in = 0;
data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent);
if (!data->outbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
@@ -351,7 +351,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) {
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "concatenated", sizeof("concatenated")-1))) {
- data->expect_concatenated = zend_is_true(tmpzval TSRMLS_CC);
+ data->expect_concatenated = zend_is_true(tmpzval);
tmpzval = NULL;
}
@@ -361,7 +361,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
}
if (tmpzval) {
- data->small_footprint = zend_is_true(tmpzval TSRMLS_CC);
+ data->small_footprint = zend_is_true(tmpzval);
}
}
@@ -382,7 +382,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
ZVAL_DUP(&tmp, tmpzval);
convert_to_long(&tmp);
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
} else {
blockSize100k = (int)Z_LVAL(tmp);
}
@@ -396,7 +396,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
convert_to_long(&tmp);
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
} else {
workFactor = (int)Z_LVAL(tmp);
}
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index 6e90e8d67f..dd226a20ad 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -47,11 +47,11 @@ extern zend_module_entry bz2_module_entry;
# define PHP_BZ2_API
#endif
-PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC);
-#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
-#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
+#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC)
+#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC)
extern php_stream_filter_factory php_bz2_filter_factory;
extern php_stream_ops php_stream_bz2io_ops;
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index 3dd16ce45b..438bf38527 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -31,7 +31,7 @@ PHP_FUNCTION(unixtojd)
time_t ts = 0;
struct tm *ta, tmbuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &ts) == FAILURE) {
return;
}
@@ -55,7 +55,7 @@ PHP_FUNCTION(jdtounix)
{
zend_long uday;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &uday) == FAILURE) {
return;
}
uday -= 2440588 /* J.D. of 1.1.1970 */;
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 50385482a7..0f94b08bca 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -292,7 +292,7 @@ PHP_FUNCTION(cal_info)
zend_long cal = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &cal) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &cal) == FAILURE) {
RETURN_FALSE;
}
@@ -311,7 +311,7 @@ PHP_FUNCTION(cal_info)
if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -328,12 +328,12 @@ PHP_FUNCTION(cal_days_in_month)
struct cal_entry_t *calendar;
zend_long sdn_start, sdn_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &cal, &month, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &cal, &month, &year) == FAILURE) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -342,7 +342,7 @@ PHP_FUNCTION(cal_days_in_month)
sdn_start = calendar->to_jd(year, month, 1);
if (sdn_start == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date.");
+ php_error_docref(NULL, E_WARNING, "invalid date.");
RETURN_FALSE;
}
@@ -370,12 +370,12 @@ PHP_FUNCTION(cal_to_jd)
{
zend_long cal, month, day, year;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "llll", &cal, &month, &day, &year) != SUCCESS) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -392,12 +392,12 @@ PHP_FUNCTION(cal_from_jd)
char date[16];
struct cal_entry_t *calendar;
- if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "ll", &jd, &cal) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &jd, &cal) == FAILURE) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd", cal);
RETURN_FALSE;
}
calendar = &cal_conversion_table[cal];
@@ -438,7 +438,7 @@ PHP_FUNCTION(jdtogregorian)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -455,7 +455,7 @@ PHP_FUNCTION(gregoriantojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -471,7 +471,7 @@ PHP_FUNCTION(jdtojulian)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -488,7 +488,7 @@ PHP_FUNCTION(juliantojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -601,7 +601,7 @@ PHP_FUNCTION(jdtojewish)
char date[16], hebdate[32];
char *dayp, *yearp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|bl", &julday, &heb, &fl) == FAILURE) {
RETURN_FALSE;
}
@@ -611,7 +611,7 @@ PHP_FUNCTION(jdtojewish)
RETURN_STRING(date);
} else {
if (year <= 0 || year > 9999) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Year out of range (0-9999).");
+ php_error_docref(NULL, E_WARNING, "Year out of range (0-9999).");
RETURN_FALSE;
}
@@ -636,7 +636,7 @@ PHP_FUNCTION(jewishtojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -652,7 +652,7 @@ PHP_FUNCTION(jdtofrench)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -669,7 +669,7 @@ PHP_FUNCTION(frenchtojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -685,7 +685,7 @@ PHP_FUNCTION(jddayofweek)
int day;
char *daynamel, *daynames;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -716,7 +716,7 @@ PHP_FUNCTION(jdmonthname)
char *monthname = NULL;
int month, day, year;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &julday, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index b6dc135d33..90e93cb54b 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -46,13 +46,13 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, zend_long gm)
}
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(),
"|ll", &year, &method) == FAILURE) {
return;
}
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive");
+ php_error_docref(NULL, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive");
RETURN_FALSE;
}
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 7de6d949bb..9dc6f23801 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -53,19 +53,19 @@ PHP_FUNCTION(com_create_instance)
&authid, EOAC_NONE
};
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "s|s!ls",
+ ZEND_NUM_ARGS(), "s|s!ls",
&module_name, &module_name_len, &server_name, &server_name_len,
&obj->code_page, &typelib_name, &typelib_name_len) &&
FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "sa|ls",
+ ZEND_NUM_ARGS(), "sa|ls",
&module_name, &module_name_len, &server_params, &obj->code_page,
&typelib_name, &typelib_name_len)) {
- php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -114,21 +114,21 @@ PHP_FUNCTION(com_create_instance)
}
if (server_name && !COMG(allow_dcom)) {
- php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]" TSRMLS_CC);
+ php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]");
return;
}
- moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page TSRMLS_CC);
+ moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page);
/* if instantiating a remote object, either directly, or via
* a moniker, fill in the relevant info */
if (server_name) {
info.dwReserved1 = 0;
info.dwReserved2 = 0;
- info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page TSRMLS_CC);
+ info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page);
if (user_name) {
- authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC);
+ authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page);
authid.UserLength = (ULONG)user_name_len;
if (password) {
@@ -228,7 +228,7 @@ PHP_FUNCTION(com_create_instance)
spprintf(&msg, 0, "Failed to create COM object `%s': %s", module_name, werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
ZEND_CTOR_MAKE_NULL();
return;
@@ -241,11 +241,11 @@ PHP_FUNCTION(com_create_instance)
/* load up the library from the named file */
int cached;
- TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached TSRMLS_CC);
+ TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached);
if (TL) {
if (COMG(autoreg_on) && !cached) {
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
}
/* cross your fingers... there is no guarantee that this ITypeInfo
@@ -261,10 +261,10 @@ PHP_FUNCTION(com_create_instance)
BSTR name;
if (SUCCEEDED(ITypeLib_GetDocumentation(TL, -1, &name, NULL, NULL, NULL))) {
- typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page TSRMLS_CC);
+ typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page);
if (NULL != zend_ts_hash_str_add_ptr(&php_com_typelibraries, typelib_name, typelib_name_len, TL)) {
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
/* add a reference for the hash */
ITypeLib_AddRef(TL);
@@ -272,7 +272,7 @@ PHP_FUNCTION(com_create_instance)
} else {
/* try it anyway */
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
}
ITypeLib_Release(TL);
@@ -295,32 +295,32 @@ PHP_FUNCTION(com_get_active_object)
HRESULT res;
OLECHAR *module = NULL;
- php_com_initialize(TSRMLS_C);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ php_com_initialize();
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
&module_name, &module_name_len, &code_page)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments!");
return;
}
- module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page TSRMLS_CC);
+ module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page);
res = CLSIDFromString(module, &clsid);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
res = GetActiveObject(&clsid, NULL, &unk);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else if (obj) {
/* we got our dispatchable object */
- php_com_wrap_dispatch(return_value, obj, (int)code_page TSRMLS_CC);
+ php_com_wrap_dispatch(return_value, obj, (int)code_page);
}
}
}
@@ -338,7 +338,7 @@ PHP_FUNCTION(com_get_active_object)
/* Performs an Invoke on the given com object.
* returns a failure code and creates an exception if there was an error */
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
- WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC)
+ WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg)
{
HRESULT hr;
unsigned int arg_err;
@@ -354,11 +354,11 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
switch (hr) {
case DISP_E_EXCEPTION:
if (e.bstrSource) {
- source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page TSRMLS_CC);
+ source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page);
SysFreeString(e.bstrSource);
}
if (e.bstrDescription) {
- desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page TSRMLS_CC);
+ desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page);
SysFreeString(e.bstrDescription);
}
if (PG(html_errors)) {
@@ -406,7 +406,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
}
if (msg) {
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
}
}
@@ -416,7 +416,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
/* map an ID to a name */
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- size_t namelen, DISPID *dispid TSRMLS_DC)
+ size_t namelen, DISPID *dispid)
{
OLECHAR *olename;
HRESULT hr;
@@ -431,7 +431,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
return S_OK;
}
- olename = php_com_string_to_olestring(name, namelen, obj->code_page TSRMLS_CC);
+ olename = php_com_string_to_olestring(name, namelen, obj->code_page);
if (obj->typeinfo) {
hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid);
@@ -465,7 +465,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
/* the core of COM */
int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f,
- WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args)
{
DISPID dispid, altdispid;
DISPPARAMS disp_params;
@@ -478,7 +478,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
return FAILURE;
}
- hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC);
+ hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid);
if (FAILED(hr)) {
char *winerr = NULL;
@@ -486,7 +486,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
winerr = php_win32_error_to_msg(hr);
spprintf(&msg, 0, "Unable to lookup `%s': %s", f->function_name->val, winerr);
LocalFree(winerr);
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
return FAILURE;
}
@@ -509,7 +509,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
for (j = 0, i = 0; i < nargs; i++) {
if (f->arg_info[nargs - i - 1].pass_by_reference) {
/* put the value into byref_vals instead */
- php_com_variant_from_zval(&byref_vals[j], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&byref_vals[j], &args[nargs - i - 1], obj->code_page);
/* if it is already byref, "move" it into the vargs array, otherwise
* make vargs a reference to this value */
@@ -524,14 +524,14 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
}
j++;
} else {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
}
} else {
/* Invoke'd args are in reverse order */
for (i = 0; i < nargs; i++) {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
}
@@ -547,7 +547,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
}
/* this will create an exception if needed */
- hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0 TSRMLS_CC);
+ hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0);
/* release variants */
if (vargs) {
@@ -564,13 +564,13 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
/* copy that value */
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
- obj->code_page TSRMLS_CC);
+ obj->code_page);
}
} else {
/* not sure if this can ever happen; the variant we marked as BYREF
* is no longer BYREF - copy its value */
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
- obj->code_page TSRMLS_CC);
+ obj->code_page);
}
VariantClear(&byref_vals[j]);
j++;
@@ -591,7 +591,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
- WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg)
{
DISPID altdispid;
DISPPARAMS disp_params;
@@ -605,7 +605,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
/* Invoke'd args are in reverse order */
for (i = 0; i < nargs; i++) {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
disp_params.cArgs = nargs;
@@ -620,7 +620,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
/* this will create an exception if needed */
- hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, allow_noarg TSRMLS_CC);
+ hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, allow_noarg);
/* release variants */
if (vargs) {
@@ -638,25 +638,25 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
- WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg)
{
DISPID dispid;
HRESULT hr;
char *winerr = NULL;
char *msg = NULL;
- hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC);
+ hr = php_com_get_id_of_name(obj, name, namelen, &dispid);
if (FAILED(hr)) {
winerr = php_win32_error_to_msg(hr);
spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr);
LocalFree(winerr);
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
return FAILURE;
}
- return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg TSRMLS_CC);
+ return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg);
}
/* {{{ proto string com_create_guid()
@@ -670,12 +670,12 @@ PHP_FUNCTION(com_create_guid)
return;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
size_t len;
char *str;
- str = php_com_olestring_to_string(guid_string, &len, CP_ACP TSRMLS_CC);
+ str = php_com_olestring_to_string(guid_string, &len, CP_ACP);
RETVAL_STRINGL(str, len);
// TODO: avoid reallocation ???
efree(str);
@@ -698,12 +698,12 @@ PHP_FUNCTION(com_event_sink)
RETVAL_FALSE;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oo|z/",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Oo|z/",
&object, php_com_variant_class_entry, &sinkobject, &sink)) {
RETURN_FALSE;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = CDNO_FETCH(object);
if (sink && Z_TYPE_P(sink) == IS_ARRAY) {
@@ -719,20 +719,20 @@ PHP_FUNCTION(com_event_sink)
dispname = Z_STRVAL_P(sink);
}
- typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC);
+ typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1);
if (typeinfo) {
HashTable *id_to_name;
ALLOC_HASHTABLE(id_to_name);
- if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page TSRMLS_CC)) {
+ if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page)) {
/* Create the COM wrapper for this sink */
- obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name TSRMLS_CC);
+ obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name);
/* Now hook it up to the source */
- php_com_object_enable_event_sink(obj, TRUE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, TRUE);
RETVAL_TRUE;
} else {
@@ -759,12 +759,12 @@ PHP_FUNCTION(com_print_typeinfo)
php_com_dotnet_object *obj = NULL;
ITypeInfo *typeinfo;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|s!b", &arg1, &ifacename,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z/|s!b", &arg1, &ifacename,
&ifacelen, &wantsink)) {
RETURN_FALSE;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (Z_TYPE_P(arg1) == IS_OBJECT) {
CDNO_FETCH_VERIFY(obj, arg1);
} else {
@@ -772,9 +772,9 @@ PHP_FUNCTION(com_print_typeinfo)
typelibname = Z_STRVAL_P(arg1);
}
- typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0 TSRMLS_CC);
+ typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0);
if (typeinfo) {
- php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page) TSRMLS_CC);
+ php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page));
ITypeInfo_Release(typeinfo);
RETURN_TRUE;
} else {
@@ -792,10 +792,10 @@ PHP_FUNCTION(com_message_pump)
MSG msg;
DWORD result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &timeoutms) == FAILURE)
RETURN_FALSE;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
result = MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD)timeoutms, QS_ALLINPUT);
if (result == WAIT_OBJECT_0) {
@@ -823,18 +823,18 @@ PHP_FUNCTION(com_load_typelib)
int codepage = COMG(code_page);
int cached = 0;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &name, &namelen, &cs)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &name, &namelen, &cs)) {
return;
}
RETVAL_FALSE;
- php_com_initialize(TSRMLS_C);
- pTL = php_com_load_typelib_via_cache(name, codepage, &cached TSRMLS_CC);
+ php_com_initialize();
+ pTL = php_com_load_typelib_via_cache(name, codepage, &cached);
if (pTL) {
if (cached) {
RETVAL_TRUE;
- } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage TSRMLS_CC) == SUCCESS) {
+ } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
RETVAL_TRUE;
}
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index ae2c6ee2f0..35f795187a 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -121,7 +121,7 @@ struct dotnet_runtime_stuff {
DISPID create_instance;
};
-static HRESULT dotnet_init(char **p_where TSRMLS_DC)
+static HRESULT dotnet_init(char **p_where)
{
HRESULT hr;
struct dotnet_runtime_stuff *stuff;
@@ -197,17 +197,17 @@ PHP_FUNCTION(com_dotnet_create_instance)
char *where = "";
IUnknown *unk = NULL;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
if (stuff == NULL) {
- hr = dotnet_init(&where TSRMLS_CC);
+ hr = dotnet_init(&where);
if (FAILED(hr)) {
char buf[1024];
char *err = php_win32_error_to_msg(hr);
snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -222,7 +222,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZVAL_NULL(object);
return;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZVAL_NULL(object);
return;
}
@@ -243,17 +243,17 @@ PHP_FUNCTION(com_dotnet_create_instance)
obj = CDNO_FETCH(object);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l",
&assembly_name, &assembly_name_len,
&datatype_name, &datatype_name_len,
&obj->code_page)) {
- php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!");
ZEND_CTOR_MAKE_NULL();
return;
}
- oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
- oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
+ oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page);
+ oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page);
oletype_sys = SysAllocString(oletype);
oleassembly_sys = SysAllocString(oleassembly);
where = "CreateInstance";
@@ -313,14 +313,14 @@ PHP_FUNCTION(com_dotnet_create_instance)
if (err && err[0]) {
LocalFree(err);
}
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZEND_CTOR_MAKE_NULL();
return;
}
}
/* }}} */
-void php_com_dotnet_mshutdown(TSRMLS_D)
+void php_com_dotnet_mshutdown(void)
{
struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);
@@ -336,7 +336,7 @@ void php_com_dotnet_mshutdown(TSRMLS_D)
COMG(dotnet_runtime_stuff) = NULL;
}
-void php_com_dotnet_rshutdown(TSRMLS_D)
+void php_com_dotnet_rshutdown(void)
{
struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index e4ed4916af..4498a84e42 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -254,6 +254,9 @@ zend_module_entry com_dotnet_module_entry = {
/* }}} */
#ifdef COMPILE_DL_COM_DOTNET
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(com_dotnet)
#endif
@@ -309,9 +312,9 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
ptr--;
}
- if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached TSRMLS_CC)) != NULL) {
+ if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached)) != NULL) {
if (!cached) {
- php_com_import_typelib(pTL, mode, COMG(code_page) TSRMLS_CC);
+ php_com_import_typelib(pTL, mode, COMG(code_page));
}
ITypeLib_Release(pTL);
}
@@ -337,6 +340,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(com_dotnet)
{
+#if defined(COMPILE_DL_COM_DOTNET) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals));
com_dotnet_globals->code_page = CP_ACP;
}
@@ -352,24 +358,24 @@ PHP_MINIT_FUNCTION(com_dotnet)
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
- php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
- php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_com_saproxy_class_entry = zend_register_internal_class(&ce);
php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL;
/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
INIT_CLASS_ENTRY(ce, "variant", NULL);
ce.create_object = php_com_object_new;
- php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_com_variant_class_entry = zend_register_internal_class(&ce);
php_com_variant_class_entry->get_iterator = php_com_iter_get;
INIT_CLASS_ENTRY(ce, "com", NULL);
ce.create_object = php_com_object_new;
- tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry TSRMLS_CC);
+ tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp->get_iterator = php_com_iter_get;
zend_ts_hash_init(&php_com_typelibraries, 0, NULL, php_com_typelibrary_dtor, 1);
@@ -377,7 +383,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
#if HAVE_MSCOREE_H
INIT_CLASS_ENTRY(ce, "dotnet", NULL);
ce.create_object = php_com_object_new;
- tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry TSRMLS_CC);
+ tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp->get_iterator = php_com_iter_get;
#endif
@@ -469,7 +475,7 @@ PHP_MSHUTDOWN_FUNCTION(com_dotnet)
UNREGISTER_INI_ENTRIES();
#if HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
- php_com_dotnet_mshutdown(TSRMLS_C);
+ php_com_dotnet_mshutdown();
}
#endif
@@ -493,7 +499,7 @@ PHP_RSHUTDOWN_FUNCTION(com_dotnet)
{
#if HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
- php_com_dotnet_rshutdown(TSRMLS_C);
+ php_com_dotnet_rshutdown();
}
#endif
COMG(rshutdown_started) = 1;
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 8b721393fd..60830dc599 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -29,7 +29,7 @@
#include "php_com_dotnet_internal.h"
#include "Zend/zend_exceptions.h"
-static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv TSRMLS_DC)
+static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -45,22 +45,22 @@ static zval *com_property_read(zval *object, zval *member, int type, void **cahc
convert_to_string_ex(member);
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1 TSRMLS_CC);
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1);
if (res == SUCCESS) {
- php_com_zval_from_variant(rv, &v, obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(rv, &v, obj->code_page);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
- php_com_saproxy_create(object, rv, member TSRMLS_CC);
+ php_com_saproxy_create(object, rv, member);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant has no properties");
}
return rv;
}
-static void com_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void com_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -72,15 +72,15 @@ static void com_property_write(zval *object, zval *member, zval *value, void **c
convert_to_string_ex(member);
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
- DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, value, 0 TSRMLS_CC)) {
+ DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, value, 0)) {
VariantClear(&v);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant has no properties");
}
}
-static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -93,30 +93,30 @@ static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv T
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, offset, 0, 0 TSRMLS_CC)) {
- php_com_zval_from_variant(rv, &v, obj->code_page TSRMLS_CC);
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, offset, 0, 0)) {
+ php_com_zval_from_variant(rv, &v, obj->code_page);
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
convert_to_long(offset);
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
- if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset) TSRMLS_CC)) {
- php_com_wrap_variant(rv, &v, obj->code_page TSRMLS_CC);
+ if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset))) {
+ php_com_wrap_variant(rv, &v, obj->code_page);
VariantClear(&v);
}
} else {
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant is not an array type");
}
return rv;
}
-static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void com_write_dimension(zval *object, zval *offset, zval *value)
{
php_com_dotnet_object *obj;
zval args[2];
@@ -132,7 +132,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args, 0, 0 TSRMLS_CC)) {
+ DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args, 0, 0)) {
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
@@ -148,7 +148,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
indices = (LONG)Z_LVAL_P(offset);
VariantInit(&v);
- php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&v, value, obj->code_page);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
@@ -163,32 +163,32 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
VariantClear(&v);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions");
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant is not an array type");
}
}
#if 0
-static void com_object_set(zval **property, zval *value TSRMLS_DC)
+static void com_object_set(zval **property, zval *value)
{
/* Not yet implemented in the engine */
}
-static zval *com_object_get(zval *property TSRMLS_DC)
+static zval *com_object_get(zval *property)
{
/* Not yet implemented in the engine */
return NULL;
}
#endif
-static int com_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int com_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
DISPID dispid;
php_com_dotnet_object *obj;
@@ -197,7 +197,7 @@ static int com_property_exists(zval *object, zval *member, int check_empty, void
if (V_VT(&obj->v) == VT_DISPATCH) {
convert_to_string_ex(member);
- if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid TSRMLS_CC))) {
+ if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid))) {
/* TODO: distinguish between property and method! */
return 1;
}
@@ -208,23 +208,23 @@ static int com_property_exists(zval *object, zval *member, int check_empty, void
return 0;
}
-static int com_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int com_dimension_exists(zval *object, zval *member, int check_empty)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object");
+ php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object");
return 0;
}
-static void com_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void com_property_delete(zval *object, zval *member, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static void com_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void com_dimension_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static HashTable *com_properties_get(zval *object TSRMLS_DC)
+static HashTable *com_properties_get(zval *object)
{
/* TODO: use type-info to get all the names and values ?
* DANGER: if we do that, there is a strong possibility for
@@ -255,7 +255,7 @@ static PHP_FUNCTION(com_method_handler)
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
-static union _zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key TSRMLS_DC)
+static union _zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key)
{
zend_internal_function f, *fptr = NULL;
union _zend_function *func;
@@ -266,7 +266,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
return NULL;
}
- if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy TSRMLS_CC))) {
+ if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy))) {
return NULL;
}
@@ -293,7 +293,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
int i;
if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) {
- olename = php_com_string_to_olestring(name->val, name->len, obj->code_page TSRMLS_CC);
+ olename = php_com_string_to_olestring(name->val, name->len, obj->code_page);
lhash = LHashValOfNameSys(SYS_WIN32, LOCALE_SYSTEM_DEFAULT, olename);
if (SUCCEEDED(ITypeComp_Bind(comp, olename, lhash, INVOKE_FUNC, &TI, &kind, &bindptr))) {
@@ -378,8 +378,8 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU
VariantInit(&v);
- if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) {
- php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
+ if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args)) {
+ php_com_zval_from_variant(return_value, &v, obj->code_page);
ret = SUCCESS;
VariantClear(&v);
}
@@ -391,7 +391,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU
return ret;
}
-static union _zend_function *com_constructor_get(zend_object *object TSRMLS_DC)
+static union _zend_function *com_constructor_get(zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object *) object;
static zend_internal_function c, d, v;
@@ -423,7 +423,7 @@ static union _zend_function *com_constructor_get(zend_object *object TSRMLS_DC)
}
}
-static zend_string* com_class_name_get(const zend_object *object TSRMLS_DC)
+static zend_string* com_class_name_get(const zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object *)object;
@@ -431,7 +431,7 @@ static zend_string* com_class_name_get(const zend_object *object TSRMLS_DC)
}
/* This compares two variants for equality */
-static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int com_objects_compare(zval *object1, zval *object2)
{
php_com_dotnet_object *obja, *objb;
int ret;
@@ -463,7 +463,7 @@ static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
return ret;
}
-static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int com_object_cast(zval *readobj, zval *writeobj, int type)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -476,7 +476,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
if (V_VT(&obj->v) == VT_DISPATCH) {
if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1, 0 TSRMLS_CC)) {
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1, 0)) {
VariantCopy(&v, &obj->v);
}
} else {
@@ -506,7 +506,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
}
if (SUCCEEDED(res)) {
- php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(writeobj, &v, obj->code_page);
}
VariantClear(&v);
@@ -515,10 +515,10 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
return SUCCESS;
}
- return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC);
+ return zend_std_cast_object_tostring(readobj, writeobj, type);
}
-static int com_object_count(zval *object, zend_long *count TSRMLS_DC)
+static int com_object_count(zval *object, zend_long *count)
{
php_com_dotnet_object *obj;
LONG ubound = 0, lbound = 0;
@@ -566,7 +566,7 @@ zend_object_handlers php_com_object_handlers = {
NULL, /* get_gc */
};
-void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC)
+void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable)
{
if (obj->sink_dispatch) {
IConnectionPointContainer *cont;
@@ -590,7 +590,7 @@ void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSR
}
}
-void php_com_object_free_storage(zend_object *object TSRMLS_DC)
+void php_com_object_free_storage(zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object*)object;
@@ -600,7 +600,7 @@ void php_com_object_free_storage(zend_object *object TSRMLS_DC)
}
if (obj->sink_dispatch) {
- php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, FALSE);
IDispatch_Release(obj->sink_dispatch);
obj->sink_dispatch = NULL;
}
@@ -617,7 +617,7 @@ void php_com_object_free_storage(zend_object *object TSRMLS_DC)
}
}
-zend_object* php_com_object_clone(zval *object TSRMLS_DC)
+zend_object* php_com_object_clone(zval *object)
{
php_com_dotnet_object *cloneobj, *origobject;
@@ -641,11 +641,11 @@ zend_object* php_com_object_clone(zval *object TSRMLS_DC)
return (zend_object*)cloneobj;
}
-zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC)
+zend_object* php_com_object_new(zend_class_entry *ce)
{
php_com_dotnet_object *obj;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = emalloc(sizeof(*obj));
memset(obj, 0, sizeof(*obj));
@@ -653,7 +653,7 @@ zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC)
obj->code_page = CP_ACP;
obj->ce = ce;
- zend_object_std_init(&obj->zo, ce TSRMLS_CC);
+ zend_object_std_init(&obj->zo, ce);
obj->zo.handlers = &php_com_object_handlers;
return (zend_object*)obj;
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index a7614673f8..20cf6bfc19 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -41,7 +41,7 @@ struct php_com_iterator {
zval zdata;
};
-static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void com_iter_dtor(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -53,7 +53,7 @@ static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
zval_ptr_dtor(&I->zdata);
}
-static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int com_iter_valid(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -64,14 +64,14 @@ static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC)
return FAILURE;
}
-static zval* com_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval* com_iter_get_data(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
return &I->zdata;
}
-static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void com_iter_get_key(zend_object_iterator *iter, zval *key)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -82,7 +82,7 @@ static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
}
}
-static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static int com_iter_move_forwards(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
unsigned long n_fetched;
@@ -112,15 +112,15 @@ static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
return FAILURE;
}
I->key++;
- if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key TSRMLS_CC) == 0) {
+ if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key) == 0) {
I->key = (ulong)-1;
return FAILURE;
}
}
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
- /* php_com_wrap_variant(ptr, &I->v, I->code_page TSRMLS_CC); */
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
+ /* php_com_wrap_variant(ptr, &I->v, I->code_page); */
ZVAL_COPY_VALUE(&I->zdata, &ptr);
return SUCCESS;
}
@@ -135,7 +135,7 @@ static zend_object_iterator_funcs com_iter_funcs = {
NULL
};
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
php_com_dotnet_object *obj;
struct php_com_iterator *I;
@@ -152,7 +152,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v));
+ php_error_docref(NULL, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v));
return NULL;
}
@@ -160,7 +160,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
VariantInit(&v);
I = (struct php_com_iterator*)ecalloc(1, sizeof(*I));
- zend_iterator_init(&I->iter TSRMLS_CC);
+ zend_iterator_init(&I->iter);
I->iter.funcs = &com_iter_funcs;
Z_PTR(I->iter.data) = I;
I->code_page = obj->code_page;
@@ -175,7 +175,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
dims = SafeArrayGetDim(V_ARRAY(&obj->v));
if (dims != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Can only handle single dimension variant arrays (this array has %d)", dims);
goto fail;
}
@@ -189,10 +189,10 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
SafeArrayGetUBound(V_ARRAY(&I->safe_array), 1, &I->sa_max);
/* pre-fetch the element */
- if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound TSRMLS_CC)) {
+ if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound)) {
I->key = bound;
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
ZVAL_COPY_VALUE(&I->zdata, &ptr);
} else {
I->key = (ulong)-1;
@@ -226,7 +226,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
/* indicate that we have element 0 */
I->key = 0;
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
ZVAL_COPY_VALUE(&I->zdata, &ptr);
} else {
/* indicate that there are no more items */
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index f0b21ff014..f776cb4d32 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -29,7 +29,7 @@
#include "php_com_dotnet_internal.h"
#include "Zend/zend_exceptions.h"
-void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
+void php_com_throw_exception(HRESULT code, char *message)
{
int free_msg = 0;
if (message == NULL) {
@@ -37,9 +37,9 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
free_msg = 1;
}
#if SIZEOF_ZEND_LONG == 8
- zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code TSRMLS_CC);
+ zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code);
#else
- zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code TSRMLS_CC);
+ zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code);
#endif
if (free_msg) {
LocalFree(message);
@@ -47,7 +47,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
- int codepage TSRMLS_DC)
+ int codepage)
{
php_com_dotnet_object *obj;
@@ -64,13 +64,13 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
IDispatch_AddRef(V_DISPATCH(&obj->v));
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo);
- zend_object_std_init(&obj->zo, php_com_variant_class_entry TSRMLS_CC);
+ zend_object_std_init(&obj->zo, php_com_variant_class_entry);
obj->zo.handlers = &php_com_object_handlers;
ZVAL_OBJ(z, &obj->zo);
}
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
- int codepage TSRMLS_DC)
+ int codepage)
{
php_com_dotnet_object *obj;
@@ -88,14 +88,14 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo);
}
- zend_object_std_init(&obj->zo, php_com_variant_class_entry TSRMLS_CC);
+ zend_object_std_init(&obj->zo, php_com_variant_class_entry);
obj->zo.handlers = &php_com_object_handlers;
ZVAL_OBJ(z, &obj->zo);
}
/* this is a convenience function for fetching a particular
* element from a (possibly multi-dimensional) safe array */
-PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1)
{
UINT dims;
LONG lbound, ubound;
@@ -109,7 +109,7 @@ PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest,
dims = SafeArrayGetDim(V_ARRAY(array));
if (dims != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Can only handle single dimension variant arrays (this array has %d)", dims);
return 0;
}
@@ -124,7 +124,7 @@ PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest,
/* check bounds */
if (dim1 < lbound || dim1 > ubound) {
- php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds");
return 0;
}
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index 2e0b558288..30389ffb8c 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
-PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t string_len, int codepage)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -62,7 +62,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
if (!ok) {
char *msg = php_win32_error_to_msg(GetLastError());
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not convert string to unicode: `%s'", msg);
LocalFree(msg);
@@ -71,7 +71,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
return olestring;
}
-PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage)
{
char *string;
uint length = 0;
@@ -93,7 +93,7 @@ PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t
if (!ok) {
char *msg = php_win32_error_to_msg(GetLastError());
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not convert string from unicode: `%s'", msg);
LocalFree(msg);
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index dbe8b45300..187b50b120 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -45,17 +45,16 @@ typedef struct {
} php_istream;
static int le_istream;
-static void istream_destructor(php_istream *stm TSRMLS_DC);
+static void istream_destructor(php_istream *stm);
-static void istream_dtor(zend_resource *rsrc TSRMLS_DC)
+static void istream_dtor(zend_resource *rsrc)
{
php_istream *stm = (php_istream *)rsrc->ptr;
- istream_destructor(stm TSRMLS_CC);
+ istream_destructor(stm);
}
#define FETCH_STM() \
php_istream *stm = (php_istream*)This; \
- TSRMLS_FETCH(); \
if (GetCurrentThreadId() != stm->engine_thread) \
return RPC_E_WRONG_THREAD;
@@ -249,7 +248,7 @@ static struct IStreamVtbl php_istream_vtbl = {
stm_clone
};
-static void istream_destructor(php_istream *stm TSRMLS_DC)
+static void istream_destructor(php_istream *stm)
{
if (stm->res) {
zend_resource *res = stm->res;
@@ -268,7 +267,7 @@ static void istream_destructor(php_istream *stm TSRMLS_DC)
}
/* }}} */
-PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
+PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
zval *tmp;
@@ -283,7 +282,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR
stm->stream = stream;
GC_REFCOUNT(stream->res)++;
- tmp = zend_list_insert(stm, le_istream TSRMLS_CC);
+ tmp = zend_list_insert(stm, le_istream);
stm->res = Z_RES_P(tmp);
return (IStream*)stm;
@@ -295,7 +294,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR
#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)Z_OBJ_P(getThis());
-#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; }
+#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance"); return; }
typedef struct {
zend_object std;
@@ -351,7 +350,7 @@ CPH_METHOD(GetCurFileName)
if (res == S_OK) {
size_t len;
char *str = php_com_olestring_to_string(olename,
- &len, helper->codepage TSRMLS_CC);
+ &len, helper->codepage);
RETVAL_STRINGL(str, len);
// TODO: avoid reallocarion???
efree(str);
@@ -361,9 +360,9 @@ CPH_METHOD(GetCurFileName)
CoTaskMemFree(olename);
RETURN_FALSE;
}
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -384,24 +383,24 @@ CPH_METHOD(SaveToFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p!|b",
&filename, &filename_len, &remember)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
if (filename) {
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+ fullpath = expand_filepath(filename, NULL);
if (!fullpath) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
RETURN_FALSE;
}
- olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
+ olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage);
efree(fullpath);
}
res = IPersistFile_Save(helper->ipf, olefilename, remember);
@@ -423,11 +422,11 @@ CPH_METHOD(SaveToFile)
}
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -448,33 +447,33 @@ CPH_METHOD(LoadFromFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|l",
&filename, &filename_len, &flags)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
- if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if (!(fullpath = expand_filepath(filename, NULL))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
RETURN_FALSE;
}
- olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC);
+ olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage);
efree(fullpath);
res = IPersistFile_Load(helper->ipf, olefilename, (DWORD)flags);
efree(olefilename);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -497,13 +496,13 @@ CPH_METHOD(GetMaxStreamSize)
if (helper->ips) {
res = IPersistStream_GetSizeMax(helper->ips, &size);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
return;
}
}
if (res != S_OK) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
/* TODO: handle 64 bit properly */
RETURN_LONG((zend_long)size.QuadPart);
@@ -525,12 +524,12 @@ CPH_METHOD(InitNew)
res = IPersistStreamInit_InitNew(helper->ipsi);
if (res != S_OK) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
RETURN_TRUE;
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -545,21 +544,21 @@ CPH_METHOD(LoadFromStream)
HRESULT res;
CPH_FETCH();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
php_stream_from_zval_no_verify(stream, zstm);
if (stream == NULL) {
- php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "expected a stream");
return;
}
- stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
+ stm = php_com_wrapper_export_stream(stream);
if (stm == NULL) {
- php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
+ php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream");
return;
}
@@ -573,7 +572,7 @@ CPH_METHOD(LoadFromStream)
res = OleLoadFromStream(stm, &IID_IDispatch, &disp);
if (SUCCEEDED(res)) {
- php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC);
+ php_com_wrap_dispatch(return_value, disp, COMG(code_page));
}
} else {
res = get_persist_stream_init(helper);
@@ -589,7 +588,7 @@ CPH_METHOD(LoadFromStream)
IStream_Release(stm);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
RETURN_NULL();
}
}
@@ -607,21 +606,21 @@ CPH_METHOD(SaveToStream)
CPH_NO_OBJ();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
php_stream_from_zval_no_verify(stream, zstm);
if (stream == NULL) {
- php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "expected a stream");
return;
}
- stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
+ stm = php_com_wrapper_export_stream(stream);
if (stm == NULL) {
- php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
+ php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream");
return;
}
@@ -638,7 +637,7 @@ CPH_METHOD(SaveToStream)
IStream_Release(stm);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
return;
}
@@ -654,9 +653,9 @@ CPH_METHOD(__construct)
zval *zobj = NULL;
CPH_FETCH();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!",
&zobj, php_com_variant_class_entry)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
@@ -667,7 +666,7 @@ CPH_METHOD(__construct)
obj = CDNO_FETCH(zobj);
if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) {
- php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object");
return;
}
@@ -693,7 +692,7 @@ static const zend_function_entry com_persist_helper_methods[] = {
PHP_FE_END
};
-static void helper_free_storage(zend_object *obj TSRMLS_DC)
+static void helper_free_storage(zend_object *obj)
{
php_com_persist_helper *object = (php_com_persist_helper*)obj;
@@ -709,18 +708,18 @@ static void helper_free_storage(zend_object *obj TSRMLS_DC)
if (object->unk) {
IUnknown_Release(object->unk);
}
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
}
-static zend_object* helper_clone(zval *obj TSRMLS_DC)
+static zend_object* helper_clone(zval *obj)
{
php_com_persist_helper *clone, *object = (php_com_persist_helper*)Z_OBJ_P(obj);
clone = emalloc(sizeof(*object));
memcpy(clone, object, sizeof(*object));
- zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC);
+ zend_object_std_init(&clone->std, object->std.ce);
if (clone->ipf) {
IPersistFile_AddRef(clone->ipf);
@@ -737,14 +736,14 @@ static zend_object* helper_clone(zval *obj TSRMLS_DC)
return (zend_object*)clone;
}
-static zend_object* helper_new(zend_class_entry *ce TSRMLS_DC)
+static zend_object* helper_new(zend_class_entry *ce)
{
php_com_persist_helper *helper;
helper = emalloc(sizeof(*helper));
memset(helper, 0, sizeof(*helper));
- zend_object_std_init(&helper->std, helper_ce TSRMLS_CC);
+ zend_object_std_init(&helper->std, helper_ce);
helper->std.handlers = &helper_handlers;
return &helper->std;
@@ -760,7 +759,7 @@ int php_com_persist_minit(INIT_FUNC_ARGS)
INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods);
ce.create_object = helper_new;
- helper_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ helper_ce = zend_register_internal_class(&ce);
helper_ce->ce_flags |= ZEND_ACC_FINAL;
le_istream = zend_register_list_destructors_ex(istream_dtor,
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 1d187a77bf..481e95a2bd 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -71,21 +71,21 @@ static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, in
}
}
-static zval *saproxy_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv TSRMLS_DC)
+static zval *saproxy_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv)
{
ZVAL_NULL(rv);
- php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
return rv;
}
-static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
}
-static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv)
{
php_com_saproxy *proxy = SA_FETCH(object);
UINT dims, i;
@@ -114,20 +114,20 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
res = php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
Z_STRLEN(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
- proxy->dimensions, args, 0 TSRMLS_CC);
+ proxy->dimensions, args, 0);
if (res == SUCCESS) {
- php_com_zval_from_variant(rv, &v, proxy->obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(rv, &v, proxy->obj->code_page);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
/* return another proxy */
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
return rv;
} else if (!V_ISARRAY(&proxy->obj->v)) {
- php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object");
return rv;
}
@@ -141,7 +141,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
if ((UINT) proxy->dimensions >= dims) {
/* too many dimensions */
- php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "too many dimensions!");
return rv;
}
@@ -150,7 +150,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
SafeArrayGetUBound(sa, proxy->dimensions, &ubound);
if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) {
- php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds");
return rv;
}
@@ -188,22 +188,22 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
efree(indices);
if (SUCCEEDED(res)) {
- php_com_wrap_variant(rv, &v, proxy->obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(rv, &v, proxy->obj->code_page);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
VariantClear(&v);
} else {
/* return another proxy */
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
return rv;
}
-static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void saproxy_write_dimension(zval *object, zval *offset, zval *value)
{
php_com_saproxy *proxy = SA_FETCH(object);
UINT dims, i;
@@ -226,7 +226,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VariantInit(&v);
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
Z_STRLEN(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
- args, 0 TSRMLS_CC)) {
+ args, 0)) {
VariantClear(&v);
}
@@ -253,7 +253,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
}
VariantInit(&v);
- php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&v, value, proxy->obj->code_page);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
@@ -269,54 +269,54 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VariantClear(&v);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC);
+ php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object");
}
}
#if 0
-static void saproxy_object_set(zval **property, zval *value TSRMLS_DC)
+static void saproxy_object_set(zval **property, zval *value)
{
}
-static zval *saproxy_object_get(zval *property TSRMLS_DC)
+static zval *saproxy_object_get(zval *property)
{
/* Not yet implemented in the engine */
return NULL;
}
#endif
-static int saproxy_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int saproxy_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
/* no properties */
return 0;
}
-static int saproxy_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int saproxy_dimension_exists(zval *object, zval *member, int check_empty)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object");
+ php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object");
return 0;
}
-static void saproxy_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void saproxy_property_delete(zval *object, zval *member, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static void saproxy_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void saproxy_dimension_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static HashTable *saproxy_properties_get(zval *object TSRMLS_DC)
+static HashTable *saproxy_properties_get(zval *object)
{
/* no properties */
return NULL;
}
-static union _zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key TSRMLS_DC)
+static union _zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key)
{
/* no methods */
return NULL;
@@ -327,28 +327,28 @@ static int saproxy_call_method(zend_string *method, zend_object *object, INTERNA
return FAILURE;
}
-static union _zend_function *saproxy_constructor_get(zend_object *object TSRMLS_DC)
+static union _zend_function *saproxy_constructor_get(zend_object *object)
{
/* user cannot instantiate */
return NULL;
}
-static zend_string* saproxy_class_name_get(const zend_object *object TSRMLS_DC)
+static zend_string* saproxy_class_name_get(const zend_object *object)
{
return zend_string_copy(php_com_saproxy_class_entry->name);
}
-static int saproxy_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int saproxy_objects_compare(zval *object1, zval *object2)
{
return -1;
}
-static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int saproxy_object_cast(zval *readobj, zval *writeobj, int type)
{
return FAILURE;
}
-static int saproxy_count_elements(zval *object, zend_long *count TSRMLS_DC)
+static int saproxy_count_elements(zval *object, zend_long *count)
{
php_com_saproxy *proxy = SA_FETCH(object);
LONG ubound, lbound;
@@ -365,7 +365,7 @@ static int saproxy_count_elements(zval *object, zend_long *count TSRMLS_DC)
return SUCCESS;
}
-static void saproxy_free_storage(zend_object *object TSRMLS_DC)
+static void saproxy_free_storage(zend_object *object)
{
php_com_saproxy *proxy = (php_com_saproxy *)object;
//??? int i;
@@ -380,7 +380,7 @@ static void saproxy_free_storage(zend_object *object TSRMLS_DC)
efree(proxy->indices);
}
-static zend_object* saproxy_clone(zval *object TSRMLS_DC)
+static zend_object* saproxy_clone(zval *object)
{
php_com_saproxy *proxy = (php_com_saproxy *)Z_OBJ_P(object);
php_com_saproxy *cloneproxy;
@@ -421,7 +421,7 @@ zend_object_handlers php_com_saproxy_handlers = {
saproxy_count_elements
};
-int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC)
+int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index)
{
php_com_saproxy *proxy, *rel = NULL;
@@ -447,7 +447,7 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
ZVAL_DUP(&proxy->indices[proxy->dimensions-1], index);
- zend_object_std_init(&proxy->std, php_com_saproxy_class_entry TSRMLS_CC);
+ zend_object_std_init(&proxy->std, php_com_saproxy_class_entry);
proxy->std.handlers = &php_com_saproxy_handlers;
ZVAL_OBJ(proxy_out, &proxy->std);
@@ -456,7 +456,7 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
/* iterator */
-static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void saproxy_iter_dtor(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -466,14 +466,14 @@ static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
efree(I);
}
-static int saproxy_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int saproxy_iter_valid(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
return (I->key < I->imax) ? SUCCESS : FAILURE;
}
-static zval* saproxy_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval* saproxy_iter_get_data(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
VARIANT v;
@@ -497,13 +497,13 @@ static zval* saproxy_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
}
ZVAL_NULL(&I->data);
- php_com_wrap_variant(&I->data, &v, I->proxy->obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(&I->data, &v, I->proxy->obj->code_page);
VariantClear(&v);
return &I->data;
}
-static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -514,7 +514,7 @@ static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC
}
}
-static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static int saproxy_iter_move_forwards(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -535,7 +535,7 @@ static zend_object_iterator_funcs saproxy_iter_funcs = {
};
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
php_com_saproxy *proxy = SA_FETCH(object);
php_com_saproxy_iter *I;
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index f07d7ff65d..2e2732afcd 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
-PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -52,7 +52,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
major = php_strtok_r(NULL, ",", &strtok_buf);
minor = php_strtok_r(NULL, ",", &strtok_buf);
- p = php_com_string_to_olestring(search_string, strlen(search_string), codepage TSRMLS_CC);
+ p = php_com_string_to_olestring(search_string, strlen(search_string), codepage);
if (SUCCEEDED(CLSIDFromString(p, &clsid))) {
WORD major_i = 1, minor_i = 0;
@@ -129,7 +129,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
spprintf(&str, 0, "%s,%d,%d", keyname, major_tmp, minor_tmp);
/* recurse */
- TL = php_com_load_typelib(str, codepage TSRMLS_CC);
+ TL = php_com_load_typelib(str, codepage);
efree(str);
break;
@@ -153,7 +153,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
/* Given a type-library, merge it into the current engine state */
-PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -185,7 +185,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
continue;
}
- const_name = php_com_olestring_to_string(bstr_ids, &len, codepage TSRMLS_CC);
+ const_name = php_com_olestring_to_string(bstr_ids, &len, codepage);
c.name = zend_string_init(const_name, len, 1);
// TODO: avoid reallocation???
efree(const_name);
@@ -197,9 +197,9 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
SysFreeString(bstr_ids);
/* sanity check for the case where the constant is already defined */
- if ((exists = zend_get_constant(c.name TSRMLS_CC)) != NULL) {
- if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type library constant %s is already defined", c.name);
+ if ((exists = zend_get_constant(c.name)) != NULL) {
+ if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists)) {
+ php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", c.name);
}
zend_string_release(c.name);
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
@@ -207,12 +207,12 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
}
/* register the constant */
- php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage TSRMLS_CC);
+ php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
if (Z_TYPE(value) == IS_LONG) {
c.flags = mode;
ZVAL_LONG(&c.value, Z_LVAL(value));
c.module_number = 0;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
}
@@ -230,7 +230,7 @@ void php_com_typelibrary_dtor(void *pDest)
}
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
- int codepage, int *cached TSRMLS_DC)
+ int codepage, int *cached)
{
ITypeLib *TL;
char *name_dup;
@@ -247,7 +247,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
*cached = 0;
name_dup = estrndup(search_string, l);
- TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC);
+ TL = php_com_load_typelib(name_dup, codepage);
efree(name_dup);
if (TL) {
@@ -261,7 +261,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
return TL;
}
-ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC)
+ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink)
{
ITypeInfo *typeinfo = NULL;
ITypeLib *typelib = NULL;
@@ -280,7 +280,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
/* examine the available interfaces */
/* TODO: write some code here */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IProvideClassInfo: this code not yet written!");
+ php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
IProvideClassInfo_Release(pci);
}
} else if (dispname == NULL) {
@@ -312,13 +312,13 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
}
} else if (typelibname) {
/* Fetch the typelibrary and use that to look things up */
- typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP TSRMLS_CC);
+ typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP);
}
if (!gotguid && dispname && typelib) {
unsigned short cfound;
MEMBERID memid;
- OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP TSRMLS_CC);
+ OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP);
cfound = 1;
if (FAILED(ITypeLib_FindName(typelib, olename, 0, &typeinfo, &memid, &cfound)) || cfound == 0) {
@@ -417,20 +417,20 @@ static inline const char *vt_to_string(VARTYPE vt)
return "?";
}
-static char *php_com_string_from_clsid(const CLSID *clsid, int codepage TSRMLS_DC)
+static char *php_com_string_from_clsid(const CLSID *clsid, int codepage)
{
LPOLESTR ole_clsid;
char *clsid_str;
StringFromCLSID(clsid, &ole_clsid);
- clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage TSRMLS_CC);
+ clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage);
LocalFree(ole_clsid);
return clsid_str;
}
-int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC)
+int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage)
{
TYPEATTR *attr;
FUNCDESC *func;
@@ -455,10 +455,10 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
char *guidstring;
ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL);
- ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC);
+ ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage);
SysFreeString(olename);
- guidstring = php_com_string_from_clsid(&attr->guid, codepage TSRMLS_CC);
+ guidstring = php_com_string_from_clsid(&attr->guid, codepage);
php_printf("class %s { /* GUID=%s */\n", ansiname, guidstring);
efree(guidstring);
@@ -485,7 +485,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
lastid = func->memid;
ITypeInfo_GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL);
- ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC);
+ ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage);
SysFreeString(olename);
if (printdef) {
@@ -514,7 +514,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
- funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage);
SysFreeString(olename);
php_printf("\t/* %s */\n", funcdesc);
efree(funcdesc);
@@ -547,7 +547,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
/* when we handle prop put and get, this will look nicer */
if (j+1 < (int)cnames) {
- funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage);
SysFreeString(names[j+1]);
} else {
funcdesc = "???";
@@ -568,7 +568,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
- funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage);
SysFreeString(olename);
php_printf("\t\t/* %s */\n", funcdesc);
efree(funcdesc);
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 7317b8d0e4..ce919d8a03 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -32,7 +32,7 @@
* Only creates a single-dimensional array of variants.
* The keys of the PHP hash MUST be numeric. If the array
* is sparse, then the gaps will be filled with NULL variants */
-static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
+static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
{
SAFEARRAY *sa = NULL;
SAFEARRAYBOUND bound;
@@ -54,7 +54,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
} else if (HASH_KEY_NON_EXISTENT == keytype) {
break;
} else if (intindex > UINT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
+ php_error_docref(NULL, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
break;
}
}
@@ -75,7 +75,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
break;
}
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
- php_com_variant_from_zval(&va[intindex], item, codepage TSRMLS_CC);
+ php_com_variant_from_zval(&va[intindex], item, codepage);
}
/* Unlock it and stuff it into our variant */
@@ -86,7 +86,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
return;
bogus:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
+ php_error_docref(NULL, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
V_VT(v) = VT_NULL;
@@ -96,7 +96,7 @@ bogus:
}
}
-PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -118,7 +118,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
break;
case IS_OBJECT:
- if (php_com_is_valid_object(z TSRMLS_CC)) {
+ if (php_com_is_valid_object(z)) {
obj = CDNO_FETCH(z);
if (V_VT(&obj->v) == VT_DISPATCH) {
/* pass the underlying object */
@@ -135,13 +135,13 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
} else {
/* export the PHP object using our COM wrapper */
V_VT(v) = VT_DISPATCH;
- V_DISPATCH(v) = php_com_wrapper_export(z TSRMLS_CC);
+ V_DISPATCH(v) = php_com_wrapper_export(z);
}
break;
case IS_ARRAY:
/* map as safe array */
- safe_array_from_zval(v, z, codepage TSRMLS_CC);
+ safe_array_from_zval(v, z, codepage);
break;
case IS_LONG:
@@ -161,7 +161,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
- olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
+ olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage);
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(wcslen(olestring) * sizeof(OLECHAR)));
} else {
@@ -179,7 +179,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
}
}
-PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -236,7 +236,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
if (olestring) {
size_t len;
char *str = php_com_olestring_to_string(olestring,
- &len, codepage TSRMLS_CC);
+ &len, codepage);
ZVAL_STRINGL(z, str, len);
// TODO: avoid reallocation???
efree(str);
@@ -248,7 +248,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
IDispatch *disp;
if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, &disp))) {
- php_com_wrap_dispatch(z, disp, codepage TSRMLS_CC);
+ php_com_wrap_dispatch(z, disp, codepage);
IDispatch_Release(disp);
} else {
ret = FAILURE;
@@ -258,16 +258,16 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
case VT_DISPATCH:
if (V_DISPATCH(v) != NULL) {
- php_com_wrap_dispatch(z, V_DISPATCH(v), codepage TSRMLS_CC);
+ php_com_wrap_dispatch(z, V_DISPATCH(v), codepage);
}
break;
case VT_VARIANT:
/* points to another variant */
- return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage TSRMLS_CC);
+ return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage);
default:
- php_com_wrap_variant(z, v, codepage TSRMLS_CC);
+ php_com_wrap_variant(z, v, codepage);
}
if (olestring) {
@@ -275,14 +275,14 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
}
if (ret == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret);
+ php_error_docref(NULL, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret);
}
return ret;
}
-PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar)
{
int ret = SUCCESS;
@@ -422,10 +422,10 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR
break;
case VT_VARIANT:
- return php_com_copy_variant(V_VARIANTREF(dstvar), srcvar TSRMLS_CC);
+ return php_com_copy_variant(V_VARIANTREF(dstvar), srcvar);
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->variant: failed to copy from 0x%x to 0x%x", V_VT(dstvar), V_VT(srcvar));
+ php_error_docref(NULL, E_WARNING, "variant->variant: failed to copy from 0x%x to 0x%x", V_VT(dstvar), V_VT(srcvar));
ret = FAILURE;
}
return ret;
@@ -448,19 +448,19 @@ PHP_FUNCTION(com_variant_create_instance)
obj = CDNO_FETCH(object);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!|ll", &zvalue, &vt, &codepage)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (ZEND_NUM_ARGS() == 3) {
obj->code_page = (int)codepage;
}
if (zvalue) {
- php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&obj->v, zvalue, obj->code_page);
}
/* Only perform conversion if variant not already of type passed */
@@ -490,7 +490,7 @@ PHP_FUNCTION(com_variant_create_instance)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
}
@@ -510,7 +510,7 @@ PHP_FUNCTION(variant_set)
zval *zobj, *zvalue = NULL;
php_com_dotnet_object *obj;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Oz!", &zobj, php_com_variant_class_entry, &zvalue)) {
return;
}
@@ -523,14 +523,14 @@ PHP_FUNCTION(variant_set)
obj->typeinfo = NULL;
}
if (obj->sink_dispatch) {
- php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, FALSE);
IDispatch_Release(obj->sink_dispatch);
obj->sink_dispatch = NULL;
}
VariantClear(&obj->v);
- php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&obj->v, zvalue, obj->code_page);
/* remember we modified this variant */
obj->modified = 1;
}
@@ -561,33 +561,33 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "OO", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "OO", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Oz!", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "Oz!", &zleft, php_com_variant_class_entry,
&zright)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "z!O", &zleft, &zright, php_com_variant_class_entry)) {
+ ZEND_NUM_ARGS(), "z!O", &zleft, &zright, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ php_com_variant_from_zval(vleft, zleft, codepage);
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!z!", &zleft, &zright)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else {
return;
@@ -639,9 +639,9 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
}
if (SUCCEEDED(result)) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
} else {
- php_com_throw_exception(result, NULL TSRMLS_CC);
+ php_com_throw_exception(result, NULL);
}
VariantClear(&vres);
@@ -768,13 +768,13 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "O", &zleft, php_com_variant_class_entry)) {
+ ZEND_NUM_ARGS(), "O", &zleft, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!", &zleft)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
} else {
return;
}
@@ -800,9 +800,9 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
}
if (SUCCEEDED(result)) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
} else {
- php_com_throw_exception(result, NULL TSRMLS_CC);
+ php_com_throw_exception(result, NULL);
}
VariantClear(&vres);
@@ -866,19 +866,19 @@ PHP_FUNCTION(variant_round)
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &zleft, php_com_variant_class_entry, &decimals)) {
+ ZEND_NUM_ARGS(), "Ol", &zleft, php_com_variant_class_entry, &decimals)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!l", &zleft, &decimals)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
} else {
return;
}
if (SUCCEEDED(VarRound(vleft, (int)decimals, &vres))) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
}
VariantClear(&vres);
@@ -904,34 +904,34 @@ PHP_FUNCTION(variant_cmp)
VariantInit(&right_val);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "OO|ll", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "Oz!|ll", &zleft, php_com_variant_class_entry,
&zright, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
&lcid, &flags)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ php_com_variant_from_zval(vleft, zleft, codepage);
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!z!|ll", &zleft, &zright, &lcid, &flags)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else {
return;
@@ -954,7 +954,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
VariantInit(&vres);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"O", &zleft, php_com_variant_class_entry)) {
return;
}
@@ -993,13 +993,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
struct tm *tmv;
VARIANT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l",
&timestamp)) {
return;
}
if (timestamp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timestamp value must be a positive value.");
+ php_error_docref(NULL, E_WARNING, "Timestamp value must be a positive value.");
RETURN_FALSE;
}
@@ -1019,7 +1019,7 @@ PHP_FUNCTION(variant_date_from_timestamp)
V_VT(&res) = VT_DATE;
SystemTimeToVariantTime(&systime, &V_DATE(&res));
- php_com_wrap_variant(return_value, &res, CP_ACP TSRMLS_CC);
+ php_com_wrap_variant(return_value, &res, CP_ACP);
VariantClear(&res);
}
@@ -1032,7 +1032,7 @@ PHP_FUNCTION(variant_get_type)
zval *zobj;
php_com_dotnet_object *obj;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"O", &zobj, php_com_variant_class_entry)) {
return;
}
@@ -1051,7 +1051,7 @@ PHP_FUNCTION(variant_set_type)
/* VARTYPE == unsigned short */ zend_long vt;
HRESULT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
@@ -1071,7 +1071,7 @@ PHP_FUNCTION(variant_set_type)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
}
@@ -1087,7 +1087,7 @@ PHP_FUNCTION(variant_cast)
VARIANT vres;
HRESULT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
@@ -1097,7 +1097,7 @@ PHP_FUNCTION(variant_cast)
res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt);
if (SUCCEEDED(res)) {
- php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, obj->code_page);
} else {
char *werr, *msg;
@@ -1105,7 +1105,7 @@ PHP_FUNCTION(variant_cast)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index f7dd7fd463..f1d08c15f2 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -52,12 +52,12 @@ typedef struct {
static int le_dispatch;
-static void disp_destructor(php_dispatchex *disp TSRMLS_DC);
+static void disp_destructor(php_dispatchex *disp);
-static void dispatch_dtor(zend_resource *rsrc TSRMLS_DC)
+static void dispatch_dtor(zend_resource *rsrc)
{
php_dispatchex *disp = (php_dispatchex *)rsrc->ptr;
- disp_destructor(disp TSRMLS_CC);
+ disp_destructor(disp);
}
int php_com_wrapper_minit(INIT_FUNC_ARGS)
@@ -88,7 +88,6 @@ static inline void trace(char *fmt, ...)
#define FETCH_DISP(methname) \
php_dispatchex *disp = (php_dispatchex*)This; \
- TSRMLS_FETCH(); \
if (COMG(rshutdown_started)) { \
trace(" PHP Object:%p (name:unknown) %s\n", Z_OBJ(disp->object), methname); \
} else { \
@@ -179,7 +178,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
size_t namelen;
zval *tmp;
- name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC);
+ name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page));
/* Lookup the name in the hash */
if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) == NULL) {
@@ -224,7 +223,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
zval *tmp;
FETCH_DISP("GetDispID");
- name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page) TSRMLS_CC);
+ name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page));
trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid);
@@ -273,7 +272,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
- php_com_wrap_variant(&params[i], arg, COMG(code_page) TSRMLS_CC);
+ php_com_wrap_variant(&params[i], arg, COMG(code_page));
}
}
@@ -283,14 +282,14 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
* and expose it as a COM exception */
if (wFlags & DISPATCH_PROPERTYGET) {
- retval = zend_read_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1 TSRMLS_CC);
+ retval = zend_read_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
- zend_update_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name), &params[0] TSRMLS_CC);
+ zend_update_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name), &params[0]);
} else if (wFlags & DISPATCH_METHOD) {
zend_try {
retval = &rv;
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, name,
- retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
+ retval, pdp->cArgs, params, 1, NULL)) {
ret = S_OK;
trace("function called ok\n");
@@ -301,7 +300,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
VARIANT *dstvar = &pdp->rgvarg[ pdp->cArgs - 1 - i];
if ((V_VT(dstvar) & VT_BYREF) && obj->modified ) {
trace("percolate modified value for arg %d VT=%08x\n", i, V_VT(dstvar));
- php_com_copy_variant(dstvar, srcvar TSRMLS_CC);
+ php_com_copy_variant(dstvar, srcvar);
}
}
} else {
@@ -328,7 +327,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
if (retval) {
if (pvarRes) {
VariantInit(pvarRes);
- php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
+ php_com_variant_from_zval(pvarRes, retval, COMG(code_page));
}
zval_ptr_dtor(retval);
} else if (pvarRes) {
@@ -385,7 +384,7 @@ static HRESULT STDMETHODCALLTYPE disp_getmembername(
FETCH_DISP("GetMemberName");
if (NULL != (name = zend_hash_index_find(disp->dispid_to_name, id))) {
- OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page) TSRMLS_CC);
+ OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page));
*pbstrName = SysAllocString(olestr);
efree(olestr);
return S_OK;
@@ -444,7 +443,7 @@ static struct IDispatchExVtbl php_dispatch_vtbl = {
/* enumerate functions and properties of the object and assign
* dispatch ids */
-static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
+static void generate_dispids(php_dispatchex *disp)
{
HashPosition pos;
zend_string *name = NULL;
@@ -529,7 +528,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
}
}
-static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
+static php_dispatchex *disp_constructor(zval *object)
{
php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex));
zval *tmp;
@@ -552,13 +551,13 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
ZVAL_UNDEF(&disp->object);
}
- tmp = zend_list_insert(disp, le_dispatch TSRMLS_CC);
+ tmp = zend_list_insert(disp, le_dispatch);
disp->res = Z_RES_P(tmp);
return disp;
}
-static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
+static void disp_destructor(php_dispatchex *disp)
{
/* Object store not available during request shutdown */
if (COMG(rshutdown_started)) {
@@ -583,9 +582,9 @@ static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
- HashTable *id_to_name TSRMLS_DC)
+ HashTable *id_to_name)
{
- php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
+ php_dispatchex *disp = disp_constructor(val);
HashPosition pos;
zend_string *name = NULL;
zval tmp, *ntmp;
@@ -618,7 +617,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
return (IDispatch*)disp;
}
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val)
{
php_dispatchex *disp = NULL;
@@ -626,7 +625,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
return NULL;
}
- if (php_com_is_valid_object(val TSRMLS_CC)) {
+ if (php_com_is_valid_object(val)) {
/* pass back its IDispatch directly */
php_com_dotnet_object *obj = CDNO_FETCH(val);
@@ -641,8 +640,8 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
return NULL;
}
- disp = disp_constructor(val TSRMLS_CC);
- generate_dispids(disp TSRMLS_CC);
+ disp = disp_constructor(val);
+ generate_dispids(disp);
return (IDispatch*)disp;
}
diff --git a/ext/com_dotnet/config.w32 b/ext/com_dotnet/config.w32
index 1526392c24..3ae2328427 100644
--- a/ext/com_dotnet/config.w32
+++ b/ext/com_dotnet/config.w32
@@ -7,7 +7,8 @@ if (PHP_COM_DOTNET == "yes") {
CHECK_LIB('oleaut32.lib', 'com_dotnet');
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
com_handlers.c com_iterator.c com_misc.c com_olechar.c \
- com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c");
+ com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c",
+ null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
}
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index cb60083289..5066a044ff 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -53,7 +53,10 @@ ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
ZEND_END_MODULE_GLOBALS(com_dotnet)
#ifdef ZTS
-# define COMG(v) TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v)
+# define COMG(v) ZEND_TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v)
+# ifdef COMPILE_DL_COM_DOTNET
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define COMG(v) (com_dotnet_globals.v)
#endif
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index e06f50c7d6..518e27af1f 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -54,7 +54,7 @@ typedef struct _php_com_dotnet_object {
HashTable *id_of_name_cache;
} php_com_dotnet_object;
-static inline int php_com_is_valid_object(zval *zv TSRMLS_DC)
+static inline int php_com_is_valid_object(zval *zv)
{
zend_class_entry *ce = Z_OBJCE_P(zv);
return strcmp("com", ce->name->val) == 0 ||
@@ -64,8 +64,8 @@ static inline int php_com_is_valid_object(zval *zv TSRMLS_DC)
#define CDNO_FETCH(zv) (php_com_dotnet_object*)Z_OBJ_P(zv)
#define CDNO_FETCH_VERIFY(obj, zv) do { \
- if (!php_com_is_valid_object(zv TSRMLS_CC)) { \
- php_com_throw_exception(E_UNEXPECTED, "expected a variant object" TSRMLS_CC); \
+ if (!php_com_is_valid_object(zv)) { \
+ php_com_throw_exception(E_UNEXPECTED, "expected a variant object"); \
return; \
} \
obj = (php_com_dotnet_object*)Z_OBJ_P(zv); \
@@ -76,21 +76,21 @@ TsHashTable php_com_typelibraries;
zend_class_entry *php_com_variant_class_entry, *php_com_exception_class_entry, *php_com_saproxy_class_entry;
/* com_handlers.c */
-zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC);
-zend_object* php_com_object_clone(zval *object TSRMLS_DC);
-void php_com_object_free_storage(zend_object *object TSRMLS_DC);
+zend_object* php_com_object_new(zend_class_entry *ce);
+zend_object* php_com_object_clone(zval *object);
+void php_com_object_free_storage(zend_object *object);
zend_object_handlers php_com_object_handlers;
-void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC);
+void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable);
/* com_saproxy.c */
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
-int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref);
+int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index);
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
- size_t *string_len, int codepage TSRMLS_DC);
+ size_t *string_len, int codepage);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
- size_t string_len, int codepage TSRMLS_DC);
+ size_t string_len, int codepage);
/* com_com.c */
@@ -103,20 +103,20 @@ PHP_FUNCTION(com_load_typelib);
PHP_FUNCTION(com_get_active_object);
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
- WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC);
+ WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg);
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- size_t namelen, DISPID *dispid TSRMLS_DC);
+ size_t namelen, DISPID *dispid);
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
- WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg);
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
- WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg);
int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f,
- WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args);
/* com_wrapper.c */
int php_com_wrapper_minit(INIT_FUNC_ARGS);
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -150,36 +150,36 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
-PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
+PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage);
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage);
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage);
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src);
/* com_dotnet.c */
PHP_FUNCTION(com_dotnet_create_instance);
-void php_com_dotnet_rshutdown(TSRMLS_D);
-void php_com_dotnet_mshutdown(TSRMLS_D);
+void php_com_dotnet_rshutdown(void);
+void php_com_dotnet_mshutdown(void);
/* com_misc.c */
-void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
+void php_com_throw_exception(HRESULT code, char *message);
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
- int codepage TSRMLS_DC);
+ int codepage);
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
- int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
+ int codepage);
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1);
/* com_typeinfo.c */
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
- int codepage, int *cached TSRMLS_DC);
-PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
+ int codepage, int *cached);
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
- int codepage TSRMLS_DC);
+ int codepage);
void php_com_typelibrary_dtor(void *pDest);
-ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
-int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC);
+ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink);
+int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage);
/* com_iterator.c */
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref);
#endif
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index b03afe05f0..da04f1fad0 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -144,7 +144,7 @@ static PHP_MINFO_FUNCTION(ctype)
*/
#define CTYPE(iswhat) \
zval *c, tmp; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &c) == FAILURE) \
return; \
if (Z_TYPE_P(c) == IS_LONG) { \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index 6b0e5462a1..a544035630 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -35,20 +35,20 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
size_t fname_len, mime_len, postname_len;
zval *cf = return_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
return;
}
if (fname) {
- zend_update_property_string(curl_CURLFile_class, cf, "name", sizeof("name")-1, fname TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "name", sizeof("name")-1, fname);
}
if (mime) {
- zend_update_property_string(curl_CURLFile_class, cf, "mime", sizeof("mime")-1, mime TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "mime", sizeof("mime")-1, mime);
}
if (postname) {
- zend_update_property_string(curl_CURLFile_class, cf, "postname", sizeof("postname")-1, postname TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "postname", sizeof("postname")-1, postname);
}
}
@@ -76,7 +76,7 @@ static void curlfile_get_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- res = zend_read_property(curl_CURLFile_class, getThis(), name, strlen(name), 1 TSRMLS_CC);
+ res = zend_read_property(curl_CURLFile_class, getThis(), name, strlen(name), 1);
RETURN_ZVAL(res, 1, 0);
}
@@ -85,10 +85,10 @@ static void curlfile_set_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
- zend_update_property_string(curl_CURLFile_class, getThis(), name, strlen(name), arg TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, getThis(), name, strlen(name), arg);
}
/* {{{ proto string CURLFile::getFilename()
@@ -135,8 +135,8 @@ ZEND_METHOD(CURLFile, setPostFilename)
Unserialization handler */
ZEND_METHOD(CURLFile, __wakeup)
{
- zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "" TSRMLS_CC);
- zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0 TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "");
+ zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0);
}
/* }}} */
@@ -162,14 +162,14 @@ static const zend_function_entry curlfile_funcs[] = {
PHP_FE_END
};
-void curlfile_register_class(TSRMLS_D)
+void curlfile_register_class(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY( ce, "CURLFile", curlfile_funcs );
- curl_CURLFile_class = zend_register_internal_class(&ce TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "mime", sizeof("mime")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "postname", sizeof("postname")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ curl_CURLFile_class = zend_register_internal_class(&ce);
+ zend_declare_property_string(curl_CURLFile_class, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(curl_CURLFile_class, "mime", sizeof("mime")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(curl_CURLFile_class, "postname", sizeof("postname")-1, "", ZEND_ACC_PUBLIC);
}
#endif
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 6bd241ee15..f5bfb1e919 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -148,8 +148,8 @@ static struct gcry_thread_cbs php_curl_gnutls_tsl = {
#endif
/* }}} */
-static void _php_curl_close_ex(php_curl *ch TSRMLS_DC);
-static void _php_curl_close(zend_resource *rsrc TSRMLS_DC);
+static void _php_curl_close_ex(php_curl *ch);
+static void _php_curl_close(zend_resource *rsrc);
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
@@ -166,12 +166,12 @@ static void _php_curl_close(zend_resource *rsrc TSRMLS_DC);
# define php_curl_ret(__ret) RETVAL_FALSE; return;
#endif
-static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const int len, zend_bool make_copy TSRMLS_DC)
+static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const int len, zend_bool make_copy)
{
CURLcode error = CURLE_OK;
if (strlen(str) != len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
+ php_error_docref(NULL, E_WARNING, "Curl option contains invalid characters (\\0)");
return FAILURE;
}
@@ -195,7 +195,7 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char *str,
return error == CURLE_OK ? SUCCESS : FAILURE;
}
-static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
+static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */
{
/* Disable file:// if open_basedir are used */
if (PG(open_basedir) && *PG(open_basedir)) {
@@ -205,12 +205,12 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
php_url *uri;
if (!(uri = php_url_parse_ex(url, len))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", url);
+ php_error_docref(NULL, E_WARNING, "Invalid URL '%s'", url);
return FAILURE;
}
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
+ php_error_docref(NULL, E_WARNING, "Protocol 'file' disabled in cURL");
php_url_free(uri);
return FAILURE;
}
@@ -218,11 +218,11 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
#endif
}
- return php_curl_option_str(ch, CURLOPT_URL, url, len, 0 TSRMLS_CC);
+ return php_curl_option_str(ch, CURLOPT_URL, url, len, 0);
}
/* }}} */
-void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
+void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
{
php_stream *stream;
if (!ch || !ch->handlers) {
@@ -230,10 +230,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
if (!Z_ISUNDEF(ch->handlers->std_err)) {
- stream = zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->std_err, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
}
zval_ptr_dtor(&ch->handlers->std_err);
ZVAL_UNDEF(&ch->handlers->std_err);
@@ -242,10 +242,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->read && !Z_ISUNDEF(ch->handlers->read->stream)) {
- stream = zend_fetch_resource(&ch->handlers->read->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->read->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->read->stream);
ZVAL_UNDEF(&ch->handlers->read->stream);
@@ -256,10 +256,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->write_header && !Z_ISUNDEF(ch->handlers->write_header->stream)) {
- stream = zend_fetch_resource(&ch->handlers->write_header->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->write_header->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write_header->stream);
ZVAL_UNDEF(&ch->handlers->write_header->stream);
@@ -270,10 +270,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->write && !Z_ISUNDEF(ch->handlers->write->stream)) {
- stream = zend_fetch_resource(&ch->handlers->write->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->write->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write->stream);
ZVAL_UNDEF(&ch->handlers->write->stream);
@@ -1243,7 +1243,7 @@ PHP_MINIT_FUNCTION(curl)
return FAILURE;
}
- curlfile_register_class(TSRMLS_C);
+ curlfile_register_class();
return SUCCESS;
}
@@ -1290,7 +1290,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write;
size_t length = size * nmemb;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
#if PHP_CURL_DEBUG
fprintf(stderr, "curl_write() called\n");
@@ -1329,10 +1328,10 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
@@ -1365,7 +1364,6 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
zval retval;
int error;
zend_fcall_info fci;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
ZVAL_RES(&argv[0], ch->res);
Z_ADDREF(argv[0]);
@@ -1383,10 +1381,10 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -1423,7 +1421,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
zval retval;
int error;
zend_fcall_info fci;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
ZVAL_RES(&argv[0], ch->res);
Z_ADDREF(argv[0]);
@@ -1443,10 +1440,10 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -1486,7 +1483,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
zval retval;
int error;
zend_fcall_info fci;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
ZVAL_RES(&argv[0], ch->res);
Z_ADDREF(argv[0]);
@@ -1505,10 +1501,10 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */
length = CURL_READFUNC_ABORT;
#endif
@@ -1538,7 +1534,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write_header;
size_t length = size * nmemb;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
switch (t->method) {
case PHP_CURL_STDOUT:
@@ -1573,10 +1568,10 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
fci.no_separation = 0;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
@@ -1628,24 +1623,23 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
zval retval;
int error;
int ret = -1;
- TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
ZVAL_RES(&argv[0], ch->res);
Z_ADDREF(argv[0]);
ZVAL_STRING(&argv[1], prompt);
ZVAL_LONG(&argv[2], buflen);
- error = call_user_function(EG(function_table), NULL, func, &retval, 2, argv TSRMLS_CC);
+ error = call_user_function(EG(function_table), NULL, func, &retval, 2, argv);
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION");
} else if (Z_TYPE(retval) == IS_STRING) {
if (Z_STRLEN(retval) > buflen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Returned password is too long for libcurl to handle");
+ php_error_docref(NULL, E_WARNING, "Returned password is too long for libcurl to handle");
} else {
memcpy(buf, Z_STRVAL(retval), Z_STRLEN(retval) + 1);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "User handler '%s' did not return a string", Z_STRVAL_P(func));
+ php_error_docref(NULL, E_WARNING, "User handler '%s' did not return a string", Z_STRVAL_P(func));
}
zval_ptr_dtor(&argv[0]);
@@ -1689,7 +1683,7 @@ PHP_FUNCTION(curl_version)
curl_version_info_data *d;
zend_long uversion = CURLVERSION_NOW;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &uversion) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &uversion) == FAILURE) {
return;
}
@@ -1788,7 +1782,7 @@ static void split_certinfo(char *string, zval *hash)
/* {{{ create_certinfo
*/
-static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC)
+static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
{
int i;
@@ -1819,7 +1813,7 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC)
add_assoc_string(&certhash, s, &slist->data[len+1]);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not extract hash key from certificate info");
+ php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info");
}
}
add_next_index_zval(listcode, &certhash);
@@ -1871,18 +1865,17 @@ PHP_FUNCTION(curl_init)
char *url = NULL;
size_t url_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &url, &url_len) == FAILURE) {
return;
}
cp = curl_easy_init();
if (!cp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not initialize a new cURL handle");
+ php_error_docref(NULL, E_WARNING, "Could not initialize a new cURL handle");
RETURN_FALSE;
}
ch = alloc_curl_handle();
- TSRMLS_SET_CTX(ch->thread_ctx);
ch->cp = cp;
@@ -1893,8 +1886,8 @@ PHP_FUNCTION(curl_init)
_php_curl_set_default_options(ch);
if (url) {
- if (php_curl_option_url(ch, url, url_len TSRMLS_CC) == FAILURE) {
- _php_curl_close_ex(ch TSRMLS_CC);
+ if (php_curl_option_url(ch, url, url_len) == FAILURE) {
+ _php_curl_close_ex(ch);
RETURN_FALSE;
}
}
@@ -1912,7 +1905,7 @@ PHP_FUNCTION(curl_copy_handle)
zval *zid;
php_curl *ch, *dupch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -1920,12 +1913,11 @@ PHP_FUNCTION(curl_copy_handle)
cp = curl_easy_duphandle(ch->cp);
if (!cp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot duplicate cURL handle");
+ php_error_docref(NULL, E_WARNING, "Cannot duplicate cURL handle");
RETURN_FALSE;
}
dupch = alloc_curl_handle();
- TSRMLS_SET_CTX(dupch->thread_ctx);
dupch->cp = cp;
Z_ADDREF_P(zid);
@@ -2003,7 +1995,7 @@ PHP_FUNCTION(curl_copy_handle)
}
/* }}} */
-static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_DC) /* {{{ */
+static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ */
{
CURLcode error = CURLE_OK;
@@ -2013,9 +2005,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
convert_to_long(zvalue);
if (Z_LVAL_P(zvalue) == 1) {
#if LIBCURL_VERSION_NUM <= 0x071c00 /* 7.28.0 */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead");
+ php_error_docref(NULL, E_NOTICE, "CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead");
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead");
+ php_error_docref(NULL, E_NOTICE, "CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead");
error = curl_easy_setopt(ch->cp, option, 2);
break;
#endif
@@ -2169,7 +2161,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#if LIBCURL_VERSION_NUM >= 0x71304
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
(PG(open_basedir) && *PG(open_basedir)) && (Z_LVAL_P(zvalue) & CURLPROTO_FILE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
+ php_error_docref(NULL, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
return 1;
}
#endif
@@ -2239,7 +2231,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#endif
{
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
/* Curl nullable string options */
@@ -2262,7 +2254,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
error = curl_easy_setopt(ch->cp, option, NULL);
} else {
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
break;
}
@@ -2270,12 +2262,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
/* Curl private option */
case CURLOPT_PRIVATE:
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 1 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 1);
/* Curl url option */
case CURLOPT_URL:
convert_to_string_ex(zvalue);
- return php_curl_option_url(ch, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue) TSRMLS_CC);
+ return php_curl_option_url(ch, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue));
/* Curl file handle options */
case CURLOPT_FILE:
@@ -2287,7 +2279,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
php_stream *what = NULL;
if (Z_TYPE_P(zvalue) != IS_NULL) {
- what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
+ what = zend_fetch_resource(zvalue, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
if (!what) {
return FAILURE;
}
@@ -2317,7 +2309,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
ch->handlers->write->method = PHP_CURL_FILE;
ZVAL_COPY(&ch->handlers->write->stream, zvalue);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
break;
@@ -2335,7 +2327,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
ch->handlers->write_header->method = PHP_CURL_FILE;
ZVAL_COPY(&ch->handlers->write_header->stream, zvalue);;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
break;
@@ -2364,7 +2356,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
zval_ptr_dtor(&ch->handlers->std_err);
ZVAL_COPY(&ch->handlers->std_err, zvalue);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
/* break omitted intentionally */
@@ -2426,7 +2418,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
break;
#endif
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the %s argument", name);
+ php_error_docref(NULL, E_WARNING, "You must pass either an object or an array with the %s argument", name);
return FAILURE;
}
@@ -2436,7 +2428,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
slist = curl_slist_append(slist, Z_STRVAL_P(current));
if (!slist) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
+ php_error_docref(NULL, E_WARNING, "Could not build curl_slist");
return 1;
}
} ZEND_HASH_FOREACH_END();
@@ -2457,7 +2449,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#if LIBCURL_VERSION_NUM < 0x071304
if (PG(open_basedir) && *PG(open_basedir)) {
if (Z_LVAL_P(zvalue) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
return FAILURE;
}
}
@@ -2485,7 +2477,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
postfields = HASH_OF(zvalue);
if (!postfields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
+ php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
return FAILURE;
}
@@ -2499,26 +2491,26 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
}
if (Z_TYPE_P(current) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(current), curl_CURLFile_class TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(current), curl_CURLFile_class)) {
/* new-style file upload */
zval *prop;
char *type = NULL, *filename = NULL;
- prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0);
if (Z_TYPE_P(prop) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename for key %s", string_key->val);
+ php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", string_key->val);
} else {
postval = Z_STRVAL_P(prop);
- if (php_check_open_basedir(postval TSRMLS_CC)) {
+ if (php_check_open_basedir(postval)) {
return 1;
}
- prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
type = Z_STRVAL_P(prop);
}
- prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
filename = Z_STRVAL_P(prop);
}
@@ -2547,7 +2539,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
char *name, *type, *filename;
++postval;
- php_error_docref("curl.curlfile" TSRMLS_CC, E_DEPRECATED,
+ php_error_docref("curl.curlfile", E_DEPRECATED,
"The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead");
name = estrndup(postval, Z_STRLEN_P(current));
@@ -2560,7 +2552,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
*filename = '\0';
}
/* open_basedir check */
- if (php_check_open_basedir(name TSRMLS_CC)) {
+ if (php_check_open_basedir(name)) {
efree(name);
return FAILURE;
}
@@ -2701,11 +2693,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
{
convert_to_string_ex(zvalue);
- if (Z_STRLEN_P(zvalue) && php_check_open_basedir(Z_STRVAL_P(zvalue) TSRMLS_CC)) {
+ if (Z_STRLEN_P(zvalue) && php_check_open_basedir(Z_STRVAL_P(zvalue))) {
return FAILURE;
}
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
case CURLINFO_HEADER_OUT:
@@ -2764,18 +2756,18 @@ PHP_FUNCTION(curl_setopt)
zend_long options;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zid, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zid, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (options <= 0 && options != CURLOPT_SAFE_UPLOAD) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl configuration option");
RETURN_FALSE;
}
- if (_php_curl_setopt(ch, options, zvalue TSRMLS_CC) == SUCCESS) {
+ if (_php_curl_setopt(ch, options, zvalue) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2792,7 +2784,7 @@ PHP_FUNCTION(curl_setopt_array)
zend_ulong option;
zend_string *string_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &zid, &arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "za", &zid, &arr) == FAILURE) {
return;
}
@@ -2800,11 +2792,11 @@ PHP_FUNCTION(curl_setopt_array)
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(arr), option, string_key, entry) {
if (string_key) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Array keys must be CURLOPT constants or equivalent integer values");
RETURN_FALSE;
}
- if (_php_curl_setopt(ch, (zend_long) option, entry TSRMLS_CC) == FAILURE) {
+ if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) {
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
@@ -2836,13 +2828,13 @@ PHP_FUNCTION(curl_exec)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
- _php_curl_verify_handlers(ch, 1 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 1);
_php_curl_cleanup_handle(ch);
@@ -2856,7 +2848,7 @@ PHP_FUNCTION(curl_exec)
if (!Z_ISUNDEF(ch->handlers->std_err)) {
php_stream *stream;
- stream = zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->std_err, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream) {
php_stream_flush(stream);
}
@@ -2891,7 +2883,7 @@ PHP_FUNCTION(curl_getinfo)
php_curl *ch;
zend_long option = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zid, &option) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zid, &option) == FAILURE) {
return;
}
@@ -2987,7 +2979,7 @@ PHP_FUNCTION(curl_getinfo)
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) {
array_init(&listcode);
- create_certinfo(ci, &listcode TSRMLS_CC);
+ create_certinfo(ci, &listcode);
CAAZ("certinfo", &listcode);
}
#endif
@@ -3020,7 +3012,7 @@ PHP_FUNCTION(curl_getinfo)
array_init(return_value);
if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) {
- create_certinfo(ci, return_value TSRMLS_CC);
+ create_certinfo(ci, return_value);
} else {
RETURN_FALSE;
}
@@ -3096,7 +3088,7 @@ PHP_FUNCTION(curl_error)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -3114,7 +3106,7 @@ PHP_FUNCTION(curl_errno)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -3131,14 +3123,14 @@ PHP_FUNCTION(curl_close)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (ch->in_callback) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close cURL handle from a callback");
+ php_error_docref(NULL, E_WARNING, "Attempt to close cURL handle from a callback");
return;
}
@@ -3150,13 +3142,13 @@ PHP_FUNCTION(curl_close)
/* {{{ _php_curl_close()
List destructor for curl handles */
-static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
+static void _php_curl_close_ex(php_curl *ch)
{
#if PHP_CURL_DEBUG
fprintf(stderr, "DTOR CALLED, ch = %x\n", ch);
#endif
- _php_curl_verify_handlers(ch, 0 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 0);
/*
* Libcurl is doing connection caching. When easy handle is cleaned up,
@@ -3222,10 +3214,10 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
/* {{{ _php_curl_close()
List destructor for curl handles */
-static void _php_curl_close(zend_resource *rsrc TSRMLS_DC)
+static void _php_curl_close(zend_resource *rsrc)
{
php_curl *ch = (php_curl *) rsrc->ptr;
- _php_curl_close_ex(ch TSRMLS_CC);
+ _php_curl_close_ex(ch);
}
/* }}} */
@@ -3237,7 +3229,7 @@ PHP_FUNCTION(curl_strerror)
zend_long code;
const char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -3307,14 +3299,14 @@ PHP_FUNCTION(curl_reset)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (ch->in_callback) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to reset cURL handle from a callback");
+ php_error_docref(NULL, E_WARNING, "Attempt to reset cURL handle from a callback");
return;
}
@@ -3335,7 +3327,7 @@ PHP_FUNCTION(curl_escape)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zid, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) {
return;
}
@@ -3359,7 +3351,7 @@ PHP_FUNCTION(curl_unescape)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zid, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) {
return;
}
@@ -3384,7 +3376,7 @@ PHP_FUNCTION(curl_pause)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zid, &bitmask) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zid, &bitmask) == FAILURE) {
return;
}
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index d9ace4119c..60f3e72ec5 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -78,7 +78,7 @@ PHP_FUNCTION(curl_multi_add_handle)
php_curl *ch;
zval tmp_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &z_mh, &z_ch) == FAILURE) {
return;
}
@@ -100,13 +100,12 @@ void _php_curl_multi_cleanup_list(void *data) /* {{{ */
{
zval *z_ch = (zval *)data;
php_curl *ch;
- TSRMLS_FETCH();
if (!z_ch) {
return;
}
- ch = zend_fetch_resource(z_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
+ ch = zend_fetch_resource(z_ch, -1, le_curl_name, NULL, 1, le_curl);
if (!ch) {
return;
}
@@ -133,7 +132,7 @@ PHP_FUNCTION(curl_multi_remove_handle)
php_curlm *mh;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &z_mh, &z_ch) == FAILURE) {
return;
}
@@ -169,7 +168,7 @@ PHP_FUNCTION(curl_multi_select)
double timeout = 1.0;
struct timeval to;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|d", &z_mh, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|d", &z_mh, &timeout) == FAILURE) {
return;
}
@@ -199,7 +198,7 @@ PHP_FUNCTION(curl_multi_exec)
int still_running;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/", &z_mh, &z_still_running) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/", &z_mh, &z_still_running) == FAILURE) {
return;
}
@@ -214,7 +213,7 @@ PHP_FUNCTION(curl_multi_exec)
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
ZEND_FETCH_RESOURCE(ch, php_curl *, pz_ch, -1, le_curl_name, le_curl);
- _php_curl_verify_handlers(ch, 1 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 1);
}
}
@@ -234,7 +233,7 @@ PHP_FUNCTION(curl_multi_getcontent)
zval *z_ch;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ch) == FAILURE) {
return;
}
@@ -262,7 +261,7 @@ PHP_FUNCTION(curl_multi_info_read)
int queued_msgs;
zval *zmsgs_in_queue = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/", &z_mh, &zmsgs_in_queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z/", &z_mh, &zmsgs_in_queue) == FAILURE) {
return;
}
@@ -322,7 +321,7 @@ PHP_FUNCTION(curl_multi_close)
zval *z_mh;
php_curlm *mh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_mh) == FAILURE) {
return;
}
@@ -332,7 +331,7 @@ PHP_FUNCTION(curl_multi_close)
}
/* }}} */
-void _php_curl_multi_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void _php_curl_multi_close(zend_resource *rsrc) /* {{{ */
{
php_curlm *mh = (php_curlm *)rsrc->ptr;
if (mh) {
@@ -343,8 +342,8 @@ void _php_curl_multi_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
- ch = (php_curl *) zend_fetch_resource(pz_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
- _php_curl_verify_handlers(ch, 0 TSRMLS_CC);
+ ch = (php_curl *) zend_fetch_resource(pz_ch, -1, le_curl_name, NULL, 1, le_curl);
+ _php_curl_verify_handlers(ch, 0);
}
curl_multi_cleanup(mh->multi);
@@ -363,7 +362,7 @@ PHP_FUNCTION(curl_multi_strerror)
zend_long code;
const char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -378,7 +377,7 @@ PHP_FUNCTION(curl_multi_strerror)
#endif
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
-static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value TSRMLS_DC) /* {{{ */
+static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value) /* {{{ */
{
CURLMcode error = CURLM_OK;
@@ -394,7 +393,7 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl multi configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl multi configuration option");
error = CURLM_UNKNOWN_OPTION;
break;
}
@@ -415,13 +414,13 @@ PHP_FUNCTION(curl_multi_setopt)
zend_long options;
php_curlm *mh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_mh, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &z_mh, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mh, php_curlm *, z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle);
- if (!_php_curl_multi_setopt(mh, options, zvalue, return_value TSRMLS_CC)) {
+ if (!_php_curl_multi_setopt(mh, options, zvalue, return_value)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index ad44ae7b96..0adb8b5ae2 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -114,8 +114,8 @@ PHP_FUNCTION(curl_pause);
PHP_FUNCTION(curl_file_create);
-void _php_curl_multi_close(zend_resource * TSRMLS_DC);
-void _php_curl_share_close(zend_resource * TSRMLS_DC);
+void _php_curl_multi_close(zend_resource *);
+void _php_curl_share_close(zend_resource *);
typedef struct {
zval func_name;
@@ -174,7 +174,6 @@ typedef struct {
struct _php_curl_error err;
struct _php_curl_free *to_free;
struct _php_curl_send_headers header;
- void ***thread_ctx;
CURL *cp;
php_curl_handlers *handlers;
zend_resource *res;
@@ -197,9 +196,9 @@ typedef struct {
void _php_curl_cleanup_handle(php_curl *);
void _php_curl_multi_cleanup_list(void *data);
-void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
+void _php_curl_verify_handlers(php_curl *ch, int reporterror);
-void curlfile_register_class(TSRMLS_D);
+void curlfile_register_class(void);
PHP_CURL_API extern zend_class_entry *curl_CURLFile_class;
#else
diff --git a/ext/curl/share.c b/ext/curl/share.c
index 94694e0b2e..1e51009050 100644
--- a/ext/curl/share.c
+++ b/ext/curl/share.c
@@ -57,7 +57,7 @@ PHP_FUNCTION(curl_share_close)
zval *z_sh;
php_curlsh *sh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_sh) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_sh) == FAILURE) {
return;
}
@@ -66,7 +66,7 @@ PHP_FUNCTION(curl_share_close)
}
/* }}} */
-static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue, zval *return_value TSRMLS_DC) /* {{{ */
+static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue, zval *return_value) /* {{{ */
{
CURLSHcode error = CURLSHE_OK;
@@ -78,7 +78,7 @@ static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl share configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl share configuration option");
error = CURLSHE_BAD_OPTION;
break;
}
@@ -99,13 +99,13 @@ PHP_FUNCTION(curl_share_setopt)
zend_long options;
php_curlsh *sh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zid, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zid, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(sh, php_curlsh *, zid, -1, le_curl_share_handle_name, le_curl_share_handle);
- if (!_php_curl_share_setopt(sh, options, zvalue, return_value TSRMLS_CC)) {
+ if (!_php_curl_share_setopt(sh, options, zvalue, return_value)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -113,7 +113,7 @@ PHP_FUNCTION(curl_share_setopt)
}
/* }}} */
-void _php_curl_share_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void _php_curl_share_close(zend_resource *rsrc) /* {{{ */
{
php_curlsh *sh = (php_curlsh *)rsrc->ptr;
if (sh) {
diff --git a/ext/date/config.w32 b/ext/date/config.w32
index c97df7246c..64a4ae92a1 100755
--- a/ext/date/config.w32
+++ b/ext/date/config.w32
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
-EXTENSION("date", "php_date.c", false, "-Iext/date/lib");
+EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
AC_DEFINE('HAVE_DATE', 1, 'Have date/time support');
diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
index 0b46c6803a..867e891f52 100644
--- a/ext/date/config0.m4
+++ b/ext/date/config0.m4
@@ -4,7 +4,7 @@ dnl config.m4 for date extension
sinclude(ext/date/lib/timelib.m4)
sinclude(lib/timelib.m4)
-PHP_DATE_CFLAGS="-I@ext_builddir@/lib"
+PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 8f2e8c8fc5..f995f0e8df 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -539,8 +539,8 @@ const zend_function_entry date_funcs_period[] = {
PHP_FE_END
};
-static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
-static void date_register_classes(TSRMLS_D);
+static char* guess_timezone(const timelib_tzdb *tzdb);
+static void date_register_classes(void);
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(date)
@@ -608,7 +608,7 @@ static zend_object_handlers date_object_handlers_period;
return; \
} \
} else { \
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "O", &object, date_ce_date) == FAILURE) { \
RETURN_FALSE; \
} \
} \
@@ -616,39 +616,39 @@ static zend_object_handlers date_object_handlers_period;
#define DATE_CHECK_INITIALIZED(member, class_name) \
if (!(member)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
+ php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
RETURN_FALSE; \
}
-static void date_object_free_storage_date(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_interval(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_period(zend_object *object TSRMLS_DC);
-
-static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC);
-
-static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC);
-
-static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC);
-static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
-static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC);
-
-zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
-void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
-static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
-static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
+static void date_object_free_storage_date(zend_object *object);
+static void date_object_free_storage_timezone(zend_object *object);
+static void date_object_free_storage_interval(zend_object *object);
+static void date_object_free_storage_period(zend_object *object);
+
+static zend_object *date_object_new_date(zend_class_entry *class_type);
+static zend_object *date_object_new_timezone(zend_class_entry *class_type);
+static zend_object *date_object_new_interval(zend_class_entry *class_type);
+static zend_object *date_object_new_period(zend_class_entry *class_type);
+
+static zend_object *date_object_clone_date(zval *this_ptr);
+static zend_object *date_object_clone_timezone(zval *this_ptr);
+static zend_object *date_object_clone_interval(zval *this_ptr);
+static zend_object *date_object_clone_period(zval *this_ptr);
+
+static int date_object_compare_date(zval *d1, zval *d2);
+static HashTable *date_object_get_gc(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties(zval *object);
+static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties_interval(zval *object);
+static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties_period(zval *object);
+static HashTable *date_object_get_properties_timezone(zval *object);
+static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n);
+
+zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
+void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
+static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
+static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
/* {{{ Module struct */
zend_module_entry date_module_entry = {
@@ -832,7 +832,7 @@ PHP_RSHUTDOWN_FUNCTION(date)
PHP_MINIT_FUNCTION(date)
{
REGISTER_INI_ENTRIES();
- date_register_classes(TSRMLS_C);
+ date_register_classes();
/*
* RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt
* A Date construct is an element whose content MUST conform to the
@@ -896,7 +896,7 @@ PHP_MINFO_FUNCTION(date)
php_info_print_table_row(2, "date/time support", "enabled");
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
- php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb TSRMLS_CC));
+ php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -904,7 +904,7 @@ PHP_MINFO_FUNCTION(date)
/* }}} */
/* {{{ Timezone Cache functions */
-static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb TSRMLS_DC)
+static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb)
{
timelib_tzinfo *tzi;
@@ -926,8 +926,7 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_
timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib_tzdb *tzdb)
{
- TSRMLS_FETCH();
- return php_date_parse_tzfile(formal_tzname, tzdb TSRMLS_CC);
+ return php_date_parse_tzfile(formal_tzname, tzdb);
}
/* }}} */
@@ -935,14 +934,14 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
- if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage) == FAILURE) {
return FAILURE;
}
DATEG(timezone_valid) = 0;
if (stage == PHP_INI_STAGE_RUNTIME) {
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG);
+ php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG);
} else {
DATEG(timezone_valid) = 1;
}
@@ -953,7 +952,7 @@ static PHP_INI_MH(OnUpdate_date_timezone)
/* }}} */
/* {{{ Helper functions */
-static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
+static char* guess_timezone(const timelib_tzdb *tzdb)
{
/* Checking configure timezone */
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
@@ -974,7 +973,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
+ php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
return "UTC";
}
@@ -982,19 +981,19 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
return DATEG(default_timezone);
}
/* Fallback to UTC */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
+ php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
return "UTC";
}
-PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D)
+PHPAPI timelib_tzinfo *get_timezone_info(void)
{
char *tz;
timelib_tzinfo *tzi;
- tz = guess_timezone(DATE_TIMEZONEDB TSRMLS_CC);
- tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC);
+ tz = guess_timezone(DATE_TIMEZONEDB);
+ tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB);
if (! tzi) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!");
+ php_error_docref(NULL, E_ERROR, "Timezone database is corrupt - this should *never* happen!");
}
return tzi;
}
@@ -1058,7 +1057,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
/* }}} */
/* {{{ date_format - (gm)date helper */
-static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime TSRMLS_DC)
+static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime)
{
smart_str string = {0};
int i, length = 0;
@@ -1222,18 +1221,18 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
size_t format_len;
zend_long ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 1) {
ts = time(NULL);
}
- RETURN_STR(php_format_date(format, format_len, ts, localtime TSRMLS_CC));
+ RETURN_STR(php_format_date(format, format_len, ts, localtime));
}
/* }}} */
-PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime) /* {{{ */
{
timelib_time *t;
timelib_tzinfo *tzi;
@@ -1242,7 +1241,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
t = timelib_time_ctor();
if (localtime) {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, ts);
@@ -1251,7 +1250,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
timelib_unixtime2gmt(t, ts);
}
- string = date_format(format, format_len, t, localtime TSRMLS_CC);
+ string = date_format(format, format_len, t, localtime);
timelib_time_dtor(t);
return string;
@@ -1260,7 +1259,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
/* {{{ php_idate
*/
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
+PHPAPI int php_idate(char format, time_t ts, int localtime)
{
timelib_time *t;
timelib_tzinfo *tzi;
@@ -1271,7 +1270,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
t = timelib_time_ctor();
if (!localtime) {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, ts);
@@ -1379,12 +1378,12 @@ PHP_FUNCTION(idate)
zend_long ts = 0;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
}
if (format_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "idate format is one char");
+ php_error_docref(NULL, E_WARNING, "idate format is one char");
RETURN_FALSE;
}
@@ -1392,9 +1391,9 @@ PHP_FUNCTION(idate)
ts = time(NULL);
}
- ret = php_idate(format[0], ts, 0 TSRMLS_CC);
+ ret = php_idate(format[0], ts, 0);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token.");
+ php_error_docref(NULL, E_WARNING, "Unrecognized date format token.");
RETURN_FALSE;
}
RETURN_LONG(ret);
@@ -1451,9 +1450,9 @@ PHP_FUNCTION(strtotime)
timelib_time *t, *now;
timelib_tzinfo *tzi;
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", &times, &time_len, &preset_ts) != FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sl", &times, &time_len, &preset_ts) != FAILURE) {
/* We have an initial timestamp */
now = timelib_time_ctor();
@@ -1466,7 +1465,7 @@ PHP_FUNCTION(strtotime)
timelib_unixtime2local(now, t->sse);
timelib_time_dtor(t);
efree(initial_ts);
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &times, &time_len, &preset_ts) != FAILURE) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &times, &time_len, &preset_ts) != FAILURE) {
/* We have no initial timestamp */
now = timelib_time_ctor();
now->tz_info = tzi;
@@ -1508,7 +1507,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
zend_long ts, adjust_seconds = 0;
int error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
RETURN_FALSE;
}
/* Initialize structure with current time */
@@ -1516,7 +1515,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
if (gmt) {
timelib_unixtime2gmt(now, (timelib_sll) time(NULL));
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
now->tz_info = tzi;
now->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(now, (timelib_sll) time(NULL));
@@ -1549,7 +1548,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
now->h = hou;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead");
+ php_error_docref(NULL, E_STRICT, "You should be using the time() function instead");
}
/* Update the timestamp */
if (gmt) {
@@ -1559,7 +1558,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
}
/* Support for the deprecated is_dst parameter */
if (dst != -1) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The is_dst parameter is deprecated");
+ php_error_docref(NULL, E_DEPRECATED, "The is_dst parameter is deprecated");
if (gmt) {
/* GMT never uses DST */
if (dst == 1) {
@@ -1613,7 +1612,7 @@ PHP_FUNCTION(checkdate)
{
zend_long m, d, y;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &m, &d, &y) == FAILURE) {
RETURN_FALSE;
}
@@ -1641,7 +1640,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
timestamp = (zend_long) time(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &timestamp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &timestamp) == FAILURE) {
RETURN_FALSE;
}
@@ -1654,7 +1653,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
tzi = NULL;
timelib_unixtime2gmt(ts, (timelib_sll) timestamp);
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(ts, (timelib_sll) timestamp);
@@ -1754,11 +1753,11 @@ PHP_FUNCTION(localtime)
timelib_tzinfo *tzi;
timelib_time *ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", &timestamp, &associative) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lb", &timestamp, &associative) == FAILURE) {
RETURN_FALSE;
}
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts = timelib_time_ctor();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
@@ -1800,11 +1799,11 @@ PHP_FUNCTION(getdate)
timelib_tzinfo *tzi;
timelib_time *ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timestamp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &timestamp) == FAILURE) {
RETURN_FALSE;
}
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts = timelib_time_ctor();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
@@ -1855,7 +1854,7 @@ typedef struct {
} date_period_it;
/* {{{ date_period_it_invalidate_current */
-static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_invalidate_current(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
@@ -1867,18 +1866,18 @@ static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_
/* }}} */
/* {{{ date_period_it_dtor */
-static void date_period_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_dtor(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.data);
}
/* }}} */
/* {{{ date_period_it_has_more */
-static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC)
+static int date_period_it_has_more(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data);
@@ -1902,7 +1901,7 @@ static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ date_period_it_current_data */
-static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *date_period_it_current_data(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data);
@@ -1910,7 +1909,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
php_date_obj *newdateobj;
/* Create new object */
- php_date_instantiate(object->start_ce, &iterator->current TSRMLS_CC);
+ php_date_instantiate(object->start_ce, &iterator->current);
newdateobj = Z_PHPDATE_P(&iterator->current);
newdateobj->time = timelib_time_ctor();
*newdateobj->time = *it_time;
@@ -1926,7 +1925,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ date_period_it_current_key */
-static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void date_period_it_current_key(zend_object_iterator *iter, zval *key)
{
date_period_it *iterator = (date_period_it *)iter;
ZVAL_LONG(key, iterator->current_index);
@@ -1934,17 +1933,17 @@ static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSR
/* }}} */
/* {{{ date_period_it_move_forward */
-static void date_period_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_move_forward(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
iterator->current_index++;
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
}
/* }}} */
/* {{{ date_period_it_rewind */
-static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_rewind(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
@@ -1953,7 +1952,7 @@ static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC)
timelib_time_dtor(iterator->object->current);
}
iterator->object->current = timelib_time_clone(iterator->object->start);
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
}
/* }}} */
@@ -1968,7 +1967,7 @@ zend_object_iterator_funcs date_period_it_funcs = {
date_period_it_invalidate_current
};
-zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
date_period_it *iterator = emalloc(sizeof(date_period_it));
@@ -1976,7 +1975,7 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &date_period_it_funcs;
@@ -1986,11 +1985,11 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
return (zend_object_iterator*)iterator;
} /* }}} */
-static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor TSRMLS_DC) /* {{{ */
+static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor) /* {{{ */
{
if (implementor->type == ZEND_USER_CLASS &&
- !instanceof_function(implementor, date_ce_date TSRMLS_CC) &&
- !instanceof_function(implementor, date_ce_immutable TSRMLS_CC)
+ !instanceof_function(implementor, date_ce_date) &&
+ !instanceof_function(implementor, date_ce_immutable)
) {
zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes");
}
@@ -1998,17 +1997,17 @@ static int implement_date_interface_handler(zend_class_entry *interface, zend_cl
return SUCCESS;
} /* }}} */
-static void date_register_classes(TSRMLS_D) /* {{{ */
+static void date_register_classes(void) /* {{{ */
{
zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface);
- date_ce_interface = zend_register_internal_interface(&ce_interface TSRMLS_CC);
+ date_ce_interface = zend_register_internal_interface(&ce_interface);
date_ce_interface->interface_gets_implemented = implement_date_interface_handler;
INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date);
ce_date.create_object = date_object_new_date;
- date_ce_date = zend_register_internal_class_ex(&ce_date, NULL TSRMLS_CC);
+ date_ce_date = zend_register_internal_class_ex(&ce_date, NULL);
memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_date.offset = XtOffsetOf(php_date_obj, std);
date_object_handlers_date.free_obj = date_object_free_storage_date;
@@ -2016,10 +2015,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_date.compare_objects = date_object_compare_date;
date_object_handlers_date.get_properties = date_object_get_properties;
date_object_handlers_date.get_gc = date_object_get_gc;
- zend_class_implements(date_ce_date TSRMLS_CC, 1, date_ce_interface);
+ zend_class_implements(date_ce_date, 1, date_ce_interface);
#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1);
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE);
@@ -2035,16 +2034,16 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_immutable, "DateTimeImmutable", date_funcs_immutable);
ce_immutable.create_object = date_object_new_date;
- date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL TSRMLS_CC);
+ date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL);
memcpy(&date_object_handlers_immutable, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_immutable.clone_obj = date_object_clone_date;
date_object_handlers_immutable.compare_objects = date_object_compare_date;
date_object_handlers_immutable.get_properties = date_object_get_properties;
- zend_class_implements(date_ce_immutable TSRMLS_CC, 1, date_ce_interface);
+ zend_class_implements(date_ce_immutable, 1, date_ce_interface);
INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", date_funcs_timezone);
ce_timezone.create_object = date_object_new_timezone;
- date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL TSRMLS_CC);
+ date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL);
memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_timezone.offset = XtOffsetOf(php_timezone_obj, std);
date_object_handlers_timezone.free_obj = date_object_free_storage_timezone;
@@ -2053,7 +2052,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_timezone.get_gc = date_object_get_gc_timezone;
#define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value TSRMLS_CC);
+ zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value);
REGISTER_TIMEZONE_CLASS_CONST_STRING("AFRICA", PHP_DATE_TIMEZONE_GROUP_AFRICA);
REGISTER_TIMEZONE_CLASS_CONST_STRING("AMERICA", PHP_DATE_TIMEZONE_GROUP_AMERICA);
@@ -2072,7 +2071,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_interval, "DateInterval", date_funcs_interval);
ce_interval.create_object = date_object_new_interval;
- date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL TSRMLS_CC);
+ date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL);
memcpy(&date_object_handlers_interval, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_interval.offset = XtOffsetOf(php_interval_obj, std);
date_object_handlers_interval.free_obj = date_object_free_storage_interval;
@@ -2085,10 +2084,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
ce_period.create_object = date_object_new_period;
- date_ce_period = zend_register_internal_class_ex(&ce_period, NULL TSRMLS_CC);
+ date_ce_period = zend_register_internal_class_ex(&ce_period, NULL);
date_ce_period->get_iterator = date_object_period_get_iterator;
date_ce_period->iterator_funcs.funcs = &date_period_it_funcs;
- zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(date_ce_period, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_period.offset = XtOffsetOf(php_period_obj, std);
date_object_handlers_period.free_obj = date_object_free_storage_period;
@@ -2100,18 +2099,18 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_period.write_property = date_period_write_property;
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
+ zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value);
REGISTER_PERIOD_CLASS_CONST_STRING("EXCLUDE_START_DATE", PHP_DATE_PERIOD_EXCLUDE_START_DATE);
} /* }}} */
-static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_date_obj *intern;
intern = ecalloc(1, sizeof(php_date_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2120,17 +2119,17 @@ static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type,
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_date(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_date_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_date_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_date(zval *this_ptr) /* {{{ */
{
php_date_obj *old_obj = Z_PHPDATE_P(this_ptr);
- php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
if (!old_obj->time) {
return &new_obj->std;
}
@@ -2148,18 +2147,18 @@ static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */
return &new_obj->std;
} /* }}} */
-static void date_clone_immutable(zval *object, zval *new_object TSRMLS_DC) /* {{{ */
+static void date_clone_immutable(zval *object, zval *new_object) /* {{{ */
{
- ZVAL_OBJ(new_object, date_object_clone_date(object TSRMLS_CC));
+ ZVAL_OBJ(new_object, date_object_clone_date(object));
} /* }}} */
-static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */
+static int date_object_compare_date(zval *d1, zval *d2) /* {{{ */
{
php_date_obj *o1 = Z_PHPDATE_P(d1);
php_date_obj *o2 = Z_PHPDATE_P(d2);
if (!o1->time || !o2->time) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object");
+ php_error_docref(NULL, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object");
return 1;
}
if (!o1->time->sse_uptodate) {
@@ -2172,21 +2171,21 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */
return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1);
} /* }}} */
-static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2195,14 +2194,14 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
dateobj = Z_PHPDATE_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!dateobj->time || GC_G(gc_active)) {
return props;
}
/* first we add the date and time in ISO format */
- ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1 TSRMLS_CC));
+ ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1));
zend_hash_str_update(props, "date", sizeof("date")-1, &zv);
/* then we add the timezone name (or similar) */
@@ -2236,13 +2235,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
return props;
} /* }}} */
-static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_timezone_obj *intern;
intern = ecalloc(1, sizeof(php_timezone_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2251,17 +2250,17 @@ static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_t
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_timezone(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_timezone_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_timezone_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_timezone(zval *this_ptr) /* {{{ */
{
php_timezone_obj *old_obj = Z_PHPTIMEZONE_P(this_ptr);
- php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
if (!old_obj->initialized) {
return &new_obj->std;
}
@@ -2285,7 +2284,7 @@ static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{
return &new_obj->std;
} /* }}} */
-static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2294,7 +2293,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /*
tzobj = Z_PHPTIMEZONE_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!tzobj->initialized) {
return props;
@@ -2327,13 +2326,13 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /*
return props;
} /* }}} */
-static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_interval_obj *intern;
intern = ecalloc(1, sizeof(php_interval_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2342,31 +2341,31 @@ static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_t
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_interval(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_interval_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_interval_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_interval(zval *this_ptr) /* {{{ */
{
php_interval_obj *old_obj = Z_PHPINTERVAL_P(this_ptr);
- php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
/** FIX ME ADD CLONE STUFF **/
return &new_obj->std;
} /* }}} */
-static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_interval(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2374,7 +2373,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /*
intervalobj = Z_PHPINTERVAL_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!intervalobj->initialized) {
return props;
@@ -2408,13 +2407,13 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /*
return props;
} /* }}} */
-static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_period_obj *intern;
intern = ecalloc(1, sizeof(php_period_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2424,23 +2423,23 @@ static inline zend_object *date_object_new_period_ex(zend_class_entry *class_typ
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_period(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_period_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_period_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_period(zval *this_ptr) /* {{{ */
{
php_period_obj *old_obj = Z_PHPPERIOD_P(this_ptr);
- php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
/** FIX ME ADD CLONE STUFF **/
return &new_obj->std;
} /* }}} */
-static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_date(zend_object *object) /* {{{ */
{
php_date_obj *intern = php_date_obj_from_obj(object);
@@ -2448,28 +2447,28 @@ static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{
timelib_time_dtor(intern->time);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_timezone(zend_object *object) /* {{{ */
{
php_timezone_obj *intern = php_timezone_obj_from_obj(object);
if (intern->type == TIMELIB_ZONETYPE_ABBR) {
free(intern->tzi.z.abbr);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_interval(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_interval(zend_object *object) /* {{{ */
{
php_interval_obj *intern = php_interval_obj_from_obj(object);
timelib_rel_time_dtor(intern->diff);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_period(zend_object *object) /* {{{ */
{
php_period_obj *intern = php_period_obj_from_obj(object);
@@ -2486,11 +2485,11 @@ static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{
}
timelib_rel_time_dtor(intern->interval);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
/* Advanced Interface */
-PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* {{{ */
+PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object) /* {{{ */
{
object_init_ex(object, pce);
return object;
@@ -2498,7 +2497,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
/* Helper function used to store the latest found warnings and errors while
* parsing, from either strtotime or parse_from_format. */
-static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_DC) /* {{{ */
+static void update_errors_warnings(timelib_error_container *last_errors) /* {{{ */
{
if (DATEG(last_errors)) {
timelib_error_container_dtor(DATEG(last_errors));
@@ -2507,7 +2506,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
DATEG(last_errors) = last_errors;
} /* }}} */
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC) /* {{{ */
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor) /* {{{ */
{
timelib_time *now;
timelib_tzinfo *tzi = NULL;
@@ -2526,12 +2525,12 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
}
/* update last errors and warnings */
- update_errors_warnings(err TSRMLS_CC);
+ update_errors_warnings(err);
if (ctor && err && err->error_count) {
/* spit out the first library error message, at least */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
+ php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
}
if (err && err->error_count) {
@@ -2561,7 +2560,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
} else if (dateobj->time->tz_info) {
tzi = dateobj->time->tz_info;
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
}
now = timelib_time_ctor();
@@ -2602,12 +2601,12 @@ PHP_FUNCTION(date_create)
size_t time_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_date, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2625,12 +2624,12 @@ PHP_FUNCTION(date_create_immutable)
size_t time_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_immutable, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2648,12 +2647,12 @@ PHP_FUNCTION(date_create_from_format)
size_t time_str_len = 0, format_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_date, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2671,12 +2670,12 @@ PHP_FUNCTION(date_create_immutable_from_format)
size_t time_str_len = 0, format_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_immutable, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2694,13 +2693,13 @@ PHP_METHOD(DateTime, __construct)
size_t time_str_len = 0;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
- if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
+ if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1)) {
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -2714,11 +2713,11 @@ PHP_METHOD(DateTimeImmutable, __construct)
size_t time_str_len = 0;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
- php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
+ php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -2731,11 +2730,11 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
php_date_obj *new_obj = NULL;
php_date_obj *old_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O!", &datetime_object, date_ce_date) == FAILURE) {
return;
}
- php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_immutable, return_value);
old_obj = Z_PHPDATE_P(datetime_object);
new_obj = Z_PHPDATE_P(return_value);
@@ -2750,7 +2749,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
}
/* }}} */
-static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
+static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht)
{
zval *z_date;
zval *z_timezone;
@@ -2775,7 +2774,7 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
char *tmp = emalloc(Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2);
int ret;
snprintf(tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2, "%s %s", Z_STRVAL_P(z_date), Z_STRVAL_P(z_timezone));
- ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
+ ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0);
efree(tmp);
return 1 == ret;
}
@@ -2784,18 +2783,18 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
int ret;
convert_to_string(z_timezone);
- tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
+ tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB);
if (tzi == NULL) {
return 0;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj TSRMLS_CC));
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj));
tzobj->type = TIMELIB_ZONETYPE_ID;
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
- ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0 TSRMLS_CC);
+ ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0);
zval_ptr_dtor(&tmp_obj);
return 1 == ret;
}
@@ -2814,15 +2813,15 @@ PHP_METHOD(DateTime, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_date, return_value);
dateobj = Z_PHPDATE_P(return_value);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
@@ -2836,15 +2835,15 @@ PHP_METHOD(DateTimeImmutable, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_immutable, return_value);
dateobj = Z_PHPDATE_P(return_value);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object");
}
}
@@ -2862,7 +2861,7 @@ PHP_METHOD(DateTime, __wakeup)
myht = Z_OBJPROP_P(object);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
@@ -2987,7 +2986,7 @@ PHP_FUNCTION(date_parse)
struct timelib_error_container *error;
timelib_time *parsed_time;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &date, &date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &date, &date_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3006,7 +3005,7 @@ PHP_FUNCTION(date_parse_from_format)
struct timelib_error_container *error;
timelib_time *parsed_time;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &format, &format_len, &date, &date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &format, &format_len, &date, &date_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3025,16 +3024,16 @@ PHP_FUNCTION(date_format)
char *format;
size_t format_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
- RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime TSRMLS_CC));
+ RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime));
}
/* }}} */
-static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */
+static int php_date_modify(zval *object, char *modify, size_t modify_len) /* {{{ */
{
php_date_obj *dateobj;
timelib_time *tmp_time;
@@ -3043,17 +3042,17 @@ static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_
dateobj = Z_PHPDATE_P(object);
if (!(dateobj->time)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The DateTime object has not been correctly initialized by its constructor");
+ php_error_docref(NULL, E_WARNING, "The DateTime object has not been correctly initialized by its constructor");
return 0;
}
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
/* update last errors and warnings */
- update_errors_warnings(err TSRMLS_CC);
+ update_errors_warnings(err);
if (err && err->error_count) {
/* spit out the first library error message, at least */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify,
+ php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify,
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
timelib_time_dtor(tmp_time);
return 0;
@@ -3105,11 +3104,11 @@ PHP_FUNCTION(date_modify)
char *modify;
size_t modify_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_date_modify(object, modify, modify_len TSRMLS_CC)) {
+ if (php_date_modify(object, modify, modify_len)) {
RETURN_ZVAL(object, 1, 0);
}
@@ -3125,12 +3124,12 @@ PHP_METHOD(DateTimeImmutable, modify)
char *modify;
size_t modify_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- if (php_date_modify(&new_object, modify, modify_len TSRMLS_CC)) {
+ date_clone_immutable(object, &new_object);
+ if (php_date_modify(&new_object, modify, modify_len)) {
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3138,7 +3137,7 @@ PHP_METHOD(DateTimeImmutable, modify)
}
/* }}} */
-static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_add(zval *object, zval *interval, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_interval_obj *intobj;
@@ -3161,11 +3160,11 @@ PHP_FUNCTION(date_add)
{
zval *object, *interval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- php_date_add(object, interval, return_value TSRMLS_CC);
+ php_date_add(object, interval, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3177,18 +3176,18 @@ PHP_METHOD(DateTimeImmutable, add)
{
zval *object, *interval, new_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_add(&new_object, interval, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_add(&new_object, interval, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_sub(zval *object, zval *interval, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_interval_obj *intobj;
@@ -3200,7 +3199,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
if (intobj->diff->have_special_relative) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only non-special relative time specifications are supported for subtraction");
+ php_error_docref(NULL, E_WARNING, "Only non-special relative time specifications are supported for subtraction");
return;
}
@@ -3216,11 +3215,11 @@ PHP_FUNCTION(date_sub)
{
zval *object, *interval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- php_date_sub(object, interval, return_value TSRMLS_CC);
+ php_date_sub(object, interval, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3232,12 +3231,12 @@ PHP_METHOD(DateTimeImmutable, sub)
{
zval *object, *interval, new_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_sub(&new_object, interval, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_sub(&new_object, interval, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3272,13 +3271,13 @@ PHP_FUNCTION(date_timezone_get)
php_date_obj *dateobj;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
if (dateobj->time->is_localtime/* && dateobj->time->tz_info*/) {
- php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
set_timezone_from_timelib_time(tzobj, dateobj->time);
} else {
@@ -3287,7 +3286,7 @@ PHP_FUNCTION(date_timezone_get)
}
/* }}} */
-static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_timezone_obj *tzobj;
@@ -3318,11 +3317,11 @@ PHP_FUNCTION(date_timezone_set)
zval *object;
zval *timezone_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_timezone_set(object, timezone_object, return_value TSRMLS_CC);
+ php_date_timezone_set(object, timezone_object, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3335,12 +3334,12 @@ PHP_METHOD(DateTimeImmutable, setTimezone)
zval *object, new_object;
zval *timezone_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_timezone_set(&new_object, timezone_object, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_timezone_set(&new_object, timezone_object, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3355,7 +3354,7 @@ PHP_FUNCTION(date_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3381,7 +3380,7 @@ PHP_FUNCTION(date_offset_get)
}
/* }}} */
-static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3401,11 +3400,11 @@ PHP_FUNCTION(date_time_set)
zval *object;
zend_long h, i, s = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) {
RETURN_FALSE;
}
- php_date_time_set(object, h, i, s, return_value TSRMLS_CC);
+ php_date_time_set(object, h, i, s, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3418,18 +3417,18 @@ PHP_METHOD(DateTimeImmutable, setTime)
zval *object, new_object;
zend_long h, i, s = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_time_set(&new_object, h, i, s, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_time_set(&new_object, h, i, s, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3449,11 +3448,11 @@ PHP_FUNCTION(date_date_set)
zval *object;
zend_long y, m, d;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) {
RETURN_FALSE;
}
- php_date_date_set(object, y, m, d, return_value TSRMLS_CC);
+ php_date_date_set(object, y, m, d, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3466,18 +3465,18 @@ PHP_METHOD(DateTimeImmutable, setDate)
zval *object, new_object;
zend_long y, m, d;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_date_set(&new_object, y, m, d, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_date_set(&new_object, y, m, d, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3501,11 +3500,11 @@ PHP_FUNCTION(date_isodate_set)
zval *object;
zend_long y, w, d = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) {
RETURN_FALSE;
}
- php_date_isodate_set(object, y, w, d, return_value TSRMLS_CC);
+ php_date_isodate_set(object, y, w, d, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3518,18 +3517,18 @@ PHP_METHOD(DateTimeImmutable, setISODate)
zval *object, new_object;
zend_long y, w, d = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_isodate_set(&new_object, y, w, d, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_isodate_set(&new_object, y, w, d, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3547,11 +3546,11 @@ PHP_FUNCTION(date_timestamp_set)
zval *object;
zend_long timestamp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_date, &timestamp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_date, &timestamp) == FAILURE) {
RETURN_FALSE;
}
- php_date_timestamp_set(object, timestamp, return_value TSRMLS_CC);
+ php_date_timestamp_set(object, timestamp, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3564,12 +3563,12 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
zval *object, new_object;
zend_long timestamp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_immutable, &timestamp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_immutable, &timestamp) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_timestamp_set(&new_object, timestamp, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_timestamp_set(&new_object, timestamp, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3585,7 +3584,7 @@ PHP_FUNCTION(date_timestamp_get)
zend_long timestamp;
int error;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3611,7 +3610,7 @@ PHP_FUNCTION(date_diff)
php_interval_obj *interval;
zend_long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = Z_PHPDATE_P(object1);
@@ -3621,7 +3620,7 @@ PHP_FUNCTION(date_diff)
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
interval = Z_PHPINTERVAL_P(return_value);
interval->diff = timelib_diff(dateobj1->time, dateobj2->time);
if (absolute) {
@@ -3631,7 +3630,7 @@ PHP_FUNCTION(date_diff)
}
/* }}} */
-static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRMLS_DC) /* {{{ */
+static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz) /* {{{ */
{
timelib_time *dummy_t = ecalloc(1, sizeof(timelib_time));
int dst, not_found;
@@ -3639,7 +3638,7 @@ static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRML
dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, &not_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
if (not_found) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
efree(dummy_t);
return FAILURE;
} else {
@@ -3659,11 +3658,11 @@ PHP_FUNCTION(timezone_open)
size_t tz_len;
php_timezone_obj *tzobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len) == FAILURE) {
RETURN_FALSE;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC));
- if (SUCCESS != timezone_initialize(tzobj, tz TSRMLS_CC)) {
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value));
+ if (SUCCESS != timezone_initialize(tzobj, tz)) {
RETURN_FALSE;
}
}
@@ -3679,18 +3678,18 @@ PHP_METHOD(DateTimeZone, __construct)
php_timezone_obj *tzobj;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len)) {
tzobj = Z_PHPTIMEZONE_P(getThis());
- if (FAILURE == timezone_initialize(tzobj, tz TSRMLS_CC)) {
+ if (FAILURE == timezone_initialize(tzobj, tz)) {
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
-static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht) /* {{{ */
{
zval *z_timezone;
zval *z_timezone_type;
@@ -3698,7 +3697,7 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
if ((z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1)) != NULL) {
if ((z_timezone = zend_hash_str_find(myht, "timezone", sizeof("timezone")-1)) != NULL) {
convert_to_long(z_timezone_type);
- if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone) TSRMLS_CC)) {
+ if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone))) {
return SUCCESS;
}
}
@@ -3714,15 +3713,15 @@ PHP_METHOD(DateTimeZone, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
- php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
+ php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht);
}
/* }}} */
@@ -3738,7 +3737,7 @@ PHP_METHOD(DateTimeZone, __wakeup)
myht = Z_OBJPROP_P(object);
- php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
+ php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht);
}
/* }}} */
@@ -3750,7 +3749,7 @@ PHP_FUNCTION(timezone_name_get)
zval *object;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3790,7 +3789,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
zend_long gmtoffset = -1;
zend_long isdst = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) {
RETURN_FALSE;
}
tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
@@ -3813,7 +3812,7 @@ PHP_FUNCTION(timezone_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3847,7 +3846,7 @@ PHP_FUNCTION(timezone_transitions_get)
unsigned int i, begin = 0, found;
zend_long timestamp_begin = ZEND_LONG_MIN, timestamp_end = ZEND_LONG_MAX;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ll", &object, date_ce_timezone, &timestamp_begin, &timestamp_end) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ll", &object, date_ce_timezone, &timestamp_begin, &timestamp_end) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3859,7 +3858,7 @@ PHP_FUNCTION(timezone_transitions_get)
#define add_nominal() \
array_init(&element); \
add_assoc_long(&element, "ts", timestamp_begin); \
- add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC)); \
+ add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0)); \
add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \
add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \
add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx]); \
@@ -3868,7 +3867,7 @@ PHP_FUNCTION(timezone_transitions_get)
#define add(i,ts) \
array_init(&element); \
add_assoc_long(&element, "ts", ts); \
- add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC)); \
+ add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0)); \
add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \
add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \
add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx]); \
@@ -3925,7 +3924,7 @@ PHP_FUNCTION(timezone_location_get)
zval *object;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3942,7 +3941,7 @@ PHP_FUNCTION(timezone_location_get)
}
/* }}} */
-static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
+static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
@@ -3953,7 +3952,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
if (errors->error_count > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format);
retval = FAILURE;
} else {
if(p) {
@@ -3966,7 +3965,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
*rt = timelib_diff(b, e);
retval = SUCCESS;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse interval (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Failed to parse interval (%s)", format);
retval = FAILURE;
}
}
@@ -3976,7 +3975,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
} /* }}} */
/* {{{ date_interval_read_property */
-zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
php_interval_obj *obj;
zval *retval;
@@ -3994,7 +3993,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
obj = Z_PHPINTERVAL_P(object);
if (!obj->initialized) {
- retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv);
if (member == &tmp_member) {
zval_dtor(member);
}
@@ -4016,7 +4015,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
GET_VALUE_FROM_STRUCT(invert, "invert");
GET_VALUE_FROM_STRUCT(days, "days");
/* didn't find any */
- retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv);
if (member == &tmp_member) {
zval_dtor(member);
@@ -4042,7 +4041,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
/* }}} */
/* {{{ date_interval_write_property */
-void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
php_interval_obj *obj;
zval tmp_member;
@@ -4058,7 +4057,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
obj = Z_PHPINTERVAL_P(object);
if (!obj->initialized) {
- (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC);
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
if (member == &tmp_member) {
zval_dtor(member);
}
@@ -4080,7 +4079,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
SET_VALUE_FROM_STRUCT(s, "s");
SET_VALUE_FROM_STRUCT(invert, "invert");
/* didn't find any */
- (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC);
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
} while(0);
if (member == &tmp_member) {
@@ -4101,9 +4100,9 @@ PHP_METHOD(DateInterval, __construct)
timelib_rel_time *reltime;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling 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) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &interval_string, &interval_string_length) == SUCCESS) {
+ if (date_interval_initialize(&reltime, interval_string, interval_string_length) == SUCCESS) {
diobj = Z_PHPINTERVAL_P(getThis());
diobj->diff = reltime;
diobj->initialized = 1;
@@ -4111,12 +4110,12 @@ PHP_METHOD(DateInterval, __construct)
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
-static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht) /* {{{ */
{
(*intobj)->diff = timelib_rel_time_ctor();
@@ -4170,15 +4169,15 @@ PHP_METHOD(DateInterval, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
intobj = Z_PHPINTERVAL_P(return_value);
- php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
+ php_date_interval_initialize_from_hash(&return_value, &intobj, myht);
}
/* }}} */
@@ -4194,7 +4193,7 @@ PHP_METHOD(DateInterval, __wakeup)
myht = Z_OBJPROP_P(object);
- php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
+ php_date_interval_initialize_from_hash(&return_value, &intobj, myht);
}
/* }}} */
@@ -4209,11 +4208,11 @@ PHP_FUNCTION(date_interval_create_from_date_string)
timelib_error_container *err = NULL;
php_interval_obj *diobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &time_str, &time_str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &time_str, &time_str_len) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
diobj = Z_PHPINTERVAL_P(return_value);
@@ -4225,7 +4224,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
/* }}} */
/* {{{ date_interval_format - */
-static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC)
+static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t)
{
smart_str string = {0};
int i, length, have_format_spec = 0;
@@ -4296,17 +4295,17 @@ PHP_FUNCTION(date_interval_format)
char *format;
size_t format_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) {
RETURN_FALSE;
}
diobj = Z_PHPINTERVAL_P(object);
DATE_CHECK_INITIALIZED(diobj->initialized, DateInterval);
- RETURN_STR(date_interval_format(format, format_len, diobj->diff TSRMLS_CC));
+ RETURN_STR(date_interval_format(format, format_len, diobj->diff));
}
/* }}} */
-static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
+static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
@@ -4317,7 +4316,7 @@ static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
if (errors->error_count > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format);
retval = FAILURE;
} else {
*st = b;
@@ -4345,12 +4344,12 @@ PHP_METHOD(DatePeriod, __construct)
timelib_time *clone;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_interface, &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_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|l", &isostr, &isostr_len, &options) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
+ zend_restore_error_handling(&error_handling);
return;
}
}
@@ -4360,15 +4359,15 @@ PHP_METHOD(DatePeriod, __construct)
dpobj->current = NULL;
if (isostr) {
- date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len TSRMLS_CC);
+ date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len);
if (dpobj->start == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
}
if (dpobj->interval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr);
}
if (dpobj->end == NULL && recurrences == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr);
}
if (dpobj->start) {
@@ -4414,7 +4413,7 @@ PHP_METHOD(DatePeriod, __construct)
dpobj->initialized = 1;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -4432,7 +4431,7 @@ PHP_METHOD(DatePeriod, getStartDate)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
+ php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->start;
@@ -4459,7 +4458,7 @@ PHP_METHOD(DatePeriod, getEndDate)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
+ php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end;
@@ -4486,7 +4485,7 @@ PHP_METHOD(DatePeriod, getDateInterval)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
diobj = Z_PHPINTERVAL_P(return_value);
diobj->diff = timelib_rel_time_clone(dpobj->interval);
diobj->initialized = 1;
@@ -4521,13 +4520,13 @@ PHP_FUNCTION(timezone_identifiers_list)
char *option = NULL;
size_t option_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &what, &option, &option_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls", &what, &option, &option_len) == FAILURE) {
RETURN_FALSE;
}
/* Extra validation */
if (what == PHP_DATE_TIMEZONE_PER_COUNTRY && option_len != 2) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected");
+ php_error_docref(NULL, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected");
RETURN_FALSE;
}
@@ -4603,11 +4602,11 @@ PHP_FUNCTION(date_default_timezone_set)
char *zone;
size_t zone_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &zone, &zone_len) == FAILURE) {
RETURN_FALSE;
}
if (!timelib_timezone_id_is_valid(zone, DATE_TIMEZONEDB)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone ID '%s' is invalid", zone);
+ php_error_docref(NULL, E_NOTICE, "Timezone ID '%s' is invalid", zone);
RETURN_FALSE;
}
if (DATEG(timezone)) {
@@ -4625,7 +4624,7 @@ PHP_FUNCTION(date_default_timezone_get)
{
timelib_tzinfo *default_tz;
- default_tz = get_timezone_info(TSRMLS_C);
+ default_tz = get_timezone_info();
RETVAL_STRING(default_tz->name);
}
/* }}} */
@@ -4644,7 +4643,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
timelib_tzinfo *tzi;
zend_string *retstr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
RETURN_FALSE;
}
@@ -4665,7 +4664,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
case 6:
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid format");
+ php_error_docref(NULL, E_WARNING, "invalid format");
RETURN_FALSE;
break;
}
@@ -4673,14 +4672,14 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
retformat != SUNFUNCS_RET_STRING &&
retformat != SUNFUNCS_RET_DOUBLE)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE");
+ php_error_docref(NULL, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE");
RETURN_FALSE;
}
altitude = 90 - zenith;
/* Initialize time struct */
t = timelib_time_ctor();
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
@@ -4746,12 +4745,12 @@ PHP_FUNCTION(date_sun_info)
int dummy;
double ddummy;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time, &latitude, &longitude) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ldd", &time, &latitude, &longitude) == FAILURE) {
RETURN_FALSE;
}
/* Initialize time struct */
t = timelib_time_ctor();
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, time);
@@ -4838,14 +4837,14 @@ PHP_FUNCTION(date_sun_info)
}
/* }}} */
-static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -4853,7 +4852,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {
period_obj = Z_PHPPERIOD_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!period_obj->start || GC_G(gc_active)) {
return props;
@@ -4910,7 +4909,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {
return props;
} /* }}} */
-static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht) /* {{{ */
{
zval *ht_entry;
@@ -4998,7 +4997,7 @@ PHP_METHOD(DatePeriod, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
@@ -5006,7 +5005,7 @@ PHP_METHOD(DatePeriod, __set_state)
object_init_ex(return_value, date_ce_period);
period_obj = Z_PHPPERIOD_P(return_value);
- if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ if (!php_date_period_initialize_from_hash(period_obj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
@@ -5024,26 +5023,26 @@ PHP_METHOD(DatePeriod, __wakeup)
myht = Z_OBJPROP_P(object);
- if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ if (!php_date_period_initialize_from_hash(period_obj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ date_period_read_property */
-static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
+ php_error_docref(NULL, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
}
Z_OBJPROP_P(object); /* build properties hash table */
- zv = std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ zv = std_object_handlers.read_property(object, member, type, cache_slot, rv);
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
/* defensive copy */
- ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC));
+ ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv));
}
return zv;
@@ -5051,9 +5050,9 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
/* }}} */
/* {{{ date_period_write_property */
-static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
+ php_error_docref(NULL, E_ERROR, "Writing to DatePeriod properties is unsupported");
}
/* }}} */
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 134beef24d..9c3b0c9322 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -200,7 +200,7 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
ZEND_END_MODULE_GLOBALS(date)
#ifdef ZTS
-#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v)
+#define DATEG(v) ZEND_TSRMG(date_globals_id, zend_date_globals *, v)
#else
#define DATEG(v) (date_globals.v)
#endif
@@ -208,24 +208,24 @@ ZEND_END_MODULE_GLOBALS(date)
/* Backwards compatibility wrapper */
PHPAPI zend_long php_parse_date(char *string, zend_long *now);
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
+PHPAPI int php_idate(char format, time_t ts, int localtime);
#if HAVE_STRFTIME
#define _php_strftime php_strftime
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#endif
-PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC);
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime);
/* Mechanism to set new TZ database */
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
-PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
+PHPAPI timelib_tzinfo *get_timezone_info(void);
/* Grabbing CE's so that other exts can use the date objects too */
PHPAPI zend_class_entry *php_date_get_date_ce(void);
PHPAPI zend_class_entry *php_date_get_timezone_ce(void);
/* Functions for creating DateTime objects, and initializing them from a string */
-PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC);
+PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object);
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor);
#endif /* PHP_DATE_H */
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index de4ea4c464..2ca9092e65 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -200,7 +200,7 @@ ZEND_GET_MODULE(dba)
/* these are used to get the standard arguments */
/* {{{ php_dba_myke_key */
-static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS_DC)
+static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
{
if (Z_TYPE_P(key) == IS_ARRAY) {
zval *group, *name;
@@ -208,7 +208,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
size_t len;
if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
return -1;
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos);
@@ -245,10 +245,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
zval *key; \
char *key_str, *key_free; \
size_t key_len; \
- if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \
return; \
} \
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\
RETURN_FALSE; \
}
@@ -259,19 +259,19 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
zend_long skip = 0; \
switch(ac) { \
case 2: \
- if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \
return; \
} \
break; \
case 3: \
- if (zend_parse_parameters(ac TSRMLS_CC, "zlr", &key, &skip, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zlr", &key, &skip, &id) == FAILURE) { \
return; \
} \
break; \
default: \
WRONG_PARAM_COUNT; \
} \
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\
RETURN_FALSE; \
}
@@ -298,14 +298,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
/* check whether the user has write access */
#define DBA_WRITE_CHECK \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
+ php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \
RETURN_FALSE; \
}
/* the same check, but with a call to DBA_ID_DONE before returning */
#define DBA_WRITE_CHECK_WITH_ID \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
+ php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \
DBA_ID_DONE; \
RETURN_FALSE; \
}
@@ -387,7 +387,7 @@ static int le_pdb;
/* }}} */
/* {{{ dba_fetch_resource
-PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id TSRMLS_DC)
+PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id)
{
dba_info *info;
DBA_ID_FETCH
@@ -408,10 +408,10 @@ PHPAPI dba_handler *dba_get_handler(const char* handler_name)
/* {{{ dba_close
*/
-static void dba_close(dba_info *info TSRMLS_DC)
+static void dba_close(dba_info *info)
{
if (info->hnd) {
- info->hnd->close(info TSRMLS_CC);
+ info->hnd->close(info);
}
if (info->path) {
pefree(info->path, info->flags&DBA_PERSISTENT);
@@ -439,28 +439,28 @@ static void dba_close(dba_info *info TSRMLS_DC)
/* {{{ dba_close_rsrc
*/
-static void dba_close_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void dba_close_rsrc(zend_resource *rsrc)
{
dba_info *info = (dba_info *)rsrc->ptr;
- dba_close(info TSRMLS_CC);
+ dba_close(info);
}
/* }}} */
/* {{{ dba_close_pe_rsrc_deleter */
-int dba_close_pe_rsrc_deleter(zval *el, void *pDba TSRMLS_DC)
+int dba_close_pe_rsrc_deleter(zval *el, void *pDba)
{
return ((zend_resource *)Z_PTR_P(el))->ptr == pDba ? ZEND_HASH_APPLY_REMOVE: ZEND_HASH_APPLY_KEEP;
}
/* }}} */
/* {{{ dba_close_pe_rsrc */
-static void dba_close_pe_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void dba_close_pe_rsrc(zend_resource *rsrc)
{
dba_info *info = (dba_info *)rsrc->ptr;
/* closes the resource by calling dba_close_rsrc() */
- zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info);
}
/* }}} */
@@ -472,17 +472,17 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
if (!new_value->len) {
DBA_G(default_hptr) = NULL;
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++);
if (!hptr->name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value->val);
+ php_error_docref(NULL, E_WARNING, "No such handler: %s", new_value->val);
return FAILURE;
}
DBA_G(default_hptr) = hptr;
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
PHP_INI_BEGIN()
@@ -560,11 +560,11 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
char *key_str, *key_free;
size_t key_len;
- if (zend_parse_parameters(ac TSRMLS_CC, "zsr", &key, &val, &val_len, &id) == FAILURE) {
+ if (zend_parse_parameters(ac, "zsr", &key, &val, &val_len, &id) == FAILURE) {
return;
}
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {
RETURN_FALSE;
}
@@ -572,7 +572,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
DBA_WRITE_CHECK_WITH_ID;
- if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->update(info, key_str, key_len, val, val_len, mode) == SUCCESS) {
DBA_ID_DONE;
RETURN_TRUE;
}
@@ -586,7 +586,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
/* {{{ php_find_dbm
*/
-dba_info *php_dba_find(const char* path TSRMLS_DC)
+dba_info *php_dba_find(const char* path)
{
zend_resource *le;
dba_info *info;
@@ -681,7 +681,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ac==2) {
hptr = DBA_G(default_hptr);
if (!hptr) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected");
FREENOW;
RETURN_FALSE;
}
@@ -690,7 +690,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (!hptr->name) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2]));
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2]));
FREENOW;
RETURN_FALSE;
}
@@ -721,13 +721,13 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
case 'l':
lock_flag = DBA_LOCK_ALL;
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name);
}
break;
default:
case '-':
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name);
FREENOW;
RETURN_FALSE;
}
@@ -776,7 +776,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
file_mode = "w+b";
break;
default:
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
FREENOW;
RETURN_FALSE;
}
@@ -789,17 +789,17 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (*pmode=='t') {
pmode++;
if (!lock_flag) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)");
FREENOW;
RETURN_FALSE;
}
if (!lock_mode) {
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name);
FREENOW;
RETURN_FALSE;
} else {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name);
FREENOW;
RETURN_FALSE;
}
@@ -808,7 +808,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (*pmode) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
FREENOW;
RETURN_FALSE;
}
@@ -827,7 +827,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* the problem is some systems would allow read during write
*/
if (hptr->flags & DBA_LOCK_ALL) {
- if ((other = php_dba_find(info->path TSRMLS_CC)) != NULL) {
+ if ((other = php_dba_find(info->path)) != NULL) {
if ( ( (lock_mode&LOCK_EX) && (other->lock.mode&(LOCK_EX|LOCK_SH)) )
|| ( (other->lock.mode&LOCK_EX) && (lock_mode&(LOCK_EX|LOCK_SH)) )
) {
@@ -882,7 +882,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(lock_name);
}
if (!info->lock.fp) {
- dba_close(info TSRMLS_CC);
+ dba_close(info);
/* stream operation already wrote an error message */
FREENOW;
RETURN_FALSE;
@@ -903,7 +903,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|persistent_flag, NULL);
}
if (!info->fp) {
- dba_close(info TSRMLS_CC);
+ dba_close(info);
/* stream operation already wrote an error message */
FREENOW;
RETURN_FALSE;
@@ -913,8 +913,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* file contents with O_APPEND being set.
*/
if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream");
- dba_close(info TSRMLS_CC);
+ php_error_docref(NULL, E_WARNING, "Could not cast stream");
+ dba_close(info);
FREENOW;
RETURN_FALSE;
#ifdef F_SETFL
@@ -927,9 +927,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
- if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {
- dba_close(info TSRMLS_CC);
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
+ if (error || hptr->open(info, &error) != SUCCESS) {
+ dba_close(info);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
FREENOW;
RETURN_FALSE;
}
@@ -944,8 +944,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
new_le.type = le_pdb;
new_le.ptr = info;
if (zend_hash_str_update_mem(&EG(persistent_list), key, keylen, &new_le, sizeof(zend_resource)) == NULL) {
- dba_close(info TSRMLS_CC);
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource");
+ dba_close(info);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource");
FREENOW;
RETURN_FALSE;
}
@@ -980,7 +980,7 @@ PHP_FUNCTION(dba_close)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
@@ -996,7 +996,7 @@ PHP_FUNCTION(dba_exists)
{
DBA_ID_GET2;
- if(info->hnd->exists(info, key_str, key_len TSRMLS_CC) == SUCCESS) {
+ if(info->hnd->exists(info, key_str, key_len) == SUCCESS) {
DBA_ID_DONE;
RETURN_TRUE;
}
@@ -1016,7 +1016,7 @@ PHP_FUNCTION(dba_fetch)
if (ac==3) {
if (!strcmp(info->hnd->name, "cdb")) {
if (skip < 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name);
skip = 0;
}
} else if (!strcmp(info->hnd->name, "inifile")) {
@@ -1027,17 +1027,17 @@ PHP_FUNCTION(dba_fetch)
* value to 0 ensures the first value.
*/
if (skip < -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name);
skip = 0;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name);
skip = 0;
}
} else {
skip = 0;
}
- if((val = info->hnd->fetch(info, key_str, key_len, skip, &len TSRMLS_CC)) != NULL) {
+ if((val = info->hnd->fetch(info, key_str, key_len, skip, &len)) != NULL) {
DBA_ID_DONE;
RETVAL_STRINGL(val, len);
efree(val);
@@ -1059,12 +1059,12 @@ PHP_FUNCTION(dba_key_split)
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &zkey) == SUCCESS) {
if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_FALSE)) {
RETURN_BOOL(0);
}
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &key, &key_len) == FAILURE) {
RETURN_BOOL(0);
}
array_init(return_value);
@@ -1087,13 +1087,13 @@ PHP_FUNCTION(dba_firstkey)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- fkey = info->hnd->firstkey(info, &len TSRMLS_CC);
+ fkey = info->hnd->firstkey(info, &len);
if (fkey) {
RETVAL_STRINGL(fkey, len);
@@ -1114,13 +1114,13 @@ PHP_FUNCTION(dba_nextkey)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- nkey = info->hnd->nextkey(info, &len TSRMLS_CC);
+ nkey = info->hnd->nextkey(info, &len);
if (nkey) {
RETVAL_STRINGL(nkey, len);
@@ -1141,7 +1141,7 @@ PHP_FUNCTION(dba_delete)
DBA_WRITE_CHECK_WITH_ID;
- if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS)
+ if(info->hnd->delete(info, key_str, key_len) == SUCCESS)
{
DBA_ID_DONE;
RETURN_TRUE;
@@ -1176,7 +1176,7 @@ PHP_FUNCTION(dba_optimize)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
@@ -1184,7 +1184,7 @@ PHP_FUNCTION(dba_optimize)
DBA_WRITE_CHECK;
- if (info->hnd->optimize(info TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->optimize(info) == SUCCESS) {
RETURN_TRUE;
}
@@ -1199,13 +1199,13 @@ PHP_FUNCTION(dba_sync)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- if (info->hnd->sync(info TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->sync(info) == SUCCESS) {
RETURN_TRUE;
}
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(dba_handlers)
dba_handler *hptr;
zend_bool full_info = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) {
RETURN_FALSE;
}
@@ -1229,7 +1229,7 @@ PHP_FUNCTION(dba_handlers)
for(hptr = handler; hptr->name; hptr++) {
if (full_info) {
// TODO: avoid reallocation ???
- char *str = hptr->info(hptr, NULL TSRMLS_CC);
+ char *str = hptr->info(hptr, NULL);
add_assoc_string(return_value, hptr->name, str);
efree(str);
} else {
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c
index 17419dcf2e..deab119861 100644
--- a/ext/dba/dba_cdb.c
+++ b/ext/dba/dba_cdb.c
@@ -104,9 +104,9 @@ DBA_OPEN_FUNC(cdb)
#if DBA_CDB_BUILTIN
if (make) {
- cdb_make_start(&cdb->m, file TSRMLS_CC);
+ cdb_make_start(&cdb->m, file);
} else {
- cdb_init(&cdb->c, file TSRMLS_CC);
+ cdb_init(&cdb->c, file);
}
cdb->make = make;
#else
@@ -125,9 +125,9 @@ DBA_CLOSE_FUNC(cdb)
/* cdb_free does not close associated file */
#if DBA_CDB_BUILTIN
if (cdb->make) {
- cdb_make_finish(&cdb->m TSRMLS_CC);
+ cdb_make_finish(&cdb->m);
} else {
- cdb_free(&cdb->c TSRMLS_CC);
+ cdb_free(&cdb->c);
}
#else
cdb_free(&cdb->c);
@@ -137,9 +137,9 @@ DBA_CLOSE_FUNC(cdb)
}
#if DBA_CDB_BUILTIN
-# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos TSRMLS_CC)
-# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len TSRMLS_CC)
-# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len TSRMLS_CC)
+# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
+# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
+# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len)
#else
# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
@@ -186,7 +186,7 @@ DBA_UPDATE_FUNC(cdb)
return FAILURE; /* database was opened readonly */
if (!mode)
return FAILURE; /* cdb_make dosn't know replace */
- if (cdb_make_add(&cdb->m, key, keylen, val, vallen TSRMLS_CC) != -1)
+ if (cdb_make_add(&cdb->m, key, keylen, val, vallen) != -1)
return SUCCESS;
#endif
return FAILURE;
@@ -225,12 +225,12 @@ DBA_DELETE_FUNC(cdb)
/* {{{ cdb_file_lseek
php_stream_seek does not return actual position */
#if DBA_CDB_BUILTIN
-int cdb_file_lseek(php_stream *fp, off_t offset, int whence TSRMLS_DC) {
+int cdb_file_lseek(php_stream *fp, off_t offset, int whence) {
php_stream_seek(fp, offset, whence);
return php_stream_tell(fp);
}
#else
-int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) {
+int cdb_file_lseek(int fd, off_t offset, int whence) {
return lseek(fd, offset, whence);
}
#endif
@@ -238,7 +238,7 @@ int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) {
#define CSEEK(n) do { \
if (n >= cdb->eod) return NULL; \
- if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET TSRMLS_CC) != (off_t) n) return NULL; \
+ if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET) != (off_t) n) return NULL; \
} while (0)
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index 6643eebcde..bde08427ee 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -164,7 +164,7 @@ DBA_FIRSTKEY_FUNC(db2)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db2(info, newlen TSRMLS_CC);
+ return dba_nextkey_db2(info, newlen);
}
DBA_NEXTKEY_FUNC(db2)
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 3f31222d9e..5e8f1da4ad 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -37,9 +37,8 @@
static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg)
{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
+ php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
}
#define DB3_DATA dba_db3_data *dba = info->dbf
@@ -187,7 +186,7 @@ DBA_FIRSTKEY_FUNC(db3)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db3(info, newlen TSRMLS_CC);
+ return dba_nextkey_db3(info, newlen);
}
DBA_NEXTKEY_FUNC(db3)
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index a9752a7bf6..393c565b2a 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -42,13 +42,12 @@ static void php_dba_db4_errcall_fcn(
#endif
const char *errpfx, const char *msg)
{
- TSRMLS_FETCH();
#if (DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8))
/* Bug 51086, Berkeley DB 4.8.26 */
/* This code suppresses a BDB 4.8+ error message, thus keeping PHP test compatibility */
{
- const char *function = get_active_function_name(TSRMLS_C);
+ const char *function = get_active_function_name();
if (function && (!strcmp(function,"dba_popen") || !strcmp(function,"dba_open"))
&& (!strncmp(msg, "fop_read_meta", sizeof("fop_read_meta")-1)
|| !strncmp(msg, "BDB0004 fop_read_meta", sizeof("BDB0004 fop_read_meta")-1))) {
@@ -57,7 +56,7 @@ static void php_dba_db4_errcall_fcn(
}
#endif
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
+ php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
}
#define DB4_DATA dba_db4_data *dba = info->dbf
@@ -239,7 +238,7 @@ DBA_FIRSTKEY_FUNC(db4)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db4(info, newlen TSRMLS_CC);
+ return dba_nextkey_db4(info, newlen);
}
DBA_NEXTKEY_FUNC(db4)
diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c
index b369f11c70..47a2e5a2af 100644
--- a/ext/dba/dba_dbm.c
+++ b/ext/dba/dba_dbm.c
@@ -195,7 +195,7 @@ DBA_INFO_FUNC(dbm)
#if DBA_GDBM
if (!strcmp(DBM_VERSION, "GDBM"))
{
- return dba_info_gdbm(hnd, info TSRMLS_CC);
+ return dba_info_gdbm(hnd, info);
}
#endif
return estrdup(DBM_VERSION);
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index 9be6e9be18..49f39cf2a8 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -67,7 +67,7 @@ DBA_FETCH_FUNC(flatfile)
FLATFILE_DATA;
FLATFILE_GKEY;
- gval = flatfile_fetch(dba, gkey TSRMLS_CC);
+ gval = flatfile_fetch(dba, gkey);
if (gval.dptr) {
if (newlen) {
*newlen = gval.dsize;
@@ -87,16 +87,16 @@ DBA_UPDATE_FUNC(flatfile)
gval.dptr = (char *) val;
gval.dsize = vallen;
- switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) {
+ switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE)) {
case 0:
return SUCCESS;
case 1:
return FAILURE;
case -1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
+ php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
return FAILURE;
default:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
+ php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value");
return FAILURE;
}
}
@@ -107,7 +107,7 @@ DBA_EXISTS_FUNC(flatfile)
FLATFILE_DATA;
FLATFILE_GKEY;
- gval = flatfile_fetch(dba, gkey TSRMLS_CC);
+ gval = flatfile_fetch(dba, gkey);
if (gval.dptr) {
efree(gval.dptr);
return SUCCESS;
@@ -119,7 +119,7 @@ DBA_DELETE_FUNC(flatfile)
{
FLATFILE_DATA;
FLATFILE_GKEY;
- return(flatfile_delete(dba, gkey TSRMLS_CC) == -1 ? FAILURE : SUCCESS);
+ return(flatfile_delete(dba, gkey) == -1 ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(flatfile)
@@ -129,7 +129,7 @@ DBA_FIRSTKEY_FUNC(flatfile)
if (dba->nextkey.dptr) {
efree(dba->nextkey.dptr);
}
- dba->nextkey = flatfile_firstkey(dba TSRMLS_CC);
+ dba->nextkey = flatfile_firstkey(dba);
if (dba->nextkey.dptr) {
if (newlen) {
*newlen = dba->nextkey.dsize;
@@ -150,7 +150,7 @@ DBA_NEXTKEY_FUNC(flatfile)
if (dba->nextkey.dptr) {
efree(dba->nextkey.dptr);
}
- dba->nextkey = flatfile_nextkey(dba TSRMLS_CC);
+ dba->nextkey = flatfile_nextkey(dba);
if (dba->nextkey.dptr) {
if (newlen) {
*newlen = dba->nextkey.dsize;
diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c
index bea2f4cf58..5f2fd1076d 100644
--- a/ext/dba/dba_gdbm.c
+++ b/ext/dba/dba_gdbm.c
@@ -110,10 +110,10 @@ DBA_UPDATE_FUNC(gdbm)
case 1:
return FAILURE;
case -1:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno));
+ php_error_docref2(NULL, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno));
return FAILURE;
default:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
+ php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value");
return FAILURE;
}
}
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index aaae690344..333438163c 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -42,7 +42,7 @@
#define INIFILE_GKEY \
key_type ini_key; \
if (!key) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \
+ php_error_docref(NULL, E_WARNING, "No key specified"); \
return 0; \
} \
ini_key = inifile_key_split((char*)key) /* keylen not needed here */
@@ -52,7 +52,7 @@
DBA_OPEN_FUNC(inifile)
{
- info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT TSRMLS_CC);
+ info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT);
return info->dbf ? SUCCESS : FAILURE;
}
@@ -71,7 +71,7 @@ DBA_FETCH_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- ini_val = inifile_fetch(dba, &ini_key, skip TSRMLS_CC);
+ ini_val = inifile_fetch(dba, &ini_key, skip);
*newlen = ini_val.value ? strlen(ini_val.value) : 0;
INIFILE_DONE;
return ini_val.value;
@@ -88,14 +88,14 @@ DBA_UPDATE_FUNC(inifile)
ini_val.value = val;
if (mode == 1) {
- res = inifile_append(dba, &ini_key, &ini_val TSRMLS_CC);
+ res = inifile_append(dba, &ini_key, &ini_val);
} else {
- res = inifile_replace(dba, &ini_key, &ini_val TSRMLS_CC);
+ res = inifile_replace(dba, &ini_key, &ini_val);
}
INIFILE_DONE;
switch(res) {
case -1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
+ php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
return FAILURE;
default:
case 0:
@@ -112,7 +112,7 @@ DBA_EXISTS_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- ini_val = inifile_fetch(dba, &ini_key, 0 TSRMLS_CC);
+ ini_val = inifile_fetch(dba, &ini_key, 0);
INIFILE_DONE;
if (ini_val.value) {
inifile_val_free(&ini_val);
@@ -129,7 +129,7 @@ DBA_DELETE_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC);
+ res = inifile_delete_ex(dba, &ini_key, &found);
INIFILE_DONE;
return (res == -1 || !found ? FAILURE : SUCCESS);
@@ -139,7 +139,7 @@ DBA_FIRSTKEY_FUNC(inifile)
{
INIFILE_DATA;
- if (inifile_firstkey(dba TSRMLS_CC)) {
+ if (inifile_firstkey(dba)) {
char *result = inifile_key_string(&dba->curr.key);
*newlen = strlen(result);
return result;
@@ -156,7 +156,7 @@ DBA_NEXTKEY_FUNC(inifile)
return NULL;
}
- if (inifile_nextkey(dba TSRMLS_CC)) {
+ if (inifile_nextkey(dba)) {
char *result = inifile_key_string(&dba->curr.key);
*newlen = strlen(result);
return result;
diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c
index 023e5e9b27..c755cb98eb 100644
--- a/ext/dba/dba_qdbm.c
+++ b/ext/dba/dba_qdbm.c
@@ -102,7 +102,7 @@ DBA_UPDATE_FUNC(qdbm)
}
if (dpecode != DP_EKEEP) {
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode));
+ php_error_docref2(NULL, key, val, E_WARNING, "%s", dperrmsg(dpecode));
}
return FAILURE;
diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c
index 99c10c2f07..e4771eb641 100644
--- a/ext/dba/dba_tcadb.c
+++ b/ext/dba/dba_tcadb.c
@@ -122,7 +122,7 @@ DBA_UPDATE_FUNC(tcadb)
return SUCCESS;
}
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Error updating data");
+ php_error_docref2(NULL, key, val, E_WARNING, "Error updating data");
return FAILURE;
}
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index c8caf8b8f2..d6578d017d 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -43,7 +43,7 @@
#endif
/* {{{ cdb_match */
-static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRMLS_DC)
+static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos)
{
char buf[32];
unsigned int n;
@@ -52,7 +52,7 @@ static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRM
n = sizeof(buf);
if (n > len)
n = len;
- if (cdb_read(c, buf, n, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, n, pos) == -1)
return -1;
if (memcmp(buf, key, n))
return 0;
@@ -79,29 +79,29 @@ uint32 cdb_hash(char *buf, unsigned int len)
/* }}} */
/* {{{ cdb_free */
-void cdb_free(struct cdb *c TSRMLS_DC)
+void cdb_free(struct cdb *c)
{
}
/* }}} */
/* {{{ cdb_findstart */
-void cdb_findstart(struct cdb *c TSRMLS_DC)
+void cdb_findstart(struct cdb *c)
{
c->loop = 0;
}
/* }}} */
/* {{{ cdb_init */
-void cdb_init(struct cdb *c, php_stream *fp TSRMLS_DC)
+void cdb_init(struct cdb *c, php_stream *fp)
{
- cdb_free(c TSRMLS_CC);
- cdb_findstart(c TSRMLS_CC);
+ cdb_free(c);
+ cdb_findstart(c);
c->fp = fp;
}
/* }}} */
/* {{{ cdb_read */
-int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
+int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos)
{
if (php_stream_seek(c->fp, pos, SEEK_SET) == -1) {
errno = EPROTO;
@@ -126,7 +126,7 @@ int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
/* }}} */
/* {{{ cdb_findnext */
-int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_findnext(struct cdb *c, char *key, unsigned int len)
{
char buf[8];
uint32 pos;
@@ -134,7 +134,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
if (!c->loop) {
u = cdb_hash(key, len);
- if (cdb_read(c, buf, 8, (u << 3) & 2047 TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, (u << 3) & 2047) == -1)
return -1;
uint32_unpack(buf + 4,&c->hslots);
if (!c->hslots)
@@ -148,7 +148,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
}
while (c->loop < c->hslots) {
- if (cdb_read(c, buf, 8, c->kpos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, c->kpos) == -1)
return -1;
uint32_unpack(buf + 4, &pos);
if (!pos)
@@ -159,11 +159,11 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
c->kpos = c->hpos;
uint32_unpack(buf, &u);
if (u == c->khash) {
- if (cdb_read(c, buf, 8, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, pos) == -1)
return -1;
uint32_unpack(buf, &u);
if (u == len)
- switch(cdb_match(c, key, len, pos + 8 TSRMLS_CC)) {
+ switch(cdb_match(c, key, len, pos + 8)) {
case -1:
return -1;
case 1:
@@ -179,10 +179,10 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
/* }}} */
/* {{{ cdb_find */
-int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_find(struct cdb *c, char *key, unsigned int len)
{
- cdb_findstart(c TSRMLS_CC);
- return cdb_findnext(c, key, len TSRMLS_CC);
+ cdb_findstart(c);
+ return cdb_findnext(c, key, len);
}
/* }}} */
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 4b4a7ff2ff..8c281fe5fe 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -40,14 +40,14 @@ struct cdb {
uint32 cdb_hash(char *, unsigned int);
-void cdb_free(struct cdb * TSRMLS_DC);
-void cdb_init(struct cdb *, php_stream *fp TSRMLS_DC);
+void cdb_free(struct cdb *);
+void cdb_init(struct cdb *, php_stream *fp);
-int cdb_read(struct cdb *, char *, unsigned int, uint32 TSRMLS_DC);
+int cdb_read(struct cdb *, char *, unsigned int, uint32);
-void cdb_findstart(struct cdb * TSRMLS_DC);
-int cdb_findnext(struct cdb *, char *, unsigned int TSRMLS_DC);
-int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC);
+void cdb_findstart(struct cdb *);
+int cdb_findnext(struct cdb *, char *, unsigned int);
+int cdb_find(struct cdb *, char *, unsigned int);
#define cdb_datapos(c) ((c)->dpos)
#define cdb_datalen(c) ((c)->dlen)
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index b6236f085e..3be1157769 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -38,7 +38,7 @@
#include "uint32.h"
/* {{{ cdb_make_write */
-static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz TSRMLS_DC) {
+static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz) {
return php_stream_write(c->fp, buf, sz) == sz ? 0 : -1;
}
@@ -56,7 +56,7 @@ static int cdb_posplus(struct cdb_make *c, uint32 len)
/* }}} */
/* {{{ cdb_make_start */
-int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
+int cdb_make_start(struct cdb_make *c, php_stream * f)
{
c->head = 0;
c->split = 0;
@@ -65,7 +65,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
c->fp = f;
c->pos = sizeof(c->final);
if (php_stream_seek(f, c->pos, SEEK_SET) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Fseek failed");
+ php_error_docref(NULL, E_NOTICE, "Fseek failed");
return -1;
}
return php_stream_tell(c->fp);
@@ -73,7 +73,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
/* }}} */
/* {{{ cdb_make_addend */
-int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h TSRMLS_DC)
+int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h)
{
struct cdb_hplist *head;
@@ -101,7 +101,7 @@ int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datale
/* }}} */
/* {{{ cdb_make_addbegin */
-int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen TSRMLS_DC)
+int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen)
{
char buf[8];
@@ -116,26 +116,26 @@ int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int data
uint32_pack(buf, keylen);
uint32_pack(buf + 4, datalen);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
return 0;
}
/* {{{ cdb_make_add */
-int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen TSRMLS_DC)
+int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen)
{
- if (cdb_make_addbegin(c, keylen, datalen TSRMLS_CC) == -1)
+ if (cdb_make_addbegin(c, keylen, datalen) == -1)
return -1;
- if (cdb_make_write(c, key, keylen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, key, keylen) != 0)
return -1;
- if (cdb_make_write(c, data, datalen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, data, datalen) != 0)
return -1;
- return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen) TSRMLS_CC);
+ return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen));
}
/* }}} */
/* {{{ cdb_make_finish */
-int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
+int cdb_make_finish(struct cdb_make *c)
{
char buf[8];
int i;
@@ -211,7 +211,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
for (u = 0;u < len;++u) {
uint32_pack(buf, c->hash[u].h);
uint32_pack(buf + 4, c->hash[u].p);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
if (cdb_posplus(c, 8) == -1)
return -1;
@@ -231,7 +231,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
php_stream_rewind(c->fp);
if (php_stream_tell(c->fp) != 0)
return -1;
- if (cdb_make_write(c, c->final, sizeof(c->final) TSRMLS_CC) != 0)
+ if (cdb_make_write(c, c->final, sizeof(c->final)) != 0)
return -1;
return php_stream_flush(c->fp);
}
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index d33fcb15da..a9a0e85143 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -54,11 +54,11 @@ struct cdb_make {
php_stream * fp;
};
-int cdb_make_start(struct cdb_make *, php_stream * TSRMLS_DC);
-int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC);
-int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC);
-int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC);
-int cdb_make_finish(struct cdb_make * TSRMLS_DC);
+int cdb_make_start(struct cdb_make *, php_stream *);
+int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int);
+int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32);
+int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int);
+int cdb_make_finish(struct cdb_make *);
char *cdb_make_version();
#endif
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index 8eae2d2508..361cc42519 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -47,30 +47,30 @@
/* {{{ flatfile_store
*/
-int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) {
+int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode) {
if (mode == FLATFILE_INSERT) {
- if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
+ if (flatfile_findkey(dba, key_datum)) {
return 1;
}
php_stream_seek(dba->fp, 0L, SEEK_END);
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", key_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
return -1;
}
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", value_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
return -1;
}
} else { /* FLATFILE_REPLACE */
- flatfile_delete(dba, key_datum TSRMLS_CC);
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize);
+ flatfile_delete(dba, key_datum);
+ php_stream_printf(dba->fp, "%zu\n", key_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
return -1;
}
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", value_datum.dsize);
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
return -1;
}
@@ -83,11 +83,11 @@ int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode T
/* {{{ flatfile_fetch
*/
-datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
+datum flatfile_fetch(flatfile *dba, datum key_datum) {
datum value_datum = {NULL, 0};
char buf[16];
- if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
+ if (flatfile_findkey(dba, key_datum)) {
if (php_stream_gets(dba->fp, buf, sizeof(buf))) {
value_datum.dsize = atoi(buf);
value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1);
@@ -103,7 +103,7 @@ datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_delete
*/
-int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
+int flatfile_delete(flatfile *dba, datum key_datum) {
char *key = key_datum.dptr;
size_t size = key_datum.dsize;
size_t buf_size = FLATFILE_BLOCK_SIZE;
@@ -161,7 +161,7 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_findkey
*/
-int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
+int flatfile_findkey(flatfile *dba, datum key_datum) {
size_t buf_size = FLATFILE_BLOCK_SIZE;
char *buf = emalloc(buf_size);
size_t num;
@@ -209,7 +209,7 @@ int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_firstkey
*/
-datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
+datum flatfile_firstkey(flatfile *dba) {
datum res;
size_t num;
size_t buf_size = FLATFILE_BLOCK_SIZE;
@@ -257,7 +257,7 @@ datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
/* {{{ flatfile_nextkey
*/
-datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
+datum flatfile_nextkey(flatfile *dba) {
datum res;
size_t num;
size_t buf_size = FLATFILE_BLOCK_SIZE;
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index 2cd8db3521..9325d80be7 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -37,12 +37,12 @@ typedef struct {
#define FLATFILE_INSERT 1
#define FLATFILE_REPLACE 0
-int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC);
-datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC);
-int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC);
-int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC);
-datum flatfile_firstkey(flatfile *dba TSRMLS_DC);
-datum flatfile_nextkey(flatfile *dba TSRMLS_DC);
+int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode);
+datum flatfile_fetch(flatfile *dba, datum key_datum);
+int flatfile_delete(flatfile *dba, datum key_datum);
+int flatfile_findkey(flatfile *dba, datum key_datum);
+datum flatfile_firstkey(flatfile *dba);
+datum flatfile_nextkey(flatfile *dba);
char *flatfile_version();
#endif
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 6b64872649..52c5d730bc 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -79,13 +79,13 @@ void inifile_line_free(line_type *ln)
/* }}} */
/* {{{ inifile_alloc */
-inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC)
+inifile * inifile_alloc(php_stream *fp, int readonly, int persistent)
{
inifile *dba;
if (!readonly) {
if (!php_stream_truncate_supported(fp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream");
+ php_error_docref(NULL, E_WARNING, "Can't truncate this stream");
return NULL;
}
}
@@ -164,7 +164,7 @@ static char *etrim(const char *str)
/* {{{ inifile_findkey
*/
-static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) {
+static int inifile_read(inifile *dba, line_type *ln) {
char *fline;
char *pos;
@@ -224,7 +224,7 @@ static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) {
* 1 = GROUP-EQUAL,NAME-DIFFERENT
* 2 = DIFFERENT
*/
-static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC)
+static int inifile_key_cmp(const key_type *k1, const key_type *k2)
{
assert(k1->group && k1->name && k2->group && k2->name);
@@ -242,12 +242,12 @@ static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC)
/* {{{ inifile_fetch
*/
-val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
+val_type inifile_fetch(inifile *dba, const key_type *key, int skip) {
line_type ln = {{NULL,NULL},{NULL}};
val_type val;
int res, grp_eq = 0;
- if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) {
+ if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key)) {
/* we got position already from last fetch */
php_stream_seek(dba->fp, dba->next.pos, SEEK_SET);
} else {
@@ -259,8 +259,8 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
if (skip == -1) {
skip = 0;
}
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if (!(res=inifile_key_cmp(&ln.key, key TSRMLS_CC))) {
+ while(inifile_read(dba, &ln)) {
+ if (!(res=inifile_key_cmp(&ln.key, key))) {
if (!skip) {
val.value = estrdup(ln.val.value ? ln.val.value : "");
/* allow faster access by updating key read into next */
@@ -285,22 +285,22 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
/* {{{ inifile_firstkey
*/
-int inifile_firstkey(inifile *dba TSRMLS_DC) {
+int inifile_firstkey(inifile *dba) {
inifile_line_free(&dba->curr);
dba->curr.pos = 0;
- return inifile_nextkey(dba TSRMLS_CC);
+ return inifile_nextkey(dba);
}
/* }}} */
/* {{{ inifile_nextkey
*/
-int inifile_nextkey(inifile *dba TSRMLS_DC) {
+int inifile_nextkey(inifile *dba) {
line_type ln = {{NULL,NULL},{NULL}};
/*inifile_line_free(&dba->next); ??? */
php_stream_seek(dba->fp, dba->curr.pos, SEEK_SET);
ln.key.group = estrdup(dba->curr.key.group ? dba->curr.key.group : "");
- inifile_read(dba, &ln TSRMLS_CC);
+ inifile_read(dba, &ln);
inifile_line_free(&dba->curr);
dba->curr = ln;
return ln.key.group || ln.key.name;
@@ -309,12 +309,12 @@ int inifile_nextkey(inifile *dba TSRMLS_DC) {
/* {{{ inifile_truncate
*/
-static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC)
+static int inifile_truncate(inifile *dba, size_t size)
{
int res;
if ((res=php_stream_truncate_set_size(dba->fp, size)) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in ftruncate: %d", res);
+ php_error_docref(NULL, E_WARNING, "Error in ftruncate: %d", res);
return FAILURE;
}
php_stream_seek(dba->fp, size, SEEK_SET);
@@ -325,7 +325,7 @@ static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC)
/* {{{ inifile_find_group
* if found pos_grp_start points to "[group_name]"
*/
-static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC)
+static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start)
{
int ret = FAILURE;
@@ -339,8 +339,8 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp
line_type ln = {{NULL,NULL},{NULL}};
res = 1;
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if ((res=inifile_key_cmp(&ln.key, key TSRMLS_CC)) < 2) {
+ while(inifile_read(dba, &ln)) {
+ if ((res=inifile_key_cmp(&ln.key, key)) < 2) {
ret = SUCCESS;
break;
}
@@ -362,15 +362,15 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp
* only valid after a call to inifile_find_group
* if any next group is found pos_grp_start points to "[group_name]" or whitespace before that
*/
-static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC)
+static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start)
{
int ret = FAILURE;
line_type ln = {{NULL,NULL},{NULL}};
*pos_grp_start = php_stream_tell(dba->fp);
ln.key.group = estrdup(key->group);
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if (inifile_key_cmp(&ln.key, key TSRMLS_CC) == 2) {
+ while(inifile_read(dba, &ln)) {
+ if (inifile_key_cmp(&ln.key, key) == 2) {
ret = SUCCESS;
break;
}
@@ -383,7 +383,7 @@ static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp
/* {{{ inifile_copy_to
*/
-static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy TSRMLS_DC)
+static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy)
{
php_stream *fp;
@@ -392,18 +392,18 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
return SUCCESS;
}
if ((fp = php_stream_temp_create(0, 64 * 1024)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not create temporary stream");
*ini_copy = NULL;
return FAILURE;
}
- if ((*ini_copy = inifile_alloc(fp, 1, 0 TSRMLS_CC)) == NULL) {
+ if ((*ini_copy = inifile_alloc(fp, 1, 0)) == NULL) {
/* writes error */
return FAILURE;
}
php_stream_seek(dba->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
+ php_error_docref(NULL, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
return FAILURE;
}
return SUCCESS;
@@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
/* {{{ inifile_filter
* copy from to dba while ignoring key name (group must equal)
*/
-static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC)
+static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found)
{
size_t pos_start = 0, pos_next = 0, pos_curr;
int ret = SUCCESS;
@@ -421,8 +421,8 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
php_stream_seek(from->fp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
- while(inifile_read(from, &ln TSRMLS_CC)) {
- switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) {
+ while(inifile_read(from, &ln)) {
+ switch(inifile_key_cmp(&ln.key, key)) {
case 0:
if (found) {
*found = (zend_bool) 1;
@@ -431,7 +431,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
+ php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
php_stream_seek(from->fp, pos_curr, SEEK_SET);
@@ -450,7 +450,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
+ php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
}
@@ -461,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
/* {{{ inifile_delete_replace_append
*/
-static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC)
+static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found)
{
size_t pos_grp_start=0, pos_grp_next;
inifile *ini_tmp = NULL;
@@ -482,26 +482,26 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
assert(!append || (key->name && value)); /* missuse */
/* 1 - 3 */
- inifile_find_group(dba, key, &pos_grp_start TSRMLS_CC);
- inifile_next_group(dba, key, &pos_grp_next TSRMLS_CC);
+ inifile_find_group(dba, key, &pos_grp_start);
+ inifile_next_group(dba, key, &pos_grp_next);
if (append) {
ret = SUCCESS;
} else {
- ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp TSRMLS_CC);
+ ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp);
}
/* 4 */
if (ret == SUCCESS) {
fp_tmp = php_stream_temp_create(0, 64 * 1024);
if (!fp_tmp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not create temporary stream");
ret = FAILURE;
} else {
php_stream_seek(dba->fp, 0, SEEK_END);
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not copy remainder to temporary stream");
ret = FAILURE;
}
}
@@ -511,7 +511,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
/* 5 */
if (ret == SUCCESS) {
if (!value || (key->name && strlen(key->name))) {
- ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */
+ ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start); /* writes error on fail */
}
}
@@ -519,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (key->name && strlen(key->name)) {
/* 6 */
if (!append && ini_tmp) {
- ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC);
+ ret = inifile_filter(dba, ini_tmp, key, found);
}
/* 7 */
@@ -528,9 +528,9 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
*/
if (value) {
if (pos_grp_start == pos_grp_next && key->group && strlen(key->group)) {
- php_stream_printf(dba->fp TSRMLS_CC, "[%s]\n", key->group);
+ php_stream_printf(dba->fp, "[%s]\n", key->group);
}
- php_stream_printf(dba->fp TSRMLS_CC, "%s=%s\n", key->name, value->value ? value->value : "");
+ php_stream_printf(dba->fp, "%s=%s\n", key->name, value->value ? value->value : "");
}
}
@@ -542,7 +542,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
php_stream_seek(fp_tmp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
ret = FAILURE;
}
}
@@ -564,41 +564,41 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
/* {{{ inifile_delete
*/
-int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
+int inifile_delete(inifile *dba, const key_type *key)
{
- return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, NULL);
}
/* }}} */
/* {{{ inifile_delete_ex
*/
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC)
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found)
{
- return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, found);
}
/* }}} */
/* {{{ inifile_relace
*/
-int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
+int inifile_replace(inifile *dba, const key_type *key, const val_type *value)
{
- return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, NULL);
}
/* }}} */
/* {{{ inifile_replace_ex
*/
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC)
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found)
{
- return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, found);
}
/* }}} */
/* {{{ inifile_append
*/
-int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
+int inifile_append(inifile *dba, const key_type *key, const val_type *value)
{
- return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 1, NULL);
}
/* }}} */
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index 9de43b62f5..24bc2dfec9 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -45,14 +45,14 @@ typedef struct {
line_type next;
} inifile;
-val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC);
-int inifile_firstkey(inifile *dba TSRMLS_DC);
-int inifile_nextkey(inifile *dba TSRMLS_DC);
-int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC);
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC);
-int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC);
-int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
+val_type inifile_fetch(inifile *dba, const key_type *key, int skip);
+int inifile_firstkey(inifile *dba);
+int inifile_nextkey(inifile *dba);
+int inifile_delete(inifile *dba, const key_type *key);
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found);
+int inifile_replace(inifile *dba, const key_type *key, const val_type *val);
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found);
+int inifile_append(inifile *dba, const key_type *key, const val_type *val);
char *inifile_version();
key_type inifile_key_split(const char *group_name);
@@ -62,7 +62,7 @@ void inifile_key_free(key_type *key);
void inifile_val_free(val_type *val);
void inifile_line_free(line_type *ln);
-inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC);
+inifile * inifile_alloc(php_stream *fp, int readonly, int persistent);
void inifile_free(inifile *dba, int persistent);
#endif
diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h
index d19000cf0f..3421b5de93 100644
--- a/ext/dba/php_dba.h
+++ b/ext/dba/php_dba.h
@@ -74,44 +74,44 @@ extern zend_module_entry dba_module_entry;
typedef struct dba_handler {
char *name; /* handler name */
int flags; /* whether and how dba does locking and other flags*/
- int (*open)(dba_info *, char **error TSRMLS_DC);
- void (*close)(dba_info * TSRMLS_DC);
- char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC);
- int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC);
- int (*exists)(dba_info *, char *, int TSRMLS_DC);
- int (*delete)(dba_info *, char *, int TSRMLS_DC);
- char* (*firstkey)(dba_info *, int * TSRMLS_DC);
- char* (*nextkey)(dba_info *, int * TSRMLS_DC);
- int (*optimize)(dba_info * TSRMLS_DC);
- int (*sync)(dba_info * TSRMLS_DC);
- char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC);
+ int (*open)(dba_info *, char **error);
+ void (*close)(dba_info *);
+ char* (*fetch)(dba_info *, char *, int, int, int *);
+ int (*update)(dba_info *, char *, int, char *, int, int);
+ int (*exists)(dba_info *, char *, int);
+ int (*delete)(dba_info *, char *, int);
+ char* (*firstkey)(dba_info *, int *);
+ char* (*nextkey)(dba_info *, int *);
+ int (*optimize)(dba_info *);
+ int (*sync)(dba_info *);
+ char* (*info)(struct dba_handler *hnd, dba_info *);
/* dba_info==NULL: Handler info, dba_info!=NULL: Database info */
} dba_handler;
/* common prototypes which must be supplied by modules */
#define DBA_OPEN_FUNC(x) \
- int dba_open_##x(dba_info *info, char **error TSRMLS_DC)
+ int dba_open_##x(dba_info *info, char **error)
#define DBA_CLOSE_FUNC(x) \
- void dba_close_##x(dba_info *info TSRMLS_DC)
+ void dba_close_##x(dba_info *info)
#define DBA_FETCH_FUNC(x) \
- char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen TSRMLS_DC)
+ char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen)
#define DBA_UPDATE_FUNC(x) \
- int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode TSRMLS_DC)
+ int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode)
#define DBA_EXISTS_FUNC(x) \
- int dba_exists_##x(dba_info *info, char *key, int keylen TSRMLS_DC)
+ int dba_exists_##x(dba_info *info, char *key, int keylen)
#define DBA_DELETE_FUNC(x) \
- int dba_delete_##x(dba_info *info, char *key, int keylen TSRMLS_DC)
+ int dba_delete_##x(dba_info *info, char *key, int keylen)
#define DBA_FIRSTKEY_FUNC(x) \
- char *dba_firstkey_##x(dba_info *info, int *newlen TSRMLS_DC)
+ char *dba_firstkey_##x(dba_info *info, int *newlen)
#define DBA_NEXTKEY_FUNC(x) \
- char *dba_nextkey_##x(dba_info *info, int *newlen TSRMLS_DC)
+ char *dba_nextkey_##x(dba_info *info, int *newlen)
#define DBA_OPTIMIZE_FUNC(x) \
- int dba_optimize_##x(dba_info *info TSRMLS_DC)
+ int dba_optimize_##x(dba_info *info)
#define DBA_SYNC_FUNC(x) \
- int dba_sync_##x(dba_info *info TSRMLS_DC)
+ int dba_sync_##x(dba_info *info)
#define DBA_INFO_FUNC(x) \
- char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC)
+ char *dba_info_##x(dba_handler *hnd, dba_info *info)
#define DBA_FUNCS(x) \
DBA_OPEN_FUNC(x); \
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 7cef0230a4..34a6749f66 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -63,33 +63,33 @@ PHP_METHOD(domattr, __construct)
size_t name_len, value_len, name_valid;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
intern = Z_DOMOBJ_P(id);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern);
}
/* }}} end DOMAttr::__construct */
@@ -99,14 +99,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1112119403
Since:
*/
-int dom_attr_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_name_read(dom_object *obj, zval *retval)
{
xmlAttrPtr attrp;
attrp = (xmlAttrPtr) dom_object_get_node(obj);
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -122,7 +122,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-862529273
Since:
*/
-int dom_attr_specified_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_specified_read(dom_object *obj, zval *retval)
{
/* TODO */
ZVAL_TRUE(retval);
@@ -136,13 +136,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-221662474
Since:
*/
-int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_value_read(dom_object *obj, zval *retval)
{
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
xmlChar *content;
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -157,18 +157,18 @@ int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_attr_value_write(dom_object *obj, zval *newval)
{
zend_string *str;
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (attrp->children) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
}
str = zval_get_string(newval);
@@ -186,14 +186,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement
Since: DOM Level 2
*/
-int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_owner_element_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep, nodeparent;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -203,7 +203,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(nodeparent, retval, obj TSRMLS_CC);
+ php_dom_create_object(nodeparent, retval, obj);
return SUCCESS;
}
@@ -215,9 +215,9 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo
Since: DOM Level 3
*/
-int dom_attr_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented");
+ php_error_docref(NULL, E_WARNING, "Not yet implemented");
ZVAL_NULL(retval);
return SUCCESS;
}
@@ -234,7 +234,7 @@ PHP_FUNCTION(dom_attr_is_id)
dom_object *intern;
xmlAttrPtr attrp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_attr_class_entry) == FAILURE) {
return;
}
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index 82af257c0a..83551766b5 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -57,26 +57,26 @@ PHP_METHOD(domcdatasection, __construct)
size_t value_len;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMCdataSection::__construct */
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index aee54bb3d2..5946915025 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -76,13 +76,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-72AB8359
Since:
*/
-int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_characterdata_data_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
xmlChar *content;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -96,13 +96,13 @@ int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_characterdata_data_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -121,14 +121,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C
Since:
*/
-int dom_characterdata_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_characterdata_length_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
xmlChar *content;
long length = 0;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -160,7 +160,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
return;
}
@@ -175,7 +175,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -207,7 +207,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
char *arg;
size_t arg_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
return;
}
@@ -244,7 +244,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
size_t arg_len;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) {
return;
}
@@ -259,7 +259,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
if (offset < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -291,7 +291,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
return;
}
@@ -306,7 +306,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -348,7 +348,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
size_t arg_len;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) {
return;
}
@@ -363,7 +363,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 9015586fd9..0477328966 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -57,17 +57,17 @@ PHP_METHOD(domcomment, __construct)
size_t value_len;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewComment((xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -75,9 +75,9 @@ PHP_METHOD(domcomment, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern);
}
}
/* }}} end DOMComment::__construct */
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 133572af3f..9f6c093f76 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -240,13 +240,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
Since:
*/
-int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_doctype_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
xmlDtdPtr dtdptr;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -256,7 +256,7 @@ int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object((xmlNodePtr) dtdptr, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) dtdptr, retval, obj);
return SUCCESS;
}
@@ -267,9 +267,9 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
Since:
*/
-int dom_document_implementation_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_implementation_read(dom_object *obj, zval *retval)
{
- php_dom_create_implementation(retval TSRMLS_CC);
+ php_dom_create_implementation(retval);
return SUCCESS;
}
@@ -280,13 +280,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
Since:
*/
-int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_document_element_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
xmlNode *root;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -296,7 +296,7 @@ int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(root, retval, obj TSRMLS_CC);
+ php_dom_create_object(root, retval, obj);
return SUCCESS;
}
@@ -306,13 +306,13 @@ int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding
Since: DOM Level 3
*/
-int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_encoding_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *encoding;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -327,14 +327,14 @@ int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_encoding_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
xmlCharEncodingHandlerPtr handler;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -349,7 +349,7 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
}
docp->encoding = xmlStrdup((const xmlChar *) str->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document Encoding");
+ php_error_docref(NULL, E_WARNING, "Invalid Document Encoding");
}
zend_string_release(str);
@@ -363,14 +363,14 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
Since: DOM Level 3
*/
-int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_standalone_read(dom_object *obj, zval *retval)
{
xmlDoc *docp;
docp = (xmlDocPtr) dom_object_get_node(obj);
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -378,13 +378,13 @@ int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_standalone_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
int standalone;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -401,13 +401,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
Since: DOM Level 3
*/
-int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_version_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *version;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -422,13 +422,13 @@ int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_version_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -451,7 +451,7 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
Since: DOM Level 3
*/
-int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_strict_error_checking_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -462,12 +462,12 @@ int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS
return SUCCESS;
}
-int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_strict_error_checking_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->stricterror = zend_is_true(newval TSRMLS_CC);
+ doc_prop->stricterror = zend_is_true(newval);
}
return SUCCESS;
@@ -478,7 +478,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
/* {{{ formatOutput boolean
readonly=no
*/
-int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_format_output_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -489,11 +489,11 @@ int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_format_output_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->formatoutput = zend_is_true(newval TSRMLS_CC);
+ doc_prop->formatoutput = zend_is_true(newval);
}
return SUCCESS;
@@ -503,7 +503,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ validateOnParse boolean
readonly=no
*/
-int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_validate_on_parse_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -514,11 +514,11 @@ int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_validate_on_parse_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->validateonparse = zend_is_true(newval TSRMLS_CC);
+ doc_prop->validateonparse = zend_is_true(newval);
}
return SUCCESS;
@@ -528,7 +528,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
/* {{{ resolveExternals boolean
readonly=no
*/
-int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_resolve_externals_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -539,11 +539,11 @@ int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_resolve_externals_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->resolveexternals = zend_is_true(newval TSRMLS_CC);
+ doc_prop->resolveexternals = zend_is_true(newval);
}
return SUCCESS;
@@ -553,7 +553,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
/* {{{ preserveWhiteSpace boolean
readonly=no
*/
-int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -564,11 +564,11 @@ int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_D
return SUCCESS;
}
-int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->preservewhitespace = zend_is_true(newval TSRMLS_CC);
+ doc_prop->preservewhitespace = zend_is_true(newval);
}
return SUCCESS;
@@ -578,7 +578,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
/* {{{ recover boolean
readonly=no
*/
-int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_recover_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -589,11 +589,11 @@ int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_recover_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->recover = zend_is_true(newval TSRMLS_CC);
+ doc_prop->recover = zend_is_true(newval);
}
return SUCCESS;
@@ -603,7 +603,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ substituteEntities boolean
readonly=no
*/
-int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_substitue_entities_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -614,11 +614,11 @@ int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC
return SUCCESS;
}
-int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_substitue_entities_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->substituteentities = zend_is_true(newval TSRMLS_CC);
+ doc_prop->substituteentities = zend_is_true(newval);
}
return SUCCESS;
@@ -630,13 +630,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
Since: DOM Level 3
*/
-int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_document_uri_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *url;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -650,13 +650,13 @@ int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_document_uri_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -679,7 +679,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
Since: DOM Level 3
*/
-int dom_document_config_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_config_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -701,14 +701,14 @@ PHP_FUNCTION(dom_document_create_element)
size_t name_len, value_len;
char *name, *value = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -733,7 +733,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
dom_object *intern;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(dom_document_create_text_node)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -791,7 +791,7 @@ PHP_FUNCTION(dom_document_create_comment)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -820,7 +820,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -849,14 +849,14 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
dom_object *intern;
char *name, *value = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -885,14 +885,14 @@ PHP_FUNCTION(dom_document_create_attribute)
dom_object *intern;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -920,14 +920,14 @@ PHP_FUNCTION(dom_document_create_entity_reference)
size_t name_len;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -953,16 +953,16 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
char *name;
xmlChar *local;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
}
/* }}} end dom_document_get_elements_by_tag_name */
@@ -979,7 +979,7 @@ PHP_FUNCTION(dom_document_import_node)
int ret;
zend_long recursive = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
@@ -989,7 +989,7 @@ PHP_FUNCTION(dom_document_import_node)
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
+ php_error_docref(NULL, E_WARNING, "Cannot import: Node Type Not Supported");
RETURN_FALSE;
}
@@ -1038,7 +1038,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
int errorcode;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@@ -1070,7 +1070,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
if (nodep != NULL) {
xmlFreeNode(nodep);
}
- php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(errorcode, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1102,7 +1102,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
dom_object *intern;
int errorcode;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -1126,7 +1126,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Missing Root Element");
+ php_error_docref(NULL, E_WARNING, "Document Missing Root Element");
RETURN_FALSE;
}
@@ -1139,7 +1139,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
if (nodep != NULL) {
xmlFreeProp((xmlAttrPtr) nodep);
}
- php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(errorcode, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1164,17 +1164,17 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
}
/* }}} end dom_document_get_elements_by_tag_name_ns */
@@ -1192,7 +1192,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
dom_object *intern;
char *idname;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) {
return;
}
@@ -1229,13 +1229,13 @@ PHP_FUNCTION(dom_document_normalize_document)
xmlDocPtr docp;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- dom_normalize((xmlNodePtr) docp TSRMLS_CC);
+ dom_normalize((xmlNodePtr) docp);
}
/* }}} end dom_document_normalize_document */
@@ -1261,17 +1261,17 @@ PHP_METHOD(domdocument, __construct)
int refcount;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
docp = xmlNewDoc((xmlChar *) version);
if (!docp) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -1283,22 +1283,22 @@ PHP_METHOD(domdocument, __construct)
if (intern != NULL) {
olddoc = (xmlDocPtr) dom_object_get_node(intern);
if (olddoc != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
olddoc->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp) == -1) {
RETURN_FALSE;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern);
}
}
/* }}} end DOMDocument::__construct */
-char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) /* {{{ */
+char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) /* {{{ */
{
xmlURI *uri;
xmlChar *escsource;
@@ -1339,7 +1339,7 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
if ((uri->scheme == NULL || isFileUri)) {
/* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -1352,7 +1352,7 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
}
/* }}} */
-static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options TSRMLS_DC) /* {{{ */
+static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options) /* {{{ */
{
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
@@ -1383,7 +1383,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
xmlInitParser();
if (mode == DOM_LOAD_FILE) {
- char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (file_dest) {
ctxt = xmlCreateFileParserCtxt(file_dest);
}
@@ -1480,20 +1480,20 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
zend_long options = 0;
id = getThis();
- if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
+ if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) {
id = NULL;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) {
return;
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
- newdoc = dom_document_parser(id, mode, source, source_len, options TSRMLS_CC);
+ newdoc = dom_document_parser(id, mode, source, source_len, options);
if (!newdoc)
RETURN_FALSE;
@@ -1504,22 +1504,22 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) {
RETURN_FALSE;
}
intern->document->doc_props = doc_prop;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern);
RETURN_TRUE;
} else {
@@ -1562,12 +1562,12 @@ PHP_FUNCTION(dom_document_save)
char *file;
zend_long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
return;
}
if (file_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
+ php_error_docref(NULL, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
@@ -1608,7 +1608,7 @@ PHP_FUNCTION(dom_document_savexml)
int size, format, saveempty = 0;
zend_long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
return;
}
@@ -1621,12 +1621,12 @@ PHP_FUNCTION(dom_document_savexml)
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
+ php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (options & LIBXML_SAVE_NOEMPTYTAG) {
@@ -1663,40 +1663,40 @@ PHP_FUNCTION(dom_document_savexml)
}
/* }}} end dom_document_savexml */
-static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur) /* {{{ */
{
xmlNodePtr xincnode;
xincnode = cur;
cur = cur->next;
xmlUnlinkNode(xincnode);
- php_libxml_node_free_resource(xincnode TSRMLS_CC);
+ php_libxml_node_free_resource(xincnode);
return cur;
}
/* }}} */
-static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) /* {{{ */
+static void php_dom_remove_xinclude_nodes(xmlNodePtr cur) /* {{{ */
{
while(cur) {
if (cur->type == XML_XINCLUDE_START) {
- cur = php_dom_free_xinclude_node(cur TSRMLS_CC);
+ cur = php_dom_free_xinclude_node(cur);
/* XML_XINCLUDE_END node will be a sibling of XML_XINCLUDE_START */
while(cur && cur->type != XML_XINCLUDE_END) {
/* remove xinclude processing nodes from recursive xincludes */
if (cur->type == XML_ELEMENT_NODE) {
- php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(cur->children);
}
cur = cur->next;
}
if (cur && cur->type == XML_XINCLUDE_END) {
- cur = php_dom_free_xinclude_node(cur TSRMLS_CC);
+ cur = php_dom_free_xinclude_node(cur);
}
} else {
if (cur->type == XML_ELEMENT_NODE) {
- php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(cur->children);
}
cur = cur->next;
}
@@ -1715,7 +1715,7 @@ PHP_FUNCTION(dom_document_xinclude)
int err;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
return;
}
@@ -1732,7 +1732,7 @@ PHP_FUNCTION(dom_document_xinclude)
root = root->next;
}
if (root) {
- php_dom_remove_xinclude_nodes(root TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(root);
}
if (err) {
@@ -1754,7 +1754,7 @@ PHP_FUNCTION(dom_document_validate)
dom_object *intern;
xmlValidCtxt *cvp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
@@ -1793,12 +1793,12 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
int is_valid;
char resolved_path[MAXPATHLEN + 1];
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
return;
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1806,9 +1806,9 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
switch (type) {
case DOM_LOAD_FILE:
- valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema file source");
RETURN_FALSE;
}
parser = xmlSchemaNewParserCtxt(valid_file);
@@ -1829,7 +1829,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
sptr = xmlSchemaParse(parser);
xmlSchemaFreeParserCtxt(parser);
if (!sptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema");
RETURN_FALSE;
}
@@ -1889,12 +1889,12 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
int is_valid;
char resolved_path[MAXPATHLEN + 1];
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
return;
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1902,9 +1902,9 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
switch (type) {
case DOM_LOAD_FILE:
- valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
+ php_error_docref(NULL, E_WARNING, "Invalid RelaxNG file source");
RETURN_FALSE;
}
parser = xmlRelaxNGNewParserCtxt(valid_file);
@@ -1925,7 +1925,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
sptr = xmlRelaxNGParse(parser);
xmlRelaxNGFreeParserCtxt(parser);
if (!sptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG");
+ php_error_docref(NULL, E_WARNING, "Invalid RelaxNG");
RETURN_FALSE;
}
@@ -1983,12 +1983,12 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
id = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) {
return;
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
@@ -2020,28 +2020,28 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
if (!newdoc)
RETURN_FALSE;
- if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
+ if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) {
intern = Z_DOMOBJ_P(id);
if (intern != NULL) {
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) {
RETURN_FALSE;
}
intern->document->doc_props = doc_prop;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern);
RETURN_TRUE;
} else {
@@ -2082,12 +2082,12 @@ PHP_FUNCTION(dom_document_save_html_file)
char *file;
const char *encoding;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
return;
}
if (file_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
+ php_error_docref(NULL, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
@@ -2121,7 +2121,7 @@ PHP_FUNCTION(dom_document_save_html)
int size = 0, format;
dom_doc_propsptr doc_props;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|O!", &id, dom_document_class_entry, &nodep, dom_node_class_entry)
== FAILURE) {
return;
@@ -2136,13 +2136,13 @@ PHP_FUNCTION(dom_document_save_html)
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
+ php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
@@ -2170,7 +2170,7 @@ PHP_FUNCTION(dom_document_save_html)
RETVAL_STRINGL((const char*) mem, size);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error dumping HTML node");
+ php_error_docref(NULL, E_WARNING, "Error dumping HTML node");
RETVAL_FALSE;
}
xmlBufferFree(buf);
@@ -2203,19 +2203,19 @@ PHP_METHOD(domdocument, registerNodeClass)
zend_class_entry *basece = dom_node_class_entry, *ce = NULL;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OCC!", &id, dom_document_class_entry, &basece, &ce) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OCC!", &id, dom_document_class_entry, &basece, &ce) == FAILURE) {
return;
}
- if (ce == NULL || instanceof_function(ce, basece TSRMLS_CC)) {
+ if (ce == NULL || instanceof_function(ce, basece)) {
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- if (dom_set_doc_classmap(intern->document, basece, ce TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be registered.", ce->name->val);
+ if (dom_set_doc_classmap(intern->document, basece, ce) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Class %s could not be registered.", ce->name->val);
}
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from %s.", ce->name->val, basece->name->val);
+ php_error_docref(NULL, E_ERROR, "Class %s is not derived from %s.", ce->name->val, basece->name->val);
}
RETURN_FALSE;
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index d3055214f6..a7264ec96f 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -58,27 +58,27 @@ PHP_METHOD(domdocumentfragment, __construct)
dom_object *intern;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewDocFragment(NULL);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- /* php_dom_set_object(intern, nodep TSRMLS_CC); */
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ /* php_dom_set_object(intern, nodep); */
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMDocumentFragment::__construct */
@@ -126,14 +126,14 @@ PHP_METHOD(domdocumentfragment, appendXML) {
int err;
xmlNodePtr lst;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 08b33242b1..7a1a1ddb59 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -43,12 +43,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134
Since:
*/
-int dom_documenttype_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_name_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -64,23 +64,23 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630
Since:
*/
-int dom_documenttype_entities_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_entities_read(dom_object *obj, zval *retval)
{
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
xmlHashTable *entityht;
dom_object *intern;
if (doctypep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
entityht = (xmlHashTable *) doctypep->entities;
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL);
return SUCCESS;
}
@@ -92,23 +92,23 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF
Since:
*/
-int dom_documenttype_notations_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_notations_read(dom_object *obj, zval *retval)
{
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
xmlHashTable *notationht;
dom_object *intern;
if (doctypep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
notationht = (xmlHashTable *) doctypep->notations;
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL);
return SUCCESS;
}
@@ -120,12 +120,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId
Since: DOM Level 2
*/
-int dom_documenttype_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_public_id_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -145,12 +145,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId
Since: DOM Level 2
*/
-int dom_documenttype_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_system_id_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -169,13 +169,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset
Since: DOM Level 2
*/
-int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
xmlDtdPtr intsubset;
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index ee892f3703..8a64aeba25 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -122,7 +122,7 @@ xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index) /* {{{ */
}
/* }}} */
-static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_dtor(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -131,7 +131,7 @@ static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int php_dom_iterator_valid(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -144,7 +144,7 @@ static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-zval *php_dom_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+zval *php_dom_iterator_current_data(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -152,12 +152,12 @@ zval *php_dom_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{
}
/* }}} */
-static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
zval *object = &iterator->intern.data;
- if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry)) {
ZVAL_LONG(key, iter->index);
} else {
dom_object *intern = Z_DOMOBJ_P(&iterator->curobj);
@@ -172,7 +172,7 @@ static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
{
zval *object;
xmlNodePtr curnode = NULL, basenode;
@@ -232,7 +232,7 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
}
err:
if (curnode) {
- php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj TSRMLS_CC);
+ php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj);
}
}
/* }}} */
@@ -246,7 +246,7 @@ zend_object_iterator_funcs php_dom_iterator_funcs = {
NULL
};
-zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
@@ -260,7 +260,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = emalloc(sizeof(php_dom_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_dom_iterator_funcs;
@@ -309,7 +309,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
}
err:
if (curnode) {
- php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj TSRMLS_CC);
+ php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj);
}
return &iterator->intern;
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index b5c81d271b..79223fa4d4 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -22,143 +22,143 @@
#define DOM_PROPERTIES_H
/* attr properties */
-int dom_attr_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_specified_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_attr_name_read(dom_object *obj, zval *retval);
+int dom_attr_specified_read(dom_object *obj, zval *retval);
+int dom_attr_value_read(dom_object *obj, zval *retval);
+int dom_attr_value_write(dom_object *obj, zval *newval);
+int dom_attr_owner_element_read(dom_object *obj, zval *retval);
+int dom_attr_schema_type_info_read(dom_object *obj, zval *retval);
/* characterdata properties */
-int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_characterdata_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_characterdata_data_read(dom_object *obj, zval *retval);
+int dom_characterdata_data_write(dom_object *obj, zval *newval);
+int dom_characterdata_length_read(dom_object *obj, zval *retval);
/* document properties */
-int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_implementation_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_config_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_document_doctype_read(dom_object *obj, zval *retval);
+int dom_document_implementation_read(dom_object *obj, zval *retval);
+int dom_document_document_element_read(dom_object *obj, zval *retval);
+int dom_document_actual_encoding_read(dom_object *obj, zval *retval);
+int dom_document_actual_encoding_write(dom_object *obj, zval *newval);
+int dom_document_encoding_read(dom_object *obj, zval *retval);
+int dom_document_encoding_write(dom_object *obj, zval *newval);
+int dom_document_standalone_read(dom_object *obj, zval *retval);
+int dom_document_standalone_write(dom_object *obj, zval *newval);
+int dom_document_version_read(dom_object *obj, zval *retval);
+int dom_document_version_write(dom_object *obj, zval *newval);
+int dom_document_strict_error_checking_read(dom_object *obj, zval *retval);
+int dom_document_strict_error_checking_write(dom_object *obj, zval *newval);
+int dom_document_document_uri_read(dom_object *obj, zval *retval);
+int dom_document_document_uri_write(dom_object *obj, zval *newval);
+int dom_document_config_read(dom_object *obj, zval *retval);
+int dom_document_format_output_read(dom_object *obj, zval *retval);
+int dom_document_format_output_write(dom_object *obj, zval *newval);
+int dom_document_validate_on_parse_read(dom_object *obj, zval *retval);
+int dom_document_validate_on_parse_write(dom_object *obj, zval *newval);
+int dom_document_resolve_externals_read(dom_object *obj, zval *retval);
+int dom_document_resolve_externals_write(dom_object *obj, zval *newval);
+int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval);
+int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval);
+int dom_document_recover_read(dom_object *obj, zval *retval);
+int dom_document_recover_write(dom_object *obj, zval *newval);
+int dom_document_substitue_entities_read(dom_object *obj, zval *retval);
+int dom_document_substitue_entities_write(dom_object *obj, zval *newval);
/* documenttype properties */
-int dom_documenttype_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_entities_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_notations_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_documenttype_name_read(dom_object *obj, zval *retval);
+int dom_documenttype_entities_read(dom_object *obj, zval *retval);
+int dom_documenttype_notations_read(dom_object *obj, zval *retval);
+int dom_documenttype_public_id_read(dom_object *obj, zval *retval);
+int dom_documenttype_system_id_read(dom_object *obj, zval *retval);
+int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval);
/* domerror properties */
-int dom_domerror_severity_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_message_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_type_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_related_exception_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_related_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_location_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domerror_severity_read(dom_object *obj, zval *retval);
+int dom_domerror_message_read(dom_object *obj, zval *retval);
+int dom_domerror_type_read(dom_object *obj, zval *retval);
+int dom_domerror_related_exception_read(dom_object *obj, zval *retval);
+int dom_domerror_related_data_read(dom_object *obj, zval *retval);
+int dom_domerror_location_read(dom_object *obj, zval *retval);
/* domimplementationlist properties */
-int dom_domimplementationlist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domimplementationlist_length_read(dom_object *obj, zval *retval);
/* domlocator properties */
-int dom_domlocator_line_number_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_column_number_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_offset_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_related_node_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domlocator_line_number_read(dom_object *obj, zval *retval);
+int dom_domlocator_column_number_read(dom_object *obj, zval *retval);
+int dom_domlocator_offset_read(dom_object *obj, zval *retval);
+int dom_domlocator_related_node_read(dom_object *obj, zval *retval);
+int dom_domlocator_uri_read(dom_object *obj, zval *retval);
/* domstringlist properties */
-int dom_domstringlist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domstringlist_length_read(dom_object *obj, zval *retval);
/* element properties */
-int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_element_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_element_tag_name_read(dom_object *obj, zval *retval);
+int dom_element_schema_type_info_read(dom_object *obj, zval *retval);
/* entity properties */
-int dom_entity_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_entity_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_entity_version_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_entity_public_id_read(dom_object *obj, zval *retval);
+int dom_entity_system_id_read(dom_object *obj, zval *retval);
+int dom_entity_notation_name_read(dom_object *obj, zval *retval);
+int dom_entity_actual_encoding_read(dom_object *obj, zval *retval);
+int dom_entity_actual_encoding_write(dom_object *obj, zval *newval);
+int dom_entity_encoding_read(dom_object *obj, zval *retval);
+int dom_entity_encoding_write(dom_object *obj, zval *newval);
+int dom_entity_version_read(dom_object *obj, zval *retval);
+int dom_entity_version_write(dom_object *obj, zval *newval);
/* namednodemap properties */
-int dom_namednodemap_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_namednodemap_length_read(dom_object *obj, zval *retval);
/* namelist properties */
-int dom_namelist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_namelist_length_read(dom_object *obj, zval *retval);
/* node properties */
-int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_node_node_type_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_child_nodes_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_attributes_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_namespace_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_node_local_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_base_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_node_node_name_read(dom_object *obj, zval *retval);
+int dom_node_node_value_read(dom_object *obj, zval *retval);
+int dom_node_node_value_write(dom_object *obj, zval *newval);
+int dom_node_node_type_read(dom_object *obj, zval *retval);
+int dom_node_parent_node_read(dom_object *obj, zval *retval);
+int dom_node_child_nodes_read(dom_object *obj, zval *retval);
+int dom_node_first_child_read(dom_object *obj, zval *retval);
+int dom_node_last_child_read(dom_object *obj, zval *retval);
+int dom_node_previous_sibling_read(dom_object *obj, zval *retval);
+int dom_node_next_sibling_read(dom_object *obj, zval *retval);
+int dom_node_attributes_read(dom_object *obj, zval *retval);
+int dom_node_owner_document_read(dom_object *obj, zval *retval);
+int dom_node_namespace_uri_read(dom_object *obj, zval *retval);
+int dom_node_prefix_read(dom_object *obj, zval *retval);
+int dom_node_prefix_write(dom_object *obj, zval *newval);
+int dom_node_local_name_read(dom_object *obj, zval *retval);
+int dom_node_base_uri_read(dom_object *obj, zval *retval);
+int dom_node_text_content_read(dom_object *obj, zval *retval);
+int dom_node_text_content_write(dom_object *obj, zval *newval);
/* nodelist properties */
-int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_nodelist_length_read(dom_object *obj, zval *retval);
xmlNodePtr dom_nodelist_xml_item(dom_nnodemap_object *objmap, long index);
xmlNodePtr dom_nodelist_baseobj_item(dom_nnodemap_object *objmap, long index);
/* notation properties */
-int dom_notation_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_notation_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_notation_public_id_read(dom_object *obj, zval *retval);
+int dom_notation_system_id_read(dom_object *obj, zval *retval);
/* processinginstruction properties */
-int dom_processinginstruction_target_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_processinginstruction_target_read(dom_object *obj, zval *retval);
+int dom_processinginstruction_data_read(dom_object *obj, zval *retval);
+int dom_processinginstruction_data_write(dom_object *obj, zval *newval);
/* text properties */
-int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_text_whole_text_read(dom_object *obj, zval *retval);
/* typeinfo properties */
-int dom_typeinfo_type_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_typeinfo_type_name_read(dom_object *obj, zval *retval);
+int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval);
#if defined(LIBXML_XPATH_ENABLED)
/* xpath properties */
-int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_xpath_document_read(dom_object *obj, zval *retval);
#endif
#endif /* DOM_PROPERTIERS_H */
diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c
index 2214c3f786..be3355b0ec 100644
--- a/ext/dom/domerror.c
+++ b/ext/dom/domerror.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-severity
Since:
*/
-int dom_domerror_severity_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_severity_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-message
Since:
*/
-int dom_domerror_message_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_message_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -72,7 +72,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-type
Since:
*/
-int dom_domerror_type_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_type_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -85,7 +85,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedException
Since:
*/
-int dom_domerror_related_exception_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_related_exception_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -98,7 +98,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedData
Since:
*/
-int dom_domerror_related_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_related_data_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -111,7 +111,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-location
Since:
*/
-int dom_domerror_location_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_location_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index 4696e87f21..d7de3c4720 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -40,18 +40,18 @@ const zend_function_entry php_dom_domexception_class_functions[] = {
PHP_FE_END
};
-void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) /* {{{ */
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error) /* {{{ */
{
if (strict_error == 1) {
- zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
+ zend_throw_exception(dom_domexception_class_entry, error_message, error_code);
} else {
- php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC);
+ php_libxml_issue_error(E_WARNING, error_message);
}
}
/* }}} */
/* {{{ php_dom_throw_error */
-void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
+void php_dom_throw_error(int error_code, int strict_error)
{
char *error_message;
@@ -109,7 +109,7 @@ void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
error_message = "Unhandled Error";
}
- php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC);
+ php_dom_throw_error_with_message(error_code, error_message, strict_error);
}
/* }}} end php_dom_throw_error */
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index ea2b784b3c..49c54b5f86 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -73,7 +73,7 @@ PHP_METHOD(domimplementation, hasFeature)
size_t feature_len, version_len;
char *feature, *version;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &feature, &feature_len, &version, &version_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) {
return;
}
@@ -98,12 +98,12 @@ PHP_METHOD(domimplementation, createDocumentType)
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
xmlURIPtr uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "qualifiedName is required");
+ php_error_docref(NULL, E_WARNING, "qualifiedName is required");
RETURN_FALSE;
}
@@ -118,7 +118,7 @@ PHP_METHOD(domimplementation, createDocumentType)
if (uri != NULL && uri->opaque != NULL) {
localname = xmlStrdup((xmlChar *) uri->opaque);
if (xmlStrchr(localname, (xmlChar) ':') != NULL) {
- php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, 1);
xmlFreeURI(uri);
xmlFree(localname);
RETURN_FALSE;
@@ -128,7 +128,7 @@ PHP_METHOD(domimplementation, createDocumentType)
}
/* TODO: Test that localname has no invalid chars
- php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR,);
*/
if (uri) {
@@ -139,7 +139,7 @@ PHP_METHOD(domimplementation, createDocumentType)
xmlFree(localname);
if (doctype == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create DocumentType");
+ php_error_docref(NULL, E_WARNING, "Unable to create DocumentType");
RETURN_FALSE;
}
@@ -164,18 +164,18 @@ PHP_METHOD(domimplementation, createDocument)
char *prefix = NULL, *localname = NULL;
dom_object *doctobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
return;
}
if (node != NULL) {
DOM_GET_OBJ(doctype, node, xmlDtdPtr, doctobj);
if (doctype->type == XML_DOCUMENT_TYPE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid DocumentType object");
+ php_error_docref(NULL, E_WARNING, "Invalid DocumentType object");
RETURN_FALSE;
}
if (doctype->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, 1);
RETURN_FALSE;
}
} else {
@@ -199,7 +199,7 @@ PHP_METHOD(domimplementation, createDocument)
if (localname != NULL) {
xmlFree(localname);
}
- php_dom_throw_error(errorcode, 1 TSRMLS_CC);
+ php_dom_throw_error(errorcode, 1);
RETURN_FALSE;
}
@@ -233,7 +233,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlFreeDoc(docp);
xmlFree(localname);
/* Need some type of error here */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected Error");
+ php_error_docref(NULL, E_WARNING, "Unexpected Error");
RETURN_FALSE;
}
@@ -247,7 +247,7 @@ PHP_METHOD(domimplementation, createDocument)
if (doctobj != NULL) {
doctobj->document = ((dom_object *)((php_libxml_node_ptr *)docp->_private)->_private)->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp);
}
}
/* }}} end dom_domimplementation_create_document */
diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c
index b4d20172f0..5feedebe27 100644
--- a/ext/dom/domimplementationlist.c
+++ b/ext/dom/domimplementationlist.c
@@ -52,7 +52,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length
Since:
*/
-int dom_domimplementationlist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domimplementationlist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c
index 8fdd326fcc..e3f3ecf3b0 100644
--- a/ext/dom/domlocator.c
+++ b/ext/dom/domlocator.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-line-number
Since:
*/
-int dom_domlocator_line_number_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_line_number_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-column-number
Since:
*/
-int dom_domlocator_column_number_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_column_number_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -72,7 +72,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-offset
Since:
*/
-int dom_domlocator_offset_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_offset_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -85,7 +85,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-node
Since:
*/
-int dom_domlocator_related_node_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_related_node_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -98,7 +98,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-uri
Since:
*/
-int dom_domlocator_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_uri_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c
index 6e8bc05bac..a13f29c91a 100644
--- a/ext/dom/domstringlist.c
+++ b/ext/dom/domstringlist.c
@@ -52,7 +52,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-length
Since:
*/
-int dom_domstringlist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domstringlist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 0aff19561a..d97bfc06b3 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -165,16 +165,16 @@ PHP_METHOD(domelement, __construct)
xmlNsPtr nsptr = NULL;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
@@ -196,7 +196,7 @@ PHP_METHOD(domelement, __construct)
if (nodep != NULL) {
xmlFreeNode(nodep);
}
- php_dom_throw_error(errorcode, 1 TSRMLS_CC);
+ php_dom_throw_error(errorcode, 1);
RETURN_FALSE;
}
} else {
@@ -205,14 +205,14 @@ PHP_METHOD(domelement, __construct)
if (prefix != NULL) {
xmlFree(localname);
xmlFree(prefix);
- php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewNode(NULL, (xmlChar *) name);
}
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -223,9 +223,9 @@ PHP_METHOD(domelement, __construct)
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMElement::__construct */
@@ -234,7 +234,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-104682815
Since:
*/
-int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_element_tag_name_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep;
xmlNsPtr ns;
@@ -243,7 +243,7 @@ int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -268,7 +268,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Element-schemaTypeInfo
Since: DOM Level 3
*/
-int dom_element_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_element_schema_type_info_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -333,7 +333,7 @@ PHP_FUNCTION(dom_element_get_attribute)
xmlNodePtr attr;
size_t name_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -376,25 +376,25 @@ PHP_FUNCTION(dom_element_set_attribute)
dom_object *intern;
char *name, *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -402,7 +402,7 @@ PHP_FUNCTION(dom_element_set_attribute)
if (attr != NULL) {
switch (attr->type) {
case XML_ATTRIBUTE_NODE:
- node_list_unlink(attr->children TSRMLS_CC);
+ node_list_unlink(attr->children);
break;
case XML_NAMESPACE_DECL:
RETURN_FALSE;
@@ -420,7 +420,7 @@ PHP_FUNCTION(dom_element_set_attribute)
attr = (xmlNodePtr)xmlSetProp(nodep, (xmlChar *) name, (xmlChar *)value);
}
if (!attr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", name);
+ php_error_docref(NULL, E_WARNING, "No such attribute '%s'", name);
RETURN_FALSE;
}
@@ -441,14 +441,14 @@ PHP_FUNCTION(dom_element_remove_attribute)
size_t name_len;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -460,7 +460,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
switch (attrp->type) {
case XML_ATTRIBUTE_NODE:
if (php_dom_object_get_data(attrp) == NULL) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
xmlUnlinkNode(attrp);
xmlFreeProp((xmlAttrPtr)attrp);
} else {
@@ -490,7 +490,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
dom_object *intern;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -536,26 +536,26 @@ PHP_FUNCTION(dom_element_set_attribute_node)
dom_object *intern, *attrobj, *oldobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required");
+ php_error_docref(NULL, E_WARNING, "Attribute node is required");
RETURN_FALSE;
}
if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -575,7 +575,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL);
}
xmlAddChild(nodep, (xmlNodePtr) attrp);
@@ -602,21 +602,21 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
dom_object *intern, *attrobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE || attrp->parent != nodep) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -640,16 +640,16 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
char *name;
xmlChar *local;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
}
/* }}} end dom_element_get_elements_by_tag_name */
@@ -667,7 +667,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
char *uri, *name;
xmlChar *strattr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -749,12 +749,12 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
dom_object *intern;
int errorcode = 0, stricterror, is_xmlns = 0, name_valid;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
@@ -763,7 +763,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
stricterror = dom_get_strict_error(intern->document);
if (dom_node_is_read_only(elemp) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_NULL();
}
@@ -773,7 +773,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
if (uri_len > 0) {
nodep = (xmlNodePtr) xmlHasNsProp(elemp, (xmlChar *) localname, (xmlChar *) uri);
if (nodep != NULL && nodep->type != XML_ATTRIBUTE_DECL) {
- node_list_unlink(nodep->children TSRMLS_CC);
+ node_list_unlink(nodep->children);
}
if ((xmlStrEqual((xmlChar *) prefix, (xmlChar *)"xmlns") ||
@@ -841,7 +841,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
} else {
attr = xmlHasProp(elemp, (xmlChar *)localname);
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) {
- node_list_unlink(attr->children TSRMLS_CC);
+ node_list_unlink(attr->children);
}
xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
}
@@ -854,7 +854,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
}
if (errorcode != 0) {
- php_dom_throw_error(errorcode, stricterror TSRMLS_CC);
+ php_dom_throw_error(errorcode, stricterror);
}
RETURN_NULL();
@@ -875,14 +875,14 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
size_t name_len, uri_len;
char *name, *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
@@ -906,7 +906,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
if (attrp && attrp->type != XML_ATTRIBUTE_DECL) {
if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
xmlUnlinkNode((xmlNodePtr) attrp);
xmlFreeProp(attrp);
} else {
@@ -932,7 +932,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
int ret;
char *uri, *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -962,26 +962,26 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
dom_object *intern, *attrobj, *oldobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required");
+ php_error_docref(NULL, E_WARNING, "Attribute node is required");
RETURN_FALSE;
}
if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1007,7 +1007,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL);
}
xmlAddChild(nodep, (xmlNodePtr) attrp);
@@ -1035,17 +1035,17 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
}
/* }}} end dom_element_get_elements_by_tag_name_ns */
@@ -1063,7 +1063,7 @@ PHP_FUNCTION(dom_element_has_attribute)
size_t name_len;
xmlNodePtr attr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -1092,7 +1092,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
char *uri, *name;
xmlChar *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -1149,20 +1149,20 @@ PHP_FUNCTION(dom_element_set_id_attribute)
size_t name_len;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
attrp = xmlHasNsProp(nodep, (xmlChar *)name, NULL);
if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
@@ -1185,20 +1185,20 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
char *uri, *name;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
if (dom_node_is_read_only(elemp) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
@@ -1219,21 +1219,21 @@ PHP_FUNCTION(dom_element_set_id_attribute_node)
dom_object *intern, *attrobj;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->parent != nodep) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
diff --git a/ext/dom/entity.c b/ext/dom/entity.c
index e0625fdd72..07c2b0cab3 100644
--- a/ext/dom/entity.c
+++ b/ext/dom/entity.c
@@ -44,12 +44,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025
Since:
*/
-int dom_entity_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_public_id_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -69,12 +69,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E
Since:
*/
-int dom_entity_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_system_id_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -94,13 +94,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38
Since:
*/
-int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_notation_name_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
char *content;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -122,13 +122,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
Since: DOM Level 3
*/
-int dom_entity_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_actual_encoding_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_actual_encoding_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
@@ -140,13 +140,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding
Since: DOM Level 3
*/
-int dom_entity_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_encoding_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_encoding_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
@@ -158,13 +158,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version
Since: DOM Level 3
*/
-int dom_entity_version_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_version_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_version_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index 1c3e60e4f1..9505654f9d 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -56,24 +56,24 @@ PHP_METHOD(domentityreference, __construct)
size_t name_len, name_valid;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
node = xmlNewReference(NULL, (xmlChar *) name);
if (!node) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -81,9 +81,9 @@ PHP_METHOD(domentityreference, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern);
}
}
/* }}} end DOMEntityReference::__construct */
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index ab314851be..fb110345ff 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -83,7 +83,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E
Since:
*/
-int dom_namednodemap_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_namednodemap_length_read(dom_object *obj, zval *retval)
{
dom_nnodemap_object *objmap;
xmlAttrPtr curnode;
@@ -136,7 +136,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) {
return;
}
@@ -210,7 +210,7 @@ PHP_FUNCTION(dom_namednodemap_item)
xmlNodePtr nodep, curnode;
int count;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) {
return;
}
if (index >= 0) {
@@ -269,7 +269,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) {
return;
}
diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c
index 3f0b8e1640..9955cb1b6c 100644
--- a/ext/dom/namelist.c
+++ b/ext/dom/namelist.c
@@ -55,7 +55,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length
Since:
*/
-int dom_namelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_namelist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/node.c b/ext/dom/node.c
index b2079ffda2..a51cb52747 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -196,7 +196,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D095
Since:
*/
-int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_name_read(dom_object *obj, zval *retval)
{
xmlNode *nodep;
xmlNsPtr ns;
@@ -206,7 +206,7 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -259,7 +259,7 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
str = "#text";
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Node Type");
+ php_error_docref(NULL, E_WARNING, "Invalid Node Type");
}
if (str != NULL) {
@@ -283,13 +283,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D080
Since:
*/
-int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_value_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -322,12 +322,12 @@ int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_node_value_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -336,7 +336,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
if (nodep->children) {
- node_list_unlink(nodep->children TSRMLS_CC);
+ node_list_unlink(nodep->children);
}
case XML_TEXT_NODE:
case XML_COMMENT_NODE:
@@ -362,14 +362,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558
Since:
*/
-int dom_node_node_type_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_type_read(dom_object *obj, zval *retval)
{
xmlNode *nodep;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -390,14 +390,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317
Since:
*/
-int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_parent_node_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *nodeparent;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -407,7 +407,7 @@ int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(nodeparent, retval, obj TSRMLS_CC);
+ php_dom_create_object(nodeparent, retval, obj);
return SUCCESS;
}
@@ -418,22 +418,22 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987
Since:
*/
-int dom_node_child_nodes_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_child_nodes_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
dom_object *intern;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (dom_node_children_valid(nodep) == FAILURE) {
ZVAL_NULL(retval);
} else {
- php_dom_create_interator(retval, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NODELIST);
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL);
}
return SUCCESS;
@@ -446,14 +446,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388
Since:
*/
-int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_first_child_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *first = NULL;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -466,7 +466,7 @@ int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(first, retval, obj TSRMLS_CC);
+ php_dom_create_object(first, retval, obj);
return SUCCESS;
}
@@ -477,14 +477,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB
Since:
*/
-int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_last_child_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *last = NULL;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -497,7 +497,7 @@ int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(last, retval, obj TSRMLS_CC);
+ php_dom_create_object(last, retval, obj);
return SUCCESS;
}
@@ -508,14 +508,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8
Since:
*/
-int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_previous_sibling_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *prevsib;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -525,7 +525,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(prevsib, retval, obj TSRMLS_CC);
+ php_dom_create_object(prevsib, retval, obj);
return SUCCESS;
}
@@ -536,14 +536,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F
Since:
*/
-int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_next_sibling_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *nextsib;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -552,7 +552,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
return FAILURE;
}
- php_dom_create_object(nextsib, retval, obj TSRMLS_CC);
+ php_dom_create_object(nextsib, retval, obj);
return SUCCESS;
}
@@ -563,20 +563,20 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096
Since:
*/
-int dom_node_attributes_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_attributes_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
dom_object *intern;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (nodep->type == XML_ELEMENT_NODE) {
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL);
} else {
ZVAL_NULL(retval);
}
@@ -591,13 +591,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc
Since:
*/
-int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_owner_document_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlDocPtr docp;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -611,7 +611,7 @@ int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC)
return FAILURE;
}
- php_dom_create_object((xmlNodePtr) docp, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) docp, retval, obj);
return SUCCESS;
}
@@ -622,13 +622,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSname
Since: DOM Level 2
*/
-int dom_node_namespace_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_namespace_uri_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -661,14 +661,14 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSPrefix
Since: DOM Level 2
*/
-int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_prefix_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlNsPtr ns;
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -695,7 +695,7 @@ int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_prefix_write(dom_object *obj, zval *newval)
{
zend_string *str;
xmlNode *nodep, *nsnode = NULL;
@@ -706,7 +706,7 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -746,7 +746,7 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
if (ns == NULL) {
zend_string_release(str);
- php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document) TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document));
return FAILURE;
}
@@ -768,12 +768,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSLocalN
Since: DOM Level 2
*/
-int dom_node_local_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_local_name_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -793,13 +793,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-baseURI
Since: DOM Level 3
*/
-int dom_node_base_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_base_uri_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlChar *baseuri;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -821,13 +821,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-textContent
Since: DOM Level 3
*/
-int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_text_content_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -843,14 +843,14 @@ int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_text_content_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
xmlChar *enc_str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -865,7 +865,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
-static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib, xmlNodePtr fragment, dom_object *intern, dom_object *childobj TSRMLS_DC) /* {{{ */
+static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib, xmlNodePtr fragment, dom_object *intern, dom_object *childobj) /* {{{ */
{
xmlNodePtr newchild, node;
@@ -893,7 +893,7 @@ static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib,
if (node->_private != NULL) {
childobj = node->_private;
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
}
if (node == fragment->last) {
@@ -921,7 +921,7 @@ PHP_FUNCTION(dom_node_insert_before)
dom_object *intern, *childobj, *refpobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
return;
}
@@ -939,34 +939,34 @@ PHP_FUNCTION(dom_node_insert_before)
if (dom_node_is_read_only(parentp) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(parentp, child) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
if (child->doc != parentp->doc && child->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
+ php_error_docref(NULL, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && parentp->doc != NULL) {
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
if (ref != NULL) {
DOM_GET_OBJ(refp, ref, xmlNodePtr, refpobj);
if (refp->parent != parentp) {
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE;
}
@@ -1003,14 +1003,14 @@ PHP_FUNCTION(dom_node_insert_before)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
} else {
DOM_RET_OBJ(child, &ret, intern);
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj);
}
if (new_child == NULL) {
@@ -1045,14 +1045,14 @@ PHP_FUNCTION(dom_node_insert_before)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
} else {
DOM_RET_OBJ(child, &ret, intern);
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj);
}
if (new_child == NULL) {
new_child = xmlAddChild(parentp, child);
@@ -1060,7 +1060,7 @@ PHP_FUNCTION(dom_node_insert_before)
}
if (NULL == new_child) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't add newnode as the previous sibling of refnode");
+ php_error_docref(NULL, E_WARNING, "Couldn't add newnode as the previous sibling of refnode");
RETURN_FALSE;
}
@@ -1084,7 +1084,7 @@ PHP_FUNCTION(dom_node_replace_child)
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1106,17 +1106,17 @@ PHP_FUNCTION(dom_node_replace_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(newchild->parent != NULL && dom_node_is_read_only(newchild->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (newchild->doc != nodep->doc && newchild->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(nodep, newchild) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
@@ -1137,7 +1137,7 @@ PHP_FUNCTION(dom_node_replace_child)
xmlUnlinkNode(oldchild);
- newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj TSRMLS_CC);
+ newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj);
if (newchild) {
dom_reconcile_ns(nodep->doc, newchild);
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(dom_node_replace_child)
if (newchild->doc == NULL && nodep->doc != NULL) {
xmlSetTreeDoc(newchild, nodep->doc);
newchildobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL);
}
xmlReplaceNode(oldchild, newchild);
dom_reconcile_ns(nodep->doc, newchild);
@@ -1153,7 +1153,7 @@ PHP_FUNCTION(dom_node_replace_child)
DOM_RET_OBJ(oldchild, &ret, intern);
return;
} else {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
}
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(dom_node_remove_child)
dom_object *intern, *childobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1186,13 +1186,13 @@ PHP_FUNCTION(dom_node_remove_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
children = nodep->children;
if (!children) {
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE;
}
@@ -1205,7 +1205,7 @@ PHP_FUNCTION(dom_node_remove_child)
children = children->next;
}
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE
}
/* }}} end dom_node_remove_child */
@@ -1221,7 +1221,7 @@ PHP_FUNCTION(dom_node_append_child)
dom_object *intern, *childobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1237,28 +1237,28 @@ PHP_FUNCTION(dom_node_append_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(nodep, child) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
if (!(child->doc == NULL || child->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
+ php_error_docref(NULL, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && nodep->doc != NULL) {
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
if (child->parent != NULL){
@@ -1290,17 +1290,17 @@ PHP_FUNCTION(dom_node_append_child)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj);
}
if (new_child == NULL) {
new_child = xmlAddChild(nodep, child);
if (new_child == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't append node");
+ php_error_docref(NULL, E_WARNING, "Couldn't append node");
RETURN_FALSE;
}
}
@@ -1321,7 +1321,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1351,7 +1351,7 @@ PHP_FUNCTION(dom_node_clone_node)
dom_object *intern;
zend_long recursive = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
@@ -1410,13 +1410,13 @@ PHP_FUNCTION(dom_node_normalize)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- dom_normalize(nodep TSRMLS_CC);
+ dom_normalize(nodep);
}
/* }}} end dom_node_normalize */
@@ -1431,7 +1431,7 @@ PHP_FUNCTION(dom_node_is_supported)
size_t feature_len, version_len;
char *feature, *version;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
return;
}
@@ -1453,7 +1453,7 @@ PHP_FUNCTION(dom_node_has_attributes)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1490,7 +1490,7 @@ PHP_FUNCTION(dom_node_is_same_node)
xmlNodePtr nodeotherp, nodep;
dom_object *intern, *nodeotherobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1519,7 +1519,7 @@ PHP_FUNCTION(dom_node_lookup_prefix)
size_t uri_len = 0;
char *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1570,7 +1570,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
size_t uri_len = 0;
char *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1603,7 +1603,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
size_t prefix_len;
char *prefix;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
return;
}
@@ -1682,13 +1682,13 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathObjectPtr xpathobjp=NULL;
if (mode == 0) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|bba!a!", &id, dom_node_class_entry, &exclusive, &with_comments,
&xpath_array, &ns_prefixes) == FAILURE) {
return;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Os|bba!a!", &id, dom_node_class_entry, &file, &file_len, &exclusive,
&with_comments, &xpath_array, &ns_prefixes) == FAILURE) {
return;
@@ -1700,7 +1700,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
docp = nodep->doc;
if (! docp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node must be associated with a document");
+ php_error_docref(NULL, E_WARNING, "Node must be associated with a document");
RETURN_FALSE;
}
@@ -1717,7 +1717,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeObject(xpathobjp);
}
xmlXPathFreeContext(ctxp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset.");
RETURN_FALSE;
}
}
@@ -1731,7 +1731,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
if (tmp && Z_TYPE_P(tmp) == IS_STRING) {
xquery = Z_STRVAL_P(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'query' missing from xpath array or is not a string");
+ php_error_docref(NULL, E_WARNING, "'query' missing from xpath array or is not a string");
RETURN_FALSE;
}
@@ -1761,7 +1761,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeObject(xpathobjp);
}
xmlXPathFreeContext(ctxp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset.");
RETURN_FALSE;
}
}
@@ -1780,7 +1780,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
} ZEND_HASH_FOREACH_END();
inclusive_ns_prefixes[nscount] = NULL;
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"Inclusive namespace prefixes only allowed in exclusive mode.");
}
}
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index 15071739d2..fa67cc1041 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -51,7 +51,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337
Since:
*/
-int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_nodelist_length_read(dom_object *obj, zval *retval)
{
dom_nnodemap_object *objmap;
xmlNodePtr nodep, curnode;
@@ -114,7 +114,7 @@ PHP_FUNCTION(dom_nodelist_item)
xmlNodePtr nodep, curnode;
int count = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) {
return;
}
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index b26608adcf..cf4039f3ab 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -45,12 +45,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
Since:
*/
-int dom_notation_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_notation_public_id_read(dom_object *obj, zval *retval)
{
xmlEntityPtr nodep = (xmlEntityPtr) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -70,12 +70,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
Since:
*/
-int dom_notation_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_notation_system_id_read(dom_object *obj, zval *retval)
{
xmlEntityPtr nodep = (xmlEntityPtr) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index c25cbaba58..6dd0f8e020 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -103,15 +103,15 @@ static HashTable dom_xpath_prop_handlers;
#endif
/* }}} */
-typedef int (*dom_read_t)(dom_object *obj, zval *retval TSRMLS_DC);
-typedef int (*dom_write_t)(dom_object *obj, zval *newval TSRMLS_DC);
+typedef int (*dom_read_t)(dom_object *obj, zval *retval);
+typedef int (*dom_write_t)(dom_object *obj, zval *newval);
typedef struct _dom_prop_handler {
dom_read_t read_func;
dom_write_t write_func;
} dom_prop_handler;
-static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
+static zend_object_handlers* dom_get_obj_handlers(void) {
return &dom_object_handlers;
}
@@ -206,7 +206,7 @@ static void dom_copy_doc_props(php_libxml_ref_obj *source_doc, php_libxml_ref_ob
}
}
-int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC)
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce)
{
dom_doc_propsptr doc_props;
@@ -228,7 +228,7 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece,
return SUCCESS;
}
-zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece TSRMLS_DC)
+zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece)
{
dom_doc_propsptr doc_props;
@@ -284,23 +284,23 @@ PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj)
/* }}} end php_dom_object_get_data */
/* {{{ dom_read_na */
-static int dom_read_na(dom_object *obj, zval *retval TSRMLS_DC)
+static int dom_read_na(dom_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property");
+ php_error_docref(NULL, E_ERROR, "Cannot read property");
return FAILURE;
}
/* }}} */
/* {{{ dom_write_na */
-static int dom_write_na(dom_object *obj, zval *newval TSRMLS_DC)
+static int dom_write_na(dom_object *obj, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property");
+ php_error_docref(NULL, E_ERROR, "Cannot write property");
return FAILURE;
}
/* }}} */
/* {{{ dom_register_prop_handler */
-static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func TSRMLS_DC)
+static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func)
{
dom_prop_handler hnd;
@@ -310,7 +310,7 @@ static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_r
}
/* }}} */
-static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -318,7 +318,7 @@ static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void
if (!obj->prop_handler || !zend_hash_exists(obj->prop_handler, member_str)) {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
zend_string_release(member_str);
@@ -327,7 +327,7 @@ static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void
/* }}} */
/* {{{ dom_read_property */
-zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -336,12 +336,12 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
if (obj->prop_handler != NULL) {
hnd = zend_hash_find_ptr(obj->prop_handler, member_str);
- } else if (instanceof_function(obj->std.ce, dom_node_class_entry TSRMLS_CC)) {
+ } else if (instanceof_function(obj->std.ce, dom_node_class_entry)) {
php_error(E_WARNING, "Couldn't fetch %s. Node no longer exists", obj->std.ce->name->val);
}
if (hnd) {
- int ret = hnd->read_func(obj, rv TSRMLS_CC);
+ int ret = hnd->read_func(obj, rv);
if (ret == SUCCESS) {
retval = rv;
} else {
@@ -349,7 +349,7 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
zend_string_release(member_str);
@@ -358,7 +358,7 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
/* }}} */
/* {{{ dom_write_property */
-void dom_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void dom_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -368,10 +368,10 @@ void dom_write_property(zval *object, zval *member, zval *value, void **cache_sl
hnd = zend_hash_find_ptr(obj->prop_handler, member_str);
}
if (hnd) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
zend_string_release(member_str);
@@ -379,7 +379,7 @@ void dom_write_property(zval *object, zval *member, zval *value, void **cache_sl
/* }}} */
/* {{{ dom_property_exists */
-static int dom_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int dom_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -394,9 +394,9 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
if (check_empty == 2) {
retval = 1;
- } else if (hnd->read_func(obj, &tmp TSRMLS_CC) == SUCCESS) {
+ } else if (hnd->read_func(obj, &tmp) == SUCCESS) {
if (check_empty == 1) {
- retval = zend_is_true(&tmp TSRMLS_CC);
+ retval = zend_is_true(&tmp);
} else if (check_empty == 0) {
retval = (Z_TYPE(tmp) != IS_NULL);
}
@@ -404,7 +404,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->has_property(object, member, check_empty, cache_slot TSRMLS_CC);
+ retval = std_hnd->has_property(object, member, check_empty, cache_slot);
}
zend_string_release(member_str);
@@ -412,7 +412,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
}
/* }}} */
-static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp) /* {{{ */
{
dom_object *obj = Z_DOMOBJ_P(object);
HashTable *debug_info,
@@ -426,7 +426,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
ALLOC_HASHTABLE(debug_info);
- std_props = zend_std_get_properties(object TSRMLS_CC);
+ std_props = zend_std_get_properties(object);
zend_array_dup(debug_info, std_props);
if (!prop_handlers) {
@@ -442,7 +442,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
zend_string *string_key;
zend_ulong num_key;
- if (entry->read_func(obj, &value TSRMLS_CC) == FAILURE) {
+ if (entry->read_func(obj, &value) == FAILURE) {
continue;
}
@@ -465,13 +465,13 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
}
/* }}} */
-static HashTable* dom_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* dom_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
- return dom_get_debug_info_helper(object, is_temp TSRMLS_CC);
+ return dom_get_debug_info_helper(object, is_temp);
}
/* }}} */
-void *php_dom_export_node(zval *object TSRMLS_DC) /* {{{ */
+void *php_dom_export_node(zval *object) /* {{{ */
{
php_libxml_node_object *intern;
xmlNodePtr nodep = NULL;
@@ -494,33 +494,33 @@ PHP_FUNCTION(dom_import_simplexml)
php_libxml_node_object *nodeobj;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &node) == FAILURE) {
return;
}
nodeobj = (php_libxml_node_object *) ((char *) Z_OBJ_P(node) - Z_OBJ_HT_P(node)->offset);
- nodep = php_libxml_import_node(node TSRMLS_CC);
+ nodep = php_libxml_import_node(node);
if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) {
DOM_RET_OBJ((xmlNodePtr) nodep, &ret, (dom_object *)nodeobj);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
+ php_error_docref(NULL, E_WARNING, "Invalid Nodetype to import");
RETURN_NULL();
}
}
/* }}} */
-static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC);
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy);
-static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *dom_objects_store_clone_obj(zval *zobject) /* {{{ */
{
dom_object *intern = Z_DOMOBJ_P(zobject);
- dom_object *clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC);
+ dom_object *clone = dom_objects_set_class(intern->std.ce, 0);
- clone->std.handlers = dom_get_obj_handlers(TSRMLS_C);
- zend_objects_clone_members(&clone->std, &intern->std TSRMLS_CC);
+ clone->std.handlers = dom_get_obj_handlers();
+ zend_objects_clone_members(&clone->std, &intern->std);
- if (instanceof_function(intern->std.ce, dom_node_class_entry TSRMLS_CC)) {
+ if (instanceof_function(intern->std.ce, dom_node_class_entry)) {
xmlNodePtr node = (xmlNodePtr)dom_object_get_node(intern);
if (node != NULL) {
xmlNodePtr cloned_node = xmlDocCopyNode(node, node->doc, 1);
@@ -529,8 +529,8 @@ static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) /* {{{
if (cloned_node->doc == node->doc) {
clone->document = intern->document;
}
- php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone);
if (intern->document != clone->document) {
dom_copy_doc_props(intern->document, clone->document);
}
@@ -592,12 +592,12 @@ zend_module_entry dom_module_entry = { /* {{{ */
ZEND_GET_MODULE(dom)
#endif
-void dom_objects_free_storage(zend_object *object TSRMLS_DC);
-void dom_nnodemap_objects_free_storage(zend_object *object TSRMLS_DC);
-static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC);
-static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC);
+void dom_objects_free_storage(zend_object *object);
+void dom_nnodemap_objects_free_storage(zend_object *object);
+static zend_object *dom_objects_store_clone_obj(zval *zobject);
+static void dom_nnodemap_object_dtor(zend_object *object);
#if defined(LIBXML_XPATH_ENABLED)
-void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC);
+void dom_xpath_objects_free_storage(zend_object *object);
#endif
/* {{{ PHP_MINIT_FUNCTION(dom) */
@@ -625,26 +625,26 @@ 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(TSRMLS_C) TSRMLS_CC);
+ dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
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);
+ zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC);
REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry);
zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domstringlist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry);
zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namelist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry);
zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domimplementationlist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry);
@@ -653,35 +653,35 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMNode", NULL, php_dom_node_class_functions, dom_node_class_entry);
zend_hash_init(&dom_node_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write);
+ dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write);
zend_hash_add_ptr(&classes, ce.name, &dom_node_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNameSpaceNode", NULL, NULL, dom_namespace_node_class_entry);
zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namespace_node_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMDocumentFragment", dom_node_class_entry, php_dom_documentfragment_class_functions, dom_documentfragment_class_entry);
@@ -689,80 +689,80 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMDocument", dom_node_class_entry, php_dom_document_class_functions, dom_document_class_entry);
zend_hash_init(&dom_document_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write);
zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_document_prop_handlers);
INIT_CLASS_ENTRY(ce, "DOMNodeList", php_dom_nodelist_class_functions);
ce.create_object = dom_nnodemap_objects_new;
- dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL);
dom_nodelist_class_entry->get_iterator = php_dom_get_iterator;
- zend_class_implements(dom_nodelist_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(dom_nodelist_class_entry, 1, zend_ce_traversable);
zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_nodelist_prop_handlers);
INIT_CLASS_ENTRY(ce, "DOMNamedNodeMap", php_dom_namednodemap_class_functions);
ce.create_object = dom_nnodemap_objects_new;
- dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL);
dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator;
- zend_class_implements(dom_namednodemap_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(dom_namednodemap_class_entry, 1, zend_ce_traversable);
zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namednodemap_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMCharacterData", dom_node_class_entry, php_dom_characterdata_class_functions, dom_characterdata_class_entry);
zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write TSRMLS_CC);
- dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write);
+ dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL);
zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_characterdata_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMAttr", dom_node_class_entry, php_dom_attr_class_functions, dom_attr_class_entry);
zend_hash_init(&dom_attr_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL);
zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_attr_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMElement", dom_node_class_entry, php_dom_element_class_functions, dom_element_class_entry);
zend_hash_init(&dom_element_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL);
+ dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL);
zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_element_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMText", dom_characterdata_class_entry, php_dom_text_class_functions, dom_text_class_entry);
zend_hash_init(&dom_text_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL);
zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_text_prop_handlers);
@@ -772,31 +772,31 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry);
zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL);
+ dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_typeinfo_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry);
zend_hash_init(&dom_domerror_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domerror_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry);
zend_hash_init(&dom_domlocator_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domlocator_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry);
@@ -806,32 +806,32 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMDocumentType", dom_node_class_entry, php_dom_documenttype_class_functions, dom_documenttype_class_entry);
zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL);
zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_documenttype_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNotation", dom_node_class_entry, php_dom_notation_class_functions, dom_notation_class_entry);
zend_hash_init(&dom_notation_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL);
+ dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL);
zend_hash_merge(&dom_notation_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_notation_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMEntity", dom_node_class_entry, php_dom_entity_class_functions, dom_entity_class_entry);
zend_hash_init(&dom_entity_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write);
zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_entity_prop_handlers);
@@ -841,8 +841,8 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMProcessingInstruction", dom_node_class_entry, php_dom_processinginstruction_class_functions, dom_processinginstruction_class_entry);
zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL);
+ dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write);
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_processinginstruction_prop_handlers);
@@ -855,10 +855,10 @@ PHP_MINIT_FUNCTION(dom)
INIT_CLASS_ENTRY(ce, "DOMXPath", php_dom_xpath_class_functions);
ce.create_object = dom_xpath_objects_new;
- dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL);
zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_xpath_prop_handlers);
#endif
@@ -979,7 +979,7 @@ PHP_MSHUTDOWN_FUNCTION(dom) /* {{{ */
/* }}} */
/* {{{ node_list_unlink */
-void node_list_unlink(xmlNodePtr node TSRMLS_DC)
+void node_list_unlink(xmlNodePtr node)
{
dom_object *wrapper;
@@ -992,7 +992,7 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
} else {
if (node->type == XML_ENTITY_REF_NODE)
break;
- node_list_unlink(node->children TSRMLS_CC);
+ node_list_unlink(node->children);
switch (node->type) {
case XML_ATTRIBUTE_DECL:
@@ -1003,7 +1003,7 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
case XML_TEXT_NODE:
break;
default:
- node_list_unlink((xmlNodePtr) node->properties TSRMLS_CC);
+ node_list_unlink((xmlNodePtr) node->properties);
}
}
@@ -1015,15 +1015,15 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
#if defined(LIBXML_XPATH_ENABLED)
/* {{{ dom_xpath_objects_free_storage */
-void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC)
+void dom_xpath_objects_free_storage(zend_object *object)
{
dom_xpath_object *intern = php_xpath_obj_from_obj(object);
- zend_object_std_dtor(&intern->dom.std TSRMLS_CC);
+ zend_object_std_dtor(&intern->dom.std);
if (intern->dom.ptr != NULL) {
xmlXPathFreeContext((xmlXPathContextPtr) intern->dom.ptr);
- php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
}
if (intern->registered_phpfunctions) {
@@ -1040,7 +1040,7 @@ void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC)
#endif
/* {{{ dom_objects_free_storage */
-void dom_objects_free_storage(zend_object *object TSRMLS_DC)
+void dom_objects_free_storage(zend_object *object)
{
dom_object *intern = php_dom_obj_from_obj(object);
#if defined(__GNUC__) && __GNUC__ >= 3
@@ -1049,21 +1049,21 @@ void dom_objects_free_storage(zend_object *object TSRMLS_DC)
int retcount;
#endif
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node != NULL) {
if (((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) {
- php_libxml_node_decrement_resource((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_node_decrement_resource((php_libxml_node_object *) intern);
} else {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
- retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
+ retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
}
intern->ptr = NULL;
}
}
/* }}} */
-void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC) /* {{{ */
+void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns) /* {{{ */
{
dom_nnodemap_object *mapptr = (dom_nnodemap_object *) intern->ptr;
@@ -1079,7 +1079,7 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml
}
/* }}} */
-static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC) /* {{{ */
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy) /* {{{ */
{
dom_object *intern = ecalloc(1, sizeof(dom_object) + sizeof(zval) * (class_type->default_properties_count - 1));
@@ -1090,7 +1090,7 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool
intern->prop_handler = zend_hash_find_ptr(&classes, base_class->name);
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (hash_copy) {
object_properties_init(&intern->std, class_type);
}
@@ -1100,17 +1100,17 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool
/* }}} */
/* {{{ dom_objects_new */
-zend_object *dom_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *dom_objects_new(zend_class_entry *class_type)
{
- dom_object *intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
- intern->std.handlers = dom_get_obj_handlers(TSRMLS_C);
+ dom_object *intern = dom_objects_set_class(class_type, 1);
+ intern->std.handlers = dom_get_obj_handlers();
return &intern->std;
}
/* }}} */
#if defined(LIBXML_XPATH_ENABLED)
-/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) */
-zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
+/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type) */
+zend_object *dom_xpath_objects_new(zend_class_entry *class_type)
{
dom_xpath_object *intern = ecalloc(1, sizeof(dom_xpath_object) + sizeof(zval) * (class_type->default_properties_count - 1));
@@ -1120,7 +1120,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern->dom.prop_handler = &dom_xpath_prop_handlers;
intern->dom.std.handlers = &dom_xpath_object_handlers;
- zend_object_std_init(&intern->dom.std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->dom.std, class_type);
object_properties_init(&intern->dom.std, class_type);
return &intern->dom.std;
@@ -1128,7 +1128,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
/* }}} */
#endif
-static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC) /* {{{ */
+static void dom_nnodemap_object_dtor(zend_object *object) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
@@ -1152,22 +1152,22 @@ static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-void dom_nnodemap_objects_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+void dom_nnodemap_objects_free_storage(zend_object *object) /* {{{ */
{
dom_object *intern = php_dom_obj_from_obj(object);
- php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
-zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
- intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
+ intern = dom_objects_set_class(class_type, 1);
intern->ptr = emalloc(sizeof(dom_nnodemap_object));
objmap = (dom_nnodemap_object *)intern->ptr;
ZVAL_UNDEF(&objmap->baseobj_zv);
@@ -1183,7 +1183,7 @@ zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) /*
}
/* }}} */
-void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) /* {{{ */
+void php_dom_create_interator(zval *return_value, int ce_type) /* {{{ */
{
zend_class_entry *ce;
@@ -1198,7 +1198,7 @@ void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) /* {{{
/* }}} */
/* {{{ php_dom_create_object */
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj TSRMLS_DC)
+PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj)
{
zend_class_entry *ce;
dom_object *intern;
@@ -1284,13 +1284,13 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d", obj->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported node type: %d", obj->type);
ZVAL_NULL(return_value);
return 0;
}
if (domobj && domobj->document) {
- ce = dom_get_doc_classmap(domobj->document, ce TSRMLS_CC);
+ ce = dom_get_doc_classmap(domobj->document, ce);
}
object_init_ex(return_value, ce);
@@ -1299,15 +1299,15 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu
if (domobj != NULL) {
intern->document = domobj->document;
}
- php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc);
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern);
return 0;
}
/* }}} end php_domobject_new */
-void php_dom_create_implementation(zval *retval TSRMLS_DC) {
+void php_dom_create_implementation(zval *retval) {
object_init_ex(retval, dom_domimplementation_class_entry);
}
@@ -1374,8 +1374,8 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *l
/* }}} */
/* }}} end dom_element_get_elements_by_tag_name_ns_raw */
-/* {{{ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) */
-void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
+/* {{{ void dom_normalize (xmlNodePtr nodep) */
+void dom_normalize (xmlNodePtr nodep)
{
xmlNodePtr child, nextp, newnextp;
xmlAttrPtr attr;
@@ -1393,7 +1393,7 @@ void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
xmlNodeAddContent(child, strContent);
xmlFree(strContent);
xmlUnlinkNode(nextp);
- php_libxml_node_free_resource(nextp TSRMLS_CC);
+ php_libxml_node_free_resource(nextp);
nextp = newnextp;
} else {
break;
@@ -1401,15 +1401,15 @@ void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
}
break;
case XML_ELEMENT_NODE:
- dom_normalize (child TSRMLS_CC);
+ dom_normalize (child);
attr = child->properties;
while (attr != NULL) {
- dom_normalize((xmlNodePtr) attr TSRMLS_CC);
+ dom_normalize((xmlNodePtr) attr);
attr = attr->next;
}
break;
case XML_ATTRIBUTE_NODE:
- dom_normalize (child TSRMLS_CC);
+ dom_normalize (child);
break;
default:
break;
@@ -1544,7 +1544,7 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) {
}
/* }}} end dom_get_nsdecl */
-zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
zval offset_copy;
@@ -1559,14 +1559,14 @@ zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv
return rv;
} /* }}} end dom_nodelist_read_dimension */
-int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC)
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty)
{
zend_long offset = zval_get_long(member);
if (offset < 0) {
return 0;
} else {
- zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC);
+ zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0);
return length && offset < Z_LVAL_P(length);
}
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index 02eb2d9509..bb4aa160e6 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -99,45 +99,45 @@ typedef struct {
dom_object *dom_object_get_data(xmlNodePtr obj);
dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document);
-zend_object *dom_objects_new(zend_class_entry *class_type TSRMLS_DC);
-zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC);
+zend_object *dom_objects_new(zend_class_entry *class_type);
+zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type);
#if defined(LIBXML_XPATH_ENABLED)
-zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC);
+zend_object *dom_xpath_objects_new(zend_class_entry *class_type);
#endif
int dom_get_strict_error(php_libxml_ref_obj *document);
-void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC);
-void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC);
-void node_list_unlink(xmlNodePtr node TSRMLS_DC);
+void php_dom_throw_error(int error_code, int strict_error);
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error);
+void node_list_unlink(xmlNodePtr node);
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len);
xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);
void dom_set_old_ns(xmlDoc *doc, xmlNs *ns);
xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName);
-void dom_normalize (xmlNodePtr nodep TSRMLS_DC);
+void dom_normalize (xmlNodePtr nodep);
xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index);
-void php_dom_create_implementation(zval *retval TSRMLS_DC);
+void php_dom_create_implementation(zval *retval);
int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child);
int dom_has_feature(char *feature, char *version);
int dom_node_is_read_only(xmlNodePtr node);
int dom_node_children_valid(xmlNodePtr node);
-void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC);
-void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC);
+void php_dom_create_interator(zval *return_value, int ce_type);
+void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns);
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, int by_ref TSRMLS_DC);
-int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC);
-zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC);
-int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC);
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce);
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv);
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = dom_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+entry = zend_register_internal_class_ex(&ce, parent_ce);
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_DOMOBJ_P(__id); \
if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name->val);\
RETURN_NULL();\
} \
}
@@ -148,7 +148,7 @@ entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
}
#define DOM_NOT_IMPLEMENTED() \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); \
+ php_error_docref(NULL, E_WARNING, "Not yet implemented"); \
return;
#define DOM_NODELIST 0
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index a42cc9508b..df66fb0bef 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -58,33 +58,33 @@ PHP_METHOD(domprocessinginstruction, __construct)
int name_valid;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMProcessingInstruction::__construct */
@@ -93,12 +93,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1478689192
Since:
*/
-int dom_processinginstruction_target_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_processinginstruction_target_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -114,7 +114,7 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-837822393
Since:
*/
-int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_processinginstruction_data_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep;
xmlChar *content;
@@ -122,7 +122,7 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -136,13 +136,13 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_processinginstruction_data_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 1cefa665aa..fc5f2d50e0 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -72,17 +72,17 @@ PHP_METHOD(domtext, __construct)
size_t value_len;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewText((xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -90,9 +90,9 @@ PHP_METHOD(domtext, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
}
/* }}} end DOMText::__construct */
@@ -102,7 +102,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-wholeText
Since: DOM Level 3
*/
-int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_text_whole_text_read(dom_object *obj, zval *retval)
{
xmlNodePtr node;
xmlChar *wholetext = NULL;
@@ -110,7 +110,7 @@ int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
node = dom_object_get_node(obj);
if (node == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -153,7 +153,7 @@ PHP_FUNCTION(dom_text_split_text)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) {
return;
}
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
@@ -194,7 +194,7 @@ PHP_FUNCTION(dom_text_split_text)
nnode->type = XML_TEXT_NODE;
}
- php_dom_create_object(nnode, return_value, intern TSRMLS_CC);
+ php_dom_create_object(nnode, return_value, intern);
}
/* }}} end dom_text_split_text */
@@ -208,7 +208,7 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content)
xmlNodePtr node;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_text_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_text_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c
index 5267ee6f77..49dddfafcd 100644
--- a/ext/dom/typeinfo.c
+++ b/ext/dom/typeinfo.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeName
Since:
*/
-int dom_typeinfo_type_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_typeinfo_type_name_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeNamespace
Since:
*/
-int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index 9d5ffe8fb6..9fad36d005 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -59,7 +59,7 @@ static inline dom_object *php_dom_obj_from_obj(zend_object *obj) {
PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry;
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj);
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj TSRMLS_DC);
+PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj);
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define DOM_XMLNS_NAMESPACE \
@@ -68,7 +68,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_LIBXML_NODE_P(__id); \
if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", \
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", \
__intern->std.ce->name->val);\
RETURN_NULL();\
} \
@@ -78,18 +78,18 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
__intern = Z_LIBXML_NODE_P(__id); \
if (__intern->document != NULL) { \
if (!(__ptr = (__prtype)__intern->document->ptr)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
RETURN_NULL();\
} \
} \
}
#define DOM_RET_OBJ(obj, ret, domobject) \
- *ret = php_dom_create_object(obj, return_value, domobject TSRMLS_CC)
+ *ret = php_dom_create_object(obj, return_value, domobject)
#define DOM_GET_THIS(zval) \
if (NULL == (zval = getThis())) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object missing"); \
+ php_error_docref(NULL, E_WARNING, "Underlying object missing"); \
RETURN_FALSE; \
}
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 336365e342..c957916156 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -83,9 +83,8 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
zend_string *callable = NULL;
dom_xpath_object *intern;
- TSRMLS_FETCH();
- if (! zend_is_executing(TSRMLS_C)) {
+ if (! zend_is_executing()) {
xmlGenericError(xmlGenericErrorContext,
"xmlExtFunctionTest: Function called from outside of PHP\n");
error = 1;
@@ -159,7 +158,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
node->parent = nsparent;
node->ns = curns;
}
- php_dom_create_object(node, &child, &intern->dom TSRMLS_CC);
+ php_dom_create_object(node, &child, &intern->dom);
add_next_index_zval(&fci.params[i], &child);
}
}
@@ -176,7 +175,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
+ php_error_docref(NULL, E_WARNING, "Handler name must be a string");
xmlXPathFreeObject(obj);
if (fci.param_count > 0) {
for (i = 0; i < nargs - 1; i++) {
@@ -194,16 +193,16 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
fci.retval = &retval;
fci.no_separation = 0;
- if (!zend_make_callable(&fci.function_name, &callable TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable->val);
+ if (!zend_make_callable(&fci.function_name, &callable)) {
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", callable->val);
} else if (intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'.", callable->val);
+ php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'.", callable->val);
/* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
- if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry TSRMLS_CC)) {
+ if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry)) {
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
@@ -218,7 +217,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
} else if (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE) {
valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE));
} else if (Z_TYPE(retval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
+ php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
zend_string *str = zval_get_string(&retval);
@@ -261,18 +260,18 @@ PHP_METHOD(domxpath, __construct)
xmlXPathContextPtr ctx, oldctx;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj);
ctx = xmlXPathNewContext(docp);
if (ctx == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -280,7 +279,7 @@ PHP_METHOD(domxpath, __construct)
if (intern != NULL) {
oldctx = (xmlXPathContextPtr)intern->dom.ptr;
if (oldctx != NULL) {
- php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
xmlXPathFreeContext(oldctx);
}
@@ -294,13 +293,13 @@ PHP_METHOD(domxpath, __construct)
intern->dom.ptr = ctx;
ctx->userData = (void *)intern;
intern->dom.document = docobj->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp);
}
}
/* }}} end DOMXPath::__construct */
/* {{{ document DOMDocument*/
-int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_xpath_document_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = NULL;
xmlXPathContextPtr ctx = (xmlXPathContextPtr) obj->ptr;
@@ -309,7 +308,7 @@ int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC)
docp = (xmlDocPtr) ctx->doc;
}
- php_dom_create_object((xmlNodePtr) docp, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) docp, retval, obj);
return SUCCESS;
}
/* }}} */
@@ -323,7 +322,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
dom_xpath_object *intern;
unsigned char *prefix, *ns_uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
@@ -331,7 +330,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
ctxp = (xmlXPathContextPtr) intern->dom.ptr;
if (ctxp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
@@ -365,7 +364,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
xmlNsPtr *ns = NULL;
zend_bool register_node_ns = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O!b", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry, &register_node_ns) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|O!b", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry, &register_node_ns) == FAILURE) {
return;
}
@@ -373,13 +372,13 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ctxp = (xmlXPathContextPtr) intern->dom.ptr;
if (ctxp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
docp = (xmlDocPtr) ctxp->doc;
if (docp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Document Pointer");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Document Pointer");
RETURN_FALSE;
}
@@ -392,7 +391,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
}
if (nodep && docp != nodep->doc) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node From Wrong Document");
+ php_error_docref(NULL, E_WARNING, "Node From Wrong Document");
RETURN_FALSE;
}
@@ -464,11 +463,11 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
node->parent = nsparent;
node->ns = curns;
}
- php_dom_create_object(node, &child, &intern->dom TSRMLS_CC);
+ php_dom_create_object(node, &child, &intern->dom);
add_next_index_zval(&retval, &child);
}
}
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
nodeobj = Z_DOMOBJ_P(return_value);
dom_xpath_iter(&retval, nodeobj);
break;
@@ -519,7 +518,7 @@ PHP_FUNCTION(dom_xpath_register_php_functions)
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
intern = Z_XPATHOBJ_P(id);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
while ((entry = zend_hash_get_current_data(Z_ARRVAL_P(array_value)))) {
@@ -532,7 +531,7 @@ PHP_FUNCTION(dom_xpath_register_php_functions)
intern->registerPhpFunctions = 2;
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
intern = Z_XPATHOBJ_P(id);
ZVAL_LONG(&new_string, 1);
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index ca33700982..d117fc167e 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -232,7 +232,7 @@ static void php_enchant_list_dicts_fn( const char * const lang_tag,
}
/* }}} */
-static void php_enchant_broker_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_enchant_broker_free(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
enchant_broker *broker = (enchant_broker *)rsrc->ptr;
@@ -263,7 +263,7 @@ static void php_enchant_broker_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_enchant_dict_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_enchant_dict_free(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
@@ -340,14 +340,14 @@ PHP_MINFO_FUNCTION(enchant)
#define PHP_ENCHANT_GET_BROKER \
ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, broker, -1, "enchant_broker", le_enchant_broker); \
if (!pbroker || !pbroker->pbroker) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \
+ php_error_docref(NULL, E_WARNING, "%s", "Resource broker invalid"); \
RETURN_FALSE; \
}
#define PHP_ENCHANT_GET_DICT \
ZEND_FETCH_RESOURCE(pdict, enchant_dict *, dict, -1, "enchant_dict", le_enchant_dict); \
if (!pdict || !pdict->pdict) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \
+ php_error_docref(NULL, E_WARNING, "%s", "Invalid dictionary resource."); \
RETURN_FALSE; \
}
@@ -383,7 +383,7 @@ PHP_FUNCTION(enchant_broker_free)
zval *broker;
enchant_broker *pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
@@ -401,7 +401,7 @@ PHP_FUNCTION(enchant_broker_get_error)
enchant_broker *pbroker;
char *msg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -426,7 +426,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
char *value;
size_t value_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
RETURN_FALSE;
}
@@ -465,7 +465,7 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
zend_long dict_type;
char *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &broker, &dict_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &broker, &dict_type) == FAILURE) {
RETURN_FALSE;
}
@@ -515,7 +515,7 @@ PHP_FUNCTION(enchant_broker_list_dicts)
zval *broker;
enchant_broker *pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -538,14 +538,14 @@ PHP_FUNCTION(enchant_broker_request_dict)
size_t taglen;
int pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
if (taglen == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tag cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Tag cannot be empty");
RETURN_FALSE;
}
@@ -586,14 +586,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
size_t pwllen;
int pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &broker, &pwl, &pwllen) == FAILURE) {
RETURN_FALSE;
}
#if PHP_API_VERSION < 20100412
- if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl)) {
#else
- if (php_check_open_basedir(pwl TSRMLS_CC)) {
+ if (php_check_open_basedir(pwl)) {
#endif
RETURN_FALSE;
}
@@ -631,7 +631,7 @@ PHP_FUNCTION(enchant_broker_free_dict)
zval *dict;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
@@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_dict_exists)
size_t taglen;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
@@ -677,7 +677,7 @@ PHP_FUNCTION(enchant_broker_set_ordering)
size_t ptaglen;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
RETURN_FALSE;
}
@@ -696,7 +696,7 @@ PHP_FUNCTION(enchant_broker_describe)
zval *broker;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -716,7 +716,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
RETURN_FALSE;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(enchant_dict_check)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -784,7 +784,7 @@ PHP_FUNCTION(enchant_dict_suggest)
int n_sugg;
size_t n_sugg_st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -814,7 +814,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -833,7 +833,7 @@ PHP_FUNCTION(enchant_dict_add_to_session)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -852,7 +852,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -875,7 +875,7 @@ PHP_FUNCTION(enchant_dict_store_replacement)
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
RETURN_FALSE;
}
@@ -893,7 +893,7 @@ PHP_FUNCTION(enchant_dict_get_error)
enchant_dict *pdict;
char *msg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
@@ -915,7 +915,7 @@ PHP_FUNCTION(enchant_dict_describe)
zval *dict;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/ereg/config.w32 b/ext/ereg/config.w32
index 18a002b44d..887fb0e5b0 100644
--- a/ext/ereg/config.w32
+++ b/ext/ereg/config.w32
@@ -4,7 +4,7 @@
ARG_WITH("ereg", "POSIX extended regular expressions", "yes");
if (PHP_EREG != "no") {
- EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex");
+ EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg");
AC_DEFINE('REGEX', 1, 'Bundled regex');
AC_DEFINE('HSREGEX', 1, 'Bundled regex');
diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4
index caec39d285..2089f24a46 100644
--- a/ext/ereg/config0.m4
+++ b/ext/ereg/config0.m4
@@ -33,6 +33,7 @@ if test "$REGEX_TYPE" = "php"; then
ereg_regex_headers="regex/"
PHP_EREG_CFLAGS="-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp"
fi
+PHP_EREG_CFLAGS="$PHP_EREG_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no,,$PHP_EREG_CFLAGS)
PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers])
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index c626fef5c7..7d478d682f 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -103,7 +103,7 @@ ZEND_GET_MODULE(ereg)
/* }}} */
/* {{{ ereg_lru_cmp */
-static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
+static int ereg_lru_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -121,7 +121,7 @@ static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
/* }}} */
/* {{{ static ereg_clean_cache */
-static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
+static int ereg_clean_cache(zval *data, void *arg)
{
int *num_clean = (int *)arg;
@@ -136,7 +136,7 @@ static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
/* {{{ _php_regcomp
*/
-static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC)
+static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
{
int r = 0;
int patlen = strlen(pattern);
@@ -144,12 +144,12 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC
if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) {
/* easier than dealing with overflow as it happens */
- if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0 TSRMLS_CC) == FAILURE) {
+ if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0) == FAILURE) {
zend_hash_clean(&EREG(ht_rc));
EREG(lru_counter) = 0;
} else {
int num_clean = EREG_CACHE_SIZE / 4;
- zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean TSRMLS_CC);
+ zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean);
}
}
@@ -215,7 +215,7 @@ static void _free_ereg_cache(zval *zv)
#undef regfree
#define regfree(a);
#undef regcomp
-#define regcomp(a, b, c) _php_regcomp(a, b, c TSRMLS_CC)
+#define regcomp(a, b, c) _php_regcomp(a, b, c)
/* {{{ PHP_GINIT_FUNCTION
*/
@@ -249,7 +249,7 @@ PHP_MINFO_FUNCTION(ereg)
/* {{{ php_ereg_eprint
* php_ereg_eprint - convert error number to name
*/
-static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
+static void php_ereg_eprint(int err, regex_t *re) {
char *buf = NULL, *message = NULL;
size_t len;
size_t buf_len;
@@ -279,7 +279,7 @@ static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
/* drop the message into place */
regerror(err, re, message + buf_len, len);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
}
if (buf) efree(buf);
@@ -305,7 +305,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
char *string = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
+ if (zend_parse_parameters(argc, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
return;
}
@@ -331,7 +331,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -344,7 +344,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* actually execute the regular expression */
err = regexec(&re, string, re.re_nsub+1, subs, 0);
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
efree(subs);
RETURN_FALSE;
@@ -403,7 +403,7 @@ PHP_FUNCTION(eregi)
/* {{{ php_ereg_replace
* this is the meat and potatoes of regex replacement! */
-PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC)
+PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended)
{
regex_t re;
regmatch_t *subs;
@@ -427,7 +427,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regcomp(&re, pattern, copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
return ((char *) -1);
}
@@ -446,7 +446,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0));
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
efree(subs);
efree(buf);
regfree(&re);
@@ -559,7 +559,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
zend_string *replace;
char *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
return;
}
@@ -596,7 +596,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
/* do the actual work */
- ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1 TSRMLS_CC);
+ ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1);
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
@@ -637,7 +637,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
size_t spliton_len, str_len;
int err, size, copts = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
return;
}
@@ -650,7 +650,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
err = regcomp(&re, spliton, REG_EXTENDED | copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -667,7 +667,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* No more matches */
regfree(&re);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression");
+ php_error_docref(NULL, E_WARNING, "Invalid Regular Expression");
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -694,7 +694,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* see if we encountered an error */
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -737,7 +737,7 @@ PHP_EREG_API PHP_FUNCTION(sql_regcase)
unsigned char c;
register int i, j;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &string, &string_len) == FAILURE) {
return;
}
diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h
index f1c2676772..4396fb9304 100644
--- a/ext/ereg/php_ereg.h
+++ b/ext/ereg/php_ereg.h
@@ -35,7 +35,7 @@ extern zend_module_entry ereg_module_entry;
# define PHP_EREG_API
#endif
-PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC);
+PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended);
PHP_FUNCTION(ereg);
PHP_FUNCTION(eregi);
@@ -54,7 +54,7 @@ ZEND_END_MODULE_GLOBALS(ereg)
PHP_MINFO_FUNCTION(ereg);
#ifdef ZTS
-#define EREG(v) TSRMG(ereg_globals_id, zend_ereg_globals *, v)
+#define EREG(v) ZEND_TSRMG(ereg_globals_id, zend_ereg_globals *, v)
#else
#define EREG(v) (ereg_globals.v)
#endif
diff --git a/ext/exif/config.m4 b/ext/exif/config.m4
index a3ba9240df..8a3a0d43c2 100644
--- a/ext/exif/config.m4
+++ b/ext/exif/config.m4
@@ -7,5 +7,5 @@ PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support,
if test "$PHP_EXIF" != "no"; then
AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support])
- PHP_NEW_EXTENSION(exif, exif.c, $ext_shared)
+ PHP_NEW_EXTENSION(exif, exif.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
diff --git a/ext/exif/config.w32 b/ext/exif/config.w32
index 38466c809c..595e71bda0 100644
--- a/ext/exif/config.w32
+++ b/ext/exif/config.w32
@@ -5,7 +5,7 @@ ARG_ENABLE("exif", "exif", "no");
if (PHP_EXIF == "yes") {
if (ADD_EXTENSION_DEP('exif', 'mbstring')) {
- EXTENSION("exif", "exif.c");
+ EXTENSION("exif", "exif.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_EXIF', 1, 'Have exif');
} else {
WARNING("exif support can't be enabled, libxml is not enabled")
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 06e1dae41a..b1e6167b2f 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -50,11 +50,11 @@
#undef EXIF_DEBUG
#ifdef EXIF_DEBUG
-#define EXIFERR_DC , const char *_file, size_t _line TSRMLS_DC
-#define EXIFERR_CC , __FILE__, __LINE__ TSRMLS_CC
+#define EXIFERR_DC , const char *_file, size_t _line
+#define EXIFERR_CC , __FILE__, __LINE__
#else
-#define EXIFERR_DC TSRMLS_DC
-#define EXIFERR_CC TSRMLS_CC
+#define EXIFERR_DC
+#define EXIFERR_CC
#endif
#undef EXIF_JPEG2000
@@ -156,7 +156,10 @@ ZEND_END_MODULE_GLOBALS(exif)
ZEND_DECLARE_MODULE_GLOBALS(exif)
#ifdef ZTS
-#define EXIF_G(v) TSRMG(exif_globals_id, zend_exif_globals *, v)
+#define EXIF_G(v) ZEND_TSRMG(exif_globals_id, zend_exif_globals *, v)
+#ifdef COMPILE_DL_EXIF
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
#else
#define EXIF_G(v) (exif_globals.v)
#endif
@@ -170,13 +173,13 @@ ZEND_INI_MH(OnUpdateEncode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
ZEND_INI_MH(OnUpdateDecode)
@@ -185,13 +188,13 @@ ZEND_INI_MH(OnUpdateDecode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
PHP_INI_BEGIN()
@@ -208,6 +211,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(exif)
{
+#if defined(COMPILE_DL_EXIF) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
exif_globals->encode_unicode = NULL;
exif_globals->decode_unicode_be = NULL;
exif_globals->decode_unicode_le = NULL;
@@ -997,7 +1003,7 @@ static const maker_note_type maker_note_array[] = {
/* {{{ exif_get_tagname
Get headername for tag_num or NULL if not defined */
-static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC)
+static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table)
{
int i, t;
char tmp[32];
@@ -1154,7 +1160,7 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
/* }}} */
#ifdef EXIF_DEBUG
-char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr TSRMLS_DC) /* {{{ */
+char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr) /* {{{ */
{
char *dump;
int len;
@@ -1229,7 +1235,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
/* {{{ exif_convert_any_format
* Evaluate number, be it int, rational, or float from directory. */
-static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC)
+static double exif_convert_any_format(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1263,12 +1269,12 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (double)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return *(double *)value;
}
@@ -1278,7 +1284,7 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* {{{ exif_convert_any_to_int
* Evaluate number, be it int, rational, or float from directory. */
-static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC)
+static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1312,12 +1318,12 @@ static size_t exif_convert_any_to_int(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (size_t)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return (size_t)*(double *)value;
}
@@ -1449,7 +1455,7 @@ static tag_table_type exif_get_tag_table(int section)
/* {{{ exif_get_sectionlist
Return list of sectionnames specified by sectionlist. Return value must be freed
*/
-static char *exif_get_sectionlist(int sectionlist TSRMLS_DC)
+static char *exif_get_sectionlist(int sectionlist)
{
int i, len, ml = 0;
char *sections;
@@ -1571,11 +1577,11 @@ static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_ty
char *buf;
spprintf(&buf, 0, "%s(%d): %s", _file, _line, format);
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args);
efree(buf);
}
#else
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args);
#endif
va_end(args);
}
@@ -1621,7 +1627,7 @@ static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t s
/* {{{ exif_file_sections_realloc
Reallocate a file section returns 0 on success and -1 on failure
*/
-static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC)
+static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size)
{
void *tmp;
@@ -1660,7 +1666,7 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
/* {{{ exif_iif_add_value
Add a value to image_info
*/
-static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
+static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel)
{
size_t idex;
void *vptr;
@@ -1767,13 +1773,13 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type single");
+ php_error_docref(NULL, E_WARNING, "Found value of type single");
#endif
info_value->f = *(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type double");
+ php_error_docref(NULL, E_WARNING, "Found value of type double");
#endif
info_value->d = *(double *)value;
break;
@@ -1788,16 +1794,16 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
/* {{{ exif_iif_add_tag
Add a tag from IFD to image_info
*/
-static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
+static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value)
{
- exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
+ exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel);
}
/* }}} */
/* {{{ exif_iif_add_int
Add an int value to image_info
*/
-static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC)
+static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1819,7 +1825,7 @@ static void exif_iif_add_int(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC)
+static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1842,7 +1848,7 @@ static void exif_iif_add_str(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_fmt
Add a format string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...)
+static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name, char *value, ...)
{
char *tmp;
va_list arglist;
@@ -1850,7 +1856,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
va_start(arglist, value);
if (value) {
vspprintf(&tmp, 0, value, arglist);
- exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC);
+ exif_iif_add_str(image_info, section_index, name, tmp);
efree(tmp);
}
va_end(arglist);
@@ -1860,7 +1866,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC)
+static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1932,7 +1938,7 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
/* {{{ add_assoc_image_info
* Add image_info to associative array value. */
-static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC)
+static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index)
{
char buffer[64], *val, *name, uname[64];
int i, ap, l, b, idx=0, unknown=0;
@@ -1944,7 +1950,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
zval tmpi, array;
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
#endif
if (image_info->info_list[section_index].count) {
if (sub_array) {
@@ -1964,7 +1970,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
name = uname;
}
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index) TSRMLS_CC), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:"<no data>"):exif_get_tagformat(info_data->format));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index)), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:"<no data>"):exif_get_tagformat(info_data->format));*/
#endif
if (info_data->length==0) {
add_assoc_null(&tmpi, name);
@@ -2209,9 +2215,9 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
We want to print out the marker contents as legible text;
we must guard against random junk and varying newline representations.
*/
-static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_COM (image_info_type *image_info, char *value, size_t length)
{
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
}
/* }}} */
@@ -2221,23 +2227,23 @@ static void exif_process_COM (image_info_type *image_info, char *value, size_t l
we must guard against random junk and varying newline representations.
*/
#ifdef EXIF_JPEG2000
-static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_CME (image_info_type *image_info, char *value, size_t length)
{
if (length>3) {
switch(value[2]) {
case 0:
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value);
break;
case 1:
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Undefined JPEG2000 comment encoding");
+ php_error_docref(NULL, E_NOTICE, "Undefined JPEG2000 comment encoding");
break;
}
} else {
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section too small");
+ php_error_docref(NULL, E_NOTICE, "JPEG2000 comment section too small");
}
}
#endif
@@ -2273,8 +2279,8 @@ static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
/* }}} */
/* forward declarations */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC);
-static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC);
+static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index);
+static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table);
/* {{{ exif_get_markername
Get name of marker */
@@ -2337,11 +2343,11 @@ PHP_FUNCTION(exif_tagname)
zend_long tag;
char *szTemp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &tag) == FAILURE) {
return;
}
- szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD TSRMLS_CC);
+ szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD);
if (tag < 0 || !szTemp || !szTemp[0]) {
RETURN_FALSE;
@@ -2353,7 +2359,7 @@ PHP_FUNCTION(exif_tagname)
/* {{{ exif_ifd_make_value
* Create a value for an ifd from an info_data pointer */
-static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) {
+static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel) {
size_t byte_count;
char *value_ptr, *data_ptr;
size_t i;
@@ -2429,7 +2435,7 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
/* {{{ exif_thumbnail_build
* Check and build thumbnail */
-static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
+static void exif_thumbnail_build(image_info_type *ImageInfo) {
size_t new_size, new_move, new_value;
char *new_data;
void *value_ptr;
@@ -2484,7 +2490,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
info_data = &info_list->list[i];
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
#ifdef EXIF_DEBUG
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD TSRMLS_CC), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count);
#endif
if (info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
@@ -2495,7 +2501,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel);
php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel);
- value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel TSRMLS_CC);
+ value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel);
if (byte_count <= 4) {
memmove(new_data+8, value_ptr, 4);
} else {
@@ -2521,7 +2527,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
/* {{{ exif_thumbnail_extract
* Grab the thumbnail, corrected */
-static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) {
+static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length) {
if (ImageInfo->Thumbnail.data) {
exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails");
return; /* Should not happen */
@@ -2543,13 +2549,13 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
return;
}
ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
/* }}} */
/* {{{ exif_process_undefined
* Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */
-static int exif_process_undefined(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_undefined(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
* chars up to byte_count, we also have to add a single NUL character to
* force end of string.
@@ -2583,7 +2589,7 @@ static int exif_process_string_raw(char **result, char *value, size_t byte_count
/* {{{ exif_process_string
* Copy a string in Exif header to a character string and return length of allocated buffer if any.
* In contrast to exif_process_string this function does always return a string buffer */
-static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_string(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we cannot use strlen to
* determin length of string and we cannot use strlcpy with len=byte_count+1
* because then we might get into an EXCEPTION if we exceed an allocated
@@ -2592,7 +2598,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
* estrdup would sometimes allocate more memory and does not return length
*/
if ((byte_count=php_strnlen(value, byte_count)) > 0) {
- return exif_process_undefined(result, value, byte_count TSRMLS_CC);
+ return exif_process_undefined(result, value, byte_count);
}
(*result) = estrndup("", 1); /* force empty string */
return byte_count+1;
@@ -2601,7 +2607,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
/* {{{ exif_process_user_comment
* Process UserComment in IFD. */
-static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount)
{
int a;
char *decode;
@@ -2636,9 +2642,9 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(decode TSRMLS_CC)
- TSRMLS_CC) == (size_t)-1) {
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(decode)
+ ) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
return len;
@@ -2657,9 +2663,9 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC)
- TSRMLS_CC) == (size_t)-1) {
+ zend_multibyte_fetch_encoding(ImageInfo->encode_jis),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le)
+ ) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
return len;
@@ -2679,14 +2685,14 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
}
/* normal text without encoding */
- exif_process_string(pszInfoPtr, szValuePtr, ByteCount TSRMLS_CC);
+ exif_process_string(pszInfoPtr, szValuePtr, ByteCount);
return strlen(*pszInfoPtr);
}
/* }}} */
/* {{{ exif_process_unicode
* Process unicode field in IFD. */
-static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount)
{
xp_field->tag = tag;
@@ -2696,9 +2702,9 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
&xp_field->size,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC)
- TSRMLS_CC) == (size_t)-1) {
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le)
+ ) == (size_t)-1) {
xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount);
}
return xp_field->size;
@@ -2707,7 +2713,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
/* {{{ exif_process_IFD_in_MAKERNOTE
* Process nested IFDs directories in Maker Note. */
-static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
+static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement)
{
int de, i=0, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel, offset_diff;
@@ -2775,7 +2781,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
return FALSE;
}
}
@@ -2790,7 +2796,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
/* {{{ exif_process_IFD_TAG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC)
+static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
{
size_t length;
int tag, format, components;
@@ -2816,20 +2822,20 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (!format || format > NUM_FORMATS) {
/* (-1) catches illegal zero case as unsigned underflows to positive large. */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), format);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table), format);
format = TAG_FMT_BYTE;
/*return TRUE;*/
}
if (components < 0) {
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), components);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
return FALSE;
}
byte_count_signed = (int64_t)components * php_tiff_bytes_per_format[format];
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC));
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname(tag, tagname, -12, tag_table));
return FALSE;
}
@@ -2852,11 +2858,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (value_ptr < dir_entry) {
/* we can read this if offset_val > 0 */
/* some files have their values in other parts of the file */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, dir_entry);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, dir_entry);
} else {
/* this is for sure not allowed */
/* exception are IFD pointers */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, byte_count, offset_val+byte_count, IFDlength);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, byte_count, offset_val+byte_count, IFDlength);
}
return FALSE;
}
@@ -2898,8 +2904,8 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_ANY_TAG;
#ifdef EXIF_DEBUG
- dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr TSRMLS_CC);
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data);
+ dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data);
if (dump_free) {
efree(dump_data);
}
@@ -2910,18 +2916,18 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
switch(tag) {
case TAG_IMAGEWIDTH:
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_IMAGEHEIGHT:
case TAG_COMP_IMAGE_HEIGHT:
- ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_OFFSETS:
case TAG_JPEG_INTERCHANGE_FORMAT:
/* accept both formats */
- ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_BYTE_COUNTS:
@@ -2931,13 +2937,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* motorola is easier to read */
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM;
}
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_JPEG_INTERCHANGE_FORMAT_LEN:
if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) {
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG;
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
}
break;
}
@@ -2963,7 +2969,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_USERCOMMENT:
- ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count TSRMLS_CC);
+ ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
break;
case TAG_XP_TITLE:
@@ -2975,13 +2981,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_WINXP;
ImageInfo->xp_fields.list = tmp_xp;
ImageInfo->xp_fields.count++;
- exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count TSRMLS_CC);
+ exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count);
break;
case TAG_FNUMBER:
/* Simplest way of expressing aperture, so I trust it the most.
(overwrite previously computed value if there is one) */
- ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_APERTURE:
@@ -2990,7 +2996,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
have appropriate aperture information yet. */
if (ImageInfo->ApertureFNumber == 0) {
ImageInfo->ApertureFNumber
- = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)*0.5);
+ = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
}
break;
@@ -3001,7 +3007,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
*/
if (ImageInfo->ExposureTime == 0) {
ImageInfo->ExposureTime
- = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)));
+ = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
}
break;
case TAG_EXPOSURETIME:
@@ -3009,21 +3015,21 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_X_RES:
- ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_SUBJECT_DISTANCE:
/* Inidcates the distacne the autofocus camera is focused to.
Tends to be less accurate as distance increases. */
- ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_RESOLUTION_UNIT:
- switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)) {
+ switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) {
case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */
case 2:
/* According to the information I was using, 2 measn meters.
@@ -3055,7 +3061,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_MAKER_NOTE:
- exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC);
+ exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement);
break;
case TAG_EXIF_IFD_POINTER:
@@ -3092,7 +3098,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
return FALSE;
}
- if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC)) {
+ if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index)) {
return FALSE;
}
#ifdef EXIF_DEBUG
@@ -3101,7 +3107,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
}
}
}
- exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table TSRMLS_CC), tag, format, components, value_ptr TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr);
EFREE_IF(outside);
return TRUE;
}
@@ -3109,7 +3115,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* {{{ exif_process_IFD_in_JPEG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC)
+static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index)
{
int de;
int NumDirEntries;
@@ -3130,7 +3136,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index) TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index))) {
return FALSE;
}
}
@@ -3155,7 +3161,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail");
#endif
- if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL TSRMLS_CC)) {
+ if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL)) {
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size);
#endif
@@ -3164,7 +3170,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
&& ImageInfo->Thumbnail.offset
&& ImageInfo->read_thumbnail
) {
- exif_thumbnail_extract(ImageInfo, offset_base, IFDlength TSRMLS_CC);
+ exif_thumbnail_extract(ImageInfo, offset_base, IFDlength);
}
return TRUE;
} else {
@@ -3178,7 +3184,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
/* {{{ exif_process_TIFF_in_JPEG
Process a TIFF header in a JPEG file
*/
-static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
unsigned exif_value_2a, offset_of_ifd;
@@ -3206,7 +3212,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
ImageInfo->sections_found |= FOUND_IFD0;
/* First directory starts at offset 8. Offsets starts at 0. */
- exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0 TSRMLS_CC);
+ exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done");
@@ -3223,7 +3229,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
Process an JPEG APP1 block marker
Describes all the drivel that most digital cameras include...
*/
-static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
/* Check the APP1 for Exif Identifier Code */
static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
@@ -3231,7 +3237,7 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code");
return;
}
- exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8 TSRMLS_CC);
+ exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done");
#endif
@@ -3241,15 +3247,15 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
/* {{{ exif_process_APP12
Process an JPEG APP12 block marker used by OLYMPUS
*/
-static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length TSRMLS_DC)
+static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length)
{
size_t l1, l2=0;
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1);
}
}
#ifdef EXIF_DEBUG
@@ -3260,7 +3266,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
/* {{{ exif_scan_JPEG_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_JPEG_header(image_info_type *ImageInfo)
{
int section, sn;
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
@@ -3368,7 +3374,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE;
case M_COM: /* Comment section */
- exif_process_COM(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_COM(ImageInfo, (char *)Data, itemlen);
break;
case M_EXIF:
@@ -3376,12 +3382,12 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/*ImageInfo->sections_found |= FOUND_EXIF;*/
/* Seen files from some 'U-lead' software with Vivitar scanner
that uses marker 31 later in the file (no clue what for!) */
- exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos TSRMLS_CC);
+ exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos);
}
break;
case M_APP12:
- exif_process_APP12(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_APP12(ImageInfo, (char *)Data, itemlen);
break;
@@ -3428,7 +3434,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_scan_thumbnail
* scan JPEG in thumbnail (memory) */
-static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
@@ -3512,7 +3518,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_process_IFD_in_TIFF
* Parse the TIFF header; */
-static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index TSRMLS_DC)
+static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index)
{
int i, sn, num_entries, sub_section_index = 0;
unsigned char *dir_entry;
@@ -3538,7 +3544,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
#endif
- if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, dir_size)) {
return FALSE;
}
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2);
@@ -3554,7 +3560,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel);
entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel);
if (entry_type > NUM_FORMATS) {
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table TSRMLS_CC), entry_type);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table), entry_type);
/* Since this is repeated in exif_process_IFD_TAG make it a notice here */
/* and make it a warning in the exif_process_IFD_TAG which is called */
/* elsewhere. */
@@ -3623,7 +3629,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
return FALSE;
}
- if (exif_file_sections_realloc(ImageInfo, sn, ifd_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, ifd_size)) {
return FALSE;
}
/* read values not stored in directory itself */
@@ -3669,7 +3675,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index);
if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) {
if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN
&& ImageInfo->Thumbnail.size
@@ -3686,7 +3692,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
}
}
@@ -3696,7 +3702,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
} else {
if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry,
(char*)(ImageInfo->file.list[sn].data-dir_offset),
- ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) {
+ ifd_size, 0, section_index, 0, tag_table)) {
return FALSE;
}
}
@@ -3709,7 +3715,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
#endif
@@ -3720,7 +3726,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
@@ -3744,7 +3750,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
/* {{{ exif_scan_FILE_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_FILE_header(image_info_type *ImageInfo)
{
unsigned char file_header[8];
int ret = FALSE;
@@ -3758,7 +3764,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
}
if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) {
ImageInfo->FileType = IMAGE_FILETYPE_JPEG;
- if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) {
+ if (exif_scan_JPEG_header(ImageInfo)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file");
@@ -3776,7 +3782,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3790,7 +3796,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3844,7 +3850,7 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
/* {{{ exif_read_file
*/
-static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all TSRMLS_DC)
+static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
{
int ret;
zend_stat_t st;
@@ -3882,7 +3888,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
}
}
- base = php_basename(FileName, strlen(FileName), NULL, 0 TSRMLS_CC);
+ base = php_basename(FileName, strlen(FileName), NULL, 0);
ImageInfo->FileName = estrndup(base->val, base->len);
zend_string_release(base);
ImageInfo->read_thumbnail = read_thumbnail;
@@ -3900,7 +3906,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
ImageInfo->ifd_nesting_level = 0;
/* Scan the JPEG headers. */
- ret = exif_scan_FILE_header(ImageInfo TSRMLS_CC);
+ ret = exif_scan_FILE_header(ImageInfo);
php_stream_close(ImageInfo->infile);
return ret;
@@ -3919,7 +3925,7 @@ PHP_FUNCTION(exif_read_data)
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
return;
}
@@ -3944,7 +3950,7 @@ PHP_FUNCTION(exif_read_data)
EFREE_IF(sections_str);
/* now see what we need */
#ifdef EXIF_DEBUG
- sections_str = exif_get_sectionlist(sections_needed TSRMLS_CC);
+ sections_str = exif_get_sectionlist(sections_needed);
if (!sections_str) {
RETURN_FALSE;
}
@@ -3953,8 +3959,8 @@ PHP_FUNCTION(exif_read_data)
#endif
}
- ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all TSRMLS_CC);
- sections_str = exif_get_sectionlist(ImageInfo.sections_found TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all);
+ sections_str = exif_get_sectionlist(ImageInfo.sections_found);
#ifdef EXIF_DEBUG
if (sections_str)
@@ -3977,81 +3983,81 @@ PHP_FUNCTION(exif_read_data)
#endif
/* now we can add our information */
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType) TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType));
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE");
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED");
#endif
if (ImageInfo.Width>0 && ImageInfo.Height>0) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" TSRMLS_CC, "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width TSRMLS_CC);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" , "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor);
if (ImageInfo.motorola_intel != -1) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel);
}
if (ImageInfo.FocalLength) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength", "%4.1Fmm", ImageInfo.FocalLength);
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength", "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
}
}
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth" TSRMLS_CC, "%dmm", (int)ImageInfo.CCDWidth);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth);
}
if(ImageInfo.ExposureTime>0) {
if(ImageInfo.ExposureTime <= 0.5) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime);
}
}
if(ImageInfo.ApertureFNumber) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber", "f/%.1F", ImageInfo.ApertureFNumber);
}
if(ImageInfo.Distance) {
if(ImageInfo.Distance<0) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite");
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "%0.2Fm", ImageInfo.Distance);
}
}
if (ImageInfo.UserComment) {
- exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment TSRMLS_CC);
+ exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment);
if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding);
}
}
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor);
for (i=0; i<ImageInfo.xp_fields.count; i++) {
- exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP) TSRMLS_CC), ImageInfo.xp_fields.list[i].value TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP)), ImageInfo.xp_fields.list[i].value);
}
if (ImageInfo.Thumbnail.size) {
if (read_thumbnail) {
/* not exif_iif_add_str : this is a buffer */
- exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data TSRMLS_CC);
+ exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data);
}
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
/* try to evaluate if thumbnail data is present */
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype) TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype));
}
if (ImageInfo.Thumbnail.width && ImageInfo.Thumbnail.height) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width);
}
EFREE_IF(sections_str);
@@ -4059,19 +4065,19 @@ PHP_FUNCTION(exif_read_data)
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos");
#endif
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE TSRMLS_CC);
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE );
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info");
@@ -4080,7 +4086,7 @@ PHP_FUNCTION(exif_read_data)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, Z_STRVAL_PP(p_name), E_NOTICE, "done");
+ php_error_docref1(NULL, Z_STRVAL_PP(p_name), E_NOTICE, "done");
#endif
}
/* }}} */
@@ -4101,11 +4107,11 @@ PHP_FUNCTION(exif_thumbnail)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(arg_c TSRMLS_CC, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
+ if (zend_parse_parameters(arg_c, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
return;
}
- ret = exif_read_file(&ImageInfo, p_name, 1, 0 TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, 1, 0);
if (ret==FALSE) {
exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
@@ -4126,7 +4132,7 @@ PHP_FUNCTION(exif_thumbnail)
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
if (arg_c >= 3) {
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
zval_dtor(p_width);
zval_dtor(p_height);
@@ -4145,7 +4151,7 @@ PHP_FUNCTION(exif_thumbnail)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, p_name, E_NOTICE, "Done");
+ php_error_docref1(NULL, p_name, E_NOTICE, "Done");
#endif
}
/* }}} */
@@ -4159,7 +4165,7 @@ PHP_FUNCTION(exif_imagetype)
php_stream * stream;
int itype = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &imagefile, &imagefile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
return;
}
@@ -4169,7 +4175,7 @@ PHP_FUNCTION(exif_imagetype)
RETURN_FALSE;
}
- itype = php_getimagetype(stream, NULL TSRMLS_CC);
+ itype = php_getimagetype(stream, NULL);
php_stream_close(stream);
diff --git a/ext/ext_skel b/ext/ext_skel
index c0c398d15e..a1c64640ae 100755
--- a/ext/ext_skel
+++ b/ext/ext_skel
@@ -166,7 +166,7 @@ if test "\$PHP_$EXTNAME" != "no"; then
dnl
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
- PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared)
+ PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
eof
@@ -182,7 +182,7 @@ cat >config.w32 <<eof
// ARG_ENABLE("$extname", "enable $extname support", "no");
if (PHP_$EXTNAME != "no") {
- EXTENSION("$extname", "$extname.c");
+ EXTENSION("$extname", "$extname.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
}
eof
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 6879926eca..c89748c9e8 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -77,14 +77,14 @@ static inline finfo_object *php_finfo_fetch_object(zend_object *obj) {
finfo_object *obj = Z_FINFO_P(object); \
finfo = obj->ptr; \
if (!finfo) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The invalid fileinfo object."); \
+ php_error_docref(NULL, E_WARNING, "The invalid fileinfo object."); \
RETURN_FALSE; \
} \
}
/* {{{ finfo_objects_free
*/
-static void finfo_objects_free(zend_object *object TSRMLS_DC)
+static void finfo_objects_free(zend_object *object)
{
finfo_object *intern = php_finfo_fetch_object(object);
@@ -93,19 +93,19 @@ static void finfo_objects_free(zend_object *object TSRMLS_DC)
efree(intern->ptr);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
/* {{{ finfo_objects_new
*/
-PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type TSRMLS_DC)
+PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type)
{
finfo_object *intern;
intern = ecalloc(1, sizeof(finfo_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &finfo_object_handlers;
@@ -176,7 +176,7 @@ zend_function_entry finfo_class_functions[] = {
#define FINFO_SET_OPTION(magic, options) \
if (magic_setflags(magic, options) == -1) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%pd' %d:%s", \
+ php_error_docref(NULL, E_WARNING, "Failed to set option '%pd' %d:%s", \
options, magic_errno(magic), magic_error(magic)); \
RETURN_FALSE; \
}
@@ -185,7 +185,7 @@ zend_function_entry finfo_class_functions[] = {
static int le_fileinfo;
/* }}} */
-void finfo_resource_destructor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void finfo_resource_destructor(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
php_fileinfo *finfo = (php_fileinfo *) rsrc->ptr;
@@ -217,7 +217,7 @@ PHP_MINIT_FUNCTION(finfo)
zend_class_entry _finfo_class_entry;
INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions);
_finfo_class_entry.create_object = finfo_objects_new;
- finfo_class_entry = zend_register_internal_class(&_finfo_class_entry TSRMLS_CC);
+ finfo_class_entry = zend_register_internal_class(&_finfo_class_entry);
/* copy the standard object handlers to you handler table */
memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
@@ -285,7 +285,7 @@ PHP_MINFO_FUNCTION(fileinfo)
#define FILEINFO_DESTROY_OBJECT(object) \
do { \
if (object) { \
- zend_object_store_ctor_failed(Z_OBJ_P(object) TSRMLS_CC); \
+ zend_object_store_ctor_failed(Z_OBJ_P(object)); \
Z_OBJ_P(object) = NULL; \
ZEND_CTOR_MAKE_NULL(); \
} \
@@ -302,7 +302,7 @@ PHP_FUNCTION(finfo_open)
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lp", &options, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -321,11 +321,11 @@ PHP_FUNCTION(finfo_open)
file = NULL;
} else if (file && *file) { /* user specified file, perform open_basedir checks */
- if (php_check_open_basedir(file TSRMLS_CC)) {
+ if (php_check_open_basedir(file)) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
- if (!expand_filepath_with_mode(file, resolved_path, NULL, 0, CWD_EXPAND TSRMLS_CC)) {
+ if (!expand_filepath_with_mode(file, resolved_path, NULL, 0, CWD_EXPAND)) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -339,13 +339,13 @@ PHP_FUNCTION(finfo_open)
if (finfo->magic == NULL) {
efree(finfo);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%pd'.", options);
+ php_error_docref(NULL, E_WARNING, "Invalid mode '%pd'.", options);
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
if (magic_load(finfo->magic, file) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
+ php_error_docref(NULL, E_WARNING, "Failed to load magic database at '%s'.", file);
magic_close(finfo->magic);
efree(finfo);
FILEINFO_DESTROY_OBJECT(object);
@@ -367,7 +367,7 @@ PHP_FUNCTION(finfo_close)
php_fileinfo *finfo;
zval *zfinfo;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfinfo) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zfinfo) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -388,12 +388,12 @@ PHP_FUNCTION(finfo_set_flags)
FILEINFO_DECLARE_INIT_OBJECT(object)
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &options) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zfinfo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zfinfo, &options) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -426,7 +426,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
if (mimetype_emu) {
/* mime_content_type(..) emulation */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &what) == FAILURE) {
return;
}
@@ -442,23 +442,23 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only process string or stream arguments");
+ php_error_docref(NULL, E_WARNING, "Can only process string or stream arguments");
RETURN_FALSE;
}
magic = magic_open(MAGIC_MIME_TYPE);
if (magic_load(magic, NULL) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database.");
+ php_error_docref(NULL, E_WARNING, "Failed to load magic database.");
goto common;
}
} else if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
magic = finfo->magic;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|lr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -504,12 +504,12 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
php_stream_statbuf ssb;
if (buffer == NULL || !*buffer) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty filename or path");
+ php_error_docref(NULL, E_WARNING, "Empty filename or path");
RETVAL_FALSE;
goto clean;
}
- wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
+ wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0);
if (wrap) {
php_stream *stream;
@@ -549,14 +549,14 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only process string or stream arguments");
+ php_error_docref(NULL, E_WARNING, "Can only process string or stream arguments");
}
common:
if (ret_val) {
RETVAL_STRING(ret_val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed identify data %d:%s", magic_errno(magic), magic_error(magic));
+ php_error_docref(NULL, E_WARNING, "Failed identify data %d:%s", magic_errno(magic), magic_error(magic));
RETVAL_FALSE;
}
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index b8e43b602d..2fe559f123 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -303,8 +303,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- if (f == NULL) {
+ php_stream *stream;
+
-+ TSRMLS_FETCH();
-+
+++
+ ms->file = fn;
+ stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
+
@@ -367,8 +366,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ php_stream *dir;
+ php_stream_dirent d;
+
-+ TSRMLS_FETCH();
-
++
memset(mset, 0, sizeof(mset));
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
@@ -551,8 +549,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- fd = -1;
- if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
+
-+ TSRMLS_FETCH();
-+
+++
+ if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
file_oomem(ms, sizeof(*map));
+ efree(map);
@@ -710,8 +707,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
uint32_t i;
+ php_stream *stream;
+
-+ TSRMLS_FETCH();
-
++
- dbname = mkdbname(ms, fn, 1);
+ dbname = mkdbname(ms, fn, 0);
@@ -771,8 +767,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
const char *p, *q;
char *buf;
-+ TSRMLS_FETCH();
-
++
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
@@ -2775,16 +2842,18 @@
@@ -1628,8 +1623,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
- ssize_t nch;
- struct stat tstatbuf;
-#endif
-+ TSRMLS_FETCH();
-
++
if (ms->flags & MAGIC_APPLE)
return 0;
- if (fn == NULL)
@@ -2082,8 +2076,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
- goto done;
+ if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
+ php_socket_t fd;
-+ TSRMLS_FETCH();
-+ if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
++ + if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
+ if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "cdf %d\n", m);
@@ -2177,8 +2170,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ zend_string *res;
+ zval repl;
+ int rep_cnt = 0;
-+ TSRMLS_FETCH();
-
++
(void)setlocale(LC_CTYPE, "C");
- rc = regcomp(&rx, pat, REG_EXTENDED);
- if (rc) {
@@ -2200,7 +2192,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+
+ opts |= PCRE_MULTILINE;
+ convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
+ zval_ptr_dtor(&patt);
+ rep_cnt = -1;
+ goto out;
@@ -2208,7 +2200,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ zval_ptr_dtor(&patt);
+
+ ZVAL_STRING(&repl, rep);
-+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt TSRMLS_CC);
++ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt);
+
+ zval_ptr_dtor(&repl);
+ if (NULL == res) {
@@ -2432,8 +2424,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
- int ispipe = 0;
- off_t pos = (off_t)-1;
+ int no_in_stream = 0;
-+ TSRMLS_FETCH();
-+
+++
+ if (!inname && !stream) {
+ return NULL;
+ }
@@ -2790,8 +2781,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
{
va_list va;
+ char *expanded_format;
-+ TSRMLS_FETCH();
-
++
- /* cuz we use stdout for most, stderr here */
- (void) fflush(stdout);
-
@@ -2805,7 +2795,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
va_end(va);
- (void) fputc('\n', stderr);
+
-+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
++ php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format);
+
+ free(expanded_format);
}
@@ -3103,8 +3093,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ int re_options, rv = -1;
+ pcre_extra *re_extra;
+ zend_string *pattern;
-+ TSRMLS_FETCH();
-+
+++
if (strchr(m->desc, '%') == NULL)
return 0;
@@ -3115,7 +3104,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
- file_magerror(ms, "regex error %d, (%s)", rc, errmsg);
+ pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
-+ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
+ rv = -1;
} else {
- rc = regexec(&rx, m->desc, 0, 0, 0);
@@ -3380,8 +3369,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ zval pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
-+ TSRMLS_FETCH();
-+
++ +
+ options |= PCRE_MULTILINE;
+
+ if (m->str_flags & STRING_IGNORE_CASE) {
@@ -3391,7 +3379,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options);
+
+ l = v = 0;
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
+ zval_ptr_dtor(&pattern);
+ return -1;
+ } else {
@@ -3407,7 +3395,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ haystack = estrndup(ms->search.s, ms->search.s_len);
+
+ /* match v = 0, no match v = 1 */
-+ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
++ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0);
+ /* Free haystack */
+ efree(haystack);
+
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index c1dc5aa1fa..83eb1f44f7 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -960,7 +960,6 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
php_stream *stream;
- TSRMLS_FETCH();
ms->file = fn;
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
@@ -1151,7 +1150,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
php_stream *dir;
php_stream_dirent d;
- TSRMLS_FETCH();
memset(mset, 0, sizeof(mset));
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
@@ -2608,7 +2606,6 @@ apprentice_map(struct magic_set *ms, const char *fn)
php_stream_statbuf st;
- TSRMLS_FETCH();
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
file_oomem(ms, sizeof(*map));
@@ -2761,7 +2758,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
uint32_t i;
php_stream *stream;
- TSRMLS_FETCH();
dbname = mkdbname(ms, fn, 0);
@@ -2820,7 +2816,6 @@ mkdbname(struct magic_set *ms, const char *fn, int strip)
{
const char *p, *q;
char *buf;
- TSRMLS_FETCH();
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
diff --git a/ext/fileinfo/libmagic/fsmagic.c b/ext/fileinfo/libmagic/fsmagic.c
index a7b420ff5d..0f6f4acbdf 100644
--- a/ext/fileinfo/libmagic/fsmagic.c
+++ b/ext/fileinfo/libmagic/fsmagic.c
@@ -94,7 +94,6 @@ file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *
{
int ret, did = 0;
int mime = ms->flags & MAGIC_MIME;
- TSRMLS_FETCH();
if (ms->flags & MAGIC_APPLE)
return 0;
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c
index c7d9a7e4f1..81c5faaafb 100644
--- a/ext/fileinfo/libmagic/funcs.c
+++ b/ext/fileinfo/libmagic/funcs.c
@@ -221,8 +221,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
/* Check if we have a CDF file */
if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
php_socket_t fd;
- TSRMLS_FETCH();
- if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
+ if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "cdf %d\n", m);
@@ -445,13 +444,12 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zend_string *res;
zval repl;
int rep_cnt = 0;
- TSRMLS_FETCH();
(void)setlocale(LC_CTYPE, "C");
opts |= PCRE_MULTILINE;
convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
- if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
zval_ptr_dtor(&patt);
rep_cnt = -1;
goto out;
@@ -459,7 +457,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zval_ptr_dtor(&patt);
ZVAL_STRING(&repl, rep);
- res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt TSRMLS_CC);
+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt);
zval_ptr_dtor(&repl);
if (NULL == res) {
diff --git a/ext/fileinfo/libmagic/magic.c b/ext/fileinfo/libmagic/magic.c
index 7f5cff6a7b..5aeb0084cb 100644
--- a/ext/fileinfo/libmagic/magic.c
+++ b/ext/fileinfo/libmagic/magic.c
@@ -353,7 +353,6 @@ file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
zend_stat_t sb;
ssize_t nbytes = 0; /* number of bytes read from a datafile */
int no_in_stream = 0;
- TSRMLS_FETCH();
if (!inname && !stream) {
return NULL;
diff --git a/ext/fileinfo/libmagic/print.c b/ext/fileinfo/libmagic/print.c
index eb4e6e8ce4..7e4a812818 100644
--- a/ext/fileinfo/libmagic/print.c
+++ b/ext/fileinfo/libmagic/print.c
@@ -60,13 +60,12 @@ file_magwarn(struct magic_set *ms, const char *f, ...)
{
va_list va;
char *expanded_format;
- TSRMLS_FETCH();
va_start(va, f);
if (vasprintf(&expanded_format, f, va)); /* silence */
va_end(va);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
+ php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format);
free(expanded_format);
}
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index e626929c9e..727446b81a 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -360,14 +360,13 @@ check_fmt(struct magic_set *ms, struct magic *m)
int re_options, rv = -1;
pcre_extra *re_extra;
zend_string *pattern;
- TSRMLS_FETCH();
if (strchr(m->desc, '%') == NULL)
return 0;
(void)setlocale(LC_CTYPE, "C");
pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
- if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
rv = -1;
} else {
rv = !pcre_exec(pce, re_extra, m->desc, strlen(m->desc), 0, re_options, NULL, 0);
@@ -2079,8 +2078,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
zval pattern;
int options = 0;
pcre_cache_entry *pce;
- TSRMLS_FETCH();
-
+
options |= PCRE_MULTILINE;
if (m->str_flags & STRING_IGNORE_CASE) {
@@ -2090,7 +2088,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options);
l = v = 0;
- if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
zval_ptr_dtor(&pattern);
return -1;
} else {
@@ -2106,7 +2104,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
haystack = estrndup(ms->search.s, ms->search.s_len);
/* match v = 0, no match v = 1 */
- php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
+ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0);
/* Free haystack */
efree(haystack);
diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c
index 5a0ea0777d..dc61bbffc7 100644
--- a/ext/filter/callback_filter.c
+++ b/ext/filter/callback_filter.c
@@ -26,8 +26,8 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
zval *args;
int status;
- if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
+ if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
+ php_error_docref(NULL, E_WARNING, "First argument is expected to be a valid callback");
zval_ptr_dtor(value);
ZVAL_NULL(value);
return;
@@ -35,7 +35,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
args = safe_emalloc(sizeof(zval), 1, 0);
ZVAL_COPY(&args[0], value);
- status = call_user_function_ex(EG(function_table), NULL, option_array, &retval, 1, args, 0, NULL TSRMLS_CC);
+ status = call_user_function_ex(EG(function_table), NULL, option_array, &retval, 1, args, 0, NULL);
if (status == SUCCESS && !Z_ISUNDEF(retval)) {
zval_ptr_dtor(value);
diff --git a/ext/filter/config.m4 b/ext/filter/config.m4
index 676f5d99ef..d589b10078 100644
--- a/ext/filter/config.m4
+++ b/ext/filter/config.m4
@@ -39,7 +39,7 @@ yes
CPPFLAGS=$old_CPPFLAGS
fi
- PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
+ PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(FILTER_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/filter/php_filter.h])
diff --git a/ext/filter/config.w32 b/ext/filter/config.w32
index b74f3a2fd0..0a9e147569 100644
--- a/ext/filter/config.w32
+++ b/ext/filter/config.w32
@@ -4,6 +4,6 @@
ARG_ENABLE("filter", "Filter Support", "yes");
if (PHP_FILTER == "yes") {
- EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
+ EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c", PHP_FILTER_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
}
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index dec6bfb4ec..20eac4577b 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -78,8 +78,8 @@ static const filter_list_entry filter_list[] = {
#define PARSE_SESSION 6
#endif
-static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC);
-static unsigned int php_sapi_filter_init(TSRMLS_D);
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
+static unsigned int php_sapi_filter_init(void);
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input, 0, 0, 2)
@@ -153,6 +153,9 @@ zend_module_entry filter_module_entry = {
/* }}} */
#ifdef COMPILE_DL_FILTER
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(filter)
#endif
@@ -192,6 +195,9 @@ PHP_INI_END()
static void php_filter_init_globals(zend_filter_globals *filter_globals) /* {{{ */
{
+#if defined(COMPILE_DL_FILTER) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
ZVAL_UNDEF(&filter_globals->post_array);
ZVAL_UNDEF(&filter_globals->get_array);
ZVAL_UNDEF(&filter_globals->cookie_array);
@@ -282,7 +288,7 @@ PHP_MINIT_FUNCTION(filter)
REGISTER_LONG_CONSTANT("FILTER_FLAG_HOSTNAME", FILTER_FLAG_HOSTNAME, CONST_CS | CONST_PERSISTENT);
- sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init TSRMLS_CC);
+ sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init);
return SUCCESS;
}
@@ -351,7 +357,7 @@ static filter_list_entry php_find_filter(zend_long id) /* {{{ */
}
/* }}} */
-static unsigned int php_sapi_filter_init(TSRMLS_D)
+static unsigned int php_sapi_filter_init(void)
{
ZVAL_UNDEF(&IF_G(get_array));
ZVAL_UNDEF(&IF_G(post_array));
@@ -362,7 +368,7 @@ static unsigned int php_sapi_filter_init(TSRMLS_D)
return SUCCESS;
}
-static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, zend_bool copy) /* {{{ */
{
filter_list_entry filter_func;
@@ -392,7 +398,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
/* Here be strings */
convert_to_string(value);
- filter_func.function(value, flags, options, charset TSRMLS_CC);
+ filter_func.function(value, flags, options, charset);
if (options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_P(value) == IS_NULL) ||
@@ -406,7 +412,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
}
/* }}} */
-static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC) /* {{{ */
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len) /* {{{ */
{
zval new_var, raw_var;
zval *array_ptr = NULL, *orig_array_ptr = NULL;
@@ -449,14 +455,14 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
if (array_ptr) {
/* Store the RAW variable internally */
ZVAL_STRINGL(&raw_var, *val, val_len);
- php_register_variable_ex(var, &raw_var, array_ptr TSRMLS_CC);
+ php_register_variable_ex(var, &raw_var, array_ptr);
}
if (val_len) {
/* Register mangled variable */
if (IF_G(default_filter) != FILTER_UNSAFE_RAW) {
ZVAL_STRINGL(&new_var, *val, val_len);
- php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0 TSRMLS_CC);
+ php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0);
} else {
ZVAL_STRINGL(&new_var, *val, val_len);
}
@@ -465,7 +471,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
}
if (orig_array_ptr) {
- php_register_variable_ex(var, &new_var, orig_array_ptr TSRMLS_CC);
+ php_register_variable_ex(var, &new_var, orig_array_ptr);
}
if (retval) {
@@ -485,7 +491,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
}
/* }}} */
-static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, zend_bool copy) /* {{{ */
{
if (Z_TYPE_P(value) == IS_ARRAY) {
zval *element;
@@ -499,19 +505,19 @@ static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long f
SEPARATE_ZVAL_NOREF(element);
if (Z_TYPE_P(element) == IS_ARRAY) {
Z_ARRVAL_P(element)->u.v.nApplyCount++;
- php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter_recursive(element, filter, flags, options, charset, copy);
Z_ARRVAL_P(element)->u.v.nApplyCount--;
} else {
- php_zval_filter(element, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(element, filter, flags, options, charset, copy);
}
} ZEND_HASH_FOREACH_END();
} else {
- php_zval_filter(value, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(value, filter, flags, options, charset, copy);
}
}
/* }}} */
-static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
+static zval *php_filter_get_storage(zend_long arg)/* {{{ */
{
zval *array_ptr = NULL;
@@ -529,7 +535,7 @@ static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
case PARSE_SERVER:
if (PG(auto_globals_jit)) {
zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
}
array_ptr = &IF_G(server_array);
@@ -537,18 +543,18 @@ static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
case PARSE_ENV:
if (PG(auto_globals_jit)) {
zend_string *name = zend_string_init("_ENV", sizeof("_ENV") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
}
array_ptr = &IF_G(env_array) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
break;
case PARSE_SESSION:
/* FIXME: Implement session source */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_SESSION is not yet implemented");
+ php_error_docref(NULL, E_WARNING, "INPUT_SESSION is not yet implemented");
break;
case PARSE_REQUEST:
/* FIXME: Implement request source */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_REQUEST is not yet implemented");
+ php_error_docref(NULL, E_WARNING, "INPUT_REQUEST is not yet implemented");
break;
}
@@ -565,11 +571,11 @@ PHP_FUNCTION(filter_has_var)
zend_string *var;
zval *array_ptr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lS", &arg, &var) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS", &arg, &var) == FAILURE) {
RETURN_FALSE;
}
- array_ptr = php_filter_get_storage(arg TSRMLS_CC);
+ array_ptr = php_filter_get_storage(arg);
if (array_ptr && HASH_OF(array_ptr) && zend_hash_exists(HASH_OF(array_ptr), var)) {
RETURN_TRUE;
@@ -579,7 +585,7 @@ PHP_FUNCTION(filter_has_var)
}
/* }}} */
-static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, const int copy, zend_long filter_flags TSRMLS_DC) /* {{{ */
+static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, const int copy, zend_long filter_flags) /* {{{ */
{
zval *options = NULL;
zval *option;
@@ -636,7 +642,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
}
return;
}
- php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy);
return;
}
if (filter_flags & FILTER_REQUIRE_ARRAY) {
@@ -652,7 +658,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
return;
}
- php_zval_filter(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(filtered, filter, filter_flags, options, charset, copy);
if (filter_flags & FILTER_FORCE_ARRAY) {
zval tmp;
ZVAL_COPY_VALUE(&tmp, filtered);
@@ -662,7 +668,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
}
/* }}} */
-static void php_filter_array_handler(zval *input, zval *op, zval *return_value, zend_bool add_empty TSRMLS_DC) /* {{{ */
+static void php_filter_array_handler(zval *input, zval *op, zval *return_value, zend_bool add_empty) /* {{{ */
{
zend_string *arg_key;
zval *tmp, *arg_elm;
@@ -670,22 +676,22 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value,
if (!op) {
zval_ptr_dtor(return_value);
ZVAL_DUP(return_value, input);
- php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY);
} else if (Z_TYPE_P(op) == IS_LONG) {
zval_ptr_dtor(return_value);
ZVAL_DUP(return_value, input);
- php_filter_call(return_value, Z_LVAL_P(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ php_filter_call(return_value, Z_LVAL_P(op), NULL, 0, FILTER_REQUIRE_ARRAY);
} else if (Z_TYPE_P(op) == IS_ARRAY) {
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(op), arg_key, arg_elm) {
if (arg_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric keys are not allowed in the definition array");
+ php_error_docref(NULL, E_WARNING, "Numeric keys are not allowed in the definition array");
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
if (arg_key->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty keys are not allowed in the definition array");
+ php_error_docref(NULL, E_WARNING, "Empty keys are not allowed in the definition array");
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -697,7 +703,7 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value,
zval nval;
ZVAL_DEREF(tmp);
ZVAL_DUP(&nval, tmp);
- php_filter_call(&nval, -1, arg_elm, 0, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(&nval, -1, arg_elm, 0, FILTER_REQUIRE_SCALAR);
zend_hash_update(Z_ARRVAL_P(return_value), arg_key, &nval);
}
} ZEND_HASH_FOREACH_END();
@@ -717,7 +723,7 @@ PHP_FUNCTION(filter_input)
zval *input = NULL;
zend_string *var;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lS|lz", &fetch_from, &var, &filter, &filter_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS|lz", &fetch_from, &var, &filter, &filter_args) == FAILURE) {
return;
}
@@ -725,7 +731,7 @@ PHP_FUNCTION(filter_input)
RETURN_FALSE;
}
- input = php_filter_get_storage(fetch_from TSRMLS_CC);
+ input = php_filter_get_storage(fetch_from);
if (!input || !HASH_OF(input) || (tmp = zend_hash_find(HASH_OF(input), var)) == NULL) {
zend_long filter_flags = 0;
@@ -759,7 +765,7 @@ PHP_FUNCTION(filter_input)
ZVAL_DUP(return_value, tmp);
- php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR);
}
/* }}} */
@@ -771,7 +777,7 @@ PHP_FUNCTION(filter_var)
zend_long filter = FILTER_DEFAULT;
zval *filter_args = NULL, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|lz", &data, &filter, &filter_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/|lz", &data, &filter, &filter_args) == FAILURE) {
return;
}
@@ -781,7 +787,7 @@ PHP_FUNCTION(filter_var)
ZVAL_DUP(return_value, data);
- php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR);
}
/* }}} */
@@ -794,7 +800,7 @@ PHP_FUNCTION(filter_input_array)
zval *array_input = NULL, *op = NULL;
zend_bool add_empty = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|zb", &fetch_from, &op, &add_empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|zb", &fetch_from, &op, &add_empty) == FAILURE) {
return;
}
@@ -802,7 +808,7 @@ PHP_FUNCTION(filter_input_array)
RETURN_FALSE;
}
- array_input = php_filter_get_storage(fetch_from TSRMLS_CC);
+ array_input = php_filter_get_storage(fetch_from);
if (!array_input || !HASH_OF(array_input)) {
zend_long filter_flags = 0;
@@ -827,7 +833,7 @@ PHP_FUNCTION(filter_input_array)
}
}
- php_filter_array_handler(array_input, op, return_value, add_empty TSRMLS_CC);
+ php_filter_array_handler(array_input, op, return_value, add_empty);
}
/* }}} */
@@ -839,7 +845,7 @@ PHP_FUNCTION(filter_var_array)
zval *array_input = NULL, *op = NULL;
zend_bool add_empty = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|zb", &array_input, &op, &add_empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &array_input, &op, &add_empty) == FAILURE) {
return;
}
@@ -847,7 +853,7 @@ PHP_FUNCTION(filter_var_array)
RETURN_FALSE;
}
- php_filter_array_handler(array_input, op, return_value, add_empty TSRMLS_CC);
+ php_filter_array_handler(array_input, op, return_value, add_empty);
}
/* }}} */
@@ -877,7 +883,7 @@ PHP_FUNCTION(filter_id)
int size = sizeof(filter_list) / sizeof(filter_list_entry);
char *filter;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filter, &filter_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filter, &filter_len) == FAILURE) {
return;
}
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 01497192f0..ecff3087c7 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -81,9 +81,9 @@
#define FORMAT_IPV4 4
#define FORMAT_IPV6 6
-static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC);
+static int _php_filter_validate_ipv6(char *str, size_t str_len);
-static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_long ctx_value;
int sign = 0, digit = 0;
const char *end = str + str_len;
@@ -135,7 +135,7 @@ static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret
}
/* }}} */
-static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
@@ -158,7 +158,7 @@ static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *re
}
/* }}} */
-static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
zend_ulong n;
@@ -225,18 +225,18 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
p++; len--;
if (allow_hex && (*p == 'x' || *p == 'X')) {
p++; len--;
- if (php_filter_parse_hex(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_hex(p, len, &ctx_value) < 0) {
error = 1;
}
} else if (allow_octal) {
- if (php_filter_parse_octal(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_octal(p, len, &ctx_value) < 0) {
error = 1;
}
} else if (len != 0) {
error = 1;
}
} else {
- if (php_filter_parse_int(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_int(p, len, &ctx_value) < 0) {
error = 1;
}
}
@@ -347,7 +347,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (decimal_set) {
if (decimal_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "decimal separator must be one char");
+ php_error_docref(NULL, E_WARNING, "decimal separator must be one char");
RETURN_VALIDATION_FAILED
} else {
dec_sep = *decimal;
@@ -440,11 +440,11 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
FETCH_LONG_OPTION(option_flags, "flags");
if (!regexp_set) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'regexp' option missing");
+ php_error_docref(NULL, E_WARNING, "'regexp' option missing");
RETURN_VALIDATION_FAILED
}
- re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options);
if (!re) {
RETURN_VALIDATION_FAILED
}
@@ -521,7 +521,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
php_url *url;
int old_len = (int)Z_STRLEN_P(value);
- php_filter_url(value, flags, option_array, charset TSRMLS_CC);
+ php_filter_url(value, flags, option_array, charset);
if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {
RETURN_VALIDATION_FAILED
@@ -548,7 +548,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
t = e - 1;
/* An IPv6 enclosed by square brackets is a valid hostname */
- if (*s == '[' && *t == ']' && _php_filter_validate_ipv6((s + 1), l - 2 TSRMLS_CC)) {
+ if (*s == '[' && *t == ']' && _php_filter_validate_ipv6((s + 1), l - 2)) {
php_url_free(url);
return;
}
@@ -615,7 +615,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
sregexp = zend_string_init(regexp, sizeof(regexp) - 1, 0);
- re = pcre_get_compiled_regex(sregexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(sregexp, &pcre_extra, &preg_options);
if (!re) {
zend_string_release(sregexp);
RETURN_VALIDATION_FAILED
@@ -666,7 +666,7 @@ static int _php_filter_validate_ipv4(char *str, size_t str_len, int *ip) /* {{{
}
/* }}} */
-static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC) /* {{{ */
+static int _php_filter_validate_ipv6(char *str, size_t str_len) /* {{{ */
{
int compressed = 0;
int blocks = 0;
@@ -805,7 +805,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
case FORMAT_IPV6:
{
int res = 0;
- res = _php_filter_validate_ipv6(Z_STRVAL_P(value), Z_STRLEN_P(value) TSRMLS_CC);
+ res = _php_filter_validate_ipv6(Z_STRVAL_P(value), Z_STRLEN_P(value));
if (res < 1) {
RETURN_VALIDATION_FAILED
}
@@ -870,7 +870,7 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
FETCH_STRING_OPTION(exp_separator, "separator");
if (exp_separator_set && exp_separator_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Separator must be exactly one character long");
+ php_error_docref(NULL, E_WARNING, "Separator must be exactly one character long");
RETURN_VALIDATION_FAILED;
}
@@ -910,7 +910,7 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
/* The current token did not end with e.g. a "." */
RETURN_VALIDATION_FAILED
}
- if (php_filter_parse_hex(input + offset, length, &ret TSRMLS_CC) < 0) {
+ if (php_filter_parse_hex(input + offset, length, &ret) < 0) {
/* The current token is no valid hexadecimal digit */
RETURN_VALIDATION_FAILED
}
diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h
index a82b2e6159..f9735be76e 100644
--- a/ext/filter/php_filter.h
+++ b/ext/filter/php_filter.h
@@ -64,13 +64,14 @@ ZEND_BEGIN_MODULE_GLOBALS(filter)
ZEND_END_MODULE_GLOBALS(filter)
#ifdef ZTS
-#define IF_G(v) TSRMG(filter_globals_id, zend_filter_globals *, v)
+#define IF_G(v) ZEND_TSRMG(filter_globals_id, zend_filter_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define IF_G(v) (filter_globals.v)
#endif
-#define PHP_INPUT_FILTER_PARAM_DECL zval *value, zend_long flags, zval *option_array, char *charset TSRMLS_DC
+#define PHP_INPUT_FILTER_PARAM_DECL zval *value, zend_long flags, zval *option_array, char *charset
void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL);
void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL);
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index 851238fe45..a10b3e31fd 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -264,7 +264,7 @@ void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL)
} else {
quotes = ENT_NOQUOTES;
}
- buf = php_escape_html_entities_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), 1, quotes, SG(default_charset), 0 TSRMLS_CC);
+ buf = php_escape_html_entities_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), 1, quotes, SG(default_charset), 0);
zval_ptr_dtor(value);
ZVAL_STR(value, buf);
}
@@ -373,7 +373,7 @@ void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL)
zend_string *buf;
/* just call php_addslashes quotes */
- buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), 0 TSRMLS_CC);
+ buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), 0);
zval_ptr_dtor(value);
ZVAL_STR(value, buf);
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index a5341080b8..f57009b527 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -100,16 +100,16 @@ static int ftp_getresp(ftpbuf_t *ftp);
static int ftp_type(ftpbuf_t *ftp, ftptype_t type);
/* opens up a data stream */
-static databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC);
+static databuf_t* ftp_getdata(ftpbuf_t *ftp);
/* accepts the data connection, returns updated data buffer */
-static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC);
+static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp);
/* closes the data connection, returns NULL */
static databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data);
/* generic file lister */
-static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC);
+static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path);
/* IP and port conversion box */
union ipbox {
@@ -121,7 +121,7 @@ union ipbox {
/* {{{ ftp_open
*/
ftpbuf_t*
-ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
+ftp_open(const char *host, short port, zend_long timeout_sec)
{
ftpbuf_t *ftp;
socklen_t size;
@@ -136,7 +136,7 @@ ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
ftp->fd = php_network_connect_socket_to_host(host,
(unsigned short) (port ? port : 21), SOCK_STREAM,
- 0, &tv, NULL, NULL, NULL, 0, STREAM_SOCKOP_NONE TSRMLS_CC);
+ 0, &tv, NULL, NULL, NULL, 0, STREAM_SOCKOP_NONE);
if (ftp->fd == -1) {
goto bail;
}
@@ -148,7 +148,7 @@ ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
size = sizeof(ftp->localaddr);
memset(&ftp->localaddr, 0, size);
if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -179,8 +179,7 @@ ftp_close(ftpbuf_t *ftp)
data_close(ftp, ftp->data);
}
if (ftp->stream && ftp->closestream) {
- TSRMLS_FETCH();
- php_stream_close(ftp->stream);
+ php_stream_close(ftp->stream);
}
if (ftp->fd != -1) {
#if HAVE_OPENSSL_EXT
@@ -244,7 +243,7 @@ ftp_quit(ftpbuf_t *ftp)
/* {{{ ftp_login
*/
int
-ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
+ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
{
#if HAVE_OPENSSL_EXT
SSL_CTX *ctx = NULL;
@@ -281,7 +280,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
ctx = SSL_CTX_new(SSLv23_client_method());
if (ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL context");
+ php_error_docref(NULL, E_WARNING, "failed to create the SSL context");
return 0;
}
@@ -292,7 +291,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
ftp->ssl_handle = SSL_new(ctx);
if (ftp->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle");
+ php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
SSL_CTX_free(ctx);
return 0;
}
@@ -300,7 +299,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
SSL_set_fd(ftp->ssl_handle, ftp->fd);
if (SSL_connect(ftp->ssl_handle) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS handshake failed");
+ php_error_docref(NULL, E_WARNING, "SSL/TLS handshake failed");
SSL_shutdown(ftp->ssl_handle);
SSL_free(ftp->ssl_handle);
return 0;
@@ -649,18 +648,18 @@ ftp_alloc(ftpbuf_t *ftp, const zend_long size, zend_string **response)
/* {{{ ftp_nlist
*/
char**
-ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC)
+ftp_nlist(ftpbuf_t *ftp, const char *path)
{
- return ftp_genlist(ftp, "NLST", path TSRMLS_CC);
+ return ftp_genlist(ftp, "NLST", path);
}
/* }}} */
/* {{{ ftp_list
*/
char**
-ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC)
+ftp_list(ftpbuf_t *ftp, const char *path, int recursive)
{
- return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC);
+ return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path);
}
/* }}} */
@@ -791,7 +790,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
/* {{{ ftp_get
*/
int
-ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC)
+ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos)
{
databuf_t *data = NULL;
size_t rcvd;
@@ -804,7 +803,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
@@ -827,7 +826,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -883,7 +882,7 @@ bail:
/* {{{ ftp_put
*/
int
-ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC)
+ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos)
{
databuf_t *data = NULL;
zend_long size;
@@ -897,7 +896,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, z
if (!ftp_type(ftp, type)) {
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -918,7 +917,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, z
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -1364,7 +1363,7 @@ my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrl
/* {{{ ftp_getdata
*/
databuf_t*
-ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
+ftp_getdata(ftpbuf_t *ftp)
{
int fd = -1;
databuf_t *data;
@@ -1389,7 +1388,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
sa = (struct sockaddr *) &ftp->localaddr;
/* bind/listen */
if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == SOCK_ERR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1404,7 +1403,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
tv.tv_sec = ftp->timeout_sec;
tv.tv_usec = 0;
if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1422,17 +1421,17 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
size = php_sockaddr_size(&addr);
if (bind(fd, (struct sockaddr*) &addr, size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (getsockname(fd, (struct sockaddr*) &addr, &size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (listen(fd, 5) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1486,7 +1485,7 @@ bail:
/* {{{ data_accept
*/
databuf_t*
-data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC)
+data_accept(databuf_t *data, ftpbuf_t *ftp)
{
php_sockaddr_storage addr;
socklen_t size;
@@ -1516,7 +1515,7 @@ data_accepted:
if (ftp->use_ssl && ftp->use_ssl_for_data) {
ctx = SSL_CTX_new(SSLv23_client_method());
if (ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL context");
return 0;
}
@@ -1527,7 +1526,7 @@ data_accepted:
data->ssl_handle = SSL_new(ctx);
if (data->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL handle");
SSL_CTX_free(ctx);
return 0;
}
@@ -1540,7 +1539,7 @@ data_accepted:
}
if (SSL_connect(data->ssl_handle) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed");
+ php_error_docref(NULL, E_WARNING, "data_accept: SSL/TLS handshake failed");
SSL_shutdown(data->ssl_handle);
SSL_free(data->ssl_handle);
return 0;
@@ -1604,7 +1603,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
/* {{{ ftp_genlist
*/
char**
-ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
+ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path)
{
php_stream *tmpstream = NULL;
databuf_t *data = NULL;
@@ -1618,7 +1617,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory.");
+ php_error_docref(NULL, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory.");
return NULL;
}
@@ -1626,7 +1625,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -1646,7 +1645,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
}
/* pull data buffer into tmpfile */
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
size = 0;
@@ -1711,7 +1710,7 @@ bail:
/* {{{ ftp_nb_get
*/
int
-ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC)
+ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1724,7 +1723,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
@@ -1745,7 +1744,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -1754,7 +1753,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_read(ftp TSRMLS_CC));
+ return (ftp_nb_continue_read(ftp));
bail:
ftp->data = data_close(ftp, data);
@@ -1765,7 +1764,7 @@ bail:
/* {{{ ftp_nb_continue_read
*/
int
-ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC)
+ftp_nb_continue_read(ftpbuf_t *ftp)
{
databuf_t *data = NULL;
char *ptr;
@@ -1828,7 +1827,7 @@ bail:
/* {{{ ftp_nb_put
*/
int
-ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC)
+ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1839,7 +1838,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
if (!ftp_type(ftp, type)) {
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
if (startpos > 0) {
@@ -1858,7 +1857,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -1866,7 +1865,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_write(ftp TSRMLS_CC));
+ return (ftp_nb_continue_write(ftp));
bail:
ftp->data = data_close(ftp, data);
@@ -1878,7 +1877,7 @@ bail:
/* {{{ ftp_nb_continue_write
*/
int
-ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC)
+ftp_nb_continue_write(ftpbuf_t *ftp)
{
long size;
char *ptr;
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index e54eda0790..ec39695986 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -93,7 +93,7 @@ typedef struct ftpbuf
/* open a FTP connection, returns ftpbuf (NULL on error)
* port is the ftp port in network byte order, or 0 for the default
*/
-ftpbuf_t* ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC);
+ftpbuf_t* ftp_open(const char *host, short port, zend_long timeout_sec);
/* quits from the ftp session (it still needs to be closed)
* return true on success, false on error
@@ -107,7 +107,7 @@ void ftp_gc(ftpbuf_t *ftp);
ftpbuf_t* ftp_close(ftpbuf_t *ftp);
/* logs into the FTP server, returns true on success, false on error */
-int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC);
+int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass);
/* reinitializes the connection, returns true on success, false on error */
int ftp_reinit(ftpbuf_t *ftp);
@@ -152,14 +152,14 @@ int ftp_alloc(ftpbuf_t *ftp, const zend_long size, zend_string **response);
* or NULL on error. the return array must be freed (but don't
* free the array elements)
*/
-char** ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC);
+char** ftp_nlist(ftpbuf_t *ftp, const char *path);
/* returns a NULL-terminated array of lines returned by the ftp
* LIST command for the given path or NULL on error. the return
* array must be freed (but don't
* free the array elements)
*/
-char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC);
+char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive);
/* switches passive mode on or off
* returns true on success, false on error
@@ -169,12 +169,12 @@ int ftp_pasv(ftpbuf_t *ftp, int pasv);
/* retrieves a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC);
+int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC);
+int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos);
/* returns the size of the given file, or -1 on error */
zend_long ftp_size(ftpbuf_t *ftp, const char *path);
@@ -194,20 +194,20 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd);
/* retrieves part of a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC);
+int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC);
+int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos);
/* continues a previous nb_(f)get command
*/
-int ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC);
+int ftp_nb_continue_read(ftpbuf_t *ftp);
/* continues a previous nb_(f)put command
*/
-int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC);
+int ftp_nb_continue_write(ftpbuf_t *ftp);
#endif
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 32d8fb86e2..1c66f8e4d2 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -298,7 +298,7 @@ zend_module_entry php_ftp_module_entry = {
ZEND_GET_MODULE(php_ftp)
#endif
-static void ftp_destructor_ftpbuf(zend_resource *rsrc TSRMLS_DC)
+static void ftp_destructor_ftpbuf(zend_resource *rsrc)
{
ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr;
@@ -330,7 +330,7 @@ PHP_MINFO_FUNCTION(ftp)
#define XTYPE(xtype, mode) { \
if (mode != FTPTYPE_ASCII && mode != FTPTYPE_IMAGE) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \
+ php_error_docref(NULL, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \
RETURN_FALSE; \
} \
xtype = mode; \
@@ -347,17 +347,17 @@ PHP_FUNCTION(ftp_connect)
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
if (timeout_sec <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
/* connect */
- if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) {
+ if (!(ftp = ftp_open(host, (short)port, timeout_sec))) {
RETURN_FALSE;
}
@@ -383,17 +383,17 @@ PHP_FUNCTION(ftp_ssl_connect)
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
if (timeout_sec <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
/* connect */
- if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) {
+ if (!(ftp = ftp_open(host, (short)port, timeout_sec))) {
RETURN_FALSE;
}
@@ -416,15 +416,15 @@ PHP_FUNCTION(ftp_login)
char *user, *pass;
size_t user_len, pass_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* log in */
- if (!ftp_login(ftp, user, pass TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_login(ftp, user, pass)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -440,14 +440,14 @@ PHP_FUNCTION(ftp_pwd)
ftpbuf_t *ftp;
const char *pwd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!(pwd = ftp_pwd(ftp))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -462,14 +462,14 @@ PHP_FUNCTION(ftp_cdup)
zval *z_ftp;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp_cdup(ftp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -486,7 +486,7 @@ PHP_FUNCTION(ftp_chdir)
char *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -494,7 +494,7 @@ PHP_FUNCTION(ftp_chdir)
/* change directories */
if (!ftp_chdir(ftp, dir)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -511,7 +511,7 @@ PHP_FUNCTION(ftp_exec)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -519,7 +519,7 @@ PHP_FUNCTION(ftp_exec)
/* execute serverside command */
if (!ftp_exec(ftp, cmd)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -536,7 +536,7 @@ PHP_FUNCTION(ftp_raw)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -557,7 +557,7 @@ PHP_FUNCTION(ftp_mkdir)
zend_string *tmp;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -565,7 +565,7 @@ PHP_FUNCTION(ftp_mkdir)
/* create directorie */
if (NULL == (tmp = ftp_mkdir(ftp, dir))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(ftp_rmdir)
char *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -590,7 +590,7 @@ PHP_FUNCTION(ftp_rmdir)
/* remove directorie */
if (!ftp_rmdir(ftp, dir)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -608,14 +608,14 @@ PHP_FUNCTION(ftp_chmod)
size_t filename_len;
zend_long mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp_chmod(ftp, mode, filename, filename_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -632,7 +632,7 @@ PHP_FUNCTION(ftp_alloc)
zend_long size, ret;
zend_string *response = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &z_ftp, &size, &zresponse) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z/", &z_ftp, &size, &zresponse) == FAILURE) {
RETURN_FALSE;
}
@@ -661,14 +661,14 @@ PHP_FUNCTION(ftp_nlist)
char **nlist, **ptr, *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* get list of files */
- if (NULL == (nlist = ftp_nlist(ftp, dir TSRMLS_CC))) {
+ if (NULL == (nlist = ftp_nlist(ftp, dir))) {
RETURN_FALSE;
}
@@ -690,14 +690,14 @@ PHP_FUNCTION(ftp_rawlist)
size_t dir_len;
zend_bool recursive = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* get raw directory listing */
- if (NULL == (llist = ftp_list(ftp, dir, recursive TSRMLS_CC))) {
+ if (NULL == (llist = ftp_list(ftp, dir, recursive))) {
RETURN_FALSE;
}
@@ -717,14 +717,14 @@ PHP_FUNCTION(ftp_systype)
ftpbuf_t *ftp;
const char *syst;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (NULL == (syst = ftp_syst(ftp))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -744,7 +744,7 @@ PHP_FUNCTION(ftp_fget)
size_t file_len;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -767,8 +767,8 @@ PHP_FUNCTION(ftp_fget)
}
}
- if (!ftp_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_get(ftp, stream, file, xtype, resumepos)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -788,7 +788,7 @@ PHP_FUNCTION(ftp_nb_fget)
size_t file_len;
zend_long mode, resumepos=0, ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -815,8 +815,8 @@ PHP_FUNCTION(ftp_nb_fget)
ftp->direction = 0; /* recv */
ftp->closestream = 0; /* do not close */
- if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos)) == PHP_FTP_FAILED) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -832,7 +832,7 @@ PHP_FUNCTION(ftp_pasv)
ftpbuf_t *ftp;
zend_bool pasv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &z_ftp, &pasv) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &z_ftp, &pasv) == FAILURE) {
return;
}
@@ -858,7 +858,7 @@ PHP_FUNCTION(ftp_get)
size_t local_len, remote_len;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -893,14 +893,14 @@ PHP_FUNCTION(ftp_get)
}
if (outstream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local);
+ php_error_docref(NULL, E_WARNING, "Error opening %s", local);
RETURN_FALSE;
}
- if (!ftp_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) {
+ if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) {
php_stream_close(outstream);
VCWD_UNLINK(local);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -922,7 +922,7 @@ PHP_FUNCTION(ftp_nb_get)
int ret;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -955,7 +955,7 @@ PHP_FUNCTION(ftp_nb_get)
}
if (outstream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local);
+ php_error_docref(NULL, E_WARNING, "Error opening %s", local);
RETURN_FALSE;
}
@@ -963,11 +963,11 @@ PHP_FUNCTION(ftp_nb_get)
ftp->direction = 0; /* recv */
ftp->closestream = 1; /* do close */
- if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
+ if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos)) == PHP_FTP_FAILED) {
php_stream_close(outstream);
ftp->stream = NULL;
VCWD_UNLINK(local);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(PHP_FTP_FAILED);
}
@@ -988,21 +988,21 @@ PHP_FUNCTION(ftp_nb_continue)
ftpbuf_t *ftp;
zend_long ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp->nb) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no nbronous transfer to continue.");
+ php_error_docref(NULL, E_WARNING, "no nbronous transfer to continue.");
RETURN_LONG(PHP_FTP_FAILED);
}
if (ftp->direction) {
- ret=ftp_nb_continue_write(ftp TSRMLS_CC);
+ ret=ftp_nb_continue_write(ftp);
} else {
- ret=ftp_nb_continue_read(ftp TSRMLS_CC);
+ ret=ftp_nb_continue_read(ftp);
}
if (ret != PHP_FTP_MOREDATA && ftp->closestream) {
@@ -1011,7 +1011,7 @@ PHP_FUNCTION(ftp_nb_continue)
}
if (ret == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
}
RETURN_LONG(ret);
@@ -1030,7 +1030,7 @@ PHP_FUNCTION(ftp_fput)
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1056,8 +1056,8 @@ PHP_FUNCTION(ftp_fput)
}
}
- if (!ftp_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_put(ftp, remote, stream, xtype, startpos)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1078,7 +1078,7 @@ PHP_FUNCTION(ftp_nb_fput)
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1108,8 +1108,8 @@ PHP_FUNCTION(ftp_nb_fput)
ftp->direction = 1; /* send */
ftp->closestream = 0; /* do not close */
- if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) == PHP_FTP_FAILED)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos)) == PHP_FTP_FAILED)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -1130,7 +1130,7 @@ PHP_FUNCTION(ftp_put)
zend_long mode, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1159,9 +1159,9 @@ PHP_FUNCTION(ftp_put)
}
}
- if (!ftp_put(ftp, remote, instream, xtype, startpos TSRMLS_CC)) {
+ if (!ftp_put(ftp, remote, instream, xtype, startpos)) {
php_stream_close(instream);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
php_stream_close(instream);
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(ftp_nb_put)
zend_long mode, startpos=0, ret;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1216,7 +1216,7 @@ PHP_FUNCTION(ftp_nb_put)
ftp->direction = 1; /* send */
ftp->closestream = 1; /* do close */
- ret = ftp_nb_put(ftp, remote, instream, xtype, startpos TSRMLS_CC);
+ ret = ftp_nb_put(ftp, remote, instream, xtype, startpos);
if (ret != PHP_FTP_MOREDATA) {
php_stream_close(instream);
@@ -1224,7 +1224,7 @@ PHP_FUNCTION(ftp_nb_put)
}
if (ret == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
}
RETURN_LONG(ret);
@@ -1240,7 +1240,7 @@ PHP_FUNCTION(ftp_size)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1260,7 +1260,7 @@ PHP_FUNCTION(ftp_mdtm)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1280,7 +1280,7 @@ PHP_FUNCTION(ftp_rename)
char *src, *dest;
size_t src_len, dest_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) {
return;
}
@@ -1288,7 +1288,7 @@ PHP_FUNCTION(ftp_rename)
/* rename the file */
if (!ftp_rename(ftp, src, dest)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1305,7 +1305,7 @@ PHP_FUNCTION(ftp_delete)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1313,7 +1313,7 @@ PHP_FUNCTION(ftp_delete)
/* delete the file */
if (!ftp_delete(ftp, file)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1330,7 +1330,7 @@ PHP_FUNCTION(ftp_site)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -1338,7 +1338,7 @@ PHP_FUNCTION(ftp_site)
/* send the site command */
if (!ftp_site(ftp, cmd)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(ftp_close)
zval *z_ftp;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
@@ -1373,7 +1373,7 @@ PHP_FUNCTION(ftp_set_option)
zend_long option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &z_ftp, &option, &z_value) == FAILURE) {
return;
}
@@ -1382,12 +1382,12 @@ PHP_FUNCTION(ftp_set_option)
switch (option) {
case PHP_FTP_OPT_TIMEOUT_SEC:
if (Z_TYPE_P(z_value) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given",
+ php_error_docref(NULL, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given",
zend_zval_type_name(z_value));
RETURN_FALSE;
}
if (Z_LVAL_P(z_value) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
ftp->timeout_sec = Z_LVAL_P(z_value);
@@ -1395,7 +1395,7 @@ PHP_FUNCTION(ftp_set_option)
break;
case PHP_FTP_OPT_AUTOSEEK:
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given",
+ php_error_docref(NULL, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given",
zend_zval_type_name(z_value));
RETURN_FALSE;
}
@@ -1403,7 +1403,7 @@ PHP_FUNCTION(ftp_set_option)
RETURN_TRUE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option);
+ php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
RETURN_FALSE;
break;
}
@@ -1418,7 +1418,7 @@ PHP_FUNCTION(ftp_get_option)
zend_long option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &z_ftp, &option) == FAILURE) {
return;
}
@@ -1432,7 +1432,7 @@ PHP_FUNCTION(ftp_get_option)
RETURN_BOOL(ftp->autoseek);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option);
+ php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
RETURN_FALSE;
break;
}
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5a820860e6..def17b8df3 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -64,8 +64,8 @@ static int le_gd, le_gd_font;
#if HAVE_LIBT1
#include <t1lib.h>
static int le_ps_font, le_ps_enc;
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC);
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC);
+static void php_free_ps_font(zend_resource *rsrc);
+static void php_free_ps_enc(zend_resource *rsrc);
#endif
#include <gd.h>
@@ -135,7 +135,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS);
static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
/* End Section filters declarations */
-static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
+static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)());
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
static int _php_image_type(char data[8]);
@@ -1072,7 +1072,7 @@ PHP_INI_END()
/* {{{ php_free_gd_image
*/
-static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_image(zend_resource *rsrc)
{
gdImageDestroy((gdImagePtr) rsrc->ptr);
}
@@ -1080,7 +1080,7 @@ static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_gd_font
*/
-static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_font(zend_resource *rsrc)
{
gdFontPtr fp = (gdFontPtr) rsrc->ptr;
@@ -1097,9 +1097,8 @@ static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
*/
void php_gd_error_method(int type, const char *format, va_list args)
{
- TSRMLS_FETCH();
- php_verror(NULL, "", type, format, args TSRMLS_CC);
+ php_verror(NULL, "", type, format, args);
}
/* }}} */
#endif
@@ -1427,7 +1426,7 @@ PHP_FUNCTION(imageloadfont)
gdFontPtr font;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_name) == FAILURE) {
return;
}
@@ -1457,9 +1456,9 @@ PHP_FUNCTION(imageloadfont)
if (!n) {
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header");
+ php_error_docref(NULL, E_WARNING, "End of file while reading header");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header");
+ php_error_docref(NULL, E_WARNING, "Error while reading header");
}
php_stream_close(stream);
RETURN_FALSE;
@@ -1478,14 +1477,14 @@ PHP_FUNCTION(imageloadfont)
}
if (overflow2(font->nchars, font->h) || overflow2(font->nchars * font->h, font->w )) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
+ php_error_docref(NULL, E_WARNING, "Error reading font, invalid font header");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
if (body_size != body_size_check) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font");
+ php_error_docref(NULL, E_WARNING, "Error reading font");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
@@ -1501,16 +1500,16 @@ PHP_FUNCTION(imageloadfont)
efree(font->data);
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading body");
+ php_error_docref(NULL, E_WARNING, "End of file while reading body");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body");
+ php_error_docref(NULL, E_WARNING, "Error while reading body");
}
php_stream_close(stream);
RETURN_FALSE;
}
php_stream_close(stream);
- ind = zend_list_insert(font, le_gd_font TSRMLS_CC);
+ ind = zend_list_insert(font, le_gd_font);
/* Adding 5 to the font index so we will never have font indices
* that overlap with the old fonts (with indices 1-5). The first
@@ -1529,7 +1528,7 @@ PHP_FUNCTION(imagesetstyle)
int *stylearr;
int index = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &styles) == FAILURE) {
return;
}
@@ -1557,12 +1556,12 @@ PHP_FUNCTION(imagecreatetruecolor)
zend_long x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size, &y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -1583,7 +1582,7 @@ PHP_FUNCTION(imageistruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1602,14 +1601,14 @@ PHP_FUNCTION(imagetruecolortopalette)
zend_long ncolors;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rbl", &IM, &dither, &ncolors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rbl", &IM, &dither, &ncolors) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
if (ncolors <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero");
RETURN_FALSE;
}
gdImageTrueColorToPalette(im, dither, ncolors);
@@ -1625,7 +1624,7 @@ PHP_FUNCTION(imagepalettetotruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1647,7 +1646,7 @@ PHP_FUNCTION(imagecolormatch)
gdImagePtr im1, im2;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM1, &IM2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM1, &IM2) == FAILURE) {
return;
}
@@ -1657,19 +1656,19 @@ PHP_FUNCTION(imagecolormatch)
result = gdImageColorMatch(im1, im2);
switch (result) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 must be TrueColor" );
+ php_error_docref(NULL, E_WARNING, "Image1 must be TrueColor" );
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must be Palette" );
+ php_error_docref(NULL, E_WARNING, "Image2 must be Palette" );
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 and Image2 must be the same size" );
+ php_error_docref(NULL, E_WARNING, "Image1 and Image2 must be the same size" );
RETURN_FALSE;
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must have at least one color" );
+ php_error_docref(NULL, E_WARNING, "Image2 must have at least one color" );
RETURN_FALSE;
break;
}
@@ -1686,7 +1685,7 @@ PHP_FUNCTION(imagesetthickness)
zend_long thick;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &thick) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &thick) == FAILURE) {
return;
}
@@ -1706,7 +1705,7 @@ PHP_FUNCTION(imagefilledellipse)
zend_long cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -1727,7 +1726,7 @@ PHP_FUNCTION(imagefilledarc)
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
return;
}
@@ -1757,7 +1756,7 @@ PHP_FUNCTION(imagealphablending)
zend_bool blend;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &blend) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &blend) == FAILURE) {
return;
}
@@ -1776,7 +1775,7 @@ PHP_FUNCTION(imagesavealpha)
zend_bool save;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &save) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &save) == FAILURE) {
return;
}
@@ -1795,7 +1794,7 @@ PHP_FUNCTION(imagelayereffect)
zend_long effect;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &effect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &effect) == FAILURE) {
return;
}
@@ -1815,7 +1814,7 @@ PHP_FUNCTION(imagecolorallocatealpha)
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
RETURN_FALSE;
}
@@ -1836,7 +1835,7 @@ PHP_FUNCTION(imagecolorresolvealpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1854,7 +1853,7 @@ PHP_FUNCTION(imagecolorclosestalpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1872,7 +1871,7 @@ PHP_FUNCTION(imagecolorexactalpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1891,7 +1890,7 @@ PHP_FUNCTION(imagecopyresampled)
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -1933,14 +1932,14 @@ PHP_FUNCTION(imagegrabwindow)
tPrintWindow pPrintWindow = 0;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &lwindow_handle, &client_area) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &lwindow_handle, &client_area) == FAILURE) {
RETURN_FALSE;
}
window = (HWND) lwindow_handle;
if (!IsWindow(window)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid window handle");
+ php_error_docref(NULL, E_NOTICE, "Invalid window handle");
RETURN_FALSE;
}
@@ -1972,7 +1971,7 @@ PHP_FUNCTION(imagegrabwindow)
if ( pPrintWindow ) {
pPrintWindow(window, memDC, (UINT) client_area);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
+ php_error_docref(NULL, E_WARNING, "Windows API too old");
goto clean;
}
@@ -2073,7 +2072,7 @@ PHP_FUNCTION(imagerotate)
zend_long color;
zend_long ignoretransparent = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
RETURN_FALSE;
}
@@ -2096,7 +2095,7 @@ PHP_FUNCTION(imagesettile)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2116,7 +2115,7 @@ PHP_FUNCTION(imagesetbrush)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2136,12 +2135,12 @@ PHP_FUNCTION(imagecreate)
zend_long x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size, &y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -2240,7 +2239,7 @@ static int _php_image_type (char data[8])
/* {{{ _php_image_create_from_string
*/
-gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC)
+gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)())
{
gdImagePtr im;
gdIOCtx *io_ctx;
@@ -2253,7 +2252,7 @@ gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioct
im = (*ioctx_func_p)(io_ctx);
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn);
+ php_error_docref(NULL, E_WARNING, "Passed data is not in '%s' format", tn);
io_ctx->gd_free(io_ctx);
return NULL;
}
@@ -2273,13 +2272,13 @@ PHP_FUNCTION(imagecreatefromstring)
int imtype;
char sig[8];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &data) == FAILURE) {
return;
}
convert_to_string_ex(data);
if (Z_STRLEN_P(data) < 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string or invalid image");
+ php_error_docref(NULL, E_WARNING, "Empty string or invalid image");
RETURN_FALSE;
}
@@ -2290,41 +2289,41 @@ PHP_FUNCTION(imagecreatefromstring)
switch (imtype) {
case PHP_GDIMG_TYPE_JPG:
#ifdef HAVE_GD_JPG
- im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No JPEG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No JPEG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_PNG:
#ifdef HAVE_GD_PNG
- im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PNG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No PNG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_GIF:
- im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx);
break;
case PHP_GDIMG_TYPE_WBM:
- im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx);
break;
case PHP_GDIMG_TYPE_GD2:
- im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data is not in a recognized format");
+ php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
RETURN_FALSE;
}
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't create GD Image Stream out of Data");
+ php_error_docref(NULL, E_WARNING, "Couldn't create GD Image Stream out of Data");
RETURN_FALSE;
}
@@ -2347,15 +2346,15 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
#endif
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero width or height not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero width or height not allowed");
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
}
@@ -2380,7 +2379,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
buff = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
if (!buff) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data");
+ php_error_docref(NULL, E_WARNING,"Cannot read image data");
goto out_err;
}
@@ -2390,7 +2389,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
if (!io_ctx) {
pefree(pstr, 1);
zend_string_release(buff);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
+ php_error_docref(NULL, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
}
@@ -2443,7 +2442,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid %s file", file, tn);
+ php_error_docref(NULL, E_WARNING, "'%s' is not a valid %s file", file, tn);
out_err:
php_stream_close(stream);
RETURN_FALSE;
@@ -2557,7 +2556,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
/* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */
/* The quality parameter for gd2 stands for chunk size */
- if (zend_parse_parameters(argc TSRMLS_CC, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
return;
}
@@ -2578,7 +2577,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn);
RETURN_FALSE;
}
@@ -2587,7 +2586,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, fp);
@@ -2628,9 +2627,9 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
char buf[4096];
char *path;
- tmp = php_open_temporary_file(NULL, NULL, &path TSRMLS_CC);
+ tmp = php_open_temporary_file(NULL, NULL, &path);
if (tmp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
+ php_error_docref(NULL, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
}
@@ -2639,7 +2638,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, tmp);
@@ -2681,7 +2680,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
#endif
while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) {
- php_write(buf, b TSRMLS_CC);
+ php_write(buf, b);
}
fclose(tmp);
@@ -2771,7 +2770,7 @@ PHP_FUNCTION(imagedestroy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -2793,7 +2792,7 @@ PHP_FUNCTION(imagecolorallocate)
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2814,7 +2813,7 @@ PHP_FUNCTION(imagepalettecopy)
zval *dstim, *srcim;
gdImagePtr dst, src;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &dstim, &srcim) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &dstim, &srcim) == FAILURE) {
return;
}
@@ -2833,7 +2832,7 @@ PHP_FUNCTION(imagecolorat)
zend_long x, y;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &IM, &x, &y) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &IM, &x, &y) == FAILURE) {
return;
}
@@ -2843,14 +2842,14 @@ PHP_FUNCTION(imagecolorat)
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
}
@@ -2865,7 +2864,7 @@ PHP_FUNCTION(imagecolorclosest)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2883,7 +2882,7 @@ PHP_FUNCTION(imagecolorclosesthwb)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2902,7 +2901,7 @@ PHP_FUNCTION(imagecolordeallocate)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -2919,7 +2918,7 @@ PHP_FUNCTION(imagecolordeallocate)
gdImageColorDeallocate(im, col);
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -2933,7 +2932,7 @@ PHP_FUNCTION(imagecolorresolve)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2951,7 +2950,7 @@ PHP_FUNCTION(imagecolorexact)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2970,7 +2969,7 @@ PHP_FUNCTION(imagecolorset)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &IM, &color, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll|l", &IM, &color, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -2998,7 +2997,7 @@ PHP_FUNCTION(imagecolorsforindex)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -3014,7 +3013,7 @@ PHP_FUNCTION(imagecolorsforindex)
add_assoc_long(return_value,"blue", gdImageBlue(im,col));
add_assoc_long(return_value,"alpha", gdImageAlpha(im,col));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -3029,7 +3028,7 @@ PHP_FUNCTION(imagegammacorrect)
int i;
double input, output;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdd", &IM, &input, &output) == FAILURE) {
return;
}
@@ -3071,7 +3070,7 @@ PHP_FUNCTION(imagesetpixel)
zend_long x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x, &y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3089,7 +3088,7 @@ PHP_FUNCTION(imageline)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3115,7 +3114,7 @@ PHP_FUNCTION(imagedashedline)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3133,7 +3132,7 @@ PHP_FUNCTION(imagerectangle)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3151,7 +3150,7 @@ PHP_FUNCTION(imagefilledrectangle)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3170,7 +3169,7 @@ PHP_FUNCTION(imagearc)
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
return;
}
@@ -3199,7 +3198,7 @@ PHP_FUNCTION(imageellipse)
zend_long cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -3218,7 +3217,7 @@ PHP_FUNCTION(imagefilltoborder)
zend_long x, y, border, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &x, &y, &border, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &x, &y, &border, &col) == FAILURE) {
return;
}
@@ -3236,7 +3235,7 @@ PHP_FUNCTION(imagefill)
zend_long x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x, &y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3253,7 +3252,7 @@ PHP_FUNCTION(imagecolorstotal)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3272,7 +3271,7 @@ PHP_FUNCTION(imagecolortransparent)
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &COL) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &COL) == FAILURE) {
return;
}
@@ -3295,7 +3294,7 @@ PHP_FUNCTION(imageinterlace)
zend_long INT = 0;
gdImagePtr im;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &INT) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &INT) == FAILURE) {
return;
}
@@ -3322,7 +3321,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
gdPointPtr points;
int npoints, col, nelem, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
return;
}
@@ -3333,15 +3332,15 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
nelem = zend_hash_num_elements(Z_ARRVAL_P(POINTS));
if (nelem < 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array");
+ php_error_docref(NULL, E_WARNING, "You must have at least 3 points in your array");
RETURN_FALSE;
}
if (npoints <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must give a positive number of points");
+ php_error_docref(NULL, E_WARNING, "You must give a positive number of points");
RETURN_FALSE;
}
if (nelem < npoints * 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
+ php_error_docref(NULL, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
RETURN_FALSE;
}
@@ -3385,7 +3384,7 @@ PHP_FUNCTION(imagefilledpolygon)
/* {{{ php_find_gd_font
*/
-static gdFontPtr php_find_gd_font(int size TSRMLS_DC)
+static gdFontPtr php_find_gd_font(int size)
{
gdFontPtr font;
@@ -3433,11 +3432,11 @@ static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
zend_long SIZE;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &SIZE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &SIZE) == FAILURE) {
return;
}
- font = php_find_gd_font(SIZE TSRMLS_CC);
+ font = php_find_gd_font(SIZE);
RETURN_LONG(arg ? font->h : font->w);
}
/* }}} */
@@ -3501,7 +3500,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
unsigned char *str = NULL;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllsl", &IM, &SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllsl", &IM, &SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
return;
}
@@ -3520,7 +3519,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
x = X;
size = SIZE;
- font = php_find_gd_font(size TSRMLS_CC);
+ font = php_find_gd_font(size);
switch (mode) {
case 0:
@@ -3592,7 +3591,7 @@ PHP_FUNCTION(imagecopy)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
return;
}
@@ -3620,7 +3619,7 @@ PHP_FUNCTION(imagecopymerge)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3649,7 +3648,7 @@ PHP_FUNCTION(imagecopymergegray)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3678,7 +3677,7 @@ PHP_FUNCTION(imagecopyresized)
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -3695,7 +3694,7 @@ PHP_FUNCTION(imagecopyresized)
dstW = DW;
if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -3711,7 +3710,7 @@ PHP_FUNCTION(imagesx)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3728,7 +3727,7 @@ PHP_FUNCTION(imagesy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3797,13 +3796,13 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
if (mode == TTFTEXT_BBOX) {
if (argc < 4 || argc > ((extended) ? 5 : 4)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
RETURN_FALSE;
}
} else {
if (argc < 8 || argc > ((extended) ? 9 : 8)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
@@ -3851,7 +3850,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
#endif /* HAVE_GD_FREETYPE */
if (error) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error);
+ php_error_docref(NULL, E_WARNING, "%s", error);
RETURN_FALSE;
}
@@ -3869,7 +3868,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
/* {{{ php_free_ps_font
*/
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_font(zend_resource *rsrc)
{
int *font = (int *)rsrc->ptr;
@@ -3880,7 +3879,7 @@ static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_ps_enc
*/
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_enc(zend_resource *rsrc)
{
char **enc = (char **)rsrc->ptr;
@@ -3898,13 +3897,13 @@ PHP_FUNCTION(imagepsloadfont)
zend_stat_t st;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
#ifdef PHP_WIN32
if (VCWD_STAT(file, &st) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font file not found (%s)", file);
+ php_error_docref(NULL, E_WARNING, "Font file not found (%s)", file);
RETURN_FALSE;
}
#endif
@@ -3912,12 +3911,12 @@ PHP_FUNCTION(imagepsloadfont)
f_ind = T1_AddFont(file);
if (f_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
RETURN_FALSE;
}
if (T1_LoadFont(f_ind)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load the font");
+ php_error_docref(NULL, E_WARNING, "Couldn't load the font");
RETURN_FALSE;
}
@@ -3936,14 +3935,14 @@ PHP_FUNCTION(imagepscopyfont)
gd_ps_font *nf_ind, *of_ind;
long fnt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &fnt) == FAILURE) {
return;
}
of_ind = zend_list_find(fnt, &type);
if (type != le_ps_font) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", fnt);
+ php_error_docref(NULL, E_WARNING, "%ld is not a Type 1 font index", fnt);
RETURN_FALSE;
}
@@ -3955,26 +3954,26 @@ PHP_FUNCTION(imagepscopyfont)
efree(nf_ind);
switch (l_ind) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "FontID %d is not loaded in memory", l_ind);
+ php_error_docref(NULL, E_WARNING, "FontID %d is not loaded in memory", l_ind);
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to copy a logical font");
+ php_error_docref(NULL, E_WARNING, "Tried to copy a logical font");
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib");
+ php_error_docref(NULL, E_WARNING, "Memory allocation fault in t1lib");
RETURN_FALSE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib");
+ php_error_docref(NULL, E_WARNING, "An unknown error occurred in t1lib");
RETURN_FALSE;
break;
}
}
nf_ind->extend = 1;
- l_ind = zend_list_insert(nf_ind, le_ps_font TSRMLS_CC);
+ l_ind = zend_list_insert(nf_ind, le_ps_font);
RETURN_LONG(l_ind);
}
*/
@@ -3987,7 +3986,7 @@ PHP_FUNCTION(imagepsfreefont)
zval *fnt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fnt) == FAILURE) {
return;
}
@@ -4005,25 +4004,25 @@ PHP_FUNCTION(imagepsencodefont)
char *enc, **enc_vector;
size_t enc_len, *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font);
if ((enc_vector = T1_LoadEncoding(enc)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load encoding vector from %s", enc);
+ php_error_docref(NULL, E_WARNING, "Couldn't load encoding vector from %s", enc);
RETURN_FALSE;
}
T1_DeleteAllSizes(*f_ind);
if (T1_ReencodeFont(*f_ind, enc_vector)) {
T1_DeleteEncoding(enc_vector);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-encode font");
+ php_error_docref(NULL, E_WARNING, "Couldn't re-encode font");
RETURN_FALSE;
}
- zend_list_insert(enc_vector, le_ps_enc TSRMLS_CC);
+ zend_list_insert(enc_vector, le_ps_enc);
RETURN_TRUE;
}
@@ -4037,7 +4036,7 @@ PHP_FUNCTION(imagepsextendfont)
double ext;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &ext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &ext) == FAILURE) {
return;
}
@@ -4046,7 +4045,7 @@ PHP_FUNCTION(imagepsextendfont)
T1_DeleteAllSizes(*f_ind);
if (ext <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
+ php_error_docref(NULL, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
RETURN_FALSE;
}
@@ -4066,7 +4065,7 @@ PHP_FUNCTION(imagepsslantfont)
double slt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &slt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &slt) == FAILURE) {
return;
}
@@ -4102,12 +4101,12 @@ PHP_FUNCTION(imagepstext)
char *str;
int str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) {
return;
}
if (aa_steps != 4 && aa_steps != 16) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Antialias steps must be 4 or 16");
+ php_error_docref(NULL, E_WARNING, "Antialias steps must be 4 or 16");
RETURN_FALSE;
}
@@ -4116,12 +4115,12 @@ PHP_FUNCTION(imagepstext)
/* Ensure that the provided colors are valid */
if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %pd out of range", _fg);
+ php_error_docref(NULL, E_WARNING, "Foreground color index %pd out of range", _fg);
RETURN_FALSE;
}
if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %pd out of range", _bg);
+ php_error_docref(NULL, E_WARNING, "Background color index %pd out of range", _bg);
RETURN_FALSE;
}
@@ -4155,7 +4154,7 @@ PHP_FUNCTION(imagepstext)
T1_AASetLevel(T1_AA_HIGH);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
+ php_error_docref(NULL, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
RETURN_FALSE;
}
@@ -4169,7 +4168,7 @@ PHP_FUNCTION(imagepstext)
if (!str_path) {
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
}
RETURN_FALSE;
}
@@ -4190,7 +4189,7 @@ PHP_FUNCTION(imagepstext)
str_img = T1_AASetString(*f_ind, str, str_len, space, T1_KERNING, size, transform);
}
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
RETURN_FALSE;
}
@@ -4239,7 +4238,7 @@ PHP_FUNCTION(imagepsbbox)
ZEND_WRONG_PARAM_COUNT();
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
return;
}
@@ -4357,23 +4356,22 @@ static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold
int dest_height = gdImageSY(im_org);
int dest_width = gdImageSX(im_org);
int x, y;
- TSRMLS_FETCH();
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
return;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
@@ -4421,7 +4419,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
zend_long ignore_warning;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
return;
}
@@ -4433,7 +4431,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Check threshold value */
if (int_threshold < 0 || int_threshold > 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'", int_threshold);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'", int_threshold);
RETURN_FALSE;
}
@@ -4446,14 +4444,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Open origin file */
org = VCWD_FOPEN(fn_org, "rb");
if (!org) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for reading", fn_org);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for reading", fn_org);
RETURN_FALSE;
}
/* Open destination file */
dest = VCWD_FOPEN(fn_dest, "wb");
if (!dest) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
RETURN_FALSE;
}
@@ -4461,7 +4459,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_GIF:
im_org = gdImageCreateFromGif(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4471,7 +4469,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
ignore_warning = INI_INT("gd.jpeg_ignore_warning");
im_org = gdImageCreateFromJpegEx(org, ignore_warning);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4481,14 +4479,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_PNG:
im_org = gdImageCreateFromPng(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
RETURN_FALSE;
}
break;
#endif /* HAVE_GD_PNG */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported");
+ php_error_docref(NULL, E_WARNING, "Format not supported");
RETURN_FALSE;
break;
}
@@ -4522,7 +4520,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_tmp = gdImageCreate (dest_width, dest_height);
if (im_tmp == NULL ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
RETURN_FALSE;
}
@@ -4534,19 +4532,19 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
RETURN_FALSE;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
@@ -4582,7 +4580,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
#define PHP_GD_SINGLE_RES \
zval *SIM; \
gdImagePtr im_src; \
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &SIM) == FAILURE) { \
+ if (zend_parse_parameters(1, "r", &SIM) == FAILURE) { \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); \
@@ -4618,7 +4616,7 @@ static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long brightness, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &SIM, &tmp, &brightness) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &SIM, &tmp, &brightness) == FAILURE) {
RETURN_FALSE;
}
@@ -4641,7 +4639,7 @@ static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long contrast, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &SIM, &tmp, &contrast) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &SIM, &tmp, &contrast) == FAILURE) {
RETURN_FALSE;
}
@@ -4665,7 +4663,7 @@ static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS)
zend_long r,g,b,tmp;
zend_long a = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &SIM, &tmp, &r, &g, &b, &a) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll|l", &SIM, &tmp, &r, &g, &b, &a) == FAILURE) {
RETURN_FALSE;
}
@@ -4744,7 +4742,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
double weight;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rld", &SIM, &tmp, &weight) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rld", &SIM, &tmp, &weight) == FAILURE) {
RETURN_FALSE;
}
@@ -4768,7 +4766,7 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS)
zend_long tmp, blocksize;
zend_bool mode = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll|b", &IM, &tmp, &blocksize, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll|b", &IM, &tmp, &blocksize, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -4811,7 +4809,7 @@ PHP_FUNCTION(imagefilter)
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > IMAGE_FILTER_MAX_ARGS) {
WRONG_PARAM_COUNT;
- } else if (zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) {
+ } else if (zend_parse_parameters(2, "rl", &tmp, &filtertype) == FAILURE) {
return;
}
@@ -4832,7 +4830,7 @@ PHP_FUNCTION(imageconvolution)
int nelem, i, j, res;
float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
RETURN_FALSE;
}
@@ -4840,14 +4838,14 @@ PHP_FUNCTION(imageconvolution)
nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
if (nelem != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
for (i=0; i<3; i++) {
if ((var = zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i))) != NULL && Z_TYPE_P(var) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(var)) != 3 ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
@@ -4855,7 +4853,7 @@ PHP_FUNCTION(imageconvolution)
if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), j)) != NULL) {
matrix[i][j] = (float) zval_get_double(var2);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
+ php_error_docref(NULL, E_WARNING, "You must have a 3x3 matrix");
RETURN_FALSE;
}
}
@@ -4880,7 +4878,7 @@ PHP_FUNCTION(imageflip)
zend_long mode;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &mode) == FAILURE) {
return;
}
@@ -4900,7 +4898,7 @@ PHP_FUNCTION(imageflip)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown flip mode");
+ php_error_docref(NULL, E_WARNING, "Unknown flip mode");
RETURN_FALSE;
}
@@ -4917,7 +4915,7 @@ PHP_FUNCTION(imageantialias)
zend_bool alias;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &alias) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &alias) == FAILURE) {
return;
}
@@ -4939,7 +4937,7 @@ PHP_FUNCTION(imagecrop)
zval *z_rect;
zval *tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &z_rect) == FAILURE) {
return;
}
@@ -4948,28 +4946,28 @@ PHP_FUNCTION(imagecrop)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") -1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
@@ -4994,7 +4992,7 @@ PHP_FUNCTION(imagecropauto)
gdImagePtr im;
gdImagePtr im_crop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ldl", &IM, &mode, &threshold, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ldl", &IM, &mode, &threshold, &color) == FAILURE) {
return;
}
@@ -5013,14 +5011,14 @@ PHP_FUNCTION(imagecropauto)
case GD_CROP_THRESHOLD:
if (color < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode");
+ php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode");
RETURN_FALSE;
}
im_crop = gdImageCropThreshold(im, color, (float) threshold);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown crop mode");
+ php_error_docref(NULL, E_WARNING, "Unknown crop mode");
RETURN_FALSE;
}
if (im_crop == NULL) {
@@ -5042,7 +5040,7 @@ PHP_FUNCTION(imagescale)
zend_long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED;
gdInterpolationMethod method;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
return;
}
method = tmp_m;
@@ -5091,14 +5089,14 @@ PHP_FUNCTION(imageaffine)
int i, nelems;
zval *zval_affine_elem = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(src, gdImagePtr, IM, -1, "Image", le_gd);
if ((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine array must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine array must have six elements");
RETURN_FALSE;
}
@@ -5115,7 +5113,7 @@ PHP_FUNCTION(imageaffine)
affine[i] = zval_get_double(zval_affine_elem);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5125,28 +5123,28 @@ PHP_FUNCTION(imageaffine)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") - 1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
pRect = &rect;
@@ -5180,7 +5178,7 @@ PHP_FUNCTION(imageaffinematrixget)
zval *tmp;
int res = GD_FALSE, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &type, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z", &type, &options) == FAILURE) {
return;
}
@@ -5189,20 +5187,20 @@ PHP_FUNCTION(imageaffinematrixget)
case GD_AFFINE_SCALE: {
double x, y;
if (!options || Z_TYPE_P(options) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array expected as options");
+ php_error_docref(NULL, E_WARNING, "Array expected as options");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "x", sizeof("x") - 1)) != NULL) {
x = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "y", sizeof("y") - 1)) != NULL) {
y = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
@@ -5220,7 +5218,7 @@ PHP_FUNCTION(imageaffinematrixget)
double angle;
if (!options) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
+ php_error_docref(NULL, E_WARNING, "Number is expected as option");
RETURN_FALSE;
}
@@ -5237,7 +5235,7 @@ PHP_FUNCTION(imageaffinematrixget)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %li", type);
RETURN_FALSE;
}
@@ -5264,12 +5262,12 @@ PHP_FUNCTION(imageaffinematrixconcat)
zval *z_m2;
int i, nelems;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &z_m1, &z_m2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &z_m1, &z_m2) == FAILURE) {
return;
}
if (((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m1))) != 6) || (nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m2))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine arrays must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine arrays must have six elements");
RETURN_FALSE;
}
@@ -5286,7 +5284,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m1[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5302,7 +5300,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m2[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5326,7 +5324,7 @@ PHP_FUNCTION(imagesetinterpolation)
gdImagePtr im;
zend_long method = GD_BILINEAR_FIXED;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &IM, &method) == FAILURE) {
return;
}
diff --git a/ext/gd/gd_compat.c b/ext/gd/gd_compat.c
index dc6a95ae11..d6d8d0b2f9 100644
--- a/ext/gd/gd_compat.c
+++ b/ext/gd/gd_compat.c
@@ -48,14 +48,13 @@ const char * gdPngGetVersionString()
int overflow2(int a, int b)
{
- TSRMLS_FETCH();
if(a <= 0 || b <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
+ php_error_docref(NULL, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
return 1;
}
if(a > INT_MAX / b) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
+ php_error_docref(NULL, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
return 1;
}
return 0;
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 0b79cb6f0d..0d4a25b13c 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -29,14 +29,12 @@ static void _php_image_output_putc(struct gdIOCtx *ctx, int c) /* {{{ */
* big endian architectures:
*/
unsigned char ch = (unsigned char) c;
- TSRMLS_FETCH();
- php_write(&ch, 1 TSRMLS_CC);
+ php_write(&ch, 1);
} /* }}} */
static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */
{
- TSRMLS_FETCH();
- return php_write((void *)buf, l TSRMLS_CC);
+ return php_write((void *)buf, l);
} /* }}} */
static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */
@@ -49,20 +47,17 @@ static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */
static void _php_image_stream_putc(struct gdIOCtx *ctx, int c) /* {{{ */ {
char ch = (char) c;
php_stream * stream = (php_stream *)ctx->data;
- TSRMLS_FETCH();
php_stream_write(stream, &ch, 1);
} /* }}} */
static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */
{
php_stream * stream = (php_stream *)ctx->data;
- TSRMLS_FETCH();
return php_stream_write(stream, (void *)buf, l);
} /* }}} */
static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) /* {{{ */
{
- TSRMLS_FETCH();
if(ctx->data) {
php_stream_close((php_stream *) ctx->data);
@@ -93,7 +88,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* from imagey<type>().
*/
if (image_type == PHP_GDIMG_TYPE_XBM) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
return;
}
} else {
@@ -103,7 +98,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* PHP_GDIMG_TYPE_WBM
* PHP_GDIMG_TYPE_WEBP
* */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/!ll", &imgind, &to_zval, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z/!ll", &imgind, &to_zval, &quality, &basefilter) == FAILURE) {
return;
}
}
@@ -125,7 +120,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
RETURN_FALSE;
}
@@ -134,7 +129,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream");
+ php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream");
RETURN_FALSE;
}
} else {
@@ -161,7 +156,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
switch(image_type) {
case PHP_GDIMG_CONVERT_WBM:
if(q<0||q>255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
}
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, ctx, q);
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 54890bc177..59fcd3533a 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -102,10 +102,9 @@ void php_gd_error_ex(int type, const char *format, ...)
{
va_list args;
- TSRMLS_FETCH();
va_start(args, format);
- php_verror(NULL, "", type, format, args TSRMLS_CC);
+ php_verror(NULL, "", type, format, args);
va_end(args);
}
@@ -113,10 +112,9 @@ void php_gd_error(const char *format, ...)
{
va_list args;
- TSRMLS_FETCH();
va_start(args, format);
- php_verror(NULL, "", E_WARNING, format, args TSRMLS_CC);
+ php_verror(NULL, "", E_WARNING, format, args);
va_end(args);
}
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 763efcf68c..c967de6ffb 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -412,8 +412,7 @@ static void *fontFetch (char **error, void *key)
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
if (!strcmp(dir, ".")) {
- TSRMLS_FETCH();
-#if HAVE_GETCWD
+ #if HAVE_GETCWD
dir = VCWD_GETCWD(cur_dir, MAXPATHLEN);
#elif HAVE_GETWD
dir = VCWD_GETWD(cur_dir);
diff --git a/ext/gd/libgd/gdkanji.c b/ext/gd/libgd/gdkanji.c
index 37f3bd10a0..2f6110c532 100644
--- a/ext/gd/libgd/gdkanji.c
+++ b/ext/gd/libgd/gdkanji.c
@@ -74,12 +74,11 @@ error (const char *format,...)
{
va_list args;
char *tmp;
- TSRMLS_FETCH();
va_start(args, format);
vspprintf(&tmp, 0, format, args);
va_end(args);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", LIBNAME, tmp);
+ php_error_docref(NULL, E_WARNING, "%s: %s", LIBNAME, tmp);
efree(tmp);
}
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index 7510b2425d..0ae90ccf89 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -32,8 +32,8 @@
/* open_basedir and safe_mode checks */
#define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
- if (!filename || php_check_open_basedir(filename TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
+ if (!filename || php_check_open_basedir(filename)) { \
+ php_error_docref(NULL, E_WARNING, errormsg); \
RETURN_FALSE; \
}
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index 938997a4a6..4554748643 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -140,13 +140,13 @@ ZEND_GET_MODULE(php_gettext)
#define PHP_GETTEXT_DOMAIN_LENGTH_CHECK \
if (domain_len > PHP_GETTEXT_MAX_DOMAIN_LENGTH) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "domain passed too long"); \
+ php_error_docref(NULL, E_WARNING, "domain passed too long"); \
RETURN_FALSE; \
}
#define PHP_GETTEXT_LENGTH_CHECK(check_name, check_len) \
if (check_len > PHP_GETTEXT_MAX_MSGID_LENGTH) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s passed too long", check_name); \
+ php_error_docref(NULL, E_WARNING, "%s passed too long", check_name); \
RETURN_FALSE; \
}
@@ -164,7 +164,7 @@ PHP_NAMED_FUNCTION(zif_textdomain)
char *domain, *domain_name, *retval;
size_t domain_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &domain, &domain_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &domain, &domain_len) == FAILURE) {
return;
}
@@ -189,7 +189,7 @@ PHP_NAMED_FUNCTION(zif_gettext)
char *msgid, *msgstr;
size_t msgid_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &msgid, &msgid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &msgid, &msgid_len) == FAILURE) {
return;
}
@@ -207,7 +207,7 @@ PHP_NAMED_FUNCTION(zif_dgettext)
char *domain, *msgid, *msgstr;
size_t domain_len, msgid_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &msgid, &msgid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &msgid, &msgid_len) == FAILURE) {
return;
}
@@ -228,7 +228,7 @@ PHP_NAMED_FUNCTION(zif_dcgettext)
size_t domain_len, msgid_len;
zend_long category;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &domain, &domain_len, &msgid, &msgid_len, &category) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl", &domain, &domain_len, &msgid, &msgid_len, &category) == FAILURE) {
return;
}
@@ -249,7 +249,7 @@ PHP_NAMED_FUNCTION(zif_bindtextdomain)
size_t domain_len, dir_len;
char *retval, dir_name[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &dir, &dir_len) == FAILURE) {
return;
}
@@ -283,7 +283,7 @@ PHP_NAMED_FUNCTION(zif_ngettext)
size_t msgid1_len, msgid2_len;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl", &msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
return;
}
@@ -307,7 +307,7 @@ PHP_NAMED_FUNCTION(zif_dngettext)
size_t domain_len, msgid1_len, msgid2_len;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl", &domain, &domain_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl", &domain, &domain_len,
&msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
return;
}
@@ -335,7 +335,7 @@ PHP_NAMED_FUNCTION(zif_dcngettext)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssll", &domain, &domain_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssll", &domain, &domain_len,
&msgid1, &msgid1_len, &msgid2, &msgid2_len, &count, &category) == FAILURE) {
return;
}
@@ -362,7 +362,7 @@ PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset)
char *domain, *codeset, *retval = NULL;
size_t domain_len, codeset_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &codeset, &codeset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &codeset, &codeset_len) == FAILURE) {
return;
}
diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4
index 0388d548cf..8265fb8dfa 100644
--- a/ext/gmp/config.m4
+++ b/ext/gmp/config.m4
@@ -21,7 +21,7 @@ if test "$PHP_GMP" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
PHP_ADD_INCLUDE($GMP_DIR/include)
- PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared)
+ PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(GMP_SHARED_LIBADD)
AC_DEFINE(HAVE_GMP, 1, [ ])
fi
diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32
index 8c863f9bc8..7ea36150b2 100644
--- a/ext/gmp/config.w32
+++ b/ext/gmp/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("gmp", "Include GNU MP support.", "no");
if (PHP_GMP != "no") {
if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
- EXTENSION("gmp", "gmp.c");
+ EXTENSION("gmp", "gmp.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_GMP', 1, 'GMP support');
AC_DEFINE('HAVE_MPIR', 1, 'MPIR support');
} else {
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index d3bf334640..1b9846a576 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -214,6 +214,9 @@ zend_module_entry gmp_module_entry = {
/* }}} */
#ifdef COMPILE_DL_GMP
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(gmp)
#endif
@@ -243,7 +246,7 @@ typedef struct _gmp_temp {
#define GMP_MAX_BASE 62
#define IS_GMP(zval) \
- (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce TSRMLS_CC))
+ (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce))
#define GET_GMP_OBJECT_FROM_OBJ(obj) \
((gmp_object *) ((char *) (obj) - XtOffsetOf(gmp_object, std)))
@@ -283,7 +286,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
FREE_GMP_TEMP(dep1); \
FREE_GMP_TEMP(dep2); \
@@ -299,7 +302,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
FREE_GMP_TEMP(dep); \
RETURN_FALSE; \
@@ -314,7 +317,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
RETURN_FALSE; \
} \
@@ -323,11 +326,11 @@ if (IS_GMP(zval)) { \
}
#define INIT_GMP_RETVAL(gmpnumber) \
- gmp_create(return_value, &gmpnumber TSRMLS_CC)
+ gmp_create(return_value, &gmpnumber)
static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base);
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC);
-static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC);
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base);
+static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg);
/*
* The gmp_*_op functions provide an implementation for several common types
@@ -347,10 +350,10 @@ typedef void (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, gmp_ulong);
typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
typedef void (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, gmp_ulong);
-static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC);
-static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC);
-static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC);
-static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC);
+static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero);
+static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero);
+static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op);
+static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op);
/* Binary operations */
#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop, 0)
@@ -364,21 +367,21 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_una
#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
-static void gmp_free_object_storage(zend_object *obj TSRMLS_DC) /* {{{ */
+static void gmp_free_object_storage(zend_object *obj) /* {{{ */
{
gmp_object *intern = GET_GMP_OBJECT_FROM_OBJ(obj);
mpz_clear(intern->num);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
-static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */
+static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *gmpnum_target) /* {{{ */
{
gmp_object *intern = emalloc(sizeof(gmp_object)
+ sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->std, ce TSRMLS_CC);
+ zend_object_std_init(&intern->std, ce);
object_properties_init(&intern->std, ce);
mpz_init(intern->num);
@@ -389,20 +392,20 @@ static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *g
}
/* }}} */
-static zend_object *gmp_create_object(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static zend_object *gmp_create_object(zend_class_entry *ce) /* {{{ */
{
mpz_ptr gmpnum_dummy;
- return gmp_create_object_ex(ce, &gmpnum_dummy TSRMLS_CC);
+ return gmp_create_object_ex(ce, &gmpnum_dummy);
}
/* }}} */
-static inline void gmp_create(zval *target, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */
+static inline void gmp_create(zval *target, mpz_ptr *gmpnum_target) /* {{{ */
{
- ZVAL_OBJ(target, gmp_create_object_ex(gmp_ce, gmpnum_target TSRMLS_CC));
+ ZVAL_OBJ(target, gmp_create_object_ex(gmp_ce, gmpnum_target));
}
/* }}} */
-static int gmp_cast_object(zval *readobj, zval *writeobj, int type TSRMLS_DC) /* {{{ */
+static int gmp_cast_object(zval *readobj, zval *writeobj, int type) /* {{{ */
{
mpz_ptr gmpnum;
switch (type) {
@@ -424,9 +427,9 @@ static int gmp_cast_object(zval *readobj, zval *writeobj, int type TSRMLS_DC) /*
}
/* }}} */
-static HashTable *gmp_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable *gmp_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- HashTable *ht, *props = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht, *props = zend_std_get_properties(obj);
mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(obj);
zval zv;
@@ -441,12 +444,12 @@ static HashTable *gmp_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zend_object *gmp_clone_obj(zval *obj TSRMLS_DC) /* {{{ */
+static zend_object *gmp_clone_obj(zval *obj) /* {{{ */
{
gmp_object *old_object = GET_GMP_OBJECT_FROM_ZVAL(obj);
- gmp_object *new_object = GET_GMP_OBJECT_FROM_OBJ(gmp_create_object(Z_OBJCE_P(obj) TSRMLS_CC));
+ gmp_object *new_object = GET_GMP_OBJECT_FROM_OBJ(gmp_create_object(Z_OBJCE_P(obj)));
- zend_objects_clone_members( &new_object->std, &old_object->std TSRMLS_CC);
+ zend_objects_clone_members( &new_object->std, &old_object->std);
mpz_set(new_object->num, old_object->num);
@@ -454,11 +457,11 @@ static zend_object *gmp_clone_obj(zval *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2 TSRMLS_DC) {
+static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2) {
zend_long shift = zval_get_long(op2);
if (shift < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shift cannot be negative");
+ php_error_docref(NULL, E_WARNING, "Shift cannot be negative");
RETVAL_FALSE;
} else {
mpz_ptr gmpnum_op, gmpnum_result;
@@ -474,7 +477,7 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
#define DO_BINARY_UI_OP_EX(op, uop, check_b_zero) \
gmp_zval_binary_ui_op( \
result, op1, op2, op, (gmp_binary_ui_op_t) uop, \
- check_b_zero TSRMLS_CC \
+ check_b_zero \
); \
return SUCCESS;
@@ -482,10 +485,10 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
#define DO_BINARY_OP(op) DO_BINARY_UI_OP_EX(op, NULL, 0)
#define DO_UNARY_OP(op) \
- gmp_zval_unary_op(result, op1, op TSRMLS_CC); \
+ gmp_zval_unary_op(result, op1, op); \
return SUCCESS;
-static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
{
switch (opcode) {
case ZEND_ADD:
@@ -495,17 +498,17 @@ static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval
case ZEND_MUL:
DO_BINARY_UI_OP(mpz_mul);
case ZEND_POW:
- shift_operator_helper(mpz_pow_ui, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_pow_ui, result, op1, op2);
return SUCCESS;
case ZEND_DIV:
DO_BINARY_UI_OP_EX(mpz_tdiv_q, mpz_tdiv_q_ui, 1);
case ZEND_MOD:
DO_BINARY_UI_OP_EX(mpz_mod, mpz_mod_ui, 1);
case ZEND_SL:
- shift_operator_helper(mpz_mul_2exp, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_mul_2exp, result, op1, op2);
return SUCCESS;
case ZEND_SR:
- shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2);
return SUCCESS;
case ZEND_BW_OR:
DO_BINARY_OP(mpz_ior);
@@ -522,7 +525,7 @@ static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval
}
/* }}} */
-static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy;
int retval;
@@ -532,7 +535,7 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op
op1 = &op1_copy;
}
- retval = gmp_do_operation_ex(opcode, result, op1, op2 TSRMLS_CC);
+ retval = gmp_do_operation_ex(opcode, result, op1, op2);
if (retval == SUCCESS && op1 == &op1_copy) {
zval_dtor(op1);
@@ -542,9 +545,9 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op
}
/* }}} */
-static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_compare(zval *result, zval *op1, zval *op2) /* {{{ */
{
- gmp_cmp(result, op1, op2 TSRMLS_CC);
+ gmp_cmp(result, op1, op2);
if (Z_TYPE_P(result) == IS_FALSE) {
ZVAL_LONG(result, 1);
}
@@ -552,7 +555,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) /* {{{ */
{
mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object);
smart_str buf = {0};
@@ -563,12 +566,12 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len,
PHP_VAR_SERIALIZE_INIT(serialize_data);
gmp_strval(&zv, gmpnum, 10);
- php_var_serialize(&buf, &zv, &serialize_data TSRMLS_CC);
+ php_var_serialize(&buf, &zv, &serialize_data);
zval_dtor(&zv);
ZVAL_ARR(&zv, &tmp_arr);
- tmp_arr.ht = *zend_std_get_properties(object TSRMLS_CC);
- php_var_serialize(&buf, &zv, &serialize_data TSRMLS_CC);
+ tmp_arr.ht = *zend_std_get_properties(object);
+ php_var_serialize(&buf, &zv, &serialize_data);
PHP_VAR_SERIALIZE_DESTROY(serialize_data);
*buffer = (unsigned char *) estrndup(buf.s->val, buf.s->len);
@@ -579,7 +582,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len,
}
/* }}} */
-static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) /* {{{ */
{
mpz_ptr gmpnum;
const unsigned char *p, *max;
@@ -589,31 +592,31 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
ZVAL_UNDEF(&zv);
PHP_VAR_UNSERIALIZE_INIT(unserialize_data);
- gmp_create(object, &gmpnum TSRMLS_CC);
+ gmp_create(object, &gmpnum);
p = buf;
max = buf + buf_len;
- if (!php_var_unserialize(&zv, &p, max, &unserialize_data TSRMLS_CC)
+ if (!php_var_unserialize(&zv, &p, max, &unserialize_data)
|| Z_TYPE(zv) != IS_STRING
- || convert_to_gmp(gmpnum, &zv, 10 TSRMLS_CC) == FAILURE
+ || convert_to_gmp(gmpnum, &zv, 10) == FAILURE
) {
- zend_throw_exception(NULL, "Could not unserialize number", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Could not unserialize number", 0);
goto exit;
}
zval_dtor(&zv);
ZVAL_UNDEF(&zv);
- if (!php_var_unserialize(&zv, &p, max, &unserialize_data TSRMLS_CC)
+ if (!php_var_unserialize(&zv, &p, max, &unserialize_data)
|| Z_TYPE(zv) != IS_ARRAY
) {
- zend_throw_exception(NULL, "Could not unserialize properties", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Could not unserialize properties", 0);
goto exit;
}
if (zend_hash_num_elements(Z_ARRVAL(zv)) != 0) {
zend_hash_copy(
- zend_std_get_properties(object TSRMLS_CC), Z_ARRVAL(zv),
+ zend_std_get_properties(object), Z_ARRVAL(zv),
(copy_ctor_func_t) zval_add_ref
);
}
@@ -630,6 +633,9 @@ exit:
*/
static ZEND_GINIT_FUNCTION(gmp)
{
+#if defined(COMPILE_DL_GMP) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
gmp_globals->rand_initialized = 0;
}
/* }}} */
@@ -640,7 +646,7 @@ ZEND_MINIT_FUNCTION(gmp)
{
zend_class_entry tmp_ce;
INIT_CLASS_ENTRY(tmp_ce, "GMP", NULL);
- gmp_ce = zend_register_internal_class(&tmp_ce TSRMLS_CC);
+ gmp_ce = zend_register_internal_class(&tmp_ce);
gmp_ce->create_object = gmp_create_object;
gmp_ce->serialize = gmp_serialize;
gmp_ce->unserialize = gmp_unserialize;
@@ -703,7 +709,7 @@ ZEND_MODULE_INFO_D(gmp)
/* {{{ convert_to_gmp
* Convert zval to be gmp number */
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base)
{
switch (Z_TYPE_P(val)) {
case IS_LONG:
@@ -729,7 +735,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), (int) base);
if (-1 == ret) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to convert variable to GMP - string is not an integer");
return FAILURE;
}
@@ -737,7 +743,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
return SUCCESS;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to convert variable to GMP - wrong type");
return FAILURE;
}
@@ -775,7 +781,7 @@ static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */
}
/* }}} */
-static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {{{ */
+static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg) /* {{{ */
{
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
@@ -807,7 +813,7 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
/* {{{ gmp_zval_binary_ui_op
Execute GMP binary operation.
*/
-static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
+static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result;
int use_ui = 0;
@@ -831,7 +837,7 @@ static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *
}
if (b_is_zero) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero operand not allowed");
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
RETURN_FALSE;
@@ -854,7 +860,7 @@ static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *
/* {{{ gmp_zval_binary_ui_op2
Execute GMP binary operation which returns 2 values.
*/
-static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC)
+static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result1, gmpnum_result2;
int use_ui = 0;
@@ -880,15 +886,15 @@ static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval
}
if (b_is_zero) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero operand not allowed");
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
RETURN_FALSE;
}
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -911,11 +917,11 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
{
zval *a_arg, *b_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero);
}
/* }}} */
@@ -923,7 +929,7 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
/* {{{ gmp_zval_unary_op
*/
-static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
+static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op)
{
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
@@ -939,7 +945,7 @@ static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_
/* {{{ gmp_zval_unary_ui_op
*/
-static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC)
+static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op)
{
mpz_ptr gmpnum_result;
@@ -955,11 +961,11 @@ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_o
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
- gmp_zval_unary_ui_op(return_value, a_arg, gmp_op TSRMLS_CC);
+ gmp_zval_unary_ui_op(return_value, a_arg, gmp_op);
}
/* }}} */
@@ -969,11 +975,11 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
- gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC);
+ gmp_zval_unary_op(return_value, a_arg, gmp_op);
}
/* }}} */
@@ -985,7 +991,7 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1003,7 +1009,7 @@ static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
@@ -1025,27 +1031,27 @@ ZEND_FUNCTION(gmp_init)
mpz_ptr gmpnumber;
zend_long base = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &number_arg, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &number_arg, &base) == FAILURE) {
return;
}
if (base && (base < 2 || base > GMP_MAX_BASE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE);
+ php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE);
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnumber);
- if (convert_to_gmp(gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) {
+ if (convert_to_gmp(gmpnumber, number_arg, base) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-int gmp_import_export_validate(zend_long size, zend_long options, int *order, int *endian TSRMLS_DC)
+int gmp_import_export_validate(zend_long size, zend_long options, int *order, int *endian)
{
if (size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Word size must be positive, %pd given", size);
return FAILURE;
}
@@ -1059,7 +1065,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
*order = 1;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid options: Conflicting word orders");
return FAILURE;
}
@@ -1076,7 +1082,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
*endian = 0;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid options: Conflicting word endianness");
return FAILURE;
}
@@ -1095,16 +1101,16 @@ ZEND_FUNCTION(gmp_import)
int order, endian;
mpz_ptr gmpnumber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &size, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &data, &data_len, &size, &options) == FAILURE) {
return;
}
- if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ if (gmp_import_export_validate(size, options, &order, &endian) == FAILURE) {
RETURN_FALSE;
}
if ((data_len % size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Input length must be a multiple of word size");
RETURN_FALSE;
}
@@ -1126,11 +1132,11 @@ ZEND_FUNCTION(gmp_export)
mpz_ptr gmpnumber;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
return;
}
- if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ if (gmp_import_export_validate(size, options, &order, &endian) == FAILURE) {
RETURN_FALSE;
}
@@ -1160,7 +1166,7 @@ ZEND_FUNCTION(gmp_intval)
{
zval *gmpnumber_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &gmpnumber_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &gmpnumber_arg) == FAILURE){
return;
}
@@ -1181,14 +1187,14 @@ ZEND_FUNCTION(gmp_strval)
mpz_ptr gmpnum;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &gmpnumber_arg, &base) == FAILURE) {
return;
}
/* Although the maximum base in general in GMP is 62, mpz_get_str()
* is explicitly limited to -36 when dealing with negative bases. */
if ((base < 2 && base > -2) || base > GMP_MAX_BASE || base < -36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
+ php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
RETURN_FALSE;
}
@@ -1231,22 +1237,22 @@ ZEND_FUNCTION(gmp_div_qr)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t) mpz_tdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t) mpz_tdiv_qr_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t) mpz_cdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t) mpz_cdiv_qr_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t) mpz_fdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t) mpz_fdiv_qr_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
}
@@ -1259,22 +1265,22 @@ ZEND_FUNCTION(gmp_div_r)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t) mpz_tdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t) mpz_tdiv_r_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t) mpz_cdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t) mpz_cdiv_r_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t) mpz_fdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t) mpz_fdiv_r_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
}
@@ -1287,22 +1293,22 @@ ZEND_FUNCTION(gmp_div_q)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t) mpz_tdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t) mpz_tdiv_q_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t) mpz_cdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t) mpz_cdiv_q_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t) mpz_fdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t) mpz_fdiv_q_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
@@ -1347,24 +1353,24 @@ ZEND_FUNCTION(gmp_fact)
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
if (IS_GMP(a_arg)) {
mpz_ptr gmpnum_tmp = GET_GMP_FROM_ZVAL(a_arg);
if (mpz_sgn(gmpnum_tmp) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
RETURN_FALSE;
}
} else {
if (zval_get_long(a_arg) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
RETURN_FALSE;
}
}
- gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui TSRMLS_CC);
+ gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui);
}
/* }}} */
@@ -1377,12 +1383,12 @@ ZEND_FUNCTION(gmp_pow)
gmp_temp_t temp_base;
zend_long exp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &base_arg, &exp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &base_arg, &exp) == FAILURE) {
return;
}
if (exp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative exponent not supported");
+ php_error_docref(NULL, E_WARNING, "Negative exponent not supported");
RETURN_FALSE;
}
@@ -1406,7 +1412,7 @@ ZEND_FUNCTION(gmp_powm)
int use_ui = 0;
gmp_temp_t temp_base, temp_exp, temp_mod;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz", &base_arg, &exp_arg, &mod_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz", &base_arg, &exp_arg, &mod_arg) == FAILURE){
return;
}
@@ -1418,7 +1424,7 @@ ZEND_FUNCTION(gmp_powm)
} else {
FETCH_GMP_ZVAL_DEP(gmpnum_exp, exp_arg, temp_exp, temp_base);
if (mpz_sgn(gmpnum_exp) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter cannot be less than 0");
+ php_error_docref(NULL, E_WARNING, "Second parameter cannot be less than 0");
FREE_GMP_TEMP(temp_base);
FREE_GMP_TEMP(temp_exp);
RETURN_FALSE;
@@ -1427,7 +1433,7 @@ ZEND_FUNCTION(gmp_powm)
FETCH_GMP_ZVAL_DEP_DEP(gmpnum_mod, mod_arg, temp_mod, temp_exp, temp_base);
if (!mpz_cmp_ui(gmpnum_mod, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modulus may not be zero");
+ php_error_docref(NULL, E_WARNING, "Modulus may not be zero");
FREE_GMP_TEMP(temp_base);
FREE_GMP_TEMP(temp_exp);
FREE_GMP_TEMP(temp_mod);
@@ -1455,14 +1461,14 @@ ZEND_FUNCTION(gmp_sqrt)
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
@@ -1482,20 +1488,20 @@ ZEND_FUNCTION(gmp_sqrtrem)
gmp_temp_t temp_a;
zval result1, result2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -1515,19 +1521,19 @@ ZEND_FUNCTION(gmp_root)
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &nth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &nth) == FAILURE) {
return;
}
if (nth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The root must be positive");
+ php_error_docref(NULL, E_WARNING, "The root must be positive");
RETURN_FALSE;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (nth % 2 == 0 && mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't take even root of negative number");
+ php_error_docref(NULL, E_WARNING, "Can't take even root of negative number");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
@@ -1548,25 +1554,25 @@ ZEND_FUNCTION(gmp_rootrem)
gmp_temp_t temp_a;
zval result1, result2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &nth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &nth) == FAILURE) {
return;
}
if (nth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The root must be positive");
+ php_error_docref(NULL, E_WARNING, "The root must be positive");
RETURN_FALSE;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (nth % 2 == 0 && mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't take even root of negative number");
+ php_error_docref(NULL, E_WARNING, "Can't take even root of negative number");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -1586,7 +1592,7 @@ ZEND_FUNCTION(gmp_perfect_square)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1606,7 +1612,7 @@ ZEND_FUNCTION(gmp_prob_prime)
zend_long reps = 10;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &reps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &gmpnumber_arg, &reps) == FAILURE) {
return;
}
@@ -1634,16 +1640,16 @@ ZEND_FUNCTION(gmp_gcdext)
gmp_temp_t temp_a, temp_b;
zval result_g, result_s, result_t;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a);
- gmp_create(&result_g, &gmpnum_g TSRMLS_CC);
- gmp_create(&result_s, &gmpnum_s TSRMLS_CC);
- gmp_create(&result_t, &gmpnum_t TSRMLS_CC);
+ gmp_create(&result_g, &gmpnum_g);
+ gmp_create(&result_s, &gmpnum_s);
+ gmp_create(&result_t, &gmpnum_t);
array_init(return_value);
add_assoc_zval(return_value, "g", &result_g);
@@ -1665,7 +1671,7 @@ ZEND_FUNCTION(gmp_invert)
gmp_temp_t temp_a, temp_b;
int res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
@@ -1705,11 +1711,11 @@ ZEND_FUNCTION(gmp_cmp)
{
zval *a_arg, *b_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
- gmp_cmp(return_value, a_arg, b_arg TSRMLS_CC);
+ gmp_cmp(return_value, a_arg, b_arg);
}
/* }}} */
@@ -1722,7 +1728,7 @@ ZEND_FUNCTION(gmp_sign)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1733,7 +1739,7 @@ ZEND_FUNCTION(gmp_sign)
}
/* }}} */
-static void gmp_init_random(TSRMLS_D)
+static void gmp_init_random(void)
{
if (!GMPG(rand_initialized)) {
/* Initialize */
@@ -1752,12 +1758,12 @@ ZEND_FUNCTION(gmp_random)
zend_long limiter = 20;
mpz_ptr gmpnum_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &limiter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &limiter) == FAILURE) {
return;
}
INIT_GMP_RETVAL(gmpnum_result);
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
#ifdef GMP_LIMB_BITS
mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS);
@@ -1775,11 +1781,11 @@ ZEND_FUNCTION(gmp_random_seed)
mpz_ptr gmpnum_seed;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &seed) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &seed) == FAILURE) {
return;
}
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
if (Z_TYPE_P(seed) == IS_LONG && Z_LVAL_P(seed) >= 0) {
gmp_randseed_ui(GMPG(rand_state), Z_LVAL_P(seed));
@@ -1801,17 +1807,17 @@ ZEND_FUNCTION(gmp_random_bits)
zend_long bits;
mpz_ptr gmpnum_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bits) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &bits) == FAILURE) {
return;
}
if (bits <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The number of bits must be positive");
+ php_error_docref(NULL, E_WARNING, "The number of bits must be positive");
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnum_result);
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
mpz_urandomb(gmpnum_result, GMPG(rand_state), bits);
}
@@ -1825,18 +1831,18 @@ ZEND_FUNCTION(gmp_random_range)
mpz_ptr gmpnum_min, gmpnum_max, gmpnum_result;
gmp_temp_t temp_a, temp_b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &min_arg, &max_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &min_arg, &max_arg) == FAILURE) {
return;
}
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
FETCH_GMP_ZVAL(gmpnum_max, max_arg, temp_a);
if (Z_TYPE_P(min_arg) == IS_LONG && Z_LVAL_P(min_arg) >= 0) {
if (mpz_cmp_ui(gmpnum_max, Z_LVAL_P(min_arg)) <= 0) {
FREE_GMP_TEMP(temp_a);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ php_error_docref(NULL, E_WARNING, "The minimum value must be less than the maximum value");
RETURN_FALSE;
}
@@ -1862,7 +1868,7 @@ ZEND_FUNCTION(gmp_random_range)
if (mpz_cmp(gmpnum_max, gmpnum_min) <= 0) {
FREE_GMP_TEMP(temp_b);
FREE_GMP_TEMP(temp_a);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ php_error_docref(NULL, E_WARNING, "The minimum value must be less than the maximum value");
RETURN_FALSE;
}
@@ -1928,12 +1934,12 @@ ZEND_FUNCTION(gmp_setbit)
zend_bool set = 1;
mpz_ptr gmpnum_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -1955,12 +1961,12 @@ ZEND_FUNCTION(gmp_clrbit)
zend_long index;
mpz_ptr gmpnum_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &a_arg, gmp_ce, &index) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &a_arg, gmp_ce, &index) == FAILURE){
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -1978,12 +1984,12 @@ ZEND_FUNCTION(gmp_testbit)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &index) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &index) == FAILURE){
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -2018,12 +2024,12 @@ ZEND_FUNCTION(gmp_scan0)
gmp_temp_t temp_a;
zend_long start;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &start) == FAILURE){
return;
}
if (start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Starting index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -2043,12 +2049,12 @@ ZEND_FUNCTION(gmp_scan1)
gmp_temp_t temp_a;
zend_long start;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &start) == FAILURE){
return;
}
if (start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Starting index must be greater than or equal to zero");
RETURN_FALSE;
}
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 0fdc1510f9..27d621bb39 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -93,7 +93,10 @@ ZEND_BEGIN_MODULE_GLOBALS(gmp)
ZEND_END_MODULE_GLOBALS(gmp)
#ifdef ZTS
-#define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v)
+#define GMPG(v) ZEND_TSRMG(gmp_globals_id, zend_gmp_globals *, v)
+#ifdef COMPILE_DL_GMP
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define GMPG(v) (gmp_globals.v)
#endif
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 406f074da3..09dea0dda3 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -126,13 +126,13 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &algo, &algo_len, &data, &data_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &algo, &algo_len, &data, &data_len, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (isfilename) {
@@ -243,14 +243,14 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|b", &algo, &algo_len, &data, &data_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|b", &algo, &algo_len, &data, &data_len,
&key, &key_len, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (isfilename) {
@@ -336,20 +336,20 @@ PHP_FUNCTION(hash_init)
const php_hash_ops *ops;
php_hash_data *hash;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (options & PHP_HASH_HMAC &&
key_len <= 0) {
/* Note: a zero length key is no key at all */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "HMAC requested without a key");
+ php_error_docref(NULL, E_WARNING, "HMAC requested without a key");
RETURN_FALSE;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION(hash_update)
char *data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zhash, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zhash, &data, &data_len) == FAILURE) {
return;
}
@@ -420,7 +420,7 @@ PHP_FUNCTION(hash_update_stream)
php_stream *stream = NULL;
zend_long length = -1, didread = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &zhash, &zstream, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &zhash, &zstream, &length) == FAILURE) {
return;
}
@@ -459,7 +459,7 @@ PHP_FUNCTION(hash_update_file)
char *filename, buf[1024];
size_t filename_len, n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
@@ -491,7 +491,7 @@ PHP_FUNCTION(hash_final)
zend_string *digest;
int digest_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &zhash, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &zhash, &raw_output) == FAILURE) {
return;
}
@@ -554,7 +554,7 @@ PHP_FUNCTION(hash_copy)
void *context;
int res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zhash) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zhash) == FAILURE) {
return;
}
@@ -609,28 +609,28 @@ PHP_FUNCTION(hash_pbkdf2)
const php_hash_ops *ops;
void *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|lb", &algo, &algo_len, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl|lb", &algo, &algo_len, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (iterations <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
+ php_error_docref(NULL, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
RETURN_FALSE;
}
if (length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
RETURN_FALSE;
}
if (salt_len > INT_MAX - 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
+ php_error_docref(NULL, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
RETURN_FALSE;
}
@@ -729,18 +729,18 @@ PHP_FUNCTION(hash_equals)
char *known_str, *user_str;
int result = 0, j;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &known_zval, &user_zval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &known_zval, &user_zval) == FAILURE) {
return;
}
/* We only allow comparing string to prevent unexpected results. */
if (Z_TYPE_P(known_zval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
+ php_error_docref(NULL, E_WARNING, "Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
RETURN_FALSE;
}
if (Z_TYPE_P(user_zval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
+ php_error_docref(NULL, E_WARNING, "Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
RETURN_FALSE;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(hash_equals)
/* Module Housekeeping */
-static void php_hash_dtor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_hash_dtor(zend_resource *rsrc) /* {{{ */
{
php_hash_data *hash = (php_hash_data*)rsrc->ptr;
@@ -820,9 +820,9 @@ static void mhash_init(INIT_FUNC_ARGS)
}
len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name, strlen(algorithm.mhash_name));
- zend_register_long_constant(buf, len, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
+ zend_register_long_constant(buf, len, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number);
}
- zend_register_internal_module(&mhash_module_entry TSRMLS_CC);
+ zend_register_internal_module(&mhash_module_entry);
}
/* {{{ proto string mhash(int hash, string data [, string key])
@@ -832,7 +832,7 @@ PHP_FUNCTION(mhash)
zval *z_algorithm;
zend_long algorithm;
- if (zend_parse_parameters(1 TSRMLS_CC, "z", &z_algorithm) == FAILURE) {
+ if (zend_parse_parameters(1, "z", &z_algorithm) == FAILURE) {
return;
}
@@ -864,7 +864,7 @@ PHP_FUNCTION(mhash_get_hash_name)
{
zend_long algorithm;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &algorithm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
return;
}
@@ -895,7 +895,7 @@ PHP_FUNCTION(mhash_get_block_size)
{
zend_long algorithm;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &algorithm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -924,13 +924,13 @@ PHP_FUNCTION(mhash_keygen_s2k)
size_t password_len, salt_len;
char padded_salt[SALT_SIZE];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
return;
}
bytes = (int)l_bytes;
if (bytes <= 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the byte parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "the byte parameter must be greater than 0");
RETURN_FALSE;
}
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index 98891f3b77..ddef755cb4 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -112,7 +112,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
PHP_MD5_CTX context;
unsigned char digest[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
@@ -144,7 +144,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index 003f05a774..19cedaf19e 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -95,7 +95,7 @@ PHP_FUNCTION(sha1)
PHP_SHA1_CTX context;
unsigned char digest[20];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
@@ -128,7 +128,7 @@ PHP_FUNCTION(sha1_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 10d21ccc6d..88e5abf97e 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -171,7 +171,7 @@ int main() {
AC_MSG_RESULT([no])
])
- PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"])
+ PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_SUBST(ICONV_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/iconv/])
else
diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32
index 00ab272423..989a477fa5 100644
--- a/ext/iconv/config.w32
+++ b/ext/iconv/config.w32
@@ -8,7 +8,7 @@ if (PHP_ICONV != "no") {
CHECK_LIB("iconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("iconv.lib", "iconv", PHP_ICONV)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {
- EXTENSION("iconv", "iconv.c");
+ EXTENSION("iconv", "iconv.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ICONV", 1, "Define if iconv extension is enabled");
AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available");
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index a4581e9fad..16c5eac578 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -164,12 +164,18 @@ zend_module_entry iconv_module_entry = {
/* }}} */
#ifdef COMPILE_DL_ICONV
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(iconv)
#endif
/* {{{ PHP_GINIT_FUNCTION */
static PHP_GINIT_FUNCTION(iconv)
{
+#if defined(COMPILE_DL_ICONV) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
iconv_globals->input_encoding = NULL;
iconv_globals->output_encoding = NULL;
iconv_globals->internal_encoding = NULL;
@@ -194,7 +200,7 @@ typedef enum _php_iconv_enc_scheme_t {
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC);
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset);
static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_t nbytes, const char *enc);
@@ -206,11 +212,11 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode);
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D);
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D);
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void);
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void);
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC);
-static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags TSRMLS_DC);
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len);
+static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags);
static int php_iconv_output_handler(void **nothing, php_output_context *output_context);
/* }}} */
@@ -227,9 +233,9 @@ static PHP_INI_MH(OnUpdateInputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -240,9 +246,9 @@ static PHP_INI_MH(OnUpdateOutputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -253,9 +259,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -303,12 +309,12 @@ PHP_MINIT_FUNCTION(miconv)
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_STRICT", PHP_ICONV_MIME_DECODE_STRICT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_CONTINUE_ON_ERROR", PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR, CONST_CS | CONST_PERSISTENT);
- if (php_iconv_stream_filter_register_factory(TSRMLS_C) != PHP_ICONV_ERR_SUCCESS) {
+ if (php_iconv_stream_filter_register_factory() != PHP_ICONV_ERR_SUCCESS) {
return FAILURE;
}
- php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict);
return SUCCESS;
}
@@ -317,7 +323,7 @@ PHP_MINIT_FUNCTION(miconv)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(miconv)
{
- php_iconv_stream_filter_unregister_factory(TSRMLS_C);
+ php_iconv_stream_filter_unregister_factory();
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -328,8 +334,8 @@ PHP_MINFO_FUNCTION(miconv)
{
zval *iconv_impl, *iconv_ver;
- iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1 TSRMLS_CC);
- iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1 TSRMLS_CC);
+ iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1);
+ iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1);
php_info_print_table_start();
php_info_print_table_row(2, "iconv support", "enabled");
@@ -341,7 +347,7 @@ PHP_MINFO_FUNCTION(miconv)
}
/* }}} */
-static char *get_internal_encoding(TSRMLS_D) {
+static char *get_internal_encoding(void) {
if (ICONVG(internal_encoding) && ICONVG(internal_encoding)[0]) {
return ICONVG(internal_encoding);
} else if (PG(internal_encoding) && PG(internal_encoding)[0]) {
@@ -352,7 +358,7 @@ static char *get_internal_encoding(TSRMLS_D) {
return "";
}
-static char *get_input_encoding(TSRMLS_D) {
+static char *get_input_encoding(void) {
if (ICONVG(input_encoding) && ICONVG(input_encoding)[0]) {
return ICONVG(input_encoding);
} else if (PG(input_encoding) && PG(input_encoding)[0]) {
@@ -363,7 +369,7 @@ static char *get_input_encoding(TSRMLS_D) {
return "";
}
-static char *get_output_encoding(TSRMLS_D) {
+static char *get_output_encoding(void) {
if (ICONVG(output_encoding) && ICONVG(output_encoding)[0]) {
return ICONVG(output_encoding);
} else if (PG(output_encoding) && PG(output_encoding)[0]) {
@@ -375,20 +381,20 @@ static char *get_output_encoding(TSRMLS_D) {
}
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C)) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)) {
+ if (php_output_get_level()) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))) {
return FAILURE;
}
}
return SUCCESS;
}
-static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
- return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags TSRMLS_CC);
+ return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags);
}
static int php_iconv_output_handler(void **nothing, php_output_context *output_context)
@@ -398,7 +404,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
PHP_OUTPUT_TSRMLS(output_context);
if (output_context->op & PHP_OUTPUT_HANDLER_START) {
- output_status = php_output_get_status(TSRMLS_C);
+ output_status = php_output_get_status();
if (output_status & PHP_OUTPUT_SENT) {
return FAILURE;
}
@@ -416,16 +422,16 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
size_t len;
- char *p = strstr(get_output_encoding(TSRMLS_C), "//");
+ char *p = strstr(get_output_encoding(), "//");
if (p) {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding()), get_output_encoding());
} else {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding());
}
if (content_type && SUCCESS == sapi_add_header(content_type, (uint)len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -433,7 +439,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (output_context->in.used) {
zend_string *out;
output_context->out.free = 1;
- _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+ _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(), get_internal_encoding()), get_output_encoding(), get_internal_encoding());
if (out) {
output_context->out.data = estrndup(out->val, out->len);
output_context->out.used = out->len;
@@ -1967,41 +1973,41 @@ out:
/* }}} */
/* {{{ php_iconv_show_error() */
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC)
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset)
{
switch (err) {
case PHP_ICONV_ERR_SUCCESS:
break;
case PHP_ICONV_ERR_CONVERTER:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot open converter");
+ php_error_docref(NULL, E_NOTICE, "Cannot open converter");
break;
case PHP_ICONV_ERR_WRONG_CHARSET:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
+ php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
in_charset, out_charset);
break;
case PHP_ICONV_ERR_ILLEGAL_CHAR:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an incomplete multibyte character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an incomplete multibyte character in input string");
break;
case PHP_ICONV_ERR_ILLEGAL_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an illegal character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an illegal character in input string");
break;
case PHP_ICONV_ERR_TOO_BIG:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer length exceeded");
+ php_error_docref(NULL, E_WARNING, "Buffer length exceeded");
break;
case PHP_ICONV_ERR_MALFORMED:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Malformed string");
+ php_error_docref(NULL, E_WARNING, "Malformed string");
break;
default:
/* other error */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown error (%d)", errno);
+ php_error_docref(NULL, E_NOTICE, "Unknown error (%d)", errno);
break;
}
}
@@ -2011,7 +2017,7 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
Returns the character count of str */
PHP_FUNCTION(iconv_strlen)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
@@ -2019,18 +2025,18 @@ PHP_FUNCTION(iconv_strlen)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s",
&str, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strlen(&retval, str->val, str->len, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
RETVAL_LONG(retval);
} else {
@@ -2043,7 +2049,7 @@ PHP_FUNCTION(iconv_strlen)
Returns specified part of a string */
PHP_FUNCTION(iconv_substr)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
zend_long offset, length = 0;
@@ -2052,14 +2058,14 @@ PHP_FUNCTION(iconv_substr)
smart_str retval = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|ls",
&str, &offset, &length,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2068,7 +2074,7 @@ PHP_FUNCTION(iconv_substr)
}
err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s != NULL) {
RETURN_STR(retval.s);
@@ -2082,7 +2088,7 @@ PHP_FUNCTION(iconv_substr)
Finds position of first occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2092,19 +2098,19 @@ PHP_FUNCTION(iconv_strpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ls",
&haystk, &ndl,
&offset, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string.");
RETURN_FALSE;
}
@@ -2114,7 +2120,7 @@ PHP_FUNCTION(iconv_strpos)
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
offset, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2128,7 +2134,7 @@ PHP_FUNCTION(iconv_strpos)
Finds position of last occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strrpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2137,7 +2143,7 @@ PHP_FUNCTION(iconv_strrpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|s",
&haystk, &ndl,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
@@ -2148,13 +2154,13 @@ PHP_FUNCTION(iconv_strrpos)
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
-1, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2175,13 +2181,13 @@ PHP_FUNCTION(iconv_mime_encode)
smart_str retval = {0};
php_iconv_err_t err;
- const char *in_charset = get_internal_encoding(TSRMLS_C);
+ const char *in_charset = get_internal_encoding();
const char *out_charset = in_charset;
zend_long line_len = 76;
const char *lfchars = "\r\n";
php_iconv_enc_scheme_t scheme_id = PHP_ICONV_ENC_SCHEME_BASE64;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|a",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|a",
&field_name, &field_value,
&pref) == FAILURE) {
@@ -2207,7 +2213,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "input-charset", sizeof("input-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2219,7 +2225,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "output-charset", sizeof("output-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2257,7 +2263,7 @@ PHP_FUNCTION(iconv_mime_encode)
err = _php_iconv_mime_encode(&retval, field_name->val, field_name->len,
field_value->val, field_value->len, line_len, lfchars, scheme_id,
out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2281,7 +2287,7 @@ PHP_FUNCTION(iconv_mime_encode)
PHP_FUNCTION(iconv_mime_decode)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
@@ -2289,19 +2295,19 @@ PHP_FUNCTION(iconv_mime_decode)
php_iconv_err_t err;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, (int)mode);
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2321,7 +2327,7 @@ PHP_FUNCTION(iconv_mime_decode)
PHP_FUNCTION(iconv_mime_decode_headers)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
char *enc_str_tmp;
@@ -2329,14 +2335,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2407,7 +2413,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
}
if (err != PHP_ICONV_ERR_SUCCESS) {
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
zval_dtor(return_value);
RETVAL_FALSE;
}
@@ -2424,17 +2430,17 @@ PHP_NAMED_FUNCTION(php_if_iconv)
php_iconv_err_t err;
zend_string *out_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssS",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssS",
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer) == FAILURE)
return;
if (in_charset_len >= ICONV_CSNMAXLEN || out_charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = php_iconv_string(in_buffer->val, (size_t)in_buffer->len, &out_buffer, out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
RETVAL_STR(out_buffer);
} else {
@@ -2455,11 +2461,11 @@ PHP_FUNCTION(iconv_set_encoding)
size_t type_len, retval;
zend_string *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &type, &type_len, &charset) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &type, &type_len, &charset) == FAILURE)
return;
if (charset->len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2491,20 +2497,20 @@ PHP_FUNCTION(iconv_get_encoding)
char *type = "all";
size_t type_len = sizeof("all")-1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &type, &type_len) == FAILURE)
return;
if (!strcasecmp("all", type)) {
array_init(return_value);
- add_assoc_string(return_value, "input_encoding", get_input_encoding(TSRMLS_C));
- add_assoc_string(return_value, "output_encoding", get_output_encoding(TSRMLS_C));
- add_assoc_string(return_value, "internal_encoding", get_internal_encoding(TSRMLS_C));
+ add_assoc_string(return_value, "input_encoding", get_input_encoding());
+ add_assoc_string(return_value, "output_encoding", get_output_encoding());
+ add_assoc_string(return_value, "internal_encoding", get_internal_encoding());
} else if (!strcasecmp("input_encoding", type)) {
- RETVAL_STRING(get_input_encoding(TSRMLS_C));
+ RETVAL_STRING(get_input_encoding());
} else if (!strcasecmp("output_encoding", type)) {
- RETVAL_STRING(get_output_encoding(TSRMLS_C));
+ RETVAL_STRING(get_output_encoding());
} else if (!strcasecmp("internal_encoding", type)) {
- RETVAL_STRING(get_internal_encoding(TSRMLS_C));
+ RETVAL_STRING(get_internal_encoding());
} else {
RETURN_FALSE;
}
@@ -2571,7 +2577,7 @@ static int php_iconv_stream_filter_append_bucket(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
const char *ps, size_t buf_len, size_t *consumed,
- int persistent TSRMLS_DC)
+ int persistent)
{
php_stream_bucket *new_bucket;
char *out_buf = NULL;
@@ -2604,14 +2610,14 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > 0) {
if (self->stub_len >= sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
self->stub[self->stub_len++] = *(ps++);
@@ -2633,11 +2639,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2646,11 +2652,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2661,12 +2667,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2683,13 +2689,13 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
memcpy(self->stub, ps, icnt);
@@ -2697,7 +2703,7 @@ static int php_iconv_stream_filter_append_bucket(
ps += icnt;
icnt = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
goto out_failure;
}
break;
@@ -2710,11 +2716,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2723,11 +2729,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2738,12 +2744,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2756,10 +2762,10 @@ static int php_iconv_stream_filter_append_bucket(
}
if (out_buf_size > ocnt) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
} else {
pefree(out_buf, persistent);
}
@@ -2778,7 +2784,7 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
- size_t *bytes_consumed, int flags TSRMLS_DC)
+ size_t *bytes_consumed, int flags)
{
php_stream_bucket *bucket = NULL;
size_t consumed = 0;
@@ -2787,21 +2793,21 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags != PSFS_FLAG_NORMAL) {
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, NULL, 0, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
}
@@ -2814,14 +2820,14 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
out_failure:
if (bucket != NULL) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
return PSFS_ERR_FATAL;
}
/* }}} */
/* {{{ php_iconv_stream_filter_cleanup */
-static void php_iconv_stream_filter_cleanup(php_stream_filter *filter TSRMLS_DC)
+static void php_iconv_stream_filter_cleanup(php_stream_filter *filter)
{
php_iconv_stream_filter_dtor((php_iconv_stream_filter *)Z_PTR(filter->abstract));
pefree(Z_PTR(filter->abstract), ((php_iconv_stream_filter *)Z_PTR(filter->abstract))->persistent);
@@ -2835,7 +2841,7 @@ static php_stream_filter_ops php_iconv_stream_filter_ops = {
};
/* {{{ php_iconv_stream_filter_create */
-static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent TSRMLS_DC)
+static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent)
{
php_stream_filter *retval = NULL;
php_iconv_stream_filter *inst;
@@ -2880,7 +2886,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
/* }}} */
/* {{{ php_iconv_stream_register_factory */
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void)
{
static php_stream_filter_factory filter_factory = {
php_iconv_stream_filter_factory_create
@@ -2888,7 +2894,7 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
if (FAILURE == php_stream_filter_register_factory(
php_iconv_stream_filter_ops.label,
- &filter_factory TSRMLS_CC)) {
+ &filter_factory)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;
@@ -2896,10 +2902,10 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
/* }}} */
/* {{{ php_iconv_stream_unregister_factory */
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void)
{
if (FAILURE == php_stream_filter_unregister_factory(
- php_iconv_stream_filter_ops.label TSRMLS_CC)) {
+ php_iconv_stream_filter_ops.label)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h
index 1a8330ae24..b2440fc03a 100644
--- a/ext/iconv/php_iconv.h
+++ b/ext/iconv/php_iconv.h
@@ -73,7 +73,10 @@ ZEND_BEGIN_MODULE_GLOBALS(iconv)
ZEND_END_MODULE_GLOBALS(iconv)
#ifdef ZTS
-# define ICONVG(v) TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# define ICONVG(v) ZEND_TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# ifdef COMPILE_DL_ICONV
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define ICONVG(v) (iconv_globals.v)
#endif
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 8dc56c5223..2c358375cf 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -74,10 +74,10 @@ MAILSTREAM DEFAULTPROTO;
# define PHP_IMAP_EXPORT
#endif
-static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC);
-static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC);
-static zend_string* _php_imap_parse_address(ADDRESS *addresslist, zval *paddress TSRMLS_DC);
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC);
+static void _php_make_header_object(zval *myzvalue, ENVELOPE *en);
+static void _php_imap_add_body(zval *arg, BODY *body);
+static zend_string* _php_imap_parse_address(ADDRESS *addresslist, zval *paddress);
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist);
/* the gets we use */
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md);
@@ -592,13 +592,13 @@ static int le_imap;
#define PHP_IMAP_CHECK_MSGNO(msgindex) \
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); \
+ php_error_docref(NULL, E_WARNING, "Bad message number"); \
RETURN_FALSE; \
} \
/* {{{ mail_close_it
*/
-static void mail_close_it(zend_resource *rsrc TSRMLS_DC)
+static void mail_close_it(zend_resource *rsrc)
{
pils *imap_le_struct = (pils *)rsrc->ptr;
@@ -622,7 +622,7 @@ static void mail_close_it(zend_resource *rsrc TSRMLS_DC)
/* {{{ add_assoc_object
*/
-static zval *add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
+static zval *add_assoc_object(zval *arg, char *key, zval *tmp)
{
HashTable *symtable;
@@ -637,7 +637,7 @@ static zval *add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
/* {{{ add_next_index_object
*/
-static inline zval *add_next_index_object(zval *arg, zval *tmp TSRMLS_DC)
+static inline zval *add_next_index_object(zval *arg, zval *tmp)
{
HashTable *symtable;
@@ -760,7 +760,6 @@ void mail_free_messagelist(MESSAGELIST **msglist, MESSAGELIST **tail)
void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
{
zval t_map, *return_value;
- TSRMLS_FETCH();
return_value = *IMAPG(quota_return);
@@ -788,7 +787,6 @@ void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
*/
void mail_getacl(MAILSTREAM *stream, char *mailbox, ACLLIST *alist)
{
- TSRMLS_FETCH();
/* walk through the ACLLIST */
for(; alist; alist = alist->next) {
@@ -1079,7 +1077,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
ecur = IMAPG(imap_errorstack);
while (ecur != NIL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
+ php_error_docref(NULL, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
ecur = ecur->next;
}
}
@@ -1091,7 +1089,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
acur = IMAPG(imap_alertstack);
while (acur != NIL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", acur->LTEXT);
+ php_error_docref(NULL, E_NOTICE, "%s", acur->LTEXT);
acur = acur->next;
}
}
@@ -1152,7 +1150,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zval *params = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
+ if (zend_parse_parameters(argc, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
&passwd, &passwd_len, &flags, &retries, &params) == FAILURE) {
return;
}
@@ -1193,7 +1191,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
mail_parameters(NIL, DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_P(z_auth_method));
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
}
}
}
@@ -1201,7 +1199,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
break;
case IS_LONG:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
break;
}
}
@@ -1218,7 +1216,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
/* local filename, need to perform open_basedir check */
- if (mailbox[0] != '{' && php_check_open_basedir(mailbox TSRMLS_CC)) {
+ if (mailbox[0] != '{' && php_check_open_basedir(mailbox)) {
RETURN_FALSE;
}
@@ -1228,7 +1226,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifdef SET_MAXLOGINTRIALS
if (argc >= 5) {
if (retries < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING ,"Retries must be greater or equal to 0");
+ php_error_docref(NULL, E_WARNING ,"Retries must be greater or equal to 0");
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries);
}
@@ -1238,7 +1236,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
imap_stream = mail_open(NIL, mailbox, flags);
if (imap_stream == NIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't open stream %s", mailbox);
+ php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", mailbox);
efree(IMAPG(imap_user)); IMAPG(imap_user) = 0;
efree(IMAPG(imap_password)); IMAPG(imap_password) = 0;
RETURN_FALSE;
@@ -1272,7 +1270,7 @@ PHP_FUNCTION(imap_reopen)
long flags=NIL;
long cl_flags=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ll", &streamind, &mailbox, &mailbox_len, &options, &retries) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ll", &streamind, &mailbox, &mailbox_len, &options, &retries) == FAILURE) {
return;
}
@@ -1292,14 +1290,14 @@ PHP_FUNCTION(imap_reopen)
}
#endif
/* local filename, need to perform open_basedir check */
- if (mailbox[0] != '{' && php_check_open_basedir(mailbox TSRMLS_CC)) {
+ if (mailbox[0] != '{' && php_check_open_basedir(mailbox)) {
RETURN_FALSE;
}
imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags);
if (imap_le_struct->imap_stream == NIL) {
zend_list_delete(Z_RES_P(streamind));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream");
+ php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1322,7 +1320,7 @@ PHP_FUNCTION(imap_append)
long start_offset = 0; /* Start offset (not used) */
int global = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|ss", &streamind, &folder, &folder_len, &message, &message_len, &flags, &flags_len, &internal_date, &internal_date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|ss", &streamind, &folder, &folder_len, &message, &message_len, &flags, &flags_len, &internal_date, &internal_date_len) == FAILURE) {
return;
}
@@ -1330,17 +1328,17 @@ PHP_FUNCTION(imap_append)
if (internal_date) {
/* Make sure the given internal_date string matches the RFC specifiedformat */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC))== NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex))== NULL) {
zend_string_free(regex);
RETURN_FALSE;
}
zend_string_free(regex);
php_pcre_match_impl(pce, internal_date, internal_date_len, return_value, subpats, global,
- 0, regex_flags, start_offset TSRMLS_CC);
+ 0, regex_flags, start_offset);
if (!Z_LVAL_P(return_value)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "internal date not correctly formatted");
+ php_error_docref(NULL, E_WARNING, "internal date not correctly formatted");
internal_date = NULL;
}
}
@@ -1364,7 +1362,7 @@ PHP_FUNCTION(imap_num_msg)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1381,7 +1379,7 @@ PHP_FUNCTION(imap_ping)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1398,7 +1396,7 @@ PHP_FUNCTION(imap_num_recent)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1418,7 +1416,7 @@ PHP_FUNCTION(imap_get_quota)
int qroot_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &qroot, &qroot_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &qroot, &qroot_len) == FAILURE) {
return;
}
@@ -1430,7 +1428,7 @@ PHP_FUNCTION(imap_get_quota)
/* set the callback for the GET_QUOTA function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
if (!imap_getquota(imap_le_struct->imap_stream, qroot)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquota failed");
+ php_error_docref(NULL, E_WARNING, "c-client imap_getquota failed");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1446,7 +1444,7 @@ PHP_FUNCTION(imap_get_quotaroot)
int mbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &mbox, &mbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &mbox, &mbox_len) == FAILURE) {
return;
}
@@ -1458,7 +1456,7 @@ PHP_FUNCTION(imap_get_quotaroot)
/* set the callback for the GET_QUOTAROOT function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
if (!imap_getquotaroot(imap_le_struct->imap_stream, mbox)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquotaroot failed");
+ php_error_docref(NULL, E_WARNING, "c-client imap_getquotaroot failed");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1476,7 +1474,7 @@ PHP_FUNCTION(imap_set_quota)
pils *imap_le_struct;
STRINGLIST limits;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &streamind, &qroot, &qroot_len, &mailbox_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &streamind, &qroot, &qroot_len, &mailbox_size) == FAILURE) {
return;
}
@@ -1499,7 +1497,7 @@ PHP_FUNCTION(imap_setacl)
int mailbox_len, id_len, rights_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &streamind, &mailbox, &mailbox_len, &id, &id_len, &rights, &rights_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &streamind, &mailbox, &mailbox_len, &id, &id_len, &rights, &rights_len) == FAILURE) {
return;
}
@@ -1518,7 +1516,7 @@ PHP_FUNCTION(imap_getacl)
int mailbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &mailbox, &mailbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &mailbox, &mailbox_len) == FAILURE) {
return;
}
@@ -1549,7 +1547,7 @@ PHP_FUNCTION(imap_expunge)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1569,12 +1567,12 @@ PHP_FUNCTION(imap_gc)
pils *imap_le_struct;
long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the flags parameter");
RETURN_FALSE;
}
@@ -1595,7 +1593,7 @@ PHP_FUNCTION(imap_close)
long options = 0, flags = NIL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &streamind, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &streamind, &options) == FAILURE) {
return;
}
@@ -1606,7 +1604,7 @@ PHP_FUNCTION(imap_close)
/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
if (flags && ((flags & ~PHP_EXPUNGE) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the flags parameter");
RETURN_FALSE;
}
@@ -1635,7 +1633,7 @@ PHP_FUNCTION(imap_headers)
unsigned int msgno;
char tmp[MAILTMPLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1685,12 +1683,12 @@ PHP_FUNCTION(imap_body)
char *body;
unsigned long body_len = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -1705,7 +1703,7 @@ PHP_FUNCTION(imap_body)
msgindex = msgno;
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -1728,7 +1726,7 @@ PHP_FUNCTION(imap_mail_copy)
int seq_len, folder_len, argc = ZEND_NUM_ARGS();
pils *imap_le_struct;
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
return;
}
@@ -1753,7 +1751,7 @@ PHP_FUNCTION(imap_mail_move)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
return;
}
@@ -1776,7 +1774,7 @@ PHP_FUNCTION(imap_createmailbox)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -1799,7 +1797,7 @@ PHP_FUNCTION(imap_renamemailbox)
int old_mailbox_len, new_mailbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &old_mailbox, &old_mailbox_len, &new_mailbox, &new_mailbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &old_mailbox, &old_mailbox_len, &new_mailbox, &new_mailbox_len) == FAILURE) {
return;
}
@@ -1822,7 +1820,7 @@ PHP_FUNCTION(imap_deletemailbox)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -1846,7 +1844,7 @@ PHP_FUNCTION(imap_list)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -1885,7 +1883,7 @@ PHP_FUNCTION(imap_list_full)
FOBJECTLIST *cur=NIL;
char *delim=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -1914,7 +1912,7 @@ PHP_FUNCTION(imap_list_full)
#else
add_property_string(&mboxob, "delimiter", cur->delimiter);
#endif
- add_next_index_object(return_value, &mboxob TSRMLS_CC);
+ add_next_index_object(return_value, &mboxob);
cur=cur->next;
}
mail_free_foblist(&IMAPG(imap_folder_objects), &IMAPG(imap_folder_objects_tail));
@@ -1933,7 +1931,7 @@ PHP_FUNCTION(imap_listscan)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &streamind, &ref, &ref_len, &pat, &pat_len, &content, &content_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &streamind, &ref, &ref_len, &pat, &pat_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1965,7 +1963,7 @@ PHP_FUNCTION(imap_check)
pils *imap_le_struct;
char date[100];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1998,7 +1996,7 @@ PHP_FUNCTION(imap_delete)
long flags = 0;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
@@ -2020,7 +2018,7 @@ PHP_FUNCTION(imap_undelete)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
@@ -2046,7 +2044,7 @@ PHP_FUNCTION(imap_headerinfo)
ENVELOPE *en;
char dummy[2000], fulladdress[MAILTMPLEN + 1];
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|lls", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|lls", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2054,7 +2052,7 @@ PHP_FUNCTION(imap_headerinfo)
if (argc >= 3) {
if (fromlength < 0 || fromlength > MAILTMPLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
+ php_error_docref(NULL, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2062,7 +2060,7 @@ PHP_FUNCTION(imap_headerinfo)
}
if (argc >= 4) {
if (subjectlength < 0 || subjectlength > MAILTMPLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
+ php_error_docref(NULL, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2081,7 +2079,7 @@ PHP_FUNCTION(imap_headerinfo)
/* call a function to parse all the text, so that we can use the
same function to parse text from other sources */
- _php_make_header_object(return_value, en TSRMLS_CC);
+ _php_make_header_object(return_value, en);
/* now run through properties that are only going to be returned
from a server, not text headers */
@@ -2124,7 +2122,7 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
ENVELOPE *en;
int headers_len, defaulthost_len = 0, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|s", &headers, &headers_len, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|s", &headers, &headers_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2136,7 +2134,7 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
/* call a function to parse all the text, so that we can use the
same function no matter where the headers are from */
- _php_make_header_object(return_value, en TSRMLS_CC);
+ _php_make_header_object(return_value, en);
mail_free_envelope(&en);
}
/* }}} */
@@ -2152,7 +2150,7 @@ PHP_FUNCTION(imap_lsub)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -2190,7 +2188,7 @@ PHP_FUNCTION(imap_lsub_full)
FOBJECTLIST *cur=NIL;
char *delim=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -2219,7 +2217,7 @@ PHP_FUNCTION(imap_lsub_full)
#else
add_property_string(&mboxob, "delimiter", cur->delimiter);
#endif
- add_next_index_object(return_value, &mboxob TSRMLS_CC);
+ add_next_index_object(return_value, &mboxob);
cur=cur->next;
}
mail_free_foblist (&IMAPG(imap_sfolder_objects), &IMAPG(imap_sfolder_objects_tail));
@@ -2237,7 +2235,7 @@ PHP_FUNCTION(imap_subscribe)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -2260,7 +2258,7 @@ PHP_FUNCTION(imap_unsubscribe)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -2284,12 +2282,12 @@ PHP_FUNCTION(imap_fetchstructure)
BODY *body;
int msgindex, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~FT_UID) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2314,11 +2312,11 @@ PHP_FUNCTION(imap_fetchstructure)
mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , (argc == 3 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available");
+ php_error_docref(NULL, E_WARNING, "No body information available");
RETURN_FALSE;
}
- _php_imap_add_body(return_value, body TSRMLS_CC);
+ _php_imap_add_body(return_value, body);
}
/* }}} */
@@ -2334,12 +2332,12 @@ PHP_FUNCTION(imap_fetchbody)
unsigned long len;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2353,7 +2351,7 @@ PHP_FUNCTION(imap_fetchbody)
body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, sec, &len, (argc == 4 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available");
+ php_error_docref(NULL, E_WARNING, "No body information available");
RETURN_FALSE;
}
RETVAL_STRINGL(body, len);
@@ -2374,12 +2372,12 @@ PHP_FUNCTION(imap_fetchmime)
unsigned long len;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2393,7 +2391,7 @@ PHP_FUNCTION(imap_fetchmime)
body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, sec, &len, (argc == 4 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body MIME information available");
+ php_error_docref(NULL, E_WARNING, "No body MIME information available");
RETURN_FALSE;
}
RETVAL_STRINGL(body, len);
@@ -2412,7 +2410,7 @@ PHP_FUNCTION(imap_savebody)
int section_len = 0, close_stream = 1;
long msgno, flags = 0;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
RETURN_FALSE;
}
@@ -2462,7 +2460,7 @@ PHP_FUNCTION(imap_base64)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2485,7 +2483,7 @@ PHP_FUNCTION(imap_qprint)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2508,7 +2506,7 @@ PHP_FUNCTION(imap_8bit)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2531,7 +2529,7 @@ PHP_FUNCTION(imap_binary)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2555,7 +2553,7 @@ PHP_FUNCTION(imap_mailboxmsginfo)
char date[100];
unsigned int msgno, unreadmsg, deletedmsg, msize;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -2602,7 +2600,7 @@ PHP_FUNCTION(imap_rfc822_write_address)
ADDRESS *addr;
zend_string *string;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &mailbox, &mailbox_len, &host, &host_len, &personal, &personal_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &mailbox, &mailbox_len, &host, &host_len, &personal, &personal_len) == FAILURE) {
return;
}
@@ -2624,7 +2622,7 @@ PHP_FUNCTION(imap_rfc822_write_address)
addr->error=NIL;
addr->adl=NIL;
- string = _php_rfc822_write_address(addr TSRMLS_CC);
+ string = _php_rfc822_write_address(addr);
if (string) {
RETVAL_STR(string);
} else {
@@ -2643,7 +2641,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
ADDRESS *addresstmp;
ENVELOPE *env;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &str, &str_len, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &str, &str_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2672,7 +2670,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
if (addresstmp->adl) {
add_property_string(&tovals, "adl", addresstmp->adl);
}
- add_next_index_object(return_value, &tovals TSRMLS_CC);
+ add_next_index_object(return_value, &tovals);
} while ((addresstmp = addresstmp->next));
mail_free_envelope(&env);
@@ -2687,7 +2685,7 @@ PHP_FUNCTION(imap_utf8)
int str_len;
SIZEDTEXT src, dest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -2751,7 +2749,7 @@ PHP_FUNCTION(imap_utf7_decode)
ST_DECODE3
} state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -2765,12 +2763,12 @@ PHP_FUNCTION(imap_utf7_decode)
if (state == ST_NORMAL) {
/* process printable character */
if (SPECIAL(*inp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified UTF-7 character: `%c'", *inp);
+ php_error_docref(NULL, E_WARNING, "Invalid modified UTF-7 character: `%c'", *inp);
RETURN_FALSE;
} else if (*inp != '&') {
outlen++;
} else if (inp + 1 == endp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string");
+ php_error_docref(NULL, E_WARNING, "Unexpected end of string");
RETURN_FALSE;
} else if (inp[1] != '-') {
state = ST_DECODE0;
@@ -2781,12 +2779,12 @@ PHP_FUNCTION(imap_utf7_decode)
} else if (*inp == '-') {
/* return to NORMAL mode */
if (state == ST_DECODE1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stray modified base64 character: `%c'", *--inp);
+ php_error_docref(NULL, E_WARNING, "Stray modified base64 character: `%c'", *--inp);
RETURN_FALSE;
}
state = ST_NORMAL;
} else if (!B64CHAR(*inp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified base64 character: `%c'", *inp);
+ php_error_docref(NULL, E_WARNING, "Invalid modified base64 character: `%c'", *inp);
RETURN_FALSE;
} else {
switch (state) {
@@ -2807,7 +2805,7 @@ PHP_FUNCTION(imap_utf7_decode)
/* enforce end state */
if (state != ST_NORMAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string");
+ php_error_docref(NULL, E_WARNING, "Unexpected end of string");
RETURN_FALSE;
}
@@ -2864,7 +2862,7 @@ PHP_FUNCTION(imap_utf7_decode)
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
+ php_error_docref(NULL, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
}
#endif
@@ -2890,7 +2888,7 @@ PHP_FUNCTION(imap_utf7_encode)
ST_ENCODE2
} state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -2995,7 +2993,7 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int in_len;
unsigned char *out;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in, &in_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &in, &in_len) == FAILURE) {
return;
}
@@ -3044,7 +3042,7 @@ PHP_FUNCTION(imap_setflag_full)
long flags = 0;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) == FAILURE) {
return;
}
@@ -3066,7 +3064,7 @@ PHP_FUNCTION(imap_clearflag_full)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) ==FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) ==FAILURE) {
return;
}
@@ -3092,19 +3090,19 @@ PHP_FUNCTION(imap_sort)
SEARCHPGM *spg=NIL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rll|lss", &streamind, &pgm, &rev, &flags, &criteria, &criteria_len, &charset, &charset_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rll|lss", &streamind, &pgm, &rev, &flags, &criteria, &criteria_len, &charset, &charset_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
if (pgm > SORTSIZE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized sort criteria");
+ php_error_docref(NULL, E_WARNING, "Unrecognized sort criteria");
RETURN_FALSE;
}
if (argc >= 4) {
if (flags < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search options parameter has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Search options parameter has to be greater than or equal to 0");
RETURN_FALSE;
}
}
@@ -3146,12 +3144,12 @@ PHP_FUNCTION(imap_fetchheader)
pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -3181,7 +3179,7 @@ PHP_FUNCTION(imap_uid)
pils *imap_le_struct;
int msgindex;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &msgno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) {
return;
}
@@ -3189,7 +3187,7 @@ PHP_FUNCTION(imap_uid)
msgindex = msgno;
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -3205,7 +3203,7 @@ PHP_FUNCTION(imap_msgno)
long msgno;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &msgno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) {
return;
}
@@ -3225,7 +3223,7 @@ PHP_FUNCTION(imap_status)
long flags;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &streamind, &mbx, &mbx_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &streamind, &mbx, &mbx_len, &flags) == FAILURE) {
return;
}
@@ -3269,14 +3267,14 @@ PHP_FUNCTION(imap_bodystruct)
PARAMETER *par, *dpar;
BODY *body;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &streamind, &msg, &section, &section_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls", &streamind, &msg, &section, &section_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
if (!msg || msg < 1 || (unsigned) msg > imap_le_struct->imap_stream->nmsgs) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -3336,9 +3334,9 @@ PHP_FUNCTION(imap_bodystruct)
object_init(&dparam);
add_property_string(&dparam, "attribute", dpar->attribute);
add_property_string(&dparam, "value", dpar->value);
- add_next_index_object(&dparametres, &dparam TSRMLS_CC);
+ add_next_index_object(&dparametres, &dparam);
} while ((dpar = dpar->next));
- add_assoc_object(return_value, "dparameters", &dparametres TSRMLS_CC);
+ add_assoc_object(return_value, "dparameters", &dparametres);
} else {
add_property_long(return_value, "ifdparameters", 0);
}
@@ -3357,13 +3355,13 @@ PHP_FUNCTION(imap_bodystruct)
add_property_string(&param, "value", par->value);
}
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ add_next_index_object(&parametres, &param);
} while ((par = par->next));
} else {
object_init(&parametres);
add_property_long(return_value, "ifparameters", 0);
}
- add_assoc_object(return_value, "parameters", &parametres TSRMLS_CC);
+ add_assoc_object(return_value, "parameters", &parametres);
}
/* }}} */
@@ -3381,12 +3379,12 @@ PHP_FUNCTION(imap_fetch_overview)
long status, flags = 0L;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &streamind, &sequence, &sequence_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &streamind, &sequence, &sequence_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~FT_UID) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -3412,14 +3410,14 @@ PHP_FUNCTION(imap_fetch_overview)
}
if (env->from) {
env->from->next=NULL;
- address =_php_rfc822_write_address(env->from TSRMLS_CC);
+ address =_php_rfc822_write_address(env->from);
if (address) {
add_property_str(&myoverview, "from", address);
}
}
if (env->to) {
env->to->next = NULL;
- address = _php_rfc822_write_address(env->to TSRMLS_CC);
+ address = _php_rfc822_write_address(env->to);
if (address) {
add_property_str(&myoverview, "to", address);
}
@@ -3446,7 +3444,7 @@ PHP_FUNCTION(imap_fetch_overview)
add_property_long(&myoverview, "seen", elt->seen);
add_property_long(&myoverview, "draft", elt->draft);
add_property_long(&myoverview, "udate", mail_longdate(elt));
- add_next_index_object(return_value, &myoverview TSRMLS_CC);
+ add_next_index_object(return_value, &myoverview);
}
}
}
@@ -3469,7 +3467,7 @@ PHP_FUNCTION(imap_mail_compose)
int toppart = 0;
int first;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &envelope, &body) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &envelope, &body) == FAILURE) {
return;
}
@@ -3545,7 +3543,7 @@ PHP_FUNCTION(imap_mail_compose)
first = 0;
if (Z_TYPE_P(data) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
RETURN_FALSE;
}
@@ -3745,12 +3743,12 @@ PHP_FUNCTION(imap_mail_compose)
} ZEND_HASH_FOREACH_END();
if (first) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
RETURN_FALSE;
}
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot generate multipart e-mail without components.");
+ php_error_docref(NULL, E_WARNING, "cannot generate multipart e-mail without components.");
RETVAL_FALSE;
goto done;
}
@@ -3809,7 +3807,7 @@ PHP_FUNCTION(imap_mail_compose)
if (!cookie) {
cookie = "-";
} else if (strlen(cookie) > (SENDBUFLEN - 2 - 2 - 2)) { /* validate cookie length -- + CRLF * 2 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The boundary should be no longer than 4kb");
+ php_error_docref(NULL, E_WARNING, "The boundary should be no longer than 4kb");
RETVAL_FALSE;
goto done;
}
@@ -3861,7 +3859,7 @@ done:
/* {{{ _php_imap_mail
*/
-int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath TSRMLS_DC)
+int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath)
{
#ifdef PHP_WIN32
int tsm_err;
@@ -3981,12 +3979,12 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
strlcat(bufferHeader, headers, bufferLen + 1);
}
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
if (tsm_errmsg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
+ php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err));
+ php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err));
}
PHP_IMAP_CLEAN;
return 0;
@@ -4014,7 +4012,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
return 1;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program");
+ php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program");
return 0;
}
#endif
@@ -4029,31 +4027,31 @@ PHP_FUNCTION(imap_mail)
char *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *cc=NULL, *bcc=NULL, *rpath=NULL;
int to_len, message_len, headers_len, subject_len, cc_len, bcc_len, rpath_len, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "sss|ssss", &to, &to_len, &subject, &subject_len, &message, &message_len,
+ if (zend_parse_parameters(argc, "sss|ssss", &to, &to_len, &subject, &subject_len, &message, &message_len,
&headers, &headers_len, &cc, &cc_len, &bcc, &bcc_len, &rpath, &rpath_len) == FAILURE) {
return;
}
/* To: */
if (!to_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No to field in mail command");
+ php_error_docref(NULL, E_WARNING, "No to field in mail command");
RETURN_FALSE;
}
/* Subject: */
if (!subject_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No subject field in mail command");
+ php_error_docref(NULL, E_WARNING, "No subject field in mail command");
RETURN_FALSE;
}
/* message body */
if (!message_len) {
/* this is not really an error, so it is allowed. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message string in mail command");
+ php_error_docref(NULL, E_WARNING, "No message string in mail command");
message = NULL;
}
- if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath TSRMLS_CC)) {
+ if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -4075,7 +4073,7 @@ PHP_FUNCTION(imap_search)
int argc = ZEND_NUM_ARGS();
SEARCHPGM *pgm = NIL;
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|ls", &streamind, &criteria, &criteria_len, &flags, &charset, &charset_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|ls", &streamind, &criteria, &criteria_len, &flags, &charset, &charset_len) == FAILURE) {
return;
}
@@ -4199,7 +4197,7 @@ PHP_FUNCTION(imap_mime_header_decode)
long charset_token, encoding_token, end_token, end, offset=0, i;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -4300,7 +4298,7 @@ static long _php_rfc822_soutr (void *stream, char *string)
/* {{{ _php_rfc822_write_address
*/
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist)
{
char address[MAILTMPLEN];
smart_str ret = {0};
@@ -4380,12 +4378,12 @@ static int _php_imap_address_size (ADDRESS *addresslist)
/* {{{ _php_rfc822_write_address
*/
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist)
{
char address[SENDBUFLEN];
if (_php_imap_address_size(addresslist) >= SENDBUFLEN) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Address buffer overflow");
+ php_error_docref(NULL, E_ERROR, "Address buffer overflow");
return NULL;
}
address[0] = 0;
@@ -4396,7 +4394,7 @@ static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
#endif
/* {{{ _php_imap_parse_address
*/
-static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddress TSRMLS_DC)
+static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddress)
{
zend_string *fulladdress;
ADDRESS *addresstmp;
@@ -4404,7 +4402,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
addresstmp = addresslist;
- fulladdress = _php_rfc822_write_address(addresstmp TSRMLS_CC);
+ fulladdress = _php_rfc822_write_address(addresstmp);
addresstmp = addresslist;
do {
@@ -4413,7 +4411,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
if (addresstmp->adl) add_property_string(&tmpvals, "adl", addresstmp->adl);
if (addresstmp->mailbox) add_property_string(&tmpvals, "mailbox", addresstmp->mailbox);
if (addresstmp->host) add_property_string(&tmpvals, "host", addresstmp->host);
- add_next_index_object(paddress, &tmpvals TSRMLS_CC);
+ add_next_index_object(paddress, &tmpvals);
} while ((addresstmp = addresstmp->next));
return fulladdress;
}
@@ -4421,7 +4419,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
/* {{{ _php_make_header_object
*/
-static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
+static void _php_make_header_object(zval *myzvalue, ENVELOPE *en)
{
zval paddress;
zend_string *fulladdress=NULL;
@@ -4441,72 +4439,72 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
if (en->to) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->to, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->to, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "toaddress", fulladdress);
}
- add_assoc_object(myzvalue, "to", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "to", &paddress);
}
if (en->from) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->from, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->from, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "fromaddress", fulladdress);
}
- add_assoc_object(myzvalue, "from", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "from", &paddress);
}
if (en->cc) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->cc, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->cc, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "ccaddress", fulladdress);
}
- add_assoc_object(myzvalue, "cc", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "cc", &paddress);
}
if (en->bcc) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->bcc, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->bcc, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "bccaddress", fulladdress);
}
- add_assoc_object(myzvalue, "bcc", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "bcc", &paddress);
}
if (en->reply_to) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->reply_to, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->reply_to, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "reply_toaddress", fulladdress);
}
- add_assoc_object(myzvalue, "reply_to", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "reply_to", &paddress);
}
if (en->sender) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->sender, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->sender, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "senderaddress", fulladdress);
}
- add_assoc_object(myzvalue, "sender", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "sender", &paddress);
}
if (en->return_path) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->return_path, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->return_path, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "return_pathaddress", fulladdress);
}
- add_assoc_object(myzvalue, "return_path", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "return_path", &paddress);
}
}
/* }}} */
/* {{{ _php_imap_add_body
*/
-void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
+void _php_imap_add_body(zval *arg, BODY *body)
{
zval parametres, param, dparametres, dparam;
PARAMETER *par, *dpar;
@@ -4565,9 +4563,9 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
object_init(&dparam);
add_property_string(&dparam, "attribute", dpar->attribute);
add_property_string(&dparam, "value", dpar->value);
- add_next_index_object(&dparametres, &dparam TSRMLS_CC);
+ add_next_index_object(&dparametres, &dparam);
} while ((dpar = dpar->next));
- add_assoc_object(arg, "dparameters", &dparametres TSRMLS_CC);
+ add_assoc_object(arg, "dparameters", &dparametres);
} else {
add_property_long(arg, "ifdparameters", 0);
}
@@ -4586,23 +4584,23 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
add_property_string(&param, "value", par->value);
}
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ add_next_index_object(&parametres, &param);
} while ((par = par->next));
} else {
object_init(&parametres);
add_property_long(arg, "ifparameters", 0);
}
- add_assoc_object(arg, "parameters", &parametres TSRMLS_CC);
+ add_assoc_object(arg, "parameters", &parametres);
/* multipart message ? */
if (body->type == TYPEMULTIPART) {
array_init(&parametres);
for (part = body->CONTENT_PART; part; part = part->next) {
object_init(&param);
- _php_imap_add_body(&param, &part->body TSRMLS_CC);
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ _php_imap_add_body(&param, &part->body);
+ add_next_index_object(&parametres, &param);
}
- add_assoc_object(arg, "parts", &parametres TSRMLS_CC);
+ add_assoc_object(arg, "parts", &parametres);
}
/* encapsulated message ? */
@@ -4610,9 +4608,9 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
body = body->CONTENT_MSG_BODY;
array_init(&parametres);
object_init(&param);
- _php_imap_add_body(&param, body TSRMLS_CC);
- add_next_index_object(&parametres, &param TSRMLS_CC);
- add_assoc_object(arg, "parts", &parametres TSRMLS_CC);
+ _php_imap_add_body(&param, body);
+ add_next_index_object(&parametres, &param);
+ add_assoc_object(arg, "parts", &parametres);
}
}
/* }}} */
@@ -4676,7 +4674,7 @@ PHP_FUNCTION(imap_thread)
int argc = ZEND_NUM_ARGS();
SEARCHPGM *pgm = NIL;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &streamind, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &streamind, &flags) == FAILURE) {
return;
}
@@ -4689,7 +4687,7 @@ PHP_FUNCTION(imap_thread)
}
if(top == NIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function returned an empty tree");
+ php_error_docref(NULL, E_WARNING, "Function returned an empty tree");
RETURN_FALSE;
}
@@ -4709,7 +4707,7 @@ PHP_FUNCTION(imap_timeout)
long ttype, timeout=-1;
int timeout_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &ttype, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &ttype, &timeout) == FAILURE) {
RETURN_FALSE;
}
@@ -4764,7 +4762,6 @@ PHP_FUNCTION(imap_timeout)
#define GETS_FETCH_SIZE 8196LU
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md) /* {{{ */
{
- TSRMLS_FETCH();
/* write to the gets stream if it is set,
otherwise forward to c-clients gets */
@@ -4783,10 +4780,10 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
}
if (!f(stream, read, buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
+ php_error_docref(NULL, E_WARNING, "Failed to read from socket");
break;
} else if (read != php_stream_write(IMAPG(gets_stream), buf, read)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write to stream");
+ php_error_docref(NULL, E_WARNING, "Failed to write to stream");
break;
}
}
@@ -4797,7 +4794,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
if (f(stream, size, buf)) {
buf[size] = '\0';
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
+ php_error_docref(NULL, E_WARNING, "Failed to read from socket");
free(buf);
buf = NULL;
}
@@ -4811,7 +4808,6 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number)
{
MESSAGELIST *cur = NIL;
- TSRMLS_FETCH();
if (IMAPG(imap_messages) == NIL) {
IMAPG(imap_messages) = mail_newmessagelist();
@@ -4844,7 +4840,6 @@ PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number)
PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg)
{
STRINGLIST *cur = NIL;
- TSRMLS_FETCH();
if (strncmp(str, "[ALERT] ", 8) == 0) {
if (IMAPG(imap_alertstack) == NIL) {
@@ -4868,7 +4863,6 @@ PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
{
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
- TSRMLS_FETCH();
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build up a the new array of objects */
@@ -4915,7 +4909,6 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
{
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
- TSRMLS_FETCH();
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build the array of objects */
@@ -4957,7 +4950,6 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
{
- TSRMLS_FETCH();
IMAPG(status_flags)=status->flags;
if (IMAPG(status_flags) & SA_MESSAGES) {
@@ -4980,7 +4972,6 @@ PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *st
PHP_IMAP_EXPORT void mm_log(char *str, long errflg)
{
ERRORLIST *cur = NIL;
- TSRMLS_FETCH();
/* Author: CJH */
if (errflg != NIL) { /* CJH: maybe put these into a more comprehensive log for debugging purposes? */
@@ -5012,7 +5003,6 @@ PHP_IMAP_EXPORT void mm_dlog(char *str)
PHP_IMAP_EXPORT void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
{
- TSRMLS_FETCH();
if (*mb->user) {
strlcpy (user, mb->user, MAILTMPLEN);
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c
index 6ac44ffeb0..a0600d15aa 100644
--- a/ext/interbase/ibase_blobs.c
+++ b/ext/interbase/ibase_blobs.c
@@ -32,14 +32,14 @@
static int le_blob;
-static void _php_ibase_free_blob(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_blob(zend_resource *rsrc) /* {{{ */
{
ibase_blob *ib_blob = (ibase_blob *)rsrc->ptr;
if (ib_blob->bl_handle != NULL) { /* blob open*/
if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
_php_ibase_module_error("You can lose data. Close any blob after reading from or "
- "writing to it. Use ibase_blob_close() before calling ibase_close()" TSRMLS_CC);
+ "writing to it. Use ibase_blob_close() before calling ibase_close()");
}
}
efree(ib_blob);
@@ -93,7 +93,7 @@ typedef struct { /* {{{ */
/* }}} */
} IBASE_BLOBINFO;
-int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC) /* {{{ */
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len) /* {{{ */
{
if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/
@@ -115,7 +115,7 @@ int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long m
bl_data[cur_len] = '\0';
if (IB_STATUS[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment)) {
efree(bl_data);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
// TODO: avoid double reallocation???
@@ -128,7 +128,7 @@ int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long m
}
/* }}} */
-int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{ */
+int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob) /* {{{ */
{
unsigned long put_cnt = 0, rem_cnt;
unsigned short chunk_size;
@@ -140,7 +140,7 @@ int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{
chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt;
if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size, &Z_STRVAL_P(string_arg)[put_cnt] )) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
put_cnt += chunk_size;
@@ -149,7 +149,7 @@ int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{
}
/* }}} */
-static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info TSRMLS_DC) /* {{{ */
+static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info) /* {{{ */
{
static char bl_items[] = {
isc_info_blob_num_segments,
@@ -166,7 +166,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
bl_info->bl_stream = 0;
if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_inf), bl_inf)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
@@ -193,7 +193,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
break;
case isc_info_truncated:
case isc_info_error: /* hmm. don't think so...*/
- _php_ibase_module_error("PHP module internal error" TSRMLS_CC);
+ _php_ibase_module_error("PHP module internal error");
return FAILURE;
} /* switch */
p += item_len;
@@ -213,7 +213,7 @@ PHP_FUNCTION(ibase_blob_create)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link)) {
RETURN_FALSE;
}
@@ -224,7 +224,7 @@ PHP_FUNCTION(ibase_blob_create)
ib_blob->type = BLOB_INPUT;
if (isc_create_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ib_blob);
RETURN_FALSE;
}
@@ -251,12 +251,12 @@ PHP_FUNCTION(ibase_blob_open)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -270,13 +270,13 @@ PHP_FUNCTION(ibase_blob_open)
do {
if (! _php_ibase_string_to_quad(blob_id, &ib_blob->bl_qd)) {
- _php_ibase_module_error("String is not a BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("String is not a BLOB ID");
break;
}
if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle,
&ib_blob->bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
break;
}
@@ -307,11 +307,11 @@ PHP_FUNCTION(ibase_blob_add)
ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob);
if (ib_blob->type != BLOB_INPUT) {
- _php_ibase_module_error("BLOB is not open for input" TSRMLS_CC);
+ _php_ibase_module_error("BLOB is not open for input");
RETURN_FALSE;
}
- if (_php_ibase_blob_add(string_arg, ib_blob TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_add(string_arg, ib_blob) != SUCCESS) {
RETURN_FALSE;
}
}
@@ -333,13 +333,13 @@ PHP_FUNCTION(ibase_blob_get)
ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob);
if (ib_blob->type != BLOB_OUTPUT) {
- _php_ibase_module_error("BLOB is not open for output" TSRMLS_CC);
+ _php_ibase_module_error("BLOB is not open for output");
RETURN_FALSE;
}
convert_to_long_ex(len_arg);
- if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_P(len_arg) TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_P(len_arg)) != SUCCESS) {
RETURN_FALSE;
}
}
@@ -363,7 +363,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) /* {{{
if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/
if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
}
@@ -375,7 +375,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) /* {{{
efree(s);
} else { /* discard created blob */
if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
ib_blob->bl_handle = NULL;
@@ -419,12 +419,12 @@ PHP_FUNCTION(ibase_blob_info)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -433,22 +433,22 @@ PHP_FUNCTION(ibase_blob_info)
PHP_IBASE_LINK_TRANS(link, ib_link, trans);
if (! _php_ibase_string_to_quad(blob_id, &ib_blob.bl_qd)) {
- _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("Unrecognized BLOB ID");
RETURN_FALSE;
}
if (ib_blob.bl_qd.gds_quad_high || ib_blob.bl_qd.gds_quad_low) { /* not null ? */
if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob.bl_handle,
&ib_blob.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
- if (_php_ibase_blob_info(ib_blob.bl_handle, &bl_info TSRMLS_CC)) {
+ if (_php_ibase_blob_info(ib_blob.bl_handle, &bl_info)) {
RETURN_FALSE;
}
if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
} else { /* null blob, all values to zero */
@@ -496,12 +496,12 @@ PHP_FUNCTION(ibase_blob_echo)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -510,7 +510,7 @@ PHP_FUNCTION(ibase_blob_echo)
PHP_IBASE_LINK_TRANS(link, ib_link, trans);
if (! _php_ibase_string_to_quad(blob_id, &ib_blob_id.bl_qd)) {
- _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("Unrecognized BLOB ID");
RETURN_FALSE;
}
@@ -535,7 +535,7 @@ PHP_FUNCTION(ibase_blob_echo)
RETURN_TRUE;
} while (0);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
/* }}} */
@@ -556,7 +556,7 @@ PHP_FUNCTION(ibase_blob_import)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|r",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r|r",
(ZEND_NUM_ARGS()-1) ? &link : &file, &file)) {
RETURN_FALSE;
}
@@ -587,7 +587,7 @@ PHP_FUNCTION(ibase_blob_import)
return;
} while (0);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
/* }}} */
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c
index 5a64b31c75..72fc18d00f 100644
--- a/ext/interbase/ibase_events.c
+++ b/ext/interbase/ibase_events.c
@@ -36,7 +36,7 @@ static void _php_ibase_event_free(char *event_buf, char *result_buf) /* {{{ */
}
/* }}} */
-void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
+void _php_ibase_free_event(ibase_event *event) /* {{{ */
{
unsigned short i;
@@ -47,7 +47,7 @@ void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
if (event->link->handle != NULL &&
isc_cancel_events(IB_STATUS, &event->link->handle, &event->event_id)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
/* delete this event from the link struct */
@@ -69,11 +69,11 @@ void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_event_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_event_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_event *e = (ibase_event *) rsrc->ptr;
- _php_ibase_free_event(e TSRMLS_CC);
+ _php_ibase_free_event(e);
efree(e);
}
@@ -137,7 +137,7 @@ PHP_FUNCTION(ibase_wait_event)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -168,7 +168,7 @@ PHP_FUNCTION(ibase_wait_event)
/* now block until an event occurs */
if (isc_wait_for_event(IB_STATUS, &ib_link->handle, buffer_size, event_buffer, result_buffer)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
_php_ibase_event_free(event_buffer,result_buffer);
efree(args);
RETURN_FALSE;
@@ -232,8 +232,8 @@ static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */
/* call the callback provided by the user */
if (SUCCESS != call_user_function(EG(function_table), NULL,
- &event->callback, &return_value, 2, args TSRMLS_CC)) {
- _php_ibase_module_error("Error calling callback %s" TSRMLS_CC, Z_STRVAL(event->callback));
+ &event->callback, &return_value, 2, args)) {
+ _php_ibase_module_error("Error calling callback %s", Z_STRVAL(event->callback));
break;
}
@@ -246,7 +246,7 @@ static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */
if (isc_que_events(IB_STATUS, &event->link->handle, &event->event_id, buffer_size,
event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
event->state = ACTIVE;
}
@@ -277,7 +277,7 @@ PHP_FUNCTION(ibase_set_event_handler)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -317,8 +317,8 @@ PHP_FUNCTION(ibase_set_event_handler)
}
/* get the callback */
- if (!zend_is_callable(cb_arg, 0, &cb_name TSRMLS_CC)) {
- _php_ibase_module_error("Callback argument %s is not a callable function" TSRMLS_CC, cb_name->val);
+ if (!zend_is_callable(cb_arg, 0, &cb_name)) {
+ _php_ibase_module_error("Callback argument %s is not a callable function", cb_name->val);
zend_string_release(cb_name);
RETURN_FALSE;
}
@@ -348,7 +348,7 @@ PHP_FUNCTION(ibase_set_event_handler)
if (isc_que_events(IB_STATUS, &ib_link->handle, &event->event_id, buffer_size,
event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(event);
RETURN_FALSE;
}
@@ -369,7 +369,7 @@ PHP_FUNCTION(ibase_free_event_handler)
RESET_ERRMSG;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &event_arg)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &event_arg)) {
ibase_event *event;
ZEND_FETCH_RESOURCE(event, ibase_event *, event_arg, -1, "Interbase event", le_event);
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 2cd2ada65f..95c462e55c 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -116,7 +116,7 @@ static void _php_ibase_free_xsqlda(XSQLDA *sqlda) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt) /* {{{ */
{
static char info[] = { isc_info_base_level, isc_info_end };
@@ -127,14 +127,14 @@ static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stm
if (SUCCESS == isc_database_info(IB_STATUS, &link->handle,
sizeof(info), info, sizeof(res_buf), res_buf)) {
if (isc_dsql_free_statement(IB_STATUS, &stmt, DSQL_drop)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
}
}
/* }}} */
-static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */
{
ibase_result *ib_result = (ibase_result *) rsrc->ptr;
@@ -145,14 +145,14 @@ static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
IBDEBUG("query still valid; don't drop statement handle");
ib_result->query->result = NULL; /* Indicate to query, that result is released */
} else {
- _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt TSRMLS_CC);
+ _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt);
}
efree(ib_result);
}
}
/* }}} */
-static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
{
IBDEBUG("Freeing query...");
@@ -166,7 +166,7 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
IBDEBUG("result still valid; don't drop statement handle");
ib_query->result->query = NULL; /* Indicate to result, that query is released */
} else {
- _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt TSRMLS_CC);
+ _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt);
}
if (ib_query->in_array) {
efree(ib_query->in_array);
@@ -180,13 +180,13 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_ibase_free_query_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_ibase_free_query_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_query *ib_query = (ibase_query *)rsrc->ptr;
if (ib_query != NULL) {
IBDEBUG("Preparing to free query by dtor...");
- _php_ibase_free_query(ib_query TSRMLS_CC);
+ _php_ibase_free_query(ib_query);
efree(ib_query);
}
}
@@ -202,7 +202,7 @@ void php_ibase_query_minit(INIT_FUNC_ARGS) /* {{{ */
/* }}} */
static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ */
- isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt TSRMLS_DC)
+ isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt)
{
unsigned short i, n;
ibase_array *ar;
@@ -228,7 +228,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{
if (isc_array_lookup_bounds(IB_STATUS, &link, &trans, var->relname,
var->sqlname, ar_desc)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ar);
return FAILURE;
}
@@ -313,14 +313,14 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{
/* allocate and prepare query */
static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* {{{ */
- ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id TSRMLS_DC)
+ ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id)
{
static char info_type[] = {isc_info_sql_stmt_type};
char result[8];
/* Return FAILURE, if querystring is empty */
if (*query == '\0') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Querystring empty.");
+ php_error_docref(NULL, E_WARNING, "Querystring empty.");
return FAILURE;
}
@@ -338,7 +338,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->in_sqlda = NULL;
if (isc_dsql_allocate_statement(IB_STATUS, &link->handle, &ib_query->stmt)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
@@ -348,14 +348,14 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
if (isc_dsql_prepare(IB_STATUS, &ib_query->trans->handle, &ib_query->stmt,
0, query, dialect, ib_query->out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
/* find out what kind of statement was prepared */
if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type),
info_type, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
ib_query->statement_type = result[3];
@@ -366,7 +366,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->out_sqlda->sqln = ib_query->out_sqlda->sqld;
ib_query->out_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
}
@@ -376,7 +376,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->in_sqlda->sqln = 1;
ib_query->in_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
@@ -388,7 +388,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt,
SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
}
@@ -398,7 +398,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
efree(ib_query->in_sqlda);
ib_query->in_sqlda = NULL;
} else if (FAILURE == _php_ibase_alloc_array(&ib_query->in_array, ib_query->in_sqlda,
- link->handle, trans->handle, &ib_query->in_array_cnt TSRMLS_CC)) {
+ link->handle, trans->handle, &ib_query->in_array_cnt)) {
goto _php_ibase_alloc_query_error;
}
@@ -406,7 +406,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
efree(ib_query->out_sqlda);
ib_query->out_sqlda = NULL;
} else if (FAILURE == _php_ibase_alloc_array(&ib_query->out_array, ib_query->out_sqlda,
- link->handle, trans->handle, &ib_query->out_array_cnt TSRMLS_CC)) {
+ link->handle, trans->handle, &ib_query->out_array_cnt)) {
goto _php_ibase_alloc_query_error;
}
@@ -431,7 +431,7 @@ _php_ibase_alloc_query_error:
/* }}} */
static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /* {{{ */
- ibase_array *array, int dim TSRMLS_DC)
+ ibase_array *array, int dim)
{
zval null_val, *pnull_val = &null_val;
int u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper,
@@ -457,7 +457,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
subval = pnull_val;
}
- if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1 TSRMLS_CC) == FAILURE)
+ if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1) == FAILURE)
{
return FAILURE;
}
@@ -492,14 +492,14 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
switch (array->el_type) {
case SQL_SHORT:
if (l > SHRT_MAX || l < SHRT_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(short*) buf = (short) l;
break;
case SQL_LONG:
if (l > ISC_LONG_MAX || l < ISC_LONG_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(ISC_LONG*) buf = (ISC_LONG) l;
@@ -536,7 +536,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
case SQL_SHORT:
convert_to_long(val);
if (Z_LVAL_P(val) > SHRT_MAX || Z_LVAL_P(val) < SHRT_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(short *) buf = (short) Z_LVAL_P(val);
@@ -545,7 +545,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
convert_to_long(val);
#if (SIZEOF_LONG > 4)
if (Z_LVAL_P(val) > ISC_LONG_MAX || Z_LVAL_P(val) < ISC_LONG_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
#endif
@@ -584,7 +584,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3 && n != 6) {
_php_ibase_module_error("Invalid date/time format (expected 3 or 6 fields, got %d."
- " Use format 'm/d/Y H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ " Use format 'm/d/Y H:i:s'. You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
t.tm_year -= 1900;
@@ -601,7 +601,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3) {
_php_ibase_module_error("Invalid date format (expected 3 fields, got %d. "
- "Use format 'm/d/Y' You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ "Use format 'm/d/Y' You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
t.tm_year -= 1900;
@@ -618,7 +618,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3) {
_php_ibase_module_error("Invalid time format (expected 3 fields, got %d. "
- "Use format 'H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ "Use format 'H:i:s'. You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
#endif
@@ -635,7 +635,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
/* }}} */
static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
- ibase_query *ib_query TSRMLS_DC)
+ ibase_query *ib_query)
{
int i, array_cnt = 0, rv = SUCCESS;
@@ -741,16 +741,16 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (isc_create_blob(IB_STATUS, &ib_query->link->handle,
&ib_query->trans->handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
- if (_php_ibase_blob_add(b_var, &ib_blob TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_add(b_var, &ib_blob) != SUCCESS) {
return FAILURE;
}
if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
buf[i].val.qval = ib_blob.bl_qd;
@@ -765,7 +765,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (Z_STRLEN_P(b_var) != BLOB_ID_LEN ||
!_php_ibase_string_to_quad(Z_STRVAL_P(b_var), &buf[i].val.qval)) {
- _php_ibase_module_error("Parameter %d: invalid array ID" TSRMLS_CC,i+1);
+ _php_ibase_module_error("Parameter %d: invalid array ID",i+1);
rv = FAILURE;
}
} else {
@@ -775,7 +775,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
ISC_QUAD array_id = { 0, 0 };
if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size,
- ar, 0 TSRMLS_CC)) {
+ ar, 0)) {
_php_ibase_module_error("Parameter %d: failed to bind array argument"
TSRMLS_CC,i+1);
efree(array_data);
@@ -785,7 +785,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (isc_array_put_slice(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle,
&array_id, &ar->ar_desc, array_data, &ar->ar_size)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(array_data);
return FAILURE;
}
@@ -888,7 +888,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0,
ib_query->query, ib_query->dialect, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -920,7 +920,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle,
&ib_query->trans->handle, 0, ib_query->query, ib_query->dialect, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -969,7 +969,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
in_sqlda = emalloc(XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
memcpy(in_sqlda, ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
bind_buf = safe_emalloc(sizeof(BIND_BUF), ib_query->in_sqlda->sqld, 0);
- if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query TSRMLS_CC) == FAILURE) {
+ if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query) == FAILURE) {
IBDEBUG("Could not bind input XSQLDA");
goto _php_ibase_exec_error;
}
@@ -984,7 +984,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
}
if (isc_result) {
IBDEBUG("Could not execute query");
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
ib_query->trans->affected_rows = 0;
@@ -1000,7 +1000,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_count),
info_count, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -1077,7 +1077,7 @@ PHP_FUNCTION(ibase_query)
long l;
default:
- if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3 TSRMLS_CC, "rrs",
+ if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3, "rrs",
&zlink, &ztrans, &query, &query_len)) {
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, zlink, -1, LE_LINK, le_link, le_plink);
@@ -1088,7 +1088,7 @@ PHP_FUNCTION(ibase_query)
break;
}
case 2:
- if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2 TSRMLS_CC, "rs",
+ if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2, "rs",
&zlink, &query, &query_len)) {
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zlink, &ib_link, &trans);
@@ -1107,19 +1107,19 @@ PHP_FUNCTION(ibase_query)
if (PG(sql_safe_mode)) {
_php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode"
- TSRMLS_CC);
+ );
} else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
_php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count "
- "(%ld) reached" TSRMLS_CC, l);
+ "(%ld) reached", l);
} else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len,
query, SQL_DIALECT_CURRENT, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
} else if (!db) {
_php_ibase_module_error("Connection to created database could not be "
- "established" TSRMLS_CC);
+ "established");
} else {
@@ -1140,7 +1140,7 @@ PHP_FUNCTION(ibase_query)
}
case 1:
case 0:
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0 TSRMLS_CC, "s", &query,
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0, "s", &query,
&query_len)) {
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK,
le_link, le_plink);
@@ -1152,9 +1152,9 @@ PHP_FUNCTION(ibase_query)
}
/* open default transaction */
- if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)
+ if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans)
|| FAILURE == _php_ibase_alloc_query(&ib_query, ib_link, trans, query, ib_link->dialect,
- trans_res_id TSRMLS_CC)) {
+ trans_res_id)) {
return;
}
@@ -1163,13 +1163,13 @@ PHP_FUNCTION(ibase_query)
expected_n = ib_query.in_sqlda ? ib_query.in_sqlda->sqld : 0;
if (bind_n != expected_n) {
- php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
+ php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
if (bind_n < expected_n) {
break;
}
} else if (bind_n > 0) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &bind_args, &bind_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &bind_args, &bind_num) == FAILURE) {
return;
}
}
@@ -1191,7 +1191,7 @@ PHP_FUNCTION(ibase_query)
}
} while (0);
- _php_ibase_free_query(&ib_query TSRMLS_CC);
+ _php_ibase_free_query(&ib_query);
}
/* }}} */
@@ -1206,7 +1206,7 @@ PHP_FUNCTION(ibase_affected_rows)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
@@ -1264,14 +1264,14 @@ PHP_FUNCTION(ibase_num_rows)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, &result_arg, -1, LE_RESULT, le_result);
if (isc_dsql_sql_info(IB_STATUS, &ib_result->stmt, sizeof(info_count), info_count, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1291,7 +1291,7 @@ PHP_FUNCTION(ibase_num_rows)
/* }}} */
static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */
- int scale, int flag TSRMLS_DC)
+ int scale, int flag)
{
static ISC_INT64 const scales[] = { 1, 10, 100, 1000,
10000,
@@ -1423,7 +1423,7 @@ format_date_time:
/* }}} */
static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_size, /* {{{ */
- ibase_array *ib_array, int dim, int flag TSRMLS_DC)
+ ibase_array *ib_array, int dim, int flag)
{
/**
* Create multidimension array - recursion function
@@ -1444,7 +1444,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
/* recursion here */
if (FAILURE == _php_ibase_arr_zval(&slice_zval, data, slice_size, ib_array, dim + 1,
- flag TSRMLS_CC)) {
+ flag)) {
return FAILURE;
}
data += slice_size;
@@ -1454,7 +1454,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
} else { /* data at last */
if (FAILURE == _php_ibase_var_zval(ar_zval, data, ib_array->el_type,
- ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag TSRMLS_CC)) {
+ ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag)) {
return FAILURE;
}
@@ -1478,7 +1478,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result_arg, &flag)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result_arg, &flag)) {
return;
}
@@ -1492,7 +1492,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1, ib_result->out_sqlda)) {
ib_result->has_more_rows = 0;
if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
RETURN_FALSE;
}
@@ -1537,7 +1537,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
default:
_php_ibase_var_zval(&result, var->sqldata, var->sqltype, var->sqllen,
- var->sqlscale, flag TSRMLS_CC);
+ var->sqlscale, flag);
break;
case SQL_BLOB:
if (flag & PHP_IBASE_FETCH_BLOBS) { /* fetch blob contents into hash */
@@ -1553,13 +1553,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_open_blob(IB_STATUS, &ib_result->link->handle, &ib_result->trans->handle,
&blob_handle.bl_handle, &blob_handle.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
if (isc_blob_info(IB_STATUS, &blob_handle.bl_handle, sizeof(bl_items),
bl_items, sizeof(bl_info), bl_info)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
@@ -1572,7 +1572,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
item == isc_info_error || i >= sizeof(bl_info)) {
_php_ibase_module_error("Could not determine BLOB size (internal error)"
- TSRMLS_CC);
+ );
goto _php_ibase_fetch_error;
}
@@ -1588,12 +1588,12 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (max_len == 0) {
ZVAL_STRING(&result, "");
} else if (SUCCESS != _php_ibase_blob_get(&result, &blob_handle,
- max_len TSRMLS_CC)) {
+ max_len)) {
goto _php_ibase_fetch_error;
}
if (isc_close_blob(IB_STATUS, &blob_handle.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
@@ -1614,13 +1614,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_array_get_slice(IB_STATUS, &ib_result->link->handle,
&ib_result->trans->handle, &ar_qd, &ib_array->ar_desc,
ar_data, &ib_array->ar_size)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ar_data);
goto _php_ibase_fetch_error;
}
if (FAILURE == _php_ibase_arr_zval(&result, ar_data, ib_array->ar_size, ib_array,
- 0, flag TSRMLS_CC)) {
+ 0, flag)) {
efree(ar_data);
goto _php_ibase_fetch_error;
}
@@ -1694,14 +1694,14 @@ PHP_FUNCTION(ibase_name_result)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result);
if (isc_dsql_set_cursor_name(IB_STATUS, &ib_result->stmt, name_arg, 0)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1718,7 +1718,7 @@ PHP_FUNCTION(ibase_free_result)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) {
return;
}
@@ -1742,12 +1742,12 @@ PHP_FUNCTION(ibase_prepare)
RESET_ERRMSG;
if (ZEND_NUM_ARGS() == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink);
} else if (ZEND_NUM_ARGS() == 2) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &link_arg, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link_arg, &query, &query_len) == FAILURE) {
return;
}
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, link_arg, &ib_link, &trans);
@@ -1756,7 +1756,7 @@ PHP_FUNCTION(ibase_prepare)
trans_res_id = Z_RES_P(link_arg)->handle;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, -1, LE_LINK, le_link, le_plink);
@@ -1764,13 +1764,13 @@ PHP_FUNCTION(ibase_prepare)
trans_res_id = Z_RES_P(trans_arg)->handle;
}
- if (FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_def_trans(ib_link, &trans)) {
RETURN_FALSE;
}
ib_query = (ibase_query *) emalloc(sizeof(ibase_query));
- if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id)) {
efree(ib_query);
RETURN_FALSE;
}
@@ -1792,7 +1792,7 @@ PHP_FUNCTION(ibase_execute)
RETVAL_FALSE;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r*", &query, &args, &bind_n)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r*", &query, &args, &bind_n)) {
return;
}
@@ -1802,7 +1802,7 @@ PHP_FUNCTION(ibase_execute)
int expected_n = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0;
if (bind_n != expected_n) {
- php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
+ php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
if (bind_n < expected_n) {
@@ -1818,7 +1818,7 @@ PHP_FUNCTION(ibase_execute)
IBDEBUG("Implicitly closing a cursor");
if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_close)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
break;
}
/* invalidate previous results returned by this query (not necessary for exec proc) */
@@ -1846,7 +1846,7 @@ PHP_FUNCTION(ibase_execute)
result->stmt = NULL;
}
- ret = zend_list_insert(result, le_result TSRMLS_CC);
+ ret = zend_list_insert(result, le_result);
ib_query->result_res_id = Z_RES_HANDLE_P(ret);
ZVAL_COPY_VALUE(return_value, ret);
Z_ADDREF_P(return_value);
@@ -1865,7 +1865,7 @@ PHP_FUNCTION(ibase_free_query)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &query_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &query_arg) == FAILURE) {
return;
}
@@ -1885,7 +1885,7 @@ PHP_FUNCTION(ibase_num_fields)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2009,7 +2009,7 @@ PHP_FUNCTION(ibase_field_info)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) {
return;
}
@@ -2028,7 +2028,7 @@ PHP_FUNCTION(ibase_field_info)
}
if (sqlda == NULL) {
- _php_ibase_module_error("Trying to get field info from a non-select query" TSRMLS_CC);
+ _php_ibase_module_error("Trying to get field info from a non-select query");
RETURN_FALSE;
}
@@ -2048,7 +2048,7 @@ PHP_FUNCTION(ibase_num_params)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2072,7 +2072,7 @@ PHP_FUNCTION(ibase_param_info)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) {
return;
}
diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c
index c068c8d56b..04125cf2aa 100644
--- a/ext/interbase/ibase_service.c
+++ b/ext/interbase/ibase_service.c
@@ -36,12 +36,12 @@ typedef struct {
static int le_service;
-static void _php_ibase_free_service(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_service(zend_resource *rsrc) /* {{{ */
{
ibase_service *sv = (ibase_service *) rsrc->ptr;
if (isc_service_detach(IB_STATUS, &sv->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
if (sv->hostname) {
@@ -58,7 +58,7 @@ static void _php_ibase_free_service(zend_resource *rsrc TSRMLS_DC) /* {{{ */
/* the svc api seems to get confused after an error has occurred,
so invalidate the handle on errors */
#define IBASE_SVC_ERROR(svm) \
- do { zend_list_delete(svm->res); _php_ibase_error(TSRMLS_C); } while (0)
+ do { zend_list_delete(svm->res); _php_ibase_error(); } while (0)
void php_ibase_service_minit(INIT_FUNC_ARGS) /* {{{ */
@@ -144,7 +144,7 @@ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
(operation == isc_action_svc_delete_user) ? "rs" : "rss|sss",
&res, &args[0], &args_len[0], &args[1], &args_len[1], &args[2], &args_len[2],
&args[3], &args_len[3], &args[4], &args_len[4])) {
@@ -215,7 +215,7 @@ PHP_FUNCTION(ibase_service_attach)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "sss",
&host, &hlen, &user, &ulen, &pass, &plen)) {
RETURN_FALSE;
@@ -227,7 +227,7 @@ PHP_FUNCTION(ibase_service_attach)
user, isc_spb_password, (char)plen, pass, host);
if (spb_len > sizeof(buf) || spb_len == -1) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -236,7 +236,7 @@ PHP_FUNCTION(ibase_service_attach)
/* attach to the service manager */
if (isc_service_attach(IB_STATUS, 0, loc, &handle, (unsigned short)spb_len, buf)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -259,7 +259,7 @@ PHP_FUNCTION(ibase_service_detach)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res)) {
RETURN_FALSE;
}
@@ -432,7 +432,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|lb",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rss|lb",
&res, &db, &dblen, &bk, &bklen, &opts, &verbose)) {
RETURN_FALSE;
}
@@ -451,7 +451,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
}
if (spb_len > sizeof(buf) || spb_len <= 0) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -495,7 +495,7 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl|l",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rsl|l",
&res, &db, &dblen, &action, &argument)) {
RETURN_FALSE;
}
@@ -520,7 +520,7 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
switch (action) {
default:
unknown_option:
- _php_ibase_module_error("Unrecognised option (%ld)" TSRMLS_CC, action);
+ _php_ibase_module_error("Unrecognised option (%ld)", action);
RETURN_FALSE;
case isc_spb_rpr_check_db:
@@ -559,7 +559,7 @@ options_argument:
}
if (spb_len > sizeof(buf) || spb_len == -1) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -602,7 +602,7 @@ PHP_FUNCTION(ibase_server_info)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &action)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &action)) {
RETURN_FALSE;
}
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 59c4a0fa42..a91bc320cf 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -41,7 +41,7 @@
#define COMMIT 1
#define RETAIN 2
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
ZEND_DECLARE_MODULE_GLOBALS(ibase)
static PHP_GINIT_FUNCTION(ibase);
@@ -502,7 +502,7 @@ PHP_FUNCTION(ibase_errcode)
/* }}} */
/* print interbase error and save it for ibase_errmsg() */
-void _php_ibase_error(TSRMLS_D) /* {{{ */
+void _php_ibase_error(void) /* {{{ */
{
char *s = IBG(errmsg);
ISC_STATUS *statusp = IB_STATUS;
@@ -514,17 +514,17 @@ void _php_ibase_error(TSRMLS_D) /* {{{ */
s = IBG(errmsg) + strlen(IBG(errmsg));
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg));
+ php_error_docref(NULL, E_WARNING, "%s", IBG(errmsg));
}
/* }}} */
/* print php interbase module error and save it for ibase_errmsg() */
-void _php_ibase_module_error(char *msg TSRMLS_DC, ...) /* {{{ */
+void _php_ibase_module_error(char *msg, ...) /* {{{ */
{
va_list ap;
#ifdef ZTS
- va_start(ap, TSRMLS_C);
+ va_start(ap, );
#else
va_start(ap, msg);
#endif
@@ -535,7 +535,7 @@ void _php_ibase_module_error(char *msg TSRMLS_DC, ...) /* {{{ */
IBG(sql_code) = -999; /* no SQL error */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg));
+ php_error_docref(NULL, E_WARNING, "%s", IBG(errmsg));
}
/* }}} */
@@ -560,7 +560,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */
ZEND_FETCH_RESOURCE(*trans, ibase_trans *, link_id, -1, LE_TRANS, le_trans);
if ((*trans)->link_cnt > 1) {
_php_ibase_module_error("Link id is ambiguous: transaction spans multiple connections."
- TSRMLS_CC);
+ );
return;
}
*ib_link = (*trans)->db_link[0];
@@ -575,7 +575,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */
/* destructors ---------------------- */
-static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
+static void _php_ibase_commit_link(ibase_db_link *link) /* {{{ */
{
unsigned short i = 0, j;
ibase_tr_list *l;
@@ -589,7 +589,7 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
if (p->trans->handle != NULL) {
IBDEBUG("Committing default transaction...");
if (isc_commit_transaction(IB_STATUS, &p->trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
efree(p->trans); /* default transaction is not a registered resource: clean up */
@@ -598,7 +598,7 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
/* non-default trans might have been rolled back by other call of this dtor */
IBDEBUG("Rolling back other transactions...");
if (isc_rollback_transaction(IB_STATUS, &p->trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
/* set this link pointer to NULL in the transaction */
@@ -616,26 +616,26 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
link->tr_list = NULL;
for (e = link->event_head; e; e = e->event_next) {
- _php_ibase_free_event(e TSRMLS_CC);
+ _php_ibase_free_event(e);
e->link = NULL;
}
}
/* }}} */
-static void php_ibase_commit_link_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_ibase_commit_link_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
}
/* }}} */
-static void _php_ibase_close_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_close_link(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
if (link->handle != NULL) {
IBDEBUG("Closing normal link...");
isc_detach_database(IB_STATUS, &link->handle);
@@ -645,11 +645,11 @@ static void _php_ibase_close_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_close_plink(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_close_plink(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
IBDEBUG("Closing permanent link...");
if (link->handle != NULL) {
isc_detach_database(IB_STATUS, &link->handle);
@@ -660,7 +660,7 @@ static void _php_ibase_close_plink(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_trans(zend_resource *rsrc) /* {{{ */
{
ibase_trans *trans = (ibase_trans *)rsrc->ptr;
unsigned short i;
@@ -669,7 +669,7 @@ static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
if (trans->handle != NULL) {
IBDEBUG("Rolling back unhandled transaction...");
if (isc_rollback_transaction(IB_STATUS, &trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
@@ -694,7 +694,6 @@ static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
/* TODO this function should be part of either Zend or PHP API */
static PHP_INI_DISP(php_ibase_password_displayer_cb)
{
- TSRMLS_FETCH();
if ((type == PHP_INI_DISPLAY_ORIG && ini_entry->orig_value)
|| (type == PHP_INI_DISPLAY_ACTIVE && ini_entry->value)) {
@@ -847,7 +846,7 @@ static char const dpb_args[] = {
0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name, 0
};
-int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db TSRMLS_DC)
+int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db)
{
short i, dpb_len, buf_len = 257-2; /* version byte at the front, and a null at the end */
char dpb_buffer[257] = { isc_dpb_version1, 0 }, *dpb;
@@ -873,7 +872,7 @@ int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db T
buf_len -= dpb_len;
}
if (isc_attach_database(IB_STATUS, (short)len[DB], args[DB], db, (short)(dpb-dpb_buffer), dpb_buffer)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
return SUCCESS;
@@ -892,7 +891,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssllsl",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|ssssllsl",
&args[DB], &len[DB], &args[USER], &len[USER], &args[PASS], &len[PASS],
&args[CSET], &len[CSET], &largs[BUF], &largs[DLECT], &args[ROLE], &len[ROLE],
&largs[SYNC])) {
@@ -975,12 +974,12 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
/* no link found, so we have to open one */
if ((l = INI_INT("ibase.max_links")) != -1 && IBG(num_links) >= l) {
- _php_ibase_module_error("Too many open links (%ld)" TSRMLS_CC, IBG(num_links));
+ _php_ibase_module_error("Too many open links (%ld)", IBG(num_links));
RETURN_FALSE;
}
/* create the ib_link */
- if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle)) {
RETURN_FALSE;
}
@@ -1060,7 +1059,7 @@ PHP_FUNCTION(ibase_close)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) {
return;
}
@@ -1098,7 +1097,7 @@ PHP_FUNCTION(ibase_drop_db)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) {
return;
}
@@ -1113,7 +1112,7 @@ PHP_FUNCTION(ibase_drop_db)
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink);
if (isc_drop_database(IB_STATUS, &ib_link->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1159,7 +1158,7 @@ PHP_FUNCTION(ibase_trans)
ISC_TEB *teb;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argn) == FAILURE) {
efree(ib_link);
RETURN_FALSE;
}
@@ -1250,7 +1249,7 @@ PHP_FUNCTION(ibase_trans)
/* start the transaction */
if (result) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ib_link);
RETURN_FALSE;
}
@@ -1283,10 +1282,10 @@ PHP_FUNCTION(ibase_trans)
}
/* }}} */
-int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC) /* {{{ */
+int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans) /* {{{ */
{
if (ib_link == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database link");
+ php_error_docref(NULL, E_WARNING, "Invalid database link");
return FAILURE;
}
@@ -1310,7 +1309,7 @@ int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC)
}
if (tr->handle == NULL) {
if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
}
@@ -1330,7 +1329,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
@@ -1338,7 +1337,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink);
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
- _php_ibase_module_error("Default link has no default transaction" TSRMLS_CC);
+ _php_ibase_module_error("Default link has no default transaction");
RETURN_FALSE;
}
trans = ib_link->tr_list->trans;
@@ -1352,7 +1351,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
- _php_ibase_module_error("Link has no default transaction" TSRMLS_CC);
+ _php_ibase_module_error("Link has no default transaction");
RETURN_FALSE;
}
trans = ib_link->tr_list->trans;
@@ -1375,7 +1374,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
}
if (result) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1434,13 +1433,13 @@ PHP_FUNCTION(ibase_gen_id)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &generator, &gen_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|lr", &generator, &gen_len,
&inc, &link)) {
RETURN_FALSE;
}
if (gen_len > 31) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid generator name");
+ php_error_docref(NULL, E_WARNING, "Invalid generator name");
RETURN_FALSE;
}
@@ -1461,7 +1460,7 @@ PHP_FUNCTION(ibase_gen_id)
/* execute the query */
if (isc_dsql_exec_immed2(IB_STATUS, &ib_link->handle, &trans->handle, 0, query,
SQL_DIALECT_CURRENT, NULL, &out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index 8e80505c17..a4886cb8e0 100644
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -149,8 +149,8 @@ typedef void (__stdcall *info_func_t)(char*);
typedef void (*info_func_t)(char*);
#endif
-void _php_ibase_error(TSRMLS_D);
-void _php_ibase_module_error(char * TSRMLS_DC, ...)
+void _php_ibase_error(void);
+void _php_ibase_module_error(char *, ...)
PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2);
/* determine if a resource is a link or transaction handle */
@@ -160,10 +160,10 @@ void _php_ibase_module_error(char * TSRMLS_DC, ...)
"InterBase link", le_link, le_plink) } \
else \
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zv, &lh, &th); \
- if (SUCCESS != _php_ibase_def_trans(lh, &th TSRMLS_CC)) { RETURN_FALSE; } \
+ if (SUCCESS != _php_ibase_def_trans(lh, &th)) { RETURN_FALSE; } \
} while (0)
-int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC);
+int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans);
void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval *link_id,
ibase_db_link **ib_link, ibase_trans **trans);
@@ -174,12 +174,12 @@ void php_ibase_query_minit(INIT_FUNC_ARGS);
void php_ibase_blobs_minit(INIT_FUNC_ARGS);
int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd);
char *_php_ibase_quad_to_string(ISC_QUAD const qd);
-int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC);
-int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC);
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len);
+int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob);
/* provided by ibase_events.c */
void php_ibase_events_minit(INIT_FUNC_ARGS);
-void _php_ibase_free_event(ibase_event *event TSRMLS_DC);
+void _php_ibase_free_event(ibase_event *event);
/* provided by ibase_service.c */
void php_ibase_service_minit(INIT_FUNC_ARGS);
diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c
index 4b47fbcfb6..bd8ba550d5 100644
--- a/ext/interbase/php_ibase_udf.c
+++ b/ext/interbase/php_ibase_udf.c
@@ -127,12 +127,12 @@ pthread_mutex_t mtx_res = PTHREAD_MUTEX_INITIALIZER;
static void __attribute__((constructor)) init()
{
- php_embed_init(0, NULL PTSRMLS_CC);
+ php_embed_init(0, NULL P);
}
static void __attribute__((destructor)) fini()
{
- php_embed_shutdown(TSRMLS_C);
+ php_embed_shutdown();
}
#endif
@@ -156,14 +156,14 @@ void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init)
default:
#ifdef PHP_EMBED
php_request_shutdown(NULL);
- if (FAILURE == (result = php_request_startup(TSRMLS_C))) {
+ if (FAILURE == (result = php_request_startup())) {
break;
}
case 0:
#endif
/* feed it to the parser */
zend_first_try {
- result = zend_eval_stringl(code, b->blob_total_length, NULL, "Firebird Embedded PHP engine" TSRMLS_CC);
+ result = zend_eval_stringl(code, b->blob_total_length, NULL, "Firebird Embedded PHP engine");
} zend_end_try();
}
@@ -192,7 +192,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
LOCK();
/* check if the requested function exists */
- if (!zend_is_callable(&callback, 0, NULL TSRMLS_CC)) {
+ if (!zend_is_callable(&callback, 0, NULL)) {
break;
}
@@ -286,7 +286,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
/* now call the function */
if (FAILURE == call_user_function(EG(function_table), NULL,
- &callback, &return_value, argc, args TSRMLS_CC)) {
+ &callback, &return_value, argc, args)) {
UNLOCK();
break;
}
@@ -345,7 +345,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
* that's not possible. We can however report it back to PHP.
*/
LOCK();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling function '%s' from database", name);
+ php_error_docref(NULL, E_WARNING, "Error calling function '%s' from database", name);
UNLOCK();
}
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index 715a866111..813204cd21 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -47,7 +47,7 @@ zend_object_handlers BreakIterator_handlers;
/* }}} */
U_CFUNC void breakiterator_object_create(zval *object,
- BreakIterator *biter, int brand_new TSRMLS_DC)
+ BreakIterator *biter, int brand_new)
{
UClassID classId = biter->getDynamicClassID();
zend_class_entry *ce;
@@ -63,11 +63,11 @@ U_CFUNC void breakiterator_object_create(zval *object,
if (brand_new) {
object_init_ex(object, ce);
}
- breakiterator_object_construct(object, biter TSRMLS_CC);
+ breakiterator_object_construct(object, biter);
}
U_CFUNC void breakiterator_object_construct(zval *object,
- BreakIterator *biter TSRMLS_DC)
+ BreakIterator *biter)
{
BreakIterator_object *bio;
@@ -78,7 +78,7 @@ U_CFUNC void breakiterator_object_construct(zval *object,
/* {{{ compare handler for BreakIterator */
static int BreakIterator_compare_objects(zval *object1,
- zval *object2 TSRMLS_DC)
+ zval *object2)
{
BreakIterator_object *bio1,
*bio2;
@@ -95,19 +95,19 @@ static int BreakIterator_compare_objects(zval *object1,
/* }}} */
/* {{{ clone handler for BreakIterator */
-static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
+static zend_object *BreakIterator_clone_obj(zval *object)
{
BreakIterator_object *bio_orig,
*bio_new;
zend_object *ret_val;
bio_orig = Z_INTL_BREAKITERATOR_P(object);
- intl_errors_reset(INTL_DATA_ERROR_P(bio_orig) TSRMLS_CC);
+ intl_errors_reset(INTL_DATA_ERROR_P(bio_orig));
- ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object));
bio_new = php_intl_breakiterator_fetch_object(ret_val);
- zend_objects_clone_members(&bio_new->zo, &bio_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&bio_new->zo, &bio_orig->zo);
if (bio_orig->biter != NULL) {
BreakIterator *new_biter;
@@ -116,18 +116,18 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
if (!new_biter) {
zend_string *err_msg;
intl_errors_set_code(BREAKITER_ERROR_P(bio_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(BREAKITER_ERROR_P(bio_orig),
- "Could not clone BreakIterator", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone BreakIterator", 0);
+ err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
bio_new->biter = new_biter;
ZVAL_COPY(&bio_new->text, &bio_orig->text);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0);
}
return ret_val;
@@ -135,7 +135,7 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
/* }}} */
/* {{{ get_debug_info handler for BreakIterator */
-static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp)
{
zval val;
HashTable *debug_info;
@@ -176,23 +176,23 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS
/* {{{ void breakiterator_object_init(BreakIterator_object* to)
* Initialize internals of BreakIterator_object not specific to zend standard objects.
*/
-static void breakiterator_object_init(BreakIterator_object *bio TSRMLS_DC)
+static void breakiterator_object_init(BreakIterator_object *bio)
{
- intl_error_init(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_error_init(BREAKITER_ERROR_P(bio));
bio->biter = NULL;
ZVAL_UNDEF(&bio->text);
}
/* }}} */
/* {{{ BreakIterator_objects_dtor */
-static void BreakIterator_objects_dtor(zend_object *object TSRMLS_DC)
+static void BreakIterator_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ BreakIterator_objects_free */
-static void BreakIterator_objects_free(zend_object *object TSRMLS_DC)
+static void BreakIterator_objects_free(zend_object *object)
{
BreakIterator_object* bio = php_intl_breakiterator_fetch_object(object);
@@ -201,22 +201,22 @@ static void BreakIterator_objects_free(zend_object *object TSRMLS_DC)
delete bio->biter;
bio->biter = NULL;
}
- intl_error_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_error_reset(BREAKITER_ERROR_P(bio));
- zend_object_std_dtor(&bio->zo TSRMLS_CC);
+ zend_object_std_dtor(&bio->zo);
}
/* }}} */
/* {{{ BreakIterator_object_create */
-static zend_object *BreakIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *BreakIterator_object_create(zend_class_entry *ce)
{
BreakIterator_object* intern;
intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init((zend_object*) intern, ce);
- breakiterator_object_init(intern TSRMLS_CC);
+ breakiterator_object_init(intern);
intern->zo.handlers = &BreakIterator_handlers;
@@ -316,7 +316,7 @@ static const zend_function_entry CodePointBreakIterator_class_functions[] = {
/* {{{ breakiterator_register_BreakIterator_class
* Initialize 'BreakIterator' class
*/
-U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
+U_CFUNC void breakiterator_register_BreakIterator_class(void)
{
zend_class_entry ce;
@@ -324,7 +324,7 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "IntlBreakIterator", BreakIterator_class_functions);
ce.create_object = BreakIterator_object_create;
ce.get_iterator = _breakiterator_get_iterator;
- BreakIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ BreakIterator_ce_ptr = zend_register_internal_class(&ce);
memcpy(&BreakIterator_handlers, zend_get_std_object_handlers(),
sizeof BreakIterator_handlers);
@@ -335,16 +335,16 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
BreakIterator_handlers.dtor_obj = BreakIterator_objects_dtor;
BreakIterator_handlers.free_obj = BreakIterator_objects_free;
- zend_class_implements(BreakIterator_ce_ptr TSRMLS_CC, 1,
+ zend_class_implements(BreakIterator_ce_ptr, 1,
zend_ce_traversable);
zend_declare_class_constant_long(BreakIterator_ce_ptr,
- "DONE", sizeof("DONE") - 1, BreakIterator::DONE TSRMLS_CC );
+ "DONE", sizeof("DONE") - 1, BreakIterator::DONE );
/* Declare constants that are defined in the C header */
#define BREAKITER_DECL_LONG_CONST(name) \
zend_declare_class_constant_long(BreakIterator_ce_ptr, #name, \
- sizeof(#name) - 1, UBRK_ ## name TSRMLS_CC)
+ sizeof(#name) - 1, UBRK_ ## name)
BREAKITER_DECL_LONG_CONST(WORD_NONE);
BREAKITER_DECL_LONG_CONST(WORD_NONE_LIMIT);
@@ -374,12 +374,12 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator",
RuleBasedBreakIterator_class_functions);
RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- BreakIterator_ce_ptr TSRMLS_CC);
+ BreakIterator_ce_ptr);
/* Create and register 'CodePointBreakIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator",
CodePointBreakIterator_class_functions);
CodePointBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- BreakIterator_ce_ptr TSRMLS_CC);
+ BreakIterator_ce_ptr);
}
/* }}} */
diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h
index 6333003981..d1b5ebb2c8 100644
--- a/ext/intl/breakiterator/breakiterator_class.h
+++ b/ext/intl/breakiterator/breakiterator_class.h
@@ -58,15 +58,15 @@ static inline BreakIterator_object *php_intl_breakiterator_fetch_object(zend_obj
BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; \
if (bio->biter == NULL) \
{ \
- intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0 TSRMLS_CC); \
+ intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0); \
RETURN_FALSE; \
}
-void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new TSRMLS_DC);
+void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new);
-void breakiterator_object_construct(zval *object, BreakIterator *break_iter TSRMLS_DC);
+void breakiterator_object_construct(zval *object, BreakIterator *break_iter);
-void breakiterator_register_BreakIterator_class(TSRMLS_D);
+void breakiterator_register_BreakIterator_class(void);
extern zend_class_entry *BreakIterator_ce_ptr,
*RuleBasedBreakIterator_ce_ptr;
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp
index 19de7bce34..624a813e54 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.cpp
+++ b/ext/intl/breakiterator/breakiterator_iterators.cpp
@@ -36,30 +36,30 @@ static zend_object_handlers IntlPartsIterator_handlers;
/* BreakIterator's iterator */
-inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter TSRMLS_DC)
+inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter)
{
BreakIterator_object *bio;
bio = Z_INTL_BREAKITERATOR_P(&iter->data);
- intl_errors_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_errors_reset(BREAKITER_ERROR_P(bio));
if (bio->biter == NULL) {
intl_errors_set(BREAKITER_ERROR_P(bio), U_INVALID_STATE_ERROR,
"The BreakIterator object backing the PHP iterator is not "
- "properly constructed", 0 TSRMLS_CC);
+ "properly constructed", 0);
}
return bio->biter;
}
-static void _breakiterator_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_destroy_it(zend_object_iterator *iter)
{
zval_ptr_dtor(&iter->data);
}
-static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_move_forward(zend_object_iterator *iter)
{
- BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC);
+ BreakIterator *biter = _breakiter_prolog(iter);
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
if (biter == NULL) {
return;
@@ -71,9 +71,9 @@ static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
} //else we've reached the end of the enum, nothing more is required
}
-static void _breakiterator_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_rewind(zend_object_iterator *iter)
{
- BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC);
+ BreakIterator *biter = _breakiter_prolog(iter);
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
int32_t pos = biter->first();
@@ -91,12 +91,12 @@ static zend_object_iterator_funcs breakiterator_iterator_funcs = {
};
U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+ zend_class_entry *ce, zval *object, int by_ref)
{
BreakIterator_object *bio;
if (by_ref) {
zend_throw_exception(NULL,
- "Iteration by reference is not supported", 0 TSRMLS_CC);
+ "Iteration by reference is not supported", 0);
return NULL;
}
@@ -105,12 +105,12 @@ U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
if (biter == NULL) {
zend_throw_exception(NULL,
- "The BreakIterator is not properly constructed", 0 TSRMLS_CC);
+ "The BreakIterator is not properly constructed", 0);
return NULL;
}
zoi_with_current *zoi_iter = static_cast<zoi_with_current*>(emalloc(sizeof *zoi_iter));
- zend_iterator_init(&zoi_iter->zoi TSRMLS_CC);
+ zend_iterator_init(&zoi_iter->zoi);
ZVAL_COPY(&zoi_iter->zoi.data, object);
zoi_iter->zoi.funcs = &breakiterator_iterator_funcs;
zoi_iter->zoi.index = 0;
@@ -129,23 +129,23 @@ typedef struct zoi_break_iter_parts {
BreakIterator_object *bio; /* so we don't have to fetch it all the time */
} zoi_break_iter_parts;
-static void _breakiterator_parts_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_destroy_it(zend_object_iterator *iter)
{
zval_ptr_dtor(&iter->data);
}
-static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key)
{
/* the actual work is done in move_forward and rewind */
ZVAL_LONG(key, iter->index);
}
-static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_move_forward(zend_object_iterator *iter)
{
zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter;
BreakIterator_object *bio = zoi_bit->bio;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
int32_t cur,
next;
@@ -183,18 +183,18 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_
ZVAL_STR(&zoi_bit->zoi_cur.current, res);
}
-static void _breakiterator_parts_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_rewind(zend_object_iterator *iter)
{
zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter;
BreakIterator_object *bio = zoi_bit->bio;
if (!Z_ISUNDEF(zoi_bit->zoi_cur.current)) {
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
}
bio->biter->first();
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
}
static zend_object_iterator_funcs breakiterator_parts_it_funcs = {
@@ -209,7 +209,7 @@ static zend_object_iterator_funcs breakiterator_parts_it_funcs = {
void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
zval *object,
- parts_iter_key_type key_type TSRMLS_DC)
+ parts_iter_key_type key_type)
{
IntlIterator_object *ii;
@@ -217,7 +217,7 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
ii = Z_INTL_ITERATOR_P(object);
ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_break_iter_parts));
- zend_iterator_init(ii->iterator TSRMLS_CC);
+ zend_iterator_init(ii->iterator);
ZVAL_COPY(&ii->iterator->data, break_iter_zv);
ii->iterator->funcs = &breakiterator_parts_it_funcs;
@@ -234,15 +234,15 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
((zoi_break_iter_parts*)ii->iterator)->key_type = key_type;
}
-U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce)
{
- zend_object *retval = IntlIterator_ce_ptr->create_object(ce TSRMLS_CC);
+ zend_object *retval = IntlIterator_ce_ptr->create_object(ce);
retval->handlers = &IntlPartsIterator_handlers;
return retval;
}
-U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key TSRMLS_DC)
+U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key)
{
zend_function *ret;
zend_string *lc_method_name;
@@ -261,12 +261,12 @@ U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, ze
if (obj->iterator && !Z_ISUNDEF(obj->iterator->data)) {
zval *break_iter_zv = &obj->iterator->data;
*object_ptr = Z_OBJ_P(break_iter_zv);
- ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key TSRMLS_CC);
+ ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key);
goto end;
}
}
- ret = std_object_handlers.get_method(object_ptr, method, key TSRMLS_CC);
+ ret = std_object_handlers.get_method(object_ptr, method, key);
end:
if (key == NULL) {
@@ -282,7 +282,7 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlPartsIterator::getBreakIterator: bad arguments", 0 TSRMLS_CC);
+ "IntlPartsIterator::getBreakIterator: bad arguments", 0);
return;
}
@@ -300,14 +300,14 @@ static const zend_function_entry IntlPartsIterator_class_functions[] = {
PHP_FE_END
};
-U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D)
+U_CFUNC void breakiterator_register_IntlPartsIterator_class(void)
{
zend_class_entry ce;
/* Create and register 'BreakIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlPartsIterator", IntlPartsIterator_class_functions);
IntlPartsIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- IntlIterator_ce_ptr TSRMLS_CC);
+ IntlIterator_ce_ptr);
IntlPartsIterator_ce_ptr->create_object = IntlPartsIterator_object_create;
memcpy(&IntlPartsIterator_handlers, &IntlIterator_handlers,
@@ -316,7 +316,7 @@ U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D)
#define PARTSITER_DECL_LONG_CONST(name) \
zend_declare_class_constant_long(IntlPartsIterator_ce_ptr, #name, \
- sizeof(#name) - 1, PARTS_ITERATOR_ ## name TSRMLS_CC)
+ sizeof(#name) - 1, PARTS_ITERATOR_ ## name)
PARTSITER_DECL_LONG_CONST(KEY_SEQUENTIAL);
PARTSITER_DECL_LONG_CONST(KEY_LEFT);
diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h
index 764f4f4426..71a1e35025 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.h
+++ b/ext/intl/breakiterator/breakiterator_iterators.h
@@ -32,11 +32,11 @@ typedef enum {
#ifdef __cplusplus
void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
zval *object,
- parts_iter_key_type key_type TSRMLS_DC);
+ parts_iter_key_type key_type);
#endif
U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
-U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D);
+ zend_class_entry *ce, zval *object, int by_ref);
+U_CFUNC void breakiterator_register_IntlPartsIterator_class(void);
#endif
diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp
index 1153340e14..64c85bad73 100644
--- a/ext/intl/breakiterator/breakiterator_methods.cpp
+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
@@ -37,7 +37,7 @@ U_CFUNC PHP_METHOD(BreakIterator, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
static void _breakiter_factory(const char *func_name,
@@ -49,31 +49,31 @@ static void _breakiter_factory(const char *func_name,
size_t dummy;
char *msg;
UErrorCode status = UErrorCode();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!",
&locale_str, &dummy) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_NULL();
}
if (locale_str == NULL) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
biter = func(Locale::createFromName(locale_str), status);
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
if (U_FAILURE(status)) {
spprintf(&msg, 0, "%s: error creating BreakIterator",
func_name);
- intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, msg, 1);
efree(msg);
RETURN_NULL();
}
- breakiterator_object_create(return_value, biter, 1 TSRMLS_CC);
+ breakiterator_object_create(return_value, biter, 1);
}
U_CFUNC PHP_FUNCTION(breakiter_create_word_instance)
@@ -114,16 +114,16 @@ U_CFUNC PHP_FUNCTION(breakiter_create_title_instance)
U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance)
{
UErrorCode status = UErrorCode();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_create_code_point_instance: bad arguments", 0 TSRMLS_CC);
+ "breakiter_create_code_point_instance: bad arguments", 0);
RETURN_NULL();
}
CodePointBreakIterator *cpbi = new CodePointBreakIterator();
- breakiterator_object_create(return_value, cpbi, 1 TSRMLS_CC);
+ breakiterator_object_create(return_value, cpbi, 1);
}
U_CFUNC PHP_FUNCTION(breakiter_get_text)
@@ -133,7 +133,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_text: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_text: bad arguments", 0);
RETURN_FALSE;
}
@@ -155,10 +155,10 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&text, &text_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_set_text: bad arguments", 0 TSRMLS_CC);
+ "breakiter_set_text: bad arguments", 0);
RETURN_FALSE;
}
@@ -199,7 +199,7 @@ static void _breakiter_no_args_ret_int32(
if (zend_parse_parameters_none() == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -221,9 +221,9 @@ static void _breakiter_int32_ret_int32(
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -233,7 +233,7 @@ static void _breakiter_int32_ret_int32(
if (arg < INT32_MIN || arg > INT32_MAX) {
spprintf(&msg, 0, "%s: offset argument is outside bounds of "
"a 32-bit wide integer", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -300,7 +300,7 @@ U_CFUNC PHP_FUNCTION(breakiter_current)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_current: bad arguments", 0 TSRMLS_CC);
+ "breakiter_current: bad arguments", 0);
RETURN_FALSE;
}
@@ -331,17 +331,17 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l",
&offset) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_is_boundary: bad arguments", 0 TSRMLS_CC);
+ "breakiter_is_boundary: bad arguments", 0);
RETURN_FALSE;
}
if (offset < INT32_MIN || offset > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"breakiter_is_boundary: offset argument is outside bounds of "
- "a 32-bit wide integer", 0 TSRMLS_CC);
+ "a 32-bit wide integer", 0);
RETURN_FALSE;
}
@@ -358,15 +358,15 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &locale_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_locale: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_locale: bad arguments", 0);
RETURN_FALSE;
}
if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_locale: invalid locale type", 0 TSRMLS_CC);
+ "breakiter_get_locale: invalid locale type", 0);
RETURN_FALSE;
}
@@ -386,9 +386,9 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &key_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_parts_iterator: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_parts_iterator: bad arguments", 0);
RETURN_FALSE;
}
@@ -396,14 +396,14 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
&& key_type != PARTS_ITERATOR_KEY_LEFT
&& key_type != PARTS_ITERATOR_KEY_RIGHT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_parts_iterator: bad key type", 0 TSRMLS_CC);
+ "breakiter_get_parts_iterator: bad key type", 0);
RETURN_FALSE;
}
BREAKITER_METHOD_FETCH_OBJECT;
IntlIterator_from_BreakIterator_parts(
- object, return_value, (parts_iter_key_type)key_type TSRMLS_CC);
+ object, return_value, (parts_iter_key_type)key_type);
}
U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
@@ -413,7 +413,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -433,7 +433,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "breakiter_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -444,6 +444,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ message = intl_error_get_message(BREAKITER_ERROR_P(bio));
RETURN_STR(message);
}
diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp
index d7fe359712..f916915ae2 100644
--- a/ext/intl/breakiterator/codepointiterator_methods.cpp
+++ b/ext/intl/breakiterator/codepointiterator_methods.cpp
@@ -34,7 +34,7 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "cpbi_get_last_code_point: bad arguments", 0 TSRMLS_CC);
+ "cpbi_get_last_code_point: bad arguments", 0);
RETURN_FALSE;
}
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index d3b36291b2..be38396466 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -36,12 +36,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
size_t rules_len;
zend_bool compiled = 0;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b",
&rules, &rules_len, &compiled) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_create_instance: bad arguments", 0 TSRMLS_CC);
+ "rbbi_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -56,12 +56,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"rbbi_create_instance: rules were not a valid UTF-8 string",
- 0 TSRMLS_CC);
+ 0);
RETURN_NULL();
}
rbbi = new RuleBasedBreakIterator(rulesStr, parseError, status);
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
if (U_FAILURE(status)) {
char *msg;
smart_str parse_error_str;
@@ -69,7 +69,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
spprintf(&msg, 0, "rbbi_create_instance: unable to create "
"RuleBasedBreakIterator from rules (%s)", parse_error_str.s? parse_error_str.s->val : "");
smart_str_free(&parse_error_str);
- intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, msg, 1);
efree(msg);
delete rbbi;
Z_OBJ_P(return_value) = NULL;
@@ -80,19 +80,19 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
- "create instance from compiled rules", 0 TSRMLS_CC);
+ "create instance from compiled rules", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
#else
intl_error_set(NULL, U_UNSUPPORTED_ERROR, "rbbi_create_instance: "
- "compiled rules require ICU >= 4.8", 0 TSRMLS_CC);
+ "compiled rules require ICU >= 4.8", 0);
Z_OBJ_P(return_value) = NULL;
return;
#endif
}
- breakiterator_object_create(return_value, rbbi, 0 TSRMLS_CC);
+ breakiterator_object_create(return_value, rbbi, 0);
}
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
@@ -103,7 +103,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -116,7 +116,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rules: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rules: bad arguments", 0);
RETURN_FALSE;
}
@@ -130,7 +130,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
{
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_hash_code: Error converting result to UTF-8 string",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
RETVAL_STRINGL(str, str_len);
@@ -145,7 +145,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rule_status: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rule_status: bad arguments", 0);
RETURN_FALSE;
}
@@ -161,7 +161,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rule_status_vec: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rule_status_vec: bad arguments", 0);
RETURN_FALSE;
}
@@ -183,7 +183,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
delete[] rules;
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_get_rule_status_vec: failed obtaining the status values",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -202,7 +202,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_binary_rules: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_binary_rules: bad arguments", 0);
RETURN_FALSE;
}
@@ -214,7 +214,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
if (rules_len > INT_MAX - 1) {
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_get_binary_rules: the rules are too large",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 7273b1d277..81f6d81546 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -41,7 +41,7 @@ zend_object_handlers Calendar_handlers;
/* }}} */
U_CFUNC void calendar_object_create(zval *object,
- Calendar *calendar TSRMLS_DC)
+ Calendar *calendar)
{
UClassID classId = calendar->getDynamicClassID();
zend_class_entry *ce;
@@ -54,10 +54,10 @@ U_CFUNC void calendar_object_create(zval *object,
}
object_init_ex(object, ce);
- calendar_object_construct(object, calendar TSRMLS_CC);
+ calendar_object_construct(object, calendar);
}
-U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC)
+U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object)
{
Calendar_object *co = Z_INTL_CALENDAR_P(object);
@@ -65,7 +65,7 @@ U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC)
}
U_CFUNC void calendar_object_construct(zval *object,
- Calendar *calendar TSRMLS_DC)
+ Calendar *calendar)
{
Calendar_object *co;
@@ -75,20 +75,20 @@ U_CFUNC void calendar_object_construct(zval *object,
}
/* {{{ clone handler for Calendar */
-static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC)
+static zend_object *Calendar_clone_obj(zval *object)
{
Calendar_object *co_orig,
*co_new;
zend_object *ret_val;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
co_orig = Z_INTL_CALENDAR_P(object);
- intl_error_reset(INTL_DATA_ERROR_P(co_orig) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(co_orig));
- ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object));
co_new = php_intl_calendar_fetch_object(ret_val);
- zend_objects_clone_members(&co_new->zo, &co_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&co_new->zo, &co_orig->zo);
if (co_orig->ucal != NULL) {
Calendar *newCalendar;
@@ -97,17 +97,17 @@ static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC)
if (!newCalendar) {
zend_string *err_msg;
intl_errors_set_code(CALENDAR_ERROR_P(co_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(CALENDAR_ERROR_P(co_orig),
- "Could not clone IntlCalendar", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone IntlCalendar", 0);
+ err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
co_new->ucal = newCalendar;
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0);
}
return ret_val;
@@ -144,7 +144,7 @@ static const struct {
};
/* {{{ get_debug_info handler for Calendar */
-static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *Calendar_get_debug_info(zval *object, int *is_temp)
{
zval zv,
zfields;
@@ -176,8 +176,8 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
int is_tmp;
HashTable *debug_info_tz;
- timezone_object_construct(&cal->getTimeZone(), &ztz , 0 TSRMLS_CC);
- debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp TSRMLS_CC);
+ timezone_object_construct(&cal->getTimeZone(), &ztz , 0);
+ debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp);
assert(is_tmp == 1);
array_init(&ztz_debug);
@@ -224,22 +224,22 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ void calendar_object_init(Calendar_object* to)
* Initialize internals of Calendar_object not specific to zend standard objects.
*/
-static void calendar_object_init(Calendar_object *co TSRMLS_DC)
+static void calendar_object_init(Calendar_object *co)
{
- intl_error_init(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ intl_error_init(CALENDAR_ERROR_P(co));
co->ucal = NULL;
}
/* }}} */
/* {{{ Calendar_objects_dtor */
-static void Calendar_objects_dtor(zend_object *object TSRMLS_DC)
+static void Calendar_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ Calendar_objects_free */
-static void Calendar_objects_free(zend_object *object TSRMLS_DC)
+static void Calendar_objects_free(zend_object *object)
{
Calendar_object* co = php_intl_calendar_fetch_object(object);
@@ -247,22 +247,22 @@ static void Calendar_objects_free(zend_object *object TSRMLS_DC)
delete co->ucal;
co->ucal = NULL;
}
- intl_error_reset(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ intl_error_reset(CALENDAR_ERROR_P(co));
- zend_object_std_dtor(&co->zo TSRMLS_CC);
+ zend_object_std_dtor(&co->zo);
}
/* }}} */
/* {{{ Calendar_object_create */
-static zend_object *Calendar_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *Calendar_object_create(zend_class_entry *ce)
{
Calendar_object* intern;
intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init((zend_object*) intern, ce);
- calendar_object_init(intern TSRMLS_CC);
+ calendar_object_init(intern);
intern->zo.handlers = &Calendar_handlers;
@@ -455,17 +455,17 @@ static const zend_function_entry GregorianCalendar_class_functions[] = {
/* {{{ calendar_register_IntlCalendar_class
* Initialize 'IntlCalendar' class
*/
-void calendar_register_IntlCalendar_class(TSRMLS_D)
+void calendar_register_IntlCalendar_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlCalendar", Calendar_class_functions);
ce.create_object = Calendar_object_create;
- Calendar_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ Calendar_ce_ptr = zend_register_internal_class(&ce);
if (!Calendar_ce_ptr) {
//can't happen now without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlCalendar: class registration has failed.");
return;
}
@@ -480,10 +480,10 @@ void calendar_register_IntlCalendar_class(TSRMLS_D)
/* Create and register 'IntlGregorianCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions);
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
- Calendar_ce_ptr TSRMLS_CC);
+ Calendar_ce_ptr);
if (!GregorianCalendar_ce_ptr) {
//can't happen know without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlGregorianCalendar: class registration has failed.");
return;
}
@@ -491,7 +491,7 @@ void calendar_register_IntlCalendar_class(TSRMLS_D)
/* Declare 'IntlCalendar' class constants */
#define CALENDAR_DECL_LONG_CONST(name, val) \
zend_declare_class_constant_long(Calendar_ce_ptr, name, sizeof(name) - 1, \
- val TSRMLS_CC)
+ val)
CALENDAR_DECL_LONG_CONST("FIELD_ERA", UCAL_ERA);
CALENDAR_DECL_LONG_CONST("FIELD_YEAR", UCAL_YEAR);
diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h
index 47f991f118..a884580a9a 100644
--- a/ext/intl/calendar/calendar_class.h
+++ b/ext/intl/calendar/calendar_class.h
@@ -55,17 +55,17 @@ static inline Calendar_object *php_intl_calendar_fetch_object(zend_object *obj)
CALENDAR_METHOD_FETCH_OBJECT_NO_CHECK; \
if (co->ucal == NULL) \
{ \
- intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0 TSRMLS_CC); \
+ intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0); \
RETURN_FALSE; \
}
-void calendar_object_create(zval *object, Calendar *calendar TSRMLS_DC);
+void calendar_object_create(zval *object, Calendar *calendar);
-Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC);
+Calendar *calendar_fetch_native_calendar(zval *object);
-void calendar_object_construct(zval *object, Calendar *calendar TSRMLS_DC);
+void calendar_object_construct(zval *object, Calendar *calendar);
-void calendar_register_IntlCalendar_class(TSRMLS_D);
+void calendar_register_IntlCalendar_class(void);
extern zend_class_entry *Calendar_ce_ptr,
*GregorianCalendar_ce_ptr;
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index eaa1930e42..da338db46b 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -44,7 +44,7 @@ U_CFUNC PHP_METHOD(IntlCalendar, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
U_CFUNC PHP_FUNCTION(intlcal_create_instance)
@@ -54,34 +54,34 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance)
size_t dummy;
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zs!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zs!",
&zv_timezone, &locale_str, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_create_calendar: bad arguments", 0 TSRMLS_CC);
+ "intlcal_create_calendar: bad arguments", 0);
RETURN_NULL();
}
timeZone = timezone_process_timezone_argument(zv_timezone, NULL,
- "intlcal_create_instance" TSRMLS_CC);
+ "intlcal_create_instance");
if (timeZone == NULL) {
RETURN_NULL();
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
Calendar *cal = Calendar::createInstance(timeZone,
Locale::createFromName(locale_str), status);
if (cal == NULL) {
delete timeZone;
- intl_error_set(NULL, status, "Error creating ICU Calendar object", 0 TSRMLS_CC);
+ intl_error_set(NULL, status, "Error creating ICU Calendar object", 0);
RETURN_NULL();
}
- calendar_object_create(return_value, cal TSRMLS_CC);
+ calendar_object_create(return_value, cal);
}
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42
@@ -146,12 +146,12 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
size_t key_len,
locale_len;
zend_bool commonly_used;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssb",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb",
&key, &key_len, &locale, &locale_len, &commonly_used) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_keyword_values_for_locale: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_keyword_values_for_locale: bad arguments", 0);
RETURN_FALSE;
}
@@ -162,7 +162,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
status);
if (se == NULL) {
intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: "
- "error calling underlying method", 0 TSRMLS_CC);
+ "error calling underlying method", 0);
RETURN_FALSE;
}
#else
@@ -171,24 +171,24 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
if (U_FAILURE(status)) {
uenum_close(uenum);
intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: "
- "error calling underlying method", 0 TSRMLS_CC);
+ "error calling underlying method", 0);
RETURN_FALSE;
}
StringEnumeration *se = new BugStringCharEnumeration(uenum);
#endif
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
}
#endif //ICU 4.2 only
U_CFUNC PHP_FUNCTION(intlcal_get_now)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_now: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_now: bad arguments", 0);
RETURN_FALSE;
}
@@ -197,11 +197,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_now)
U_CFUNC PHP_FUNCTION(intlcal_get_available_locales)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_available_locales: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_available_locales: bad arguments", 0);
RETURN_FALSE;
}
@@ -223,17 +223,17 @@ static void _php_intlcal_field_uec_ret_in32t_method(
char *message;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
spprintf(&message, 0, "%s: bad arguments", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
spprintf(&message, 0, "%s: invalid field", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
@@ -257,10 +257,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -278,10 +278,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time)
double time_arg;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Od",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od",
&object, Calendar_ce_ptr, &time_arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -299,21 +299,21 @@ U_CFUNC PHP_FUNCTION(intlcal_add)
amount;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: bad arguments", 0 TSRMLS_CC);
+ "intlcal_add: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: invalid field", 0 TSRMLS_CC);
+ "intlcal_add: invalid field", 0);
RETURN_FALSE;
}
if (amount < INT32_MIN || amount > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: amount out of bounds", 0 TSRMLS_CC);
+ "intlcal_add: amount out of bounds", 0);
RETURN_FALSE;
}
@@ -331,10 +331,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
TimeZone *timeZone;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oz!", &object, Calendar_ce_ptr, &zv_timezone) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_time_zone: bad arguments", 0);
RETURN_FALSE;
}
@@ -345,7 +345,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
}
timeZone = timezone_process_timezone_argument(zv_timezone,
- CALENDAR_ERROR_P(co), "intlcal_set_time_zone" TSRMLS_CC);
+ CALENDAR_ERROR_P(co), "intlcal_set_time_zone");
if (timeZone == NULL) {
RETURN_FALSE;
}
@@ -364,11 +364,11 @@ static void _php_intlcal_before_after(
Calendar_object *when_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &when_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_before/after: bad arguments", 0 TSRMLS_CC);
+ "intlcal_before/after: bad arguments", 0);
RETURN_FALSE;
}
@@ -377,7 +377,7 @@ static void _php_intlcal_before_after(
when_co = Z_INTL_CALENDAR_P(when_object);
if (when_co->ucal == NULL) {
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_before/after: Other IntlCalendar was unconstructed", 0 TSRMLS_CC);
+ "intlcal_before/after: Other IntlCalendar was unconstructed", 0);
RETURN_FALSE;
}
@@ -410,7 +410,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
if (ZEND_NUM_ARGS() > (getThis() ? 6 : 7) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: too many arguments", 0 TSRMLS_CC);
+ "intlcal_set: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
@@ -422,11 +422,11 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
}
if (variant == 4 ||
- zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll|llll", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4,
&arg5, &arg6) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set: bad arguments", 0);
RETURN_FALSE;
}
@@ -434,14 +434,14 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
if (Z_LVAL(args[i]) < INT32_MIN || Z_LVAL(args[i]) > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set: at least one of the arguments has an absolute "
- "value that is too large", 0 TSRMLS_CC);
+ "value that is too large", 0);
RETURN_FALSE;
}
}
if (variant == 2 && (arg1 < 0 || arg1 >= UCAL_FIELD_COUNT)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: invalid field", 0 TSRMLS_CC);
+ "intlcal_set: invalid field", 0);
RETURN_FALSE;
}
@@ -472,37 +472,37 @@ U_CFUNC PHP_FUNCTION(intlcal_roll)
if (ZEND_NUM_ARGS() > (getThis() ? 2 :3) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: too many arguments", 0 TSRMLS_CC);
+ "intlcal_set: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
args++;
}
if (!Z_ISUNDEF(args[1]) && (Z_TYPE(args[1]) == IS_TRUE || Z_TYPE(args[1]) == IS_FALSE)) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Olb", &object, Calendar_ce_ptr, &field, &bool_variant_val)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: bad arguments", 0 TSRMLS_CC);
+ "intlcal_roll: bad arguments", 0);
RETURN_FALSE;
}
bool_variant_val = Z_TYPE(args[1]) == IS_TRUE? 1 : 0;
- } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &value) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: bad arguments", 0 TSRMLS_CC);
+ "intlcal_roll: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: invalid field", 0 TSRMLS_CC);
+ "intlcal_roll: invalid field", 0);
RETURN_FALSE;
}
if (bool_variant_val == (zend_bool)-1 &&
(value < INT32_MIN || value > INT32_MAX)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: value out of bounds", 0 TSRMLS_CC);
+ "intlcal_roll: value out of bounds", 0);
RETURN_FALSE;
}
@@ -531,7 +531,7 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
if (ZEND_NUM_ARGS() > (getThis() ? 1 : 2) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: too many arguments", 0 TSRMLS_CC);
+ "intlcal_clear: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
@@ -539,21 +539,21 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
}
if (Z_ISUNDEF(args[0]) || Z_TYPE(args[0]) == IS_NULL) {
zval *dummy; /* we know it's null */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(),
getThis(), "O|z", &object, Calendar_ce_ptr, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: bad arguments", 0 TSRMLS_CC);
+ "intlcal_clear: bad arguments", 0);
RETURN_FALSE;
}
variant = 0;
- } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(),
getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: bad arguments", 0 TSRMLS_CC);
+ "intlcal_clear: bad arguments", 0);
RETURN_FALSE;
} else if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: invalid field", 0 TSRMLS_CC);
+ "intlcal_clear: invalid field", 0);
RETURN_FALSE;
} else {
variant = 1;
@@ -576,16 +576,16 @@ U_CFUNC PHP_FUNCTION(intlcal_field_difference)
double when;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Odl", &object, Calendar_ce_ptr, &when, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_field_difference: bad arguments", 0 TSRMLS_CC);
+ "intlcal_field_difference: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_field_difference: invalid field", 0 TSRMLS_CC);
+ "intlcal_field_difference: invalid field", 0);
RETURN_FALSE;
}
@@ -617,16 +617,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type)
zend_ulong dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_day_of_week_type: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_day_of_week_type: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_day_of_week_type: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_get_day_of_week_type: invalid day of week", 0);
RETURN_FALSE;
}
@@ -645,10 +645,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_first_day_of_week)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_first_day_of_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_first_day_of_week: bad arguments", 0);
RETURN_FALSE;
}
@@ -670,17 +670,17 @@ static void _php_intlcal_field_ret_in32t_method(
char *message;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
spprintf(&message, 0, "%s: bad arguments", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
spprintf(&message, 0, "%s: invalid field", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
@@ -710,16 +710,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_locale)
zend_long locale_type;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_locale: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_locale: bad arguments", 0);
RETURN_FALSE;
}
if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_locale: invalid locale type", 0 TSRMLS_CC);
+ "intlcal_get_locale: invalid locale type", 0);
RETURN_FALSE;
}
@@ -743,10 +743,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_minimal_days_in_first_week)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_minimal_days_in_first_week: bad arguments", 0);
RETURN_FALSE;
}
@@ -769,10 +769,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_time_zone: bad arguments", 0);
RETURN_FALSE;
}
@@ -781,21 +781,21 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone)
TimeZone *tz = co->ucal->getTimeZone().clone();
if (tz == NULL) {
intl_errors_set(CALENDAR_ERROR_P(co), U_MEMORY_ALLOCATION_ERROR,
- "intlcal_get_time_zone: could not clone TimeZone", 0 TSRMLS_CC);
+ "intlcal_get_time_zone: could not clone TimeZone", 0);
RETURN_FALSE;
}
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intlcal_get_type)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_type: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_type: bad arguments", 0);
RETURN_FALSE;
}
@@ -810,16 +810,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition)
zend_long dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_weekend_transition: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_weekend_transition: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_weekend_transition: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_get_weekend_transition: invalid day of week", 0);
RETURN_FALSE;
}
@@ -838,10 +838,10 @@ U_CFUNC PHP_FUNCTION(intlcal_in_daylight_time)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_in_daylight_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_in_daylight_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -860,18 +860,18 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to)
Calendar_object *other_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_equivalent_to: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_equivalent_to: bad arguments", 0);
RETURN_FALSE;
}
other_co = Z_INTL_CALENDAR_P(other_object);
if (other_co->ucal == NULL) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_is_equivalent_to:"
- " Other IntlCalendar is unconstructed", 0 TSRMLS_CC);
+ " Other IntlCalendar is unconstructed", 0);
RETURN_FALSE;
}
@@ -884,10 +884,10 @@ U_CFUNC PHP_FUNCTION(intlcal_is_lenient)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_lenient: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_lenient: bad arguments", 0);
RETURN_FALSE;
}
@@ -901,16 +901,16 @@ U_CFUNC PHP_FUNCTION(intlcal_is_set)
zend_long field;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_set: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_set: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_set: invalid field", 0 TSRMLS_CC);
+ "intlcal_is_set: invalid field", 0);
RETURN_FALSE;
}
@@ -927,13 +927,13 @@ U_CFUNC PHP_FUNCTION(intlcal_is_weekend)
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ ZEND_NUM_ARGS(), getThis(),
"O|z!", &object, Calendar_ce_ptr, &rawDate) == FAILURE
|| (rawDate != NULL &&
- zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|d", &object, Calendar_ce_ptr, &date) == FAILURE)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_weekend: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_weekend: bad arguments", 0);
RETURN_FALSE;
}
@@ -956,16 +956,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_first_day_of_week)
zend_long dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_first_day_of_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_first_day_of_week: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_first_day_of_week: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_set_first_day_of_week: invalid day of week", 0);
RETURN_FALSE;
}
@@ -981,10 +981,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient)
zend_bool is_lenient;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ob", &object, Calendar_ce_ptr, &is_lenient) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_lenient: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_lenient: bad arguments", 0);
RETURN_FALSE;
}
@@ -1000,17 +1000,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week)
zend_long num_days;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_minimal_days_in_first_week: bad arguments", 0);
RETURN_FALSE;
}
if (num_days < 1 || num_days > 7) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_minimal_days_in_first_week: invalid number of days; "
- "must be between 1 and 7", 0 TSRMLS_CC);
+ "must be between 1 and 7", 0);
RETURN_FALSE;
}
@@ -1027,11 +1027,11 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
Calendar_object *other_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_equals: bad arguments", 0 TSRMLS_CC);
+ "intlcal_equals: bad arguments", 0);
RETURN_FALSE;
}
@@ -1039,7 +1039,7 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
other_co = Z_INTL_CALENDAR_P(other_object);
if (other_co->ucal == NULL) {
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_equals: The second IntlCalendar is unconstructed", 0 TSRMLS_CC);
+ "intlcal_equals: The second IntlCalendar is unconstructed", 0);
RETURN_FALSE;
}
@@ -1055,10 +1055,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_repeated_wall_time_option)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_repeated_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
@@ -1071,10 +1071,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_skipped_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
@@ -1088,16 +1088,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option)
zend_long option;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_repeated_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_repeated_wall_time_option: invalid option", 0 TSRMLS_CC);
+ "intlcal_set_repeated_wall_time_option: invalid option", 0);
RETURN_FALSE;
}
@@ -1113,17 +1113,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option)
zend_long option;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_skipped_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST
&& option != UCAL_WALLTIME_NEXT_VALID) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_skipped_wall_time_option: invalid option", 0 TSRMLS_CC);
+ "intlcal_set_skipped_wall_time_option: invalid option", 0);
RETURN_FALSE;
}
@@ -1148,21 +1148,21 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
Calendar *cal;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!",
&zv_arg, &locale_str, &locale_str_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_from_date_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_from_date_time: bad arguments", 0);
RETURN_NULL();
}
if (!(Z_TYPE_P(zv_arg) == IS_OBJECT && instanceof_function(
- Z_OBJCE_P(zv_arg), php_date_get_date_ce() TSRMLS_CC))) {
+ Z_OBJCE_P(zv_arg), php_date_get_date_ce()))) {
object_init_ex(&zv_tmp, php_date_get_date_ce());
zend_call_method_with_1_params(&zv_tmp, NULL, NULL, "__construct", NULL, zv_arg);
if (EG(exception)) {
- zend_object_store_ctor_failed(Z_OBJ(zv_tmp) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(zv_tmp));
goto error;
}
zv_datetime = &zv_tmp;
@@ -1174,7 +1174,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (!datetime->time) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: DateTime object is unconstructed",
- 0 TSRMLS_CC);
+ 0);
goto error;
}
@@ -1182,7 +1182,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (Z_TYPE(zv_timestamp) != IS_LONG) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: bad DateTime; call to "
- "DateTime::getTimestamp() failed", 0 TSRMLS_CC);
+ "DateTime::getTimestamp() failed", 0);
zval_ptr_dtor(&zv_timestamp);
goto error;
}
@@ -1191,14 +1191,14 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
timeZone = TimeZone::getGMT()->clone();
} else {
timeZone = timezone_convert_datetimezone(datetime->time->zone_type,
- datetime, 1, NULL, "intlcal_from_date_time" TSRMLS_CC);
+ datetime, 1, NULL, "intlcal_from_date_time");
if (timeZone == NULL) {
goto error;
}
}
if (!locale_str) {
- locale_str = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
+ locale_str = const_cast<char*>(intl_locale_get_default());
}
cal = Calendar::createInstance(timeZone,
@@ -1206,7 +1206,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (cal == NULL) {
delete timeZone;
intl_error_set(NULL, status, "intlcal_from_date_time: "
- "error creating ICU Calendar object", 0 TSRMLS_CC);
+ "error creating ICU Calendar object", 0);
goto error;
}
cal->setTime(((UDate)Z_LVAL(zv_timestamp)) * 1000., status);
@@ -1214,11 +1214,11 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
/* time zone was adopted by cal; should not be deleted here */
delete cal;
intl_error_set(NULL, status, "intlcal_from_date_time: "
- "error creating ICU Calendar::setTime()", 0 TSRMLS_CC);
+ "error creating ICU Calendar::setTime()", 0);
goto error;
}
- calendar_object_create(return_value, cal TSRMLS_CC);
+ calendar_object_create(return_value, cal);
error:
if (zv_datetime && zv_datetime != zv_arg) {
@@ -1231,10 +1231,10 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
zval retval;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_to_date_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_to_date_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -1253,7 +1253,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (date > (double)U_INT64_MAX || date < (double)U_INT64_MIN) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: The calendar date is out of the "
- "range for a 64-bit integer", 0 TSRMLS_CC);
+ "range for a 64-bit integer", 0);
RETURN_FALSE;
}
@@ -1266,7 +1266,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
/* Now get the time zone */
const TimeZone& tz = co->ucal->getTimeZone();
zval *timezone_zval = timezone_convert_to_datetimezone(
- &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp TSRMLS_CC);
+ &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp);
if (timezone_zval == NULL) {
RETURN_FALSE;
}
@@ -1279,8 +1279,8 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (EG(exception)) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: DateTime constructor has thrown exception",
- 1 TSRMLS_CC);
- zend_object_store_ctor_failed(Z_OBJ_P(return_value) TSRMLS_CC);
+ 1);
+ zend_object_store_ctor_failed(Z_OBJ_P(return_value));
zval_ptr_dtor(return_value);
zval_ptr_dtor(&ts_zval);
@@ -1295,7 +1295,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (Z_ISUNDEF(retval) || Z_TYPE(retval) == IS_FALSE) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: call to DateTime::setTimeZone has failed",
- 1 TSRMLS_CC);
+ 1);
zval_ptr_dtor(return_value);
RETVAL_FALSE;
goto error;
@@ -1310,10 +1310,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -1330,10 +1330,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message)
zend_string* message = NULL;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "intlcal_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -1344,6 +1344,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ message = intl_error_get_message(CALENDAR_ERROR_P(co));
RETURN_STR(message);
}
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index b0c8a964f6..8484f09629 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -46,13 +46,13 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
zend_long largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
// parameter number validation / variant determination
if (ZEND_NUM_ARGS() > 6 ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: too many arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: too many arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -62,26 +62,26 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (variant == 4) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: no variant with 4 arguments "
- "(excluding trailing NULLs)", 0 TSRMLS_CC);
+ "(excluding trailing NULLs)", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
// argument parsing
if (variant <= 2) {
- if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2) TSRMLS_CC,
+ if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2),
"|z!s!", &tz_object, &locale, &locale_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
}
- if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(),
"lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4],
&largs[5]) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -92,20 +92,20 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (variant <= 2) {
// From timezone and locale (0 to 2 arguments)
TimeZone *tz = timezone_process_timezone_argument(tz_object, NULL,
- "intlgregcal_create_instance" TSRMLS_CC);
+ "intlgregcal_create_instance");
if (tz == NULL) {
Z_OBJ_P(return_value) = NULL;
return;
}
if (!locale) {
- locale = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
+ locale = const_cast<char*>(intl_locale_get_default());
}
gcal = new GregorianCalendar(tz, Locale::createFromName(locale),
status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "intlgregcal_create_instance: error "
- "creating ICU GregorianCalendar from time zone and locale", 0 TSRMLS_CC);
+ "creating ICU GregorianCalendar from time zone and locale", 0);
if (gcal) {
delete gcal;
}
@@ -119,7 +119,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (largs[i] < INT32_MIN || largs[i] > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: at least one of the arguments"
- " has an absolute value that is too large", 0 TSRMLS_CC);
+ " has an absolute value that is too large", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -138,7 +138,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
}
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "intlgregcal_create_instance: error "
- "creating ICU GregorianCalendar from date", 0 TSRMLS_CC);
+ "creating ICU GregorianCalendar from date", 0);
if (gcal) {
delete gcal;
}
@@ -146,7 +146,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
return;
}
- timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C);
+ timelib_tzinfo *tzinfo = get_timezone_info();
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42
UnicodeString tzstr = UnicodeString::fromUTF8(StringPiece(tzinfo->name));
#else
@@ -157,7 +157,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: could not create UTF-8 string "
"from PHP's default timezone name (see date_default_timezone_get())",
- 0 TSRMLS_CC);
+ 0);
delete gcal;
Z_OBJ_P(return_value) = NULL;
return;
@@ -174,7 +174,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
U_CFUNC PHP_FUNCTION(intlgregcal_create_instance)
{
zval orig;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
object_init_ex(return_value, GregorianCalendar_ce_ptr);
ZVAL_COPY_VALUE(&orig, return_value);
@@ -190,14 +190,14 @@ U_CFUNC PHP_FUNCTION(intlgregcal_create_instance)
U_CFUNC PHP_METHOD(IntlGregorianCalendar, __construct)
{
zval orig_this = *getThis();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
return_value = getThis();
//changes this to IS_NULL (without first destroying) if there's an error
_php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -208,10 +208,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_set_gregorian_change)
double date;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Od", &object, GregorianCalendar_ce_ptr, &date) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_set_gregorian_change: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_set_gregorian_change: bad arguments", 0);
RETURN_FALSE;
}
@@ -228,10 +228,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_get_gregorian_change)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, GregorianCalendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_get_gregorian_change: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_get_gregorian_change: bad arguments", 0);
RETURN_FALSE;
}
@@ -245,16 +245,16 @@ U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year)
zend_long year;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_is_leap_year: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_is_leap_year: bad arguments", 0);
RETURN_FALSE;
}
if (year < INT32_MIN || year > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_is_leap_year: year out of bounds", 0 TSRMLS_CC);
+ "intlgregcal_is_leap_year: year out of bounds", 0);
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c
index 07dc6385c8..d86139c9e0 100644
--- a/ext/intl/collator/collator.c
+++ b/ext/intl/collator/collator.c
@@ -39,8 +39,8 @@ void collator_register_constants( INIT_FUNC_ARGS )
}
#define COLLATOR_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x TSRMLS_CC );
- #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x );
+ #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value );
/* UColAttributeValue constants */
COLLATOR_EXPOSE_CUSTOM_CLASS_CONST( "DEFAULT_VALUE", UCOL_DEFAULT );
diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c
index 8d879de8f7..7063db3562 100644
--- a/ext/intl/collator/collator_attr.c
+++ b/ext/intl/collator/collator_attr.c
@@ -38,11 +38,11 @@ PHP_FUNCTION( collator_get_attribute )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -69,11 +69,11 @@ PHP_FUNCTION( collator_set_attribute )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oll",
&object, Collator_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -99,11 +99,11 @@ PHP_FUNCTION( collator_get_strength )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -128,11 +128,11 @@ PHP_FUNCTION( collator_set_strength )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &strength ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index fd3f08e359..5632dc0f76 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -36,31 +36,31 @@ static zend_object_handlers Collator_handlers;
*/
/* {{{ Collator_objects_dtor */
-static void Collator_objects_dtor(zend_object *object TSRMLS_DC )
+static void Collator_objects_dtor(zend_object *object )
{
- zend_objects_destroy_object(object TSRMLS_CC );
+ zend_objects_destroy_object(object );
}
/* }}} */
/* {{{ Collator_objects_free */
-void Collator_objects_free(zend_object *object TSRMLS_DC )
+void Collator_objects_free(zend_object *object )
{
Collator_object* co = php_intl_collator_fetch_object(object);
- zend_object_std_dtor(&co->zo TSRMLS_CC );
+ zend_object_std_dtor(&co->zo );
- collator_object_destroy(co TSRMLS_CC );
+ collator_object_destroy(co );
}
/* }}} */
/* {{{ Collator_object_create */
-zend_object *Collator_object_create(zend_class_entry *ce TSRMLS_DC )
+zend_object *Collator_object_create(zend_class_entry *ce )
{
Collator_object* intern;
intern = ecalloc(1, sizeof(Collator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- intl_error_init(COLLATOR_ERROR_P(intern) TSRMLS_CC);
- zend_object_std_init(&intern->zo, ce TSRMLS_CC );
+ intl_error_init(COLLATOR_ERROR_P(intern));
+ zend_object_std_init(&intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &Collator_handlers;
@@ -123,14 +123,14 @@ zend_function_entry Collator_class_functions[] = {
/* {{{ collator_register_Collator_class
* Initialize 'Collator' class
*/
-void collator_register_Collator_class( TSRMLS_D )
+void collator_register_Collator_class( void )
{
zend_class_entry ce;
/* Create and register 'Collator' class. */
INIT_CLASS_ENTRY( ce, "Collator", Collator_class_functions );
ce.create_object = Collator_object_create;
- Collator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Collator_ce_ptr = zend_register_internal_class( &ce );
memcpy(&Collator_handlers, zend_get_std_object_handlers(),
sizeof Collator_handlers);
@@ -156,19 +156,19 @@ void collator_register_Collator_class( TSRMLS_D )
* Initialize internals of Collator_object.
* Must be called before any other call to 'collator_object_...' functions.
*/
-void collator_object_init( Collator_object* co TSRMLS_DC )
+void collator_object_init( Collator_object* co )
{
if( !co )
return;
- intl_error_init( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_init( COLLATOR_ERROR_P( co ) );
}
/* }}} */
/* {{{ void collator_object_destroy( Collator_object* co )
* Clean up mem allocted by internals of Collator_object
*/
-void collator_object_destroy( Collator_object* co TSRMLS_DC )
+void collator_object_destroy( Collator_object* co )
{
if( !co )
return;
@@ -179,7 +179,7 @@ void collator_object_destroy( Collator_object* co TSRMLS_DC )
co->ucoll = NULL;
}
- intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_reset( COLLATOR_ERROR_P( co ) );
}
/* }}} */
diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h
index f9d2cedf88..4ee8aba749 100644
--- a/ext/intl/collator/collator_class.h
+++ b/ext/intl/collator/collator_class.h
@@ -48,9 +48,9 @@ static inline Collator_object *php_intl_collator_fetch_object(zend_object *obj)
}
#define Z_INTL_COLLATOR_P(zv) php_intl_collator_fetch_object(Z_OBJ_P(zv))
-void collator_register_Collator_class( TSRMLS_D );
-void collator_object_init( Collator_object* co TSRMLS_DC );
-void collator_object_destroy( Collator_object* co TSRMLS_DC );
+void collator_register_Collator_class( void );
+void collator_object_init( Collator_object* co );
+void collator_object_destroy( Collator_object* co );
extern zend_class_entry *Collator_ce_ptr;
@@ -59,16 +59,16 @@ extern zend_class_entry *Collator_ce_ptr;
#define COLLATOR_METHOD_INIT_VARS \
zval* object = NULL; \
Collator_object* co = NULL; \
- intl_error_reset( NULL TSRMLS_CC ); \
+ intl_error_reset( NULL ); \
#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(INTL_COLLATOR, co)
// Macro to check return value of a ucol_* function call.
#define COLLATOR_CHECK_STATUS( co, msg ) \
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC ); \
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); \
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) \
{ \
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 ); \
RETURN_FALSE; \
} \
diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c
index d27ff32ebd..a7bc7f6383 100644
--- a/ext/intl/collator/collator_compare.c
+++ b/ext/intl/collator/collator_compare.c
@@ -46,11 +46,11 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oss",
&object, Collator_ce_ptr, &str1, &str1_len, &str2, &str2_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_compare: unable to parse input params", 0 TSRMLS_CC );
+ "collator_compare: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -59,10 +59,10 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -77,11 +77,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
@@ -93,11 +93,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting second argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting second argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index 607add2fcf..8ff63a902e 100644
--- a/ext/intl/collator/collator_convert.c
+++ b/ext/intl/collator/collator_convert.c
@@ -225,7 +225,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv )
/* {{{ collator_convert_object_to_string
* Convert object to UTF16-encoded string.
*/
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
+zval* collator_convert_object_to_string( zval* obj, zval *rv )
{
zval* zstr = NULL;
UErrorCode status = U_ZERO_ERROR;
@@ -241,7 +241,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
/* Try object's handlers. */
if( Z_OBJ_HT_P(obj)->get )
{
- zstr = Z_OBJ_HT_P(obj)->get( obj, rv TSRMLS_CC );
+ zstr = Z_OBJ_HT_P(obj)->get( obj, rv );
switch( Z_TYPE_P( zstr ) )
{
@@ -265,7 +265,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
{
zstr = rv;
- if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE TSRMLS_CC ) == FAILURE )
+ if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE ) == FAILURE )
{
/* cast_object failed => bail out. */
zval_ptr_dtor( zstr );
@@ -400,9 +400,8 @@ zval* collator_make_printable_zval( zval* arg, zval *rv)
if( Z_TYPE_P(arg) != IS_STRING )
{
- TSRMLS_FETCH();
-
- use_copy = zend_make_printable_zval(arg, &arg_copy TSRMLS_CC);
+
+ use_copy = zend_make_printable_zval(arg, &arg_copy);
if( use_copy )
{
diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h
index bf116bdfd8..4cfc8b56ce 100644
--- a/ext/intl/collator/collator_convert.h
+++ b/ext/intl/collator/collator_convert.h
@@ -28,7 +28,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv );
zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv );
zval* collator_normalize_sort_argument( zval* arg, zval *rv );
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC );
+zval* collator_convert_object_to_string( zval* obj, zval *rv );
zval* collator_convert_string_to_number( zval* arg, zval *rv );
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv );
zval* collator_convert_string_to_double( zval* str, zval *rv );
diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c
index 3c59f218e6..3945fb78b3 100644
--- a/ext/intl/collator/collator_create.c
+++ b/ext/intl/collator/collator_create.c
@@ -32,14 +32,14 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval* object;
Collator_object* co;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&locale, &locale_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_create: unable to parse input params", 0 TSRMLS_CC );
+ "collator_create: unable to parse input params", 0 );
zval_dtor(return_value);
RETURN_NULL();
}
@@ -48,7 +48,7 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
COLLATOR_METHOD_FETCH_OBJECT;
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
/* Open ICU collator. */
@@ -78,7 +78,7 @@ PHP_METHOD( Collator, __construct )
collator_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c
index fb8886ef64..5d30b8c655 100644
--- a/ext/intl/collator/collator_error.c
+++ b/ext/intl/collator/collator_error.c
@@ -33,11 +33,11 @@ PHP_FUNCTION( collator_get_error_code )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -64,11 +64,11 @@ PHP_FUNCTION( collator_get_error_message )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -79,7 +79,7 @@ PHP_FUNCTION( collator_get_error_message )
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ message = intl_error_get_message( COLLATOR_ERROR_P( co ) );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c
index 76f154bb7c..8e0b32650a 100644
--- a/ext/intl/collator/collator_locale.c
+++ b/ext/intl/collator/collator_locale.c
@@ -39,11 +39,11 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -52,10 +52,10 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 6f29c9b6de..d0d6b1a9d9 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -50,7 +50,7 @@ static const size_t DEF_SORT_KEYS_INDX_BUF_INCREMENT = 1048576;
static const size_t DEF_UTF16_BUF_SIZE = 1024;
/* {{{ collator_regular_compare_function */
-static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_regular_compare_function(zval *result, zval *op1, zval *op2)
{
Collator_object* co = NULL;
int rc = SUCCESS;
@@ -59,8 +59,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
zval norm1, norm2;
zval *num1_p = NULL, *num2_p = NULL;
zval *norm1_p = NULL, *norm2_p = NULL;
- zval* str1_p = collator_convert_object_to_string( op1, &str1 TSRMLS_CC );
- zval* str2_p = collator_convert_object_to_string( op2, &str2 TSRMLS_CC );
+ zval* str1_p = collator_convert_object_to_string( op1, &str1 );
+ zval* str2_p = collator_convert_object_to_string( op2, &str2 );
/* If both args are strings AND either of args is not numeric string
* then use ICU-compare. Otherwise PHP-compare. */
@@ -72,10 +72,10 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
co = Z_INTL_COLLATOR_P(&INTL_G(current_collator));
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
}
@@ -120,7 +120,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
norm2_p = collator_normalize_sort_argument( str2_p, &norm2 );
}
- rc = compare_function( result, norm1_p, norm2_p TSRMLS_CC );
+ rc = compare_function( result, norm1_p, norm2_p );
zval_ptr_dtor( norm1_p );
zval_ptr_dtor( norm2_p );
@@ -142,7 +142,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_numeric_compare_function
* Convert input args to double and compare it.
*/
-static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2)
{
int rc = SUCCESS;
zval num1, num2;
@@ -161,7 +161,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
op2 = num2_p;
}
- rc = numeric_compare_function( result, op1, op2 TSRMLS_CC);
+ rc = numeric_compare_function( result, op1, op2);
if( num1_p )
zval_ptr_dtor( num1_p );
@@ -175,7 +175,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_icu_compare_function
* Direct use of ucol_strcoll.
*/
-static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_icu_compare_function(zval *result, zval *op1, zval *op2)
{
zval str1, str2;
int rc = SUCCESS;
@@ -205,7 +205,7 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM
/* {{{ collator_compare_func
* Taken from PHP7 source (array_data_compare).
*/
-static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
+static int collator_compare_func( const void* a, const void* b )
{
Bucket *f;
Bucket *s;
@@ -219,7 +219,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
first = &f->val;
second = &s->val;
- if( INTL_G(compare_func)( &result, first, second TSRMLS_CC) == FAILURE )
+ if( INTL_G(compare_func)( &result, first, second) == FAILURE )
return 0;
if( Z_TYPE(result) == IS_DOUBLE )
@@ -246,7 +246,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
/* {{{ collator_cmp_sort_keys
* Compare sort keys
*/
-static int collator_cmp_sort_keys( const void *p1, const void *p2 TSRMLS_DC )
+static int collator_cmp_sort_keys( const void *p1, const void *p2 )
{
char* key1 = ((collator_sort_key_index_t*)p1)->key;
char* key2 = ((collator_sort_key_index_t*)p2)->key;
@@ -295,11 +295,11 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa/|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa/|l",
&object, Collator_ce_ptr, &array, &sort_flags ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_internal: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_internal: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -321,7 +321,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
ZVAL_COPY_VALUE(&INTL_G( current_collator ), object);
/* Sort specified array. */
- zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber TSRMLS_CC );
+ zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber );
/* Restore saved collator. */
ZVAL_COPY_VALUE(&INTL_G( current_collator ), &saved_collator);
@@ -381,11 +381,11 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa",
&object, Collator_ce_ptr, &array ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_with_sort_keys: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_with_sort_keys: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -394,10 +394,10 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -428,8 +428,8 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 );
if( utf16_buf )
efree( utf16_buf );
@@ -496,7 +496,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
sortKeyIndxBuf[j].key = sortKeyBuf + (ptrdiff_t)sortKeyIndxBuf[j].key;
/* sort it */
- zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys TSRMLS_CC );
+ zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys );
zval_ptr_dtor( array );
/* for resulting hash we'll assign new hash keys rather then reordering */
@@ -545,11 +545,11 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, Collator_ce_ptr, &str, &str_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_sort_key: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_sort_key: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -558,10 +558,10 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -576,11 +576,11 @@ PHP_FUNCTION( collator_get_sort_key )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
efree( ustr );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h
index b5cb017a8c..ffaf86e664 100644
--- a/ext/intl/collator/collator_sort.h
+++ b/ext/intl/collator/collator_sort.h
@@ -20,7 +20,7 @@
#include <php.h>
-typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
+typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 );
PHP_FUNCTION( collator_sort );
PHP_FUNCTION( collator_sort_with_sort_keys );
diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp
index 23dc342080..326e8c01c9 100644
--- a/ext/intl/common/common_date.cpp
+++ b/ext/intl/common/common_date.cpp
@@ -39,7 +39,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
void *object,
int is_datetime,
intl_error *outside_error,
- const char *func TSRMLS_DC)
+ const char *func)
{
char *id = NULL,
offset_id[] = "GMT+00:00";
@@ -66,7 +66,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
spprintf(&message, 0, "%s: object has an time zone offset "
"that's too large", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return NULL;
}
@@ -97,7 +97,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
spprintf(&message, 0, "%s: time zone id '%s' "
"extracted from ext/date DateTimeZone not recognized", func, id);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
delete timeZone;
return NULL;
@@ -107,7 +107,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
/* }}} */
U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- intl_error *err, const char *func TSRMLS_DC)
+ intl_error *err, const char *func)
{
zval retval;
zval zfuncname;
@@ -126,12 +126,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
if (millis) {
ZVAL_STRING(&zfuncname, "getTimestamp");
- if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL TSRMLS_CC)
+ if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL)
!= SUCCESS || Z_TYPE(retval) != IS_LONG) {
spprintf(&message, 0, "%s: error calling ::getTimeStamp() on the "
"object", func);
intl_errors_set(err, U_INTERNAL_PROGRAM_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
zval_ptr_dtor(&zfuncname);
return FAILURE;
@@ -148,7 +148,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
spprintf(&message, 0, "%s: the DateTime object is not properly "
"initialized", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return FAILURE;
}
@@ -156,12 +156,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
*tz = TimeZone::getGMT()->clone();
} else {
*tz = timezone_convert_datetimezone(datetime->time->zone_type,
- datetime, 1, NULL, func TSRMLS_CC);
+ datetime, 1, NULL, func);
if (*tz == NULL) {
spprintf(&message, 0, "%s: could not convert DateTime's "
"time zone", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return FAILURE;
}
@@ -171,7 +171,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
return SUCCESS;
}
-U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC)
+U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func)
{
double rv = NAN;
zend_long lv;
@@ -194,7 +194,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
"which would be required for it to be a valid date", func,
Z_STRVAL_P(z));
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
}
break;
@@ -205,15 +205,15 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
- intl_datetime_decompose(z, &rv, NULL, err, func TSRMLS_CC);
- } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce())) {
+ intl_datetime_decompose(z, &rv, NULL, err, func);
+ } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr)) {
Calendar_object *co = Z_INTL_CALENDAR_P(z);
if (co->ucal == NULL) {
spprintf(&message, 0, "%s: IntlCalendar object is not properly "
"constructed", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
} else {
UErrorCode status = UErrorCode();
@@ -221,7 +221,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
if (U_FAILURE(status)) {
spprintf(&message, 0, "%s: call to internal "
"Calendar::getTime() has failed", func);
- intl_errors_set(err, status, message, 1 TSRMLS_CC);
+ intl_errors_set(err, status, message, 1);
efree(message);
}
}
@@ -230,14 +230,14 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
spprintf(&message, 0, "%s: invalid object type for date/time "
"(only IntlCalendar and DateTime permitted)", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
}
break;
default:
spprintf(&message, 0, "%s: invalid PHP type for date", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
break;
}
diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h
index e8ab66f40d..d6b7c20719 100644
--- a/ext/intl/common/common_date.h
+++ b/ext/intl/common/common_date.h
@@ -28,13 +28,13 @@ U_CDECL_END
#include <unicode/timezone.h>
-U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC);
+U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- intl_error *err, const char *func TSRMLS_DC);
+ intl_error *err, const char *func);
#endif
-U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC);
+U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func);
#endif /* COMMON_DATE_H */
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index 952b39edca..cea9dc71c5 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -33,7 +33,7 @@ extern "C" {
zend_class_entry *IntlIterator_ce_ptr;
zend_object_handlers IntlIterator_handlers;
-void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC)
+void zoi_with_current_dtor(zend_object_iterator *iter)
{
zoi_with_current *zoiwc = (zoi_with_current*)iter;
@@ -52,22 +52,22 @@ void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC)
* precedes the object free phase. Therefore there's no risk on this
* function being called by the iterator wrapper destructor function and
* not finding the memory of this iterator allocated anymore. */
- iter->funcs->invalidate_current(iter TSRMLS_CC);
- zoiwc->destroy_it(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
+ zoiwc->destroy_it(iter);
}
}
-U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter)
{
return Z_ISUNDEF(((zoi_with_current*)iter)->current)? FAILURE : SUCCESS;
}
-U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter)
{
return &((zoi_with_current*)iter)->current;
}
-U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
if (!Z_ISUNDEF(zoi_iter->current)) {
@@ -76,12 +76,12 @@ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRM
}
}
-static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_current_move_forward(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
INTLITERATOR_METHOD_INIT_VARS;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
object = &zoi_iter->wrapping_obj;
INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK;
@@ -90,22 +90,22 @@ static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_D
const char *result = ((StringEnumeration*)Z_PTR(iter->data))->next(
&result_length, INTLITERATOR_ERROR_CODE(ii));
- intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC);
+ intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii));
if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) {
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii),
- "Error fetching next iteration element", 0 TSRMLS_CC);
+ "Error fetching next iteration element", 0);
} else if (result) {
ZVAL_STRINGL(&zoi_iter->current, result, result_length);
} //else we've reached the end of the enum, nothing more is required
}
-static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_rewind(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
INTLITERATOR_METHOD_INIT_VARS;
if (!Z_ISUNDEF(zoi_iter->current)) {
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
}
object = &zoi_iter->wrapping_obj;
@@ -113,16 +113,16 @@ static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC)
((StringEnumeration*)Z_PTR(iter->data))->reset(INTLITERATOR_ERROR_CODE(ii));
- intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC);
+ intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii));
if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) {
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii),
- "Error resetting enumeration", 0 TSRMLS_CC);
+ "Error resetting enumeration", 0);
} else {
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
}
}
-static void string_enum_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_destroy_it(zend_object_iterator *iter)
{
delete (StringEnumeration*)Z_PTR(iter->data);
}
@@ -137,13 +137,13 @@ static zend_object_iterator_funcs string_enum_object_iterator_funcs = {
zoi_with_current_invalidate_current
};
-U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC)
+U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object)
{
IntlIterator_object *ii;
object_init_ex(object, IntlIterator_ce_ptr);
ii = Z_INTL_ITERATOR_P(object);
ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_with_current));
- zend_iterator_init(ii->iterator TSRMLS_CC);
+ zend_iterator_init(ii->iterator);
ZVAL_PTR(&ii->iterator->data, se);
ii->iterator->funcs = &string_enum_object_iterator_funcs;
ii->iterator->index = 0;
@@ -152,26 +152,26 @@ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *ob
ZVAL_UNDEF(&((zoi_with_current*)ii->iterator)->current);
}
-static void IntlIterator_objects_free(zend_object *object TSRMLS_DC)
+static void IntlIterator_objects_free(zend_object *object)
{
IntlIterator_object *ii = php_intl_iterator_fetch_object(object);
if (ii->iterator) {
zval *wrapping_objp = &((zoi_with_current*)ii->iterator)->wrapping_obj;
ZVAL_UNDEF(wrapping_objp);
- zend_iterator_dtor(ii->iterator TSRMLS_CC);
+ zend_iterator_dtor(ii->iterator);
}
- intl_error_reset(INTLITERATOR_ERROR_P(ii) TSRMLS_CC);
+ intl_error_reset(INTLITERATOR_ERROR_P(ii));
- zend_object_std_dtor(&ii->zo TSRMLS_CC);
+ zend_object_std_dtor(&ii->zo);
}
static zend_object_iterator *IntlIterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+ zend_class_entry *ce, zval *object, int by_ref)
{
if (by_ref) {
zend_throw_exception(NULL,
- "Iteration by reference is not supported", 0 TSRMLS_CC);
+ "Iteration by reference is not supported", 0);
return NULL;
}
@@ -179,7 +179,7 @@ static zend_object_iterator *IntlIterator_get_iterator(
if (ii->iterator == NULL) {
zend_throw_exception(NULL,
- "The IntlIterator is not properly constructed", 0 TSRMLS_CC);
+ "The IntlIterator is not properly constructed", 0);
return NULL;
}
@@ -188,15 +188,15 @@ static zend_object_iterator *IntlIterator_get_iterator(
return ii->iterator;
}
-static zend_object *IntlIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *IntlIterator_object_create(zend_class_entry *ce)
{
IntlIterator_object *intern;
intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
- intl_error_init(INTLITERATOR_ERROR_P(intern) TSRMLS_CC);
+ intl_error_init(INTLITERATOR_ERROR_P(intern));
intern->iterator = NULL;
@@ -212,12 +212,12 @@ static PHP_METHOD(IntlIterator, current)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::current: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::current: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- data = ii->iterator->funcs->get_current_data(ii->iterator TSRMLS_CC);
+ data = ii->iterator->funcs->get_current_data(ii->iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -229,14 +229,14 @@ static PHP_METHOD(IntlIterator, key)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::key: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::key: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
if (ii->iterator->funcs->get_current_key) {
- ii->iterator->funcs->get_current_key(ii->iterator, return_value TSRMLS_CC);
+ ii->iterator->funcs->get_current_key(ii->iterator, return_value);
} else {
RETURN_LONG(ii->iterator->index);
}
@@ -248,12 +248,12 @@ static PHP_METHOD(IntlIterator, next)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::next: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::next: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- ii->iterator->funcs->move_forward(ii->iterator TSRMLS_CC);
+ ii->iterator->funcs->move_forward(ii->iterator);
/* foreach also advances the index after the last iteration,
* so I see no problem in incrementing the index here unconditionally */
ii->iterator->index++;
@@ -265,16 +265,16 @@ static PHP_METHOD(IntlIterator, rewind)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::rewind: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::rewind: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
if (ii->iterator->funcs->rewind) {
- ii->iterator->funcs->rewind(ii->iterator TSRMLS_CC);
+ ii->iterator->funcs->rewind(ii->iterator);
} else {
intl_errors_set(INTLITERATOR_ERROR_P(ii), U_UNSUPPORTED_ERROR,
- "IntlIterator::rewind: rewind not supported", 0 TSRMLS_CC);
+ "IntlIterator::rewind: rewind not supported", 0);
}
}
@@ -284,12 +284,12 @@ static PHP_METHOD(IntlIterator, valid)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::valid: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::valid: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator) == SUCCESS);
}
ZEND_BEGIN_ARG_INFO_EX(ainfo_se_void, 0, 0, 0)
@@ -308,16 +308,16 @@ static zend_function_entry IntlIterator_class_functions[] = {
/* {{{ intl_register_IntlIterator_class
* Initialize 'IntlIterator' class
*/
-U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D)
+U_CFUNC void intl_register_IntlIterator_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlIterator", IntlIterator_class_functions);
ce.create_object = IntlIterator_object_create;
- IntlIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ IntlIterator_ce_ptr = zend_register_internal_class(&ce);
IntlIterator_ce_ptr->get_iterator = IntlIterator_get_iterator;
- zend_class_implements(IntlIterator_ce_ptr TSRMLS_CC, 1,
+ zend_class_implements(IntlIterator_ce_ptr, 1,
zend_ce_iterator);
memcpy(&IntlIterator_handlers, zend_get_std_object_handlers(),
diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h
index af46a47751..b9b87c17e0 100644
--- a/ext/intl/common/common_enum.h
+++ b/ext/intl/common/common_enum.h
@@ -43,7 +43,7 @@ extern "C" {
object = getThis(); \
INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
if (ii->iterator == NULL) { \
- intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0 TSRMLS_CC); \
+ intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0); \
RETURN_FALSE; \
}
@@ -63,21 +63,21 @@ typedef struct {
zend_object_iterator zoi;
zval current;
zval wrapping_obj;
- void (*destroy_it)(zend_object_iterator *iterator TSRMLS_DC);
+ void (*destroy_it)(zend_object_iterator *iterator);
} zoi_with_current;
extern zend_class_entry *IntlIterator_ce_ptr;
extern zend_object_handlers IntlIterator_handlers;
-U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC);
+U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter);
+U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter);
+U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
+U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
#ifdef __cplusplus
-U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC);
+U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
#endif
-U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D);
+U_CFUNC void intl_register_IntlIterator_class(void);
#endif // INTL_COMMON_ENUM_H
diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c
index 524bb94327..16933c587f 100644
--- a/ext/intl/common/common_error.c
+++ b/ext/intl/common/common_error.c
@@ -28,7 +28,7 @@
*/
PHP_FUNCTION( intl_get_error_code )
{
- RETURN_LONG( intl_error_get_code( NULL TSRMLS_CC ) );
+ RETURN_LONG( intl_error_get_code( NULL ) );
}
/* }}} */
@@ -37,7 +37,7 @@ PHP_FUNCTION( intl_get_error_code )
*/
PHP_FUNCTION( intl_get_error_message )
{
- RETURN_STR(intl_error_get_message( NULL TSRMLS_CC ));
+ RETURN_STR(intl_error_get_message( NULL ));
}
/* }}} */
@@ -51,11 +51,11 @@ PHP_FUNCTION( intl_is_failure )
zend_long err_code;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "l",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intl_is_failure: unable to parse input params", 0 TSRMLS_CC );
+ "intl_is_failure: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -73,11 +73,11 @@ PHP_FUNCTION( intl_error_name )
zend_long err_code;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "l",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intl_error_name: unable to parse input params", 0 TSRMLS_CC );
+ "intl_error_name: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index 5afee4809e..0fbbd0f786 100644
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -85,7 +85,7 @@ if test "$PHP_INTL" != "no"; then
breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp \
idn/idn.c \
- $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS)
+ $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/collator)
PHP_ADD_BUILD_DIR($ext_builddir/converter)
PHP_ADD_BUILD_DIR($ext_builddir/common)
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index 22cde6bd6d..4628e434f7 100644
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -8,7 +8,7 @@ if (PHP_INTL != "no") {
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
// always build as shared - zend_strtod.c/ICU type conflict
EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
- "/I \"" + configure_module_dirname + "\"");
+ "/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/collator", "\
collator.c \
collator_attr.c \
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index b27652aa9a..f52d0490cc 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -24,9 +24,6 @@
#include "../intl_error.h"
typedef struct _php_converter_object {
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
UConverter *src, *dest;
zend_fcall_info to_cb, from_cb;
zend_fcall_info_cache to_cache, from_cache;
@@ -44,11 +41,11 @@ static zend_class_entry *php_converter_ce;
static zend_object_handlers php_converter_object_handlers;
#define CONV_GET(pzv) (Z_INTL_CONVERTER_P((pzv)))
-#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error TSRMLS_CC, \
+#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error, \
fname "() returned error " ZEND_LONG_FMT ": %s", (zend_long)error, u_errorName(error))
/* {{{ php_converter_throw_failure */
-static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error TSRMLS_DC, const char *format, ...) {
+static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error, const char *format, ...) {
intl_error *err = objval ? &(objval->error) : NULL;
char message[1024];
va_list vargs;
@@ -57,12 +54,12 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
vsnprintf(message, sizeof(message), format, vargs);
va_end(vargs);
- intl_errors_set(err, error, message, 1 TSRMLS_CC);
+ intl_errors_set(err, error, message, 1);
}
/* }}} */
/* {{{ php_converter_default_callback */
-static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error TSRMLS_DC) {
+static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
ZVAL_DEREF(error);
zval_dtor(error);
ZVAL_LONG(error, U_ZERO_ERROR);
@@ -77,7 +74,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
int8_t chars_len = sizeof(chars);
UErrorCode uerror = U_ZERO_ERROR;
if(!objval->src) {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
chars[0] = 0x1A;
chars[1] = 0;
chars_len = 1;
@@ -120,12 +117,12 @@ static PHP_METHOD(UConverter, toUCallback) {
zend_long reason;
zval *source, *codeUnits, *error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz",
&reason, &source, &codeUnits, &error) == FAILURE) {
return;
}
- php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC);
+ php_converter_default_callback(return_value, getThis(), reason, error);
}
/* }}} */
@@ -142,29 +139,29 @@ static PHP_METHOD(UConverter, fromUCallback) {
zend_long reason;
zval *source, *codePoint, *error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz",
&reason, &source, &codePoint, &error) == FAILURE) {
return;
}
- php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC);
+ php_converter_default_callback(return_value, getThis(), reason, error);
}
/* }}} */
/* {{{ php_converter_check_limits */
-static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed TSRMLS_DC) {
+static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) {
if (available < needed) {
- php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %pd bytes needed, %pd available", needed, available);
+ php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun %pd bytes needed, %pd available", needed, available);
return 0;
}
return 1;
}
/* }}} */
-#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed TSRMLS_CC)
+#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed)
/* {{{ php_converter_append_toUnicode_target */
-static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) {
+static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval) {
switch (Z_TYPE_P(val)) {
case IS_NULL:
/* Code unit is being skipped */
@@ -173,7 +170,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
{
zend_long lval = Z_LVAL_P(val);
if ((lval < 0) || (lval > 0x10FFFF)) {
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "Invalid codepoint U+%04lx", lval);
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "Invalid codepoint U+%04lx", lval);
return;
}
if (lval > 0xFFFF) {
@@ -209,12 +206,12 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
zval *tmpzval;
ZEND_HASH_FOREACH_VAL(ht, tmpzval) {
- php_converter_append_toUnicode_target(tmpzval, args, objval TSRMLS_CC);
+ php_converter_append_toUnicode_target(tmpzval, args, objval);
} ZEND_HASH_FOREACH_END();
return;
}
default:
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC,
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR,
"toUCallback() specified illegal type for substitution character");
}
}
@@ -229,9 +226,6 @@ static void php_converter_to_u_callback(const void *context,
php_converter_object *objval = (php_converter_object*)context;
zval retval;
zval zargs[4];
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
ZVAL_STRINGL(&zargs[1], args->source, args->sourceLimit - args->source);
@@ -242,11 +236,11 @@ static void php_converter_to_u_callback(const void *context,
objval->to_cb.params = zargs;
objval->to_cb.retval = &retval;
objval->to_cb.no_separation = 0;
- if (zend_call_function(&(objval->to_cb), &(objval->to_cache) TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) {
/* Unlikely */
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling toUCallback()");
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()");
} else if (!Z_ISUNDEF(retval)) {
- php_converter_append_toUnicode_target(&retval, args, objval TSRMLS_CC);
+ php_converter_append_toUnicode_target(&retval, args, objval);
zval_ptr_dtor(&retval);
}
@@ -264,7 +258,7 @@ static void php_converter_to_u_callback(const void *context,
/* }}} */
/* {{{ php_converter_append_fromUnicode_target */
-static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) {
+static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval) {
switch (Z_TYPE_P(val)) {
case IS_NULL:
/* Ignore */
@@ -288,12 +282,12 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni
HashTable *ht = Z_ARRVAL_P(val);
zval *tmpzval;
ZEND_HASH_FOREACH_VAL(ht, tmpzval) {
- php_converter_append_fromUnicode_target(tmpzval, args, objval TSRMLS_CC);
+ php_converter_append_fromUnicode_target(tmpzval, args, objval);
} ZEND_HASH_FOREACH_END();
return;
}
default:
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "fromUCallback() specified illegal type for substitution character");
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "fromUCallback() specified illegal type for substitution character");
}
}
/* }}} */
@@ -308,9 +302,6 @@ static void php_converter_from_u_callback(const void *context,
zval retval;
zval zargs[4];
int i;
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
array_init(&zargs[1]);
@@ -327,11 +318,11 @@ static void php_converter_from_u_callback(const void *context,
objval->from_cb.params = zargs;
objval->from_cb.retval = &retval;
objval->from_cb.no_separation = 0;
- if (zend_call_function(&(objval->from_cb), &(objval->from_cache) TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) {
/* Unlikely */
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling fromUCallback()");
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()");
} else if (!Z_ISUNDEF(retval)) {
- php_converter_append_fromUnicode_target(&retval, args, objval TSRMLS_CC);
+ php_converter_append_fromUnicode_target(&retval, args, objval);
zval_ptr_dtor(&retval);
}
@@ -349,7 +340,7 @@ static void php_converter_from_u_callback(const void *context,
/* }}} */
/* {{{ php_converter_set_callbacks */
-static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv TSRMLS_DC) {
+static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) {
zend_bool ret = 1;
UErrorCode error = U_ZERO_ERROR;
@@ -382,7 +373,7 @@ static inline zend_bool php_converter_set_callbacks(php_converter_object *objval
static zend_bool php_converter_set_encoding(php_converter_object *objval,
UConverter **pcnv,
const char *enc, int enc_len
- TSRMLS_DC) {
+ ) {
UErrorCode error = U_ZERO_ERROR;
UConverter *cnv = ucnv_open(enc, &error);
@@ -393,17 +384,17 @@ static zend_bool php_converter_set_encoding(php_converter_object *objval,
/* Should never happen */
actual_encoding = "(unknown)";
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding);
+ php_error_docref(NULL, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding);
} else if (U_FAILURE(error)) {
if (objval) {
THROW_UFAILURE(objval, "ucnv_open", error);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error));
+ php_error_docref(NULL, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error));
}
return 0;
}
- if (objval && !php_converter_set_callbacks(objval, cnv TSRMLS_CC)) {
+ if (objval && !php_converter_set_callbacks(objval, cnv)) {
return 0;
}
@@ -424,14 +415,14 @@ static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PAR
char *enc;
size_t enc_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &enc, &enc_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Bad arguments, "
- "expected one string argument", 0 TSRMLS_CC);
+ "expected one string argument", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
- RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len TSRMLS_CC));
+ RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len));
}
/* }}} */
@@ -456,11 +447,11 @@ static void php_converter_do_get_encoding(php_converter_object *objval, UConvert
const char *name;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!cnv) {
RETURN_NULL();
@@ -497,10 +488,10 @@ static void php_converter_do_get_type(php_converter_object *objval, UConverter *
UConverterType t;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!cnv) {
RETURN_NULL();
@@ -535,7 +526,7 @@ static void php_converter_resolve_callback(zval *zobj,
php_converter_object *objval,
const char *callback_name,
zend_fcall_info *finfo,
- zend_fcall_info_cache *fcache TSRMLS_DC) {
+ zend_fcall_info_cache *fcache) {
char *errstr = NULL;
zval caller;
@@ -543,8 +534,8 @@ static void php_converter_resolve_callback(zval *zobj,
Z_ADDREF_P(zobj);
add_index_zval(&caller, 0, zobj);
add_index_string(&caller, 1, callback_name);
- if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr TSRMLS_CC) == FAILURE) {
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Error setting converter callback: %s", errstr);
+ if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr) == FAILURE) {
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Error setting converter callback: %s", errstr);
}
zval_dtor(&caller);
if (errstr) {
@@ -566,19 +557,19 @@ static PHP_METHOD(UConverter, __construct) {
char *dest = src;
size_t dest_len = src_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!",
&dest, &dest_len, &src, &src_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::__construct(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::__construct(): bad arguments", 0);
return;
}
- php_converter_set_encoding(objval, &(objval->src), src, src_len TSRMLS_CC);
- php_converter_set_encoding(objval, &(objval->dest), dest, dest_len TSRMLS_CC);
- php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache) TSRMLS_CC);
- php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache) TSRMLS_CC);
+ php_converter_set_encoding(objval, &(objval->src), src, src_len );
+ php_converter_set_encoding(objval, &(objval->dest), dest, dest_len);
+ php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache));
+ php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache));
}
/* }}} */
@@ -593,12 +584,12 @@ static PHP_METHOD(UConverter, setSubstChars) {
size_t chars_len;
int ret = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &chars, &chars_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &chars, &chars_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::setSubstChars(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::setSubstChars(): bad arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (objval->src) {
UErrorCode error = U_ZERO_ERROR;
@@ -608,7 +599,7 @@ static PHP_METHOD(UConverter, setSubstChars) {
ret = 0;
}
} else {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
ret = 0;
}
@@ -620,7 +611,7 @@ static PHP_METHOD(UConverter, setSubstChars) {
ret = 0;
}
} else {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Destination Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Destination Converter has not been initialized yet");
ret = 0;
}
@@ -640,10 +631,10 @@ static PHP_METHOD(UConverter, getSubstChars) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getSubstChars(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getSubstChars(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!objval->src) {
RETURN_NULL();
@@ -666,7 +657,7 @@ static PHP_METHOD(UConverter, getSubstChars) {
static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, int32_t *pdest_len,
UConverter *src_cnv, const char *src, int32_t src_len,
php_converter_object *objval
- TSRMLS_DC) {
+ ) {
UErrorCode error = U_ZERO_ERROR;
int32_t dest_len,
temp_len;
@@ -674,7 +665,7 @@ static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, in
UChar *temp;
if (!src_cnv || !dest_cnv) {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC,
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR,
"Internal converters not initialized");
return 0;
}
@@ -734,12 +725,12 @@ ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, reasonText) {
zend_long reason;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &reason) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &reason) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::reasonText(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::reasonText(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
switch (reason) {
UCNV_REASON_CASE(UNASSIGNED)
@@ -749,7 +740,7 @@ static PHP_METHOD(UConverter, reasonText) {
UCNV_REASON_CASE(CLOSE)
UCNV_REASON_CASE(CLONE)
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason);
+ php_error_docref(NULL, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason);
RETURN_FALSE;
}
}
@@ -768,19 +759,19 @@ static PHP_METHOD(UConverter, convert) {
int32_t dest_len;
zend_bool reverse = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b",
&str, &str_len, &reverse) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::convert(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::convert(): bad arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (php_converter_do_convert(reverse ? objval->src : objval->dest,
&dest, &dest_len,
reverse ? objval->dest : objval->src,
str, str_len,
- objval TSRMLS_CC)) {
+ objval)) {
RETVAL_STRINGL(dest, dest_len);
//???
efree(dest);
@@ -805,16 +796,16 @@ static PHP_METHOD(UConverter, transcode) {
zval *options = NULL;
UConverter *src_cnv = NULL, *dest_cnv = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|a!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|a!",
&str, &str_len, &dest, &dest_len, &src, &src_len, &options) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::transcode(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::transcode(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (php_converter_set_encoding(NULL, &src_cnv, src, src_len TSRMLS_CC) &&
- php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len TSRMLS_CC)) {
+ if (php_converter_set_encoding(NULL, &src_cnv, src, src_len) &&
+ php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len)) {
char *out = NULL;
int out_len = 0;
UErrorCode error = U_ZERO_ERROR;
@@ -837,7 +828,7 @@ static PHP_METHOD(UConverter, transcode) {
}
if (U_SUCCESS(error) &&
- php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL TSRMLS_CC)) {
+ php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL)) {
RETVAL_STRINGL(out, out_len);
//???
efree(out);
@@ -869,11 +860,11 @@ static PHP_METHOD(UConverter, getErrorCode) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorCode(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorCode(): expected no arguments", 0);
RETURN_FALSE;
}
- RETURN_LONG(intl_error_get_code(&(objval->error) TSRMLS_CC));
+ RETURN_LONG(intl_error_get_code(&(objval->error)));
}
/* }}} */
@@ -882,11 +873,11 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_geterrormsg_arginfo, 0, ZEND_RETURN_VALUE,
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getErrorMessage) {
php_converter_object *objval = CONV_GET(getThis());
- zend_string *message = intl_error_get_message(&(objval->error) TSRMLS_CC);
+ zend_string *message = intl_error_get_message(&(objval->error));
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorMessage(): expected no arguments", 0);
RETURN_FALSE;
}
@@ -907,10 +898,10 @@ static PHP_METHOD(UConverter, getAvailable) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorMessage(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
array_init(return_value);
for(i = 0; i < count; i++) {
@@ -930,12 +921,12 @@ static PHP_METHOD(UConverter, getAliases) {
UErrorCode error = U_ZERO_ERROR;
uint16_t i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getAliases(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::getAliases(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
count = ucnv_countAliases(name, &error);
if (U_FAILURE(error)) {
@@ -967,10 +958,10 @@ static PHP_METHOD(UConverter, getStandards) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getStandards(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getStandards(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
array_init(return_value);
count = ucnv_countStandards();
@@ -1025,7 +1016,7 @@ static zend_function_entry php_converter_methods[] = {
};
/* {{{ Converter create/clone/destroy */
-static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) {
+static void php_converter_dtor_object(zend_object *obj) {
php_converter_object *objval = php_converter_fetch_object(obj);
if (objval->src) {
@@ -1036,19 +1027,16 @@ static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) {
ucnv_close(objval->dest);
}
- intl_error_reset(&(objval->error) TSRMLS_CC);
+ intl_error_reset(&(objval->error));
}
-static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval TSRMLS_DC) {
+static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval) {
php_converter_object *objval;
objval = ecalloc(1, sizeof(php_converter_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&objval->obj, ce TSRMLS_CC );
-#ifdef ZTS
- objval->tsrm_ls = TSRMLS_C;
-#endif
- intl_error_init(&(objval->error) TSRMLS_CC);
+ zend_object_std_init(&objval->obj, ce );
+ intl_error_init(&(objval->error));
objval->obj.handlers = &php_converter_object_handlers;
*pobjval = objval;
@@ -1056,21 +1044,21 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte
return &objval->obj;
}
-static zend_object *php_converter_create_object(zend_class_entry *ce TSRMLS_DC) {
+static zend_object *php_converter_create_object(zend_class_entry *ce) {
php_converter_object *objval = NULL;
- zend_object *retval = php_converter_object_ctor(ce, &objval TSRMLS_CC);
+ zend_object *retval = php_converter_object_ctor(ce, &objval);
object_properties_init(&(objval->obj), ce);
return retval;
}
-static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
+static zend_object *php_converter_clone_object(zval *object) {
php_converter_object *objval, *oldobj = Z_INTL_CONVERTER_P(object);
- zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval TSRMLS_CC);
+ zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval);
UErrorCode error = U_ZERO_ERROR;
- intl_errors_reset(&oldobj->error TSRMLS_CC);
+ intl_errors_reset(&oldobj->error);
objval->src = ucnv_safeClone(oldobj->src, NULL, NULL, &error);
if (U_SUCCESS(error)) {
@@ -1081,18 +1069,18 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
zend_string *err_msg;
THROW_UFAILURE(oldobj, "ucnv_safeClone", error);
- err_msg = intl_error_get_message(&oldobj->error TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ err_msg = intl_error_get_message(&oldobj->error);
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_release(err_msg);
return retval;
}
/* Update contexts for converter error handlers */
- php_converter_set_callbacks(objval, objval->src TSRMLS_CC);
- php_converter_set_callbacks(objval, objval->dest TSRMLS_CC);
+ php_converter_set_callbacks(objval, objval->src );
+ php_converter_set_callbacks(objval, objval->dest);
- zend_objects_clone_members(&(objval->obj), &(oldobj->obj) TSRMLS_CC);
+ zend_objects_clone_members(&(objval->obj), &(oldobj->obj));
/* Newly cloned object deliberately does not inherit error state from original object */
@@ -1100,15 +1088,15 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
}
/* }}} */
-#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v TSRMLS_CC)
-#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v TSRMLS_CC)
+#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v)
+#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v)
/* {{{ php_converter_minit */
int php_converter_minit(INIT_FUNC_ARGS) {
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "UConverter", php_converter_methods);
- php_converter_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ php_converter_ce = zend_register_internal_class(&ce);
php_converter_ce->create_object = php_converter_create_object;
memcpy(&php_converter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj);
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index ffa606a9cd..b1821ce0d3 100644
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -35,10 +35,10 @@ void dateformat_register_constants( INIT_FUNC_ARGS )
}
#define DATEFORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x TSRMLS_CC );
- #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x );
+ #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value );
- #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x TSRMLS_CC );
+ #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x );
/* UDateFormatStyle constants */
DATEFORMATTER_EXPOSE_CLASS_CONST( FULL );
@@ -74,11 +74,11 @@ PHP_FUNCTION( datefmt_get_error_code )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -100,11 +100,11 @@ PHP_FUNCTION( datefmt_get_error_message )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -112,7 +112,7 @@ PHP_FUNCTION( datefmt_get_error_message )
dfo = Z_INTL_DATEFORMATTER_P( object );
/* Return last error message. */
- message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) TSRMLS_CC );
+ message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) );
RETURN_STR( message);
}
/* }}} */
diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c
index 314ae730c7..ee8b91dbed 100644
--- a/ext/intl/dateformat/dateformat_attr.c
+++ b/ext/intl/dateformat/dateformat_attr.c
@@ -36,10 +36,10 @@ PHP_FUNCTION( datefmt_get_datetype )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_datetype: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_datetype: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -62,10 +62,10 @@ PHP_FUNCTION( datefmt_get_timetype )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_timetype: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_timetype: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -93,10 +93,10 @@ PHP_FUNCTION( datefmt_get_pattern )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -137,11 +137,11 @@ PHP_FUNCTION( datefmt_set_pattern )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, IntlDateFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_pattern: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_set_pattern: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -175,11 +175,11 @@ PHP_FUNCTION( datefmt_get_locale )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l",
&object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -204,11 +204,11 @@ PHP_FUNCTION( datefmt_is_lenient )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_is_lenient: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_is_lenient: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -232,11 +232,11 @@ PHP_FUNCTION( datefmt_set_lenient )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ob",
&object, IntlDateFormatter_ce_ptr,&isLenient ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_lenient: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_set_lenient: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp
index 71b136c6c1..52df471a10 100644
--- a/ext/intl/dateformat/dateformat_attrcpp.cpp
+++ b/ext/intl/dateformat/dateformat_attrcpp.cpp
@@ -48,10 +48,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id)
int str_len;
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_timezone_"
- "id: unable to parse input params", 0 TSRMLS_CC);
+ "id: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -76,10 +76,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_timezone: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_timezone: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -90,17 +90,17 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone)
if (tz_clone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_get_timezone: Out of memory when cloning time zone",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
object_init_ex(return_value, TimeZone_ce_ptr);
- timezone_object_construct(tz_clone, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz_clone, return_value, 1);
}
U_CFUNC PHP_FUNCTION(datefmt_set_timezone_id)
{
- php_error_docref0(NULL TSRMLS_CC, E_DEPRECATED,
+ php_error_docref0(NULL, E_DEPRECATED,
"Use datefmt_set_timezone() instead, which also accepts a plain "
"time zone identifier and for which this function is now an "
"alias");
@@ -119,17 +119,17 @@ U_CFUNC PHP_FUNCTION(datefmt_set_timezone)
DATE_FORMAT_METHOD_INIT_VARS;
- if ( zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if ( zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oz", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: "
- "unable to parse input params", 0 TSRMLS_CC);
+ "unable to parse input params", 0);
RETURN_FALSE;
}
DATE_FORMAT_METHOD_FETCH_OBJECT;
timezone = timezone_process_timezone_argument(timezone_zv,
- INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone" TSRMLS_CC);
+ INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone");
if (timezone == NULL) {
RETURN_FALSE;
}
@@ -146,10 +146,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_calendar: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_get_calendar: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -173,11 +173,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_get_calendar_object: unable to parse input params",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -192,11 +192,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object)
if (cal_clone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_get_calendar_object: Out of memory when cloning "
- "calendar", 0 TSRMLS_CC);
+ "calendar", 0);
RETURN_FALSE;
}
- calendar_object_create(return_value, cal_clone TSRMLS_CC);
+ calendar_object_create(return_value, cal_clone);
}
/* }}} */
@@ -210,10 +210,10 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
zval *calendar_zv;
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz",
&object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_calendar: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_set_calendar: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -229,7 +229,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (datefmt_process_calendar_arg(calendar_zv, locale,
"datefmt_set_calendar", INTL_DATA_ERROR_P(dfo), cal, cal_type,
- cal_owned TSRMLS_CC) == FAILURE) {
+ cal_owned) == FAILURE) {
RETURN_FALSE;
}
@@ -239,7 +239,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (old_timezone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_set_calendar: Out of memory when cloning calendar",
- 0 TSRMLS_CC);
+ 0);
delete cal;
RETURN_FALSE;
}
@@ -249,7 +249,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (cal == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_set_calendar: Out of memory when cloning calendar",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
}
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 0d93338ecd..ef63929a43 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -35,35 +35,35 @@ static zend_object_handlers IntlDateFormatter_handlers;
*/
/* {{{ IntlDateFormatter_objects_dtor */
-static void IntlDateFormatter_object_dtor(zend_object *object TSRMLS_DC )
+static void IntlDateFormatter_object_dtor(zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ IntlDateFormatter_objects_free */
-void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC )
+void IntlDateFormatter_object_free( zend_object *object )
{
IntlDateFormatter_object* dfo = php_intl_dateformatter_fetch_object(object);
- zend_object_std_dtor( &dfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &dfo->zo );
if (dfo->requested_locale) {
efree( dfo->requested_locale );
}
- dateformat_data_free( &dfo->datef_data TSRMLS_CC );
+ dateformat_data_free( &dfo->datef_data );
}
/* }}} */
/* {{{ IntlDateFormatter_object_create */
-zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *IntlDateFormatter_object_create(zend_class_entry *ce)
{
IntlDateFormatter_object* intern;
intern = ecalloc( 1, sizeof(IntlDateFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- dateformat_data_init( &intern->datef_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ dateformat_data_init( &intern->datef_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->date_type = 0;
intern->time_type = 0;
@@ -78,28 +78,28 @@ zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ IntlDateFormatter_object_clone */
-zend_object *IntlDateFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *IntlDateFormatter_object_clone(zval *object)
{
IntlDateFormatter_object *dfo, *new_dfo;
zend_object *new_obj;
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_dfo = php_intl_dateformatter_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_dfo->zo, &dfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_dfo->zo, &dfo->zo);
/* clone formatter object */
if (dfo->datef_data.udatf != NULL) {
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* set up error in case error handler is interested */
intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo),
- "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
- zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC);
+ "Failed to clone IntlDateFormatter object", 0 );
+ zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0);
}
return new_obj;
}
@@ -188,14 +188,14 @@ static zend_function_entry IntlDateFormatter_class_functions[] = {
/* {{{ dateformat_register_class
* Initialize 'IntlDateFormatter' class
*/
-void dateformat_register_IntlDateFormatter_class( TSRMLS_D )
+void dateformat_register_IntlDateFormatter_class( void )
{
zend_class_entry ce;
/* Create and register 'IntlDateFormatter' class. */
INIT_CLASS_ENTRY( ce, "IntlDateFormatter", IntlDateFormatter_class_functions );
ce.create_object = IntlDateFormatter_object_create;
- IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(),
sizeof IntlDateFormatter_handlers);
diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h
index ebd057022e..e96a20b5ee 100644
--- a/ext/intl/dateformat/dateformat_class.h
+++ b/ext/intl/dateformat/dateformat_class.h
@@ -37,7 +37,7 @@ static inline IntlDateFormatter_object *php_intl_dateformatter_fetch_object(zend
}
#define Z_INTL_DATEFORMATTER_P(zv) php_intl_dateformatter_fetch_object(Z_OBJ_P(zv))
-void dateformat_register_IntlDateFormatter_class( TSRMLS_D );
+void dateformat_register_IntlDateFormatter_class( void );
extern zend_class_entry *IntlDateFormatter_ce_ptr;
/* Auxiliary macros */
@@ -48,7 +48,7 @@ extern zend_class_entry *IntlDateFormatter_ce_ptr;
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
if (dfo->datef_data.udatf == NULL) \
{ \
- intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \
+ intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index 4a272aa45f..9a90029ca1 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -58,21 +58,21 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int slength = 0;
IntlDateFormatter_object* dfo;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
object = return_value;
/* Parse parameters. */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|zzs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
- "unable to parse input parameters", 0 TSRMLS_CC);
+ "unable to parse input parameters", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (locale_len == 0) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
locale = Locale::createFromName(locale_str);
@@ -80,14 +80,14 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
+ "datefmt_create: cannot call constructor twice", 0);
return;
}
/* process calendar */
if (datefmt_process_calendar_arg(calendar_zv, locale, "datefmt_create",
INTL_DATA_ERROR_P(dfo), calendar, calendar_type,
- calendar_owned TSRMLS_CC)
+ calendar_owned)
== FAILURE) {
goto error;
}
@@ -98,7 +98,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (explicit_tz || calendar_owned ) {
//we have an explicit time zone or a non-object calendar
timezone = timezone_process_timezone_argument(timezone_zv,
- INTL_DATA_ERROR_P(dfo), "datefmt_create" TSRMLS_CC);
+ INTL_DATA_ERROR_P(dfo), "datefmt_create");
if (timezone == NULL) {
goto error;
}
@@ -111,7 +111,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* object construction -> only set global error */
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
- "error converting pattern to UTF-16", 0 TSRMLS_CC);
+ "error converting pattern to UTF-16", 0);
goto error;
}
}
@@ -140,7 +140,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
- "formatter creation failed", 0 TSRMLS_CC);
+ "formatter creation failed", 0);
goto error;
}
@@ -160,7 +160,7 @@ error:
if (calendar != NULL && calendar_owned) {
delete calendar;
}
- if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
+ if (U_FAILURE(intl_error_get_code(NULL))) {
/* free_object handles partially constructed instances fine */
Z_OBJ_P(return_value) = NULL;
}
@@ -195,7 +195,7 @@ U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c
index 509e91b617..04d37aa7ac 100644
--- a/ext/intl/dateformat/dateformat_data.c
+++ b/ext/intl/dateformat/dateformat_data.c
@@ -22,20 +22,20 @@
/* {{{ void dateformat_data_init( dateformat_data* datef_data )
* Initialize internals of dateformat_data.
*/
-void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC )
+void dateformat_data_init( dateformat_data* datef_data )
{
if( !datef_data )
return;
datef_data->udatf = NULL;
- intl_error_reset( &datef_data->error TSRMLS_CC );
+ intl_error_reset( &datef_data->error );
}
/* }}} */
/* {{{ void dateformat_data_free( dateformat_data* datef_data )
* Clean up memory allocated for dateformat_data
*/
-void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC )
+void dateformat_data_free( dateformat_data* datef_data )
{
if( !datef_data )
return;
@@ -44,18 +44,18 @@ void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC )
udat_close( datef_data->udatf );
datef_data->udatf = NULL;
- intl_error_reset( &datef_data->error TSRMLS_CC );
+ intl_error_reset( &datef_data->error );
}
/* }}} */
/* {{{ dateformat_data* dateformat_data_create()
* Allocate memory for dateformat_data and initialize it with default values.
*/
-dateformat_data* dateformat_data_create( TSRMLS_D )
+dateformat_data* dateformat_data_create( void )
{
dateformat_data* datef_data = ecalloc( 1, sizeof(dateformat_data) );
- dateformat_data_init( datef_data TSRMLS_CC );
+ dateformat_data_init( datef_data );
return datef_data;
}
diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h
index a49da7dc89..aaf61e6266 100644
--- a/ext/intl/dateformat/dateformat_data.h
+++ b/ext/intl/dateformat/dateformat_data.h
@@ -30,8 +30,8 @@ typedef struct {
UDateFormat * udatf;
} dateformat_data;
-dateformat_data* dateformat_data_create( TSRMLS_D );
-void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC );
-void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC );
+dateformat_data* dateformat_data_create( void );
+void dateformat_data_init( dateformat_data* datef_data );
+void dateformat_data_free( dateformat_data* datef_data );
#endif // DATE_FORMAT_DATA_H
diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c
index d11eb2df24..61c3627cb8 100644
--- a/ext/intl/dateformat/dateformat_format.c
+++ b/ext/intl/dateformat/dateformat_format.c
@@ -32,7 +32,7 @@
/* {{{
* Internal function which calls the udat_format
*/
-static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value TSRMLS_DC)
+static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value)
{
UChar* formatted = NULL;
int32_t resultlengthneeded =0 ;
@@ -60,7 +60,7 @@ static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval
* Internal function which fetches an element from the passed array for the key_name passed
*/
static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
- HashTable* hash_arr, char* key_name, intl_error *err TSRMLS_DC)
+ HashTable* hash_arr, char* key_name, intl_error *err)
{
zval *ele_value = NULL;
int32_t result = 0;
@@ -74,7 +74,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
if(Z_TYPE_P(ele_value) != IS_LONG) {
spprintf(&message, 0, "datefmt_format: parameter array contains "
"a non-integer element for key '%s'", key_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
} else {
if (Z_LVAL_P(ele_value) > INT32_MAX ||
@@ -82,7 +82,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
spprintf(&message, 0, "datefmt_format: value %pd is out of "
"bounds for a 32-bit integer in key '%s'",
Z_LVAL_P(ele_value), key_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
} else {
result = Z_LVAL_P(ele_value);
@@ -98,7 +98,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
* Internal function which sets UCalendar from the passed array and retrieves timestamp
*/
static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
- HashTable *hash_arr TSRMLS_DC)
+ HashTable *hash_arr)
{
int32_t year,
month,
@@ -111,7 +111,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
intl_error *err = &dfo->datef_data.error;
#define INTL_GET_ELEM(elem) \
- internal_get_arr_ele(dfo, hash_arr, (elem), err TSRMLS_CC)
+ internal_get_arr_ele(dfo, hash_arr, (elem), err)
/* Fetch values from the incoming array */
year = INTL_GET_ELEM(CALENDAR_YEAR) + 1900; /* tm_year is years since 1900 */
@@ -130,7 +130,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
if (INTL_DATA_ERROR_CODE(dfo) != U_ZERO_ERROR) {
intl_errors_set(err, INTL_DATA_ERROR_CODE(dfo), "datefmt_format: "
- "error cloning calendar", 0 TSRMLS_CC);
+ "error cloning calendar", 0);
return 0;
}
@@ -158,10 +158,10 @@ PHP_FUNCTION(datefmt_format)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz",
&object, IntlDateFormatter_ce_ptr, &zarg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format: unable "
- "to parse input params", 0 TSRMLS_CC );
+ "to parse input params", 0 );
RETURN_FALSE;
}
@@ -173,17 +173,17 @@ PHP_FUNCTION(datefmt_format)
RETURN_FALSE;
}
- timestamp = internal_get_timestamp(dfo, hash_arr TSRMLS_CC);
+ timestamp = internal_get_timestamp(dfo, hash_arr);
INTL_METHOD_CHECK_STATUS(dfo, "datefmt_format: date formatting failed")
} else {
timestamp = intl_zval_to_millis(zarg, INTL_DATA_ERROR_P(dfo),
- "datefmt_format" TSRMLS_CC);
+ "datefmt_format");
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
RETURN_FALSE;
}
}
- internal_format( dfo, timestamp, return_value TSRMLS_CC);
+ internal_format( dfo, timestamp, return_value);
}
/* }}} */
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp
index b552ed7529..fe38a71287 100644
--- a/ext/intl/dateformat/dateformat_format_object.cpp
+++ b/ext/intl/dateformat/dateformat_format_object.cpp
@@ -73,13 +73,13 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
DateFormat::EStyle dateStyle = DateFormat::kDefault,
timeStyle = DateFormat::kDefault;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|zs!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|zs!",
&object, &format, &locale_str, &locale_len) == FAILURE) {
RETURN_FALSE;
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
if (format == NULL || Z_TYPE_P(format) == IS_NULL) {
@@ -91,7 +91,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (zend_hash_num_elements(ht) != 2) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; if array, it must have "
- "two elements", 0 TSRMLS_CC);
+ "two elements", 0);
RETURN_FALSE;
}
@@ -100,7 +100,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(z)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; the date format (first "
- "element of the array) is not valid", 0 TSRMLS_CC);
+ "element of the array) is not valid", 0);
RETURN_FALSE;
}
dateStyle = (DateFormat::EStyle)Z_LVAL_P(z);
@@ -110,7 +110,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(z)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; the time format ("
- "second element of the array) is not valid", 0 TSRMLS_CC);
+ "second element of the array) is not valid", 0);
RETURN_FALSE;
}
timeStyle = (DateFormat::EStyle)Z_LVAL_P(z);
@@ -118,7 +118,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(format)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: the date/time format type is invalid",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format);
@@ -126,7 +126,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
convert_to_string_ex(format);
if (Z_STRLEN_P(format) == 0) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_format_object: the format is empty", 0 TSRMLS_CC);
+ "datefmt_format_object: the format is empty", 0);
RETURN_FALSE;
}
pattern = true;
@@ -136,12 +136,12 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative);
zend_class_entry *instance_ce = Z_OBJCE_P(object);
- if (instanceof_function(instance_ce, Calendar_ce_ptr TSRMLS_CC)) {
- Calendar *obj_cal = calendar_fetch_native_calendar(object TSRMLS_CC);
+ if (instanceof_function(instance_ce, Calendar_ce_ptr)) {
+ Calendar *obj_cal = calendar_fetch_native_calendar(object);
if (obj_cal == NULL) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad IntlCalendar instance: "
- "not initialized properly", 0 TSRMLS_CC);
+ "not initialized properly", 0);
RETURN_FALSE;
}
timeZone = obj_cal->getTimeZone().clone();
@@ -149,28 +149,28 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: error obtaining instant from "
- "IntlCalendar", 0 TSRMLS_CC);
+ "IntlCalendar", 0);
RETVAL_FALSE;
goto cleanup;
}
cal = obj_cal->clone();
- } else if (instanceof_function(instance_ce, php_date_get_date_ce() TSRMLS_CC)) {
+ } else if (instanceof_function(instance_ce, php_date_get_date_ce())) {
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
- "datefmt_format_object" TSRMLS_CC) == FAILURE) {
+ "datefmt_format_object") == FAILURE) {
RETURN_FALSE;
}
cal = new GregorianCalendar(Locale::createFromName(locale_str), status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: could not create GregorianCalendar",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
} else {
intl_error_set(NULL, status, "datefmt_format_object: the passed object "
"must be an instance of either IntlCalendar or DateTime",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -184,7 +184,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: could not create SimpleDateFormat",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
@@ -195,7 +195,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (df == NULL) { /* according to ICU sources, this should never happen */
intl_error_set(NULL, status,
"datefmt_format_object: could not create DateFormat",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
@@ -216,7 +216,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (intl_charFromString(result, &ret_str, &ret_str_len, &status) == FAILURE) {
intl_error_set(NULL, status,
"datefmt_format_object: error converting result to UTF-8",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp
index b3f134a4f1..959afa8d82 100644
--- a/ext/intl/dateformat/dateformat_helpers.cpp
+++ b/ext/intl/dateformat/dateformat_helpers.cpp
@@ -34,7 +34,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
intl_error *err,
Calendar*& cal,
zend_long& cal_int_type,
- bool& calendar_owned TSRMLS_DC)
+ bool& calendar_owned)
{
char *msg;
UErrorCode status = UErrorCode();
@@ -56,7 +56,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
"calendar) or IntlDateFormatter::GREGORIAN. "
"Alternatively, it can be an IntlCalendar object",
func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
} else if (v == (zend_long)UCAL_TRADITIONAL) {
@@ -70,13 +70,13 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
} else if (Z_TYPE_P(calendar_zv) == IS_OBJECT &&
instanceof_function_ex(Z_OBJCE_P(calendar_zv),
- Calendar_ce_ptr, 0 TSRMLS_CC)) {
+ Calendar_ce_ptr, 0)) {
- cal = calendar_fetch_native_calendar(calendar_zv TSRMLS_CC);
+ cal = calendar_fetch_native_calendar(calendar_zv);
if (cal == NULL) {
spprintf(&msg, 0, "%s: Found unconstructed IntlCalendar object",
func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
@@ -87,7 +87,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
} else {
spprintf(&msg, 0, "%s: Invalid calendar argument; should be an integer "
"or an IntlCalendar instance", func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
@@ -97,7 +97,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
}
if (U_FAILURE(status)) {
spprintf(&msg, 0, "%s: Failure instantiating calendar", func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h
index c6121d75bb..eb90c99169 100644
--- a/ext/intl/dateformat/dateformat_helpers.h
+++ b/ext/intl/dateformat/dateformat_helpers.h
@@ -33,7 +33,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
intl_error *err,
Calendar*& cal,
zend_long& cal_int_type,
- bool& calendar_owned TSRMLS_DC);
+ bool& calendar_owned);
#endif /* DATEFORMAT_HELPERS_H */
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 15279da3a1..7d12f877e7 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -34,7 +34,7 @@
* if set to 1 - store any error encountered in the parameter parse_error
* if set to 0 - no need to store any error encountered in the parameter parse_error
*/
-static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC)
+static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value)
{
double result = 0;
UDate timestamp =0;
@@ -62,7 +62,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex
}
/* }}} */
-static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name TSRMLS_DC)
+static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name)
{
zend_long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo));
INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" );
@@ -81,7 +81,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va
/* {{{
* Internal function which calls the udat_parseCalendar
*/
-static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC)
+static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value)
{
UCalendar *parsed_calendar = NULL;
UChar* text_utf16 = NULL;
@@ -104,14 +104,14 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
array_init( return_value );
/* Add entries from various fields of the obtained parsed_calendar */
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON TSRMLS_CC);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON);
/* Is in DST? */
isInDST = ucal_inDaylightTime(parsed_calendar , &INTL_DATA_ERROR_CODE(dfo));
@@ -135,9 +135,9 @@ PHP_FUNCTION(datefmt_parse)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!",
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -152,7 +152,7 @@ PHP_FUNCTION(datefmt_parse)
RETURN_FALSE;
}
}
- internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
+ internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
if(z_parse_pos) {
zval_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
@@ -174,9 +174,9 @@ PHP_FUNCTION(datefmt_localtime)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!",
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -191,7 +191,7 @@ PHP_FUNCTION(datefmt_localtime)
RETURN_FALSE;
}
}
- internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
+ internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
if (z_parse_pos) {
zval_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c
index bb4d3d2ac5..63664ecc03 100644
--- a/ext/intl/formatter/formatter.c
+++ b/ext/intl/formatter/formatter.c
@@ -41,8 +41,8 @@ void formatter_register_constants( INIT_FUNC_ARGS )
}
#define FORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x TSRMLS_CC );
- #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x );
+ #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value );
/* UNumberFormatStyle constants */
FORMATTER_EXPOSE_CLASS_CONST( PATTERN_DECIMAL );
diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c
index 639342f4af..d3189df6d6 100644
--- a/ext/intl/formatter/formatter_attr.c
+++ b/ext/intl/formatter/formatter_attr.c
@@ -36,11 +36,11 @@ PHP_FUNCTION( numfmt_get_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -109,11 +109,11 @@ PHP_FUNCTION( numfmt_get_text_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_text_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_text_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -150,11 +150,11 @@ PHP_FUNCTION( numfmt_set_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Olz",
&object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -215,11 +215,11 @@ PHP_FUNCTION( numfmt_set_text_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols",
&object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_text_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_text_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -256,17 +256,17 @@ PHP_FUNCTION( numfmt_get_symbol )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &symbol ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_symbol: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_symbol: unable to parse input params", 0 );
RETURN_FALSE;
}
if(symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 );
RETURN_FALSE;
}
@@ -305,17 +305,17 @@ PHP_FUNCTION( numfmt_set_symbol )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols",
&object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_symbol: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_symbol: unable to parse input params", 0 );
RETURN_FALSE;
}
if (symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 );
RETURN_FALSE;
}
@@ -350,11 +350,11 @@ PHP_FUNCTION( numfmt_get_pattern )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -393,11 +393,11 @@ PHP_FUNCTION( numfmt_set_pattern )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, NumberFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -431,11 +431,11 @@ PHP_FUNCTION( numfmt_get_locale )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l",
&object, NumberFormatter_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index 8fcc155e85..935c51a955 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -34,33 +34,31 @@ static zend_object_handlers NumberFormatter_handlers;
*/
/* {{{ NumberFormatter_objects_dtor */
-static void NumberFormatter_object_dtor(
- zend_object *object
- TSRMLS_DC )
+static void NumberFormatter_object_dtor(zend_object *object)
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ NumberFormatter_objects_free */
-void NumberFormatter_object_free( zend_object *object TSRMLS_DC )
+void NumberFormatter_object_free( zend_object *object )
{
NumberFormatter_object* nfo = php_intl_number_format_fetch_object(object);
- zend_object_std_dtor( &nfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &nfo->zo );
- formatter_data_free( &nfo->nf_data TSRMLS_CC );
+ formatter_data_free( &nfo->nf_data );
}
/* }}} */
/* {{{ NumberFormatter_object_create */
-zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *NumberFormatter_object_create(zend_class_entry *ce)
{
NumberFormatter_object* intern;
intern = ecalloc( 1, sizeof(NumberFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- formatter_data_init( &intern->nf_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ formatter_data_init( &intern->nf_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &NumberFormatter_handlers;
@@ -70,16 +68,16 @@ zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ NumberFormatter_object_clone */
-zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *NumberFormatter_object_clone(zval *object)
{
NumberFormatter_object *nfo, *new_nfo;
zend_object *new_obj;
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_nfo = php_intl_number_format_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_nfo->zo, &nfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_nfo->zo, &nfo->zo);
/* clone formatter object. It may fail, the destruction code must handle this case */
if (FORMATTER_OBJECT(nfo) != NULL) {
FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo),
@@ -87,11 +85,11 @@ zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC)
if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) {
/* set up error in case error handler is interested */
intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo),
- "Failed to clone NumberFormatter object", 0 TSRMLS_CC);
- zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC);
+ "Failed to clone NumberFormatter object", 0);
+ zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0);
}
return new_obj;
}
@@ -184,14 +182,14 @@ static zend_function_entry NumberFormatter_class_functions[] = {
/* {{{ formatter_register_class
* Initialize 'NumberFormatter' class
*/
-void formatter_register_class( TSRMLS_D )
+void formatter_register_class( void )
{
zend_class_entry ce;
/* Create and register 'NumberFormatter' class. */
INIT_CLASS_ENTRY( ce, "NumberFormatter", NumberFormatter_class_functions );
ce.create_object = NumberFormatter_object_create;
- NumberFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ NumberFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&NumberFormatter_handlers, zend_get_std_object_handlers(),
sizeof(NumberFormatter_handlers));
diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h
index 1db688712c..1d6fa817c9 100644
--- a/ext/intl/formatter/formatter_class.h
+++ b/ext/intl/formatter/formatter_class.h
@@ -34,7 +34,7 @@ static inline NumberFormatter_object *php_intl_number_format_fetch_object(zend_o
}
#define Z_INTL_NUMBERFORMATTER_P(zv) php_intl_number_format_fetch_object(Z_OBJ_P(zv))
-void formatter_register_class( TSRMLS_D );
+void formatter_register_class( void );
extern zend_class_entry *NumberFormatter_ce_ptr;
/* Auxiliary macros */
@@ -47,7 +47,7 @@ extern zend_class_entry *NumberFormatter_ce_ptr;
if (FORMATTER_OBJECT(nfo) == NULL) \
{ \
intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \
+ "Found unconstructed NumberFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c
index 2f785ba68f..46b94ad4ea 100644
--- a/ext/intl/formatter/formatter_data.c
+++ b/ext/intl/formatter/formatter_data.c
@@ -23,20 +23,20 @@
/* {{{ void formatter_data_init( formatter_data* nf_data )
* Initialize internals of formatter_data.
*/
-void formatter_data_init( formatter_data* nf_data TSRMLS_DC )
+void formatter_data_init( formatter_data* nf_data )
{
if( !nf_data )
return;
nf_data->unum = NULL;
- intl_error_reset( &nf_data->error TSRMLS_CC );
+ intl_error_reset( &nf_data->error );
}
/* }}} */
/* {{{ void formatter_data_free( formatter_data* nf_data )
* Clean up mem allocted by internals of formatter_data
*/
-void formatter_data_free( formatter_data* nf_data TSRMLS_DC )
+void formatter_data_free( formatter_data* nf_data )
{
if( !nf_data )
return;
@@ -45,18 +45,18 @@ void formatter_data_free( formatter_data* nf_data TSRMLS_DC )
unum_close( nf_data->unum );
nf_data->unum = NULL;
- intl_error_reset( &nf_data->error TSRMLS_CC );
+ intl_error_reset( &nf_data->error );
}
/* }}} */
/* {{{ formatter_data* formatter_data_create()
* Alloc mem for formatter_data and initialize it with default values.
*/
-formatter_data* formatter_data_create( TSRMLS_D )
+formatter_data* formatter_data_create( void )
{
formatter_data* nf_data = ecalloc( 1, sizeof(formatter_data) );
- formatter_data_init( nf_data TSRMLS_CC );
+ formatter_data_init( nf_data );
return nf_data;
}
diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h
index 0e3bc4fea4..8d1bfd12cd 100644
--- a/ext/intl/formatter/formatter_data.h
+++ b/ext/intl/formatter/formatter_data.h
@@ -31,8 +31,8 @@ typedef struct {
UNumberFormat* unum;
} formatter_data;
-formatter_data* formatter_data_create( TSRMLS_D );
-void formatter_data_init( formatter_data* nf_data TSRMLS_DC );
-void formatter_data_free( formatter_data* nf_data TSRMLS_DC );
+formatter_data* formatter_data_create( void );
+void formatter_data_init( formatter_data* nf_data );
+void formatter_data_free( formatter_data* nf_data );
#endif // FORMATTER_DATA_H
diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c
index 937cb05812..b852e54b3e 100644
--- a/ext/intl/formatter/formatter_format.c
+++ b/ext/intl/formatter/formatter_format.c
@@ -40,11 +40,11 @@ PHP_FUNCTION( numfmt_format )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oz|l",
&object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_format: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_format: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -69,7 +69,7 @@ PHP_FUNCTION( numfmt_format )
if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) {
SEPARATE_ZVAL_IF_NOT_REF(number);
- convert_scalar_to_number(number TSRMLS_CC );
+ convert_scalar_to_number(number );
}
switch(type) {
@@ -78,7 +78,7 @@ PHP_FUNCTION( numfmt_format )
formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number),
formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number),
formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
@@ -94,7 +94,7 @@ PHP_FUNCTION( numfmt_format )
int64_t value = (Z_TYPE_P(number) == IS_DOUBLE)?(int64_t)Z_DVAL_P(number):Z_LVAL_P(number);
formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) {
@@ -109,7 +109,7 @@ PHP_FUNCTION( numfmt_format )
convert_to_double_ex(number);
formatted_len = unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) {
@@ -120,7 +120,7 @@ PHP_FUNCTION( numfmt_format )
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
RETURN_FALSE;
break;
}
@@ -147,11 +147,11 @@ PHP_FUNCTION( numfmt_format_currency )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ods",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ods",
&object, NumberFormatter_ce_ptr, &number, &currency, &currency_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_format_currency: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_format_currency: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -171,14 +171,14 @@ PHP_FUNCTION( numfmt_format_currency )
* and use it to format the number.
*/
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
unum_formatDoubleCurrency(FORMATTER_OBJECT(nfo), number, scurrency, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
}
if( U_FAILURE( INTL_DATA_ERROR_CODE((nfo)) ) ) {
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) TSRMLS_CC );
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 );
RETVAL_FALSE;
if (formatted != format_buf) {
efree(formatted);
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c
index 939a8f782b..067f3bd82b 100644
--- a/ext/intl/formatter/formatter_main.c
+++ b/ext/intl/formatter/formatter_main.c
@@ -36,11 +36,11 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sl|s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s",
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_create: unable to parse input parameters", 0 TSRMLS_CC );
+ "numfmt_create: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -56,7 +56,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
/* Create an ICU number formatter. */
@@ -96,7 +96,7 @@ PHP_METHOD( NumberFormatter, __construct )
numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -113,11 +113,11 @@ PHP_FUNCTION( numfmt_get_error_code )
FORMATTER_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -140,11 +140,11 @@ PHP_FUNCTION( numfmt_get_error_message )
FORMATTER_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -152,7 +152,7 @@ PHP_FUNCTION( numfmt_get_error_message )
nfo = Z_INTL_NUMBERFORMATTER_P(object);
/* Return last error message. */
- message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) TSRMLS_CC );
+ message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 0959d11830..b2af74a2e0 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -50,11 +50,11 @@ PHP_FUNCTION( numfmt_parse )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|lz/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|lz/!",
&object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "number_parse: unable to parse input params", 0 TSRMLS_CC );
+ "number_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -97,7 +97,7 @@ PHP_FUNCTION( numfmt_parse )
RETVAL_DOUBLE(val_double);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
RETVAL_FALSE;
break;
}
@@ -139,11 +139,11 @@ PHP_FUNCTION( numfmt_parse_currency )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osz/|z/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Osz/|z/!",
&object, NumberFormatter_ce_ptr, &str, &str_len, &zcurrency, &zposition ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "number_parse_currency: unable to parse input params", 0 TSRMLS_CC );
+ "number_parse_currency: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h
index 5256a272a1..871e660639 100644
--- a/ext/intl/grapheme/grapheme.h
+++ b/ext/intl/grapheme/grapheme.h
@@ -31,6 +31,6 @@ PHP_FUNCTION(grapheme_stristr);
PHP_FUNCTION(grapheme_extract);
void grapheme_register_constants( INIT_FUNC_ARGS );
-void grapheme_close_global_iterator( TSRMLS_D );
+void grapheme_close_global_iterator( void );
#endif // GRAPHEME_GRAPHEME_H
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 55ce63955f..d5a33fe663 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -61,10 +61,10 @@ PHP_FUNCTION(grapheme_strlen)
int ret_len;
UErrorCode status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string, &string_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strlen: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strlen: unable to parse input param", 0 );
RETURN_FALSE;
}
@@ -80,17 +80,17 @@ PHP_FUNCTION(grapheme_strlen)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustring) {
efree( ustring );
}
RETURN_NULL();
}
- ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 TSRMLS_CC );
+ ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 );
if (ustring) {
efree( ustring );
@@ -115,17 +115,17 @@ PHP_FUNCTION(grapheme_strpos)
int32_t offset = 0;
int ret_pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -137,7 +137,7 @@ PHP_FUNCTION(grapheme_strpos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -160,7 +160,7 @@ PHP_FUNCTION(grapheme_strpos)
}
/* do utf16 part of the strpos */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ );
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -183,17 +183,17 @@ PHP_FUNCTION(grapheme_stripos)
int ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_stripos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_stripos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -205,7 +205,7 @@ PHP_FUNCTION(grapheme_stripos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(grapheme_stripos)
}
/* do utf16 part of the strpos */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ );
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -257,17 +257,17 @@ PHP_FUNCTION(grapheme_strrpos)
int32_t ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strrpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -279,7 +279,7 @@ PHP_FUNCTION(grapheme_strrpos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos)
/* else we need to continue via utf16 */
}
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC);
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */);
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -327,17 +327,17 @@ PHP_FUNCTION(grapheme_strripos)
int32_t ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strrpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -349,7 +349,7 @@ PHP_FUNCTION(grapheme_strripos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos)
/* else we need to continue via utf16 */
}
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC);
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */);
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -412,17 +412,17 @@ PHP_FUNCTION(grapheme_substr)
int sub_str_start_pos, sub_str_end_pos;
int32_t (*iter_func)(UBreakIterator *);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_substr: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_substr: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(lstart, str_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 );
RETURN_FALSE;
}
@@ -436,7 +436,7 @@ PHP_FUNCTION(grapheme_substr)
grapheme_substr_ascii((char *)str, str_len, start, length, ZEND_NUM_ARGS(), (char **) &sub_str, &sub_str_len);
if ( NULL == sub_str ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 );
RETURN_FALSE;
}
@@ -450,17 +450,17 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustr) {
efree( ustr );
}
RETURN_FALSE;
}
- bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status );
if( U_FAILURE(status) ) {
RETURN_FALSE;
@@ -492,7 +492,7 @@ PHP_FUNCTION(grapheme_substr)
if ( 0 != start || sub_str_start_pos >= ustr_len ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 );
if (ustr) {
efree(ustr);
@@ -517,10 +517,10 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
if (sub_str) {
efree( sub_str );
@@ -573,7 +573,7 @@ PHP_FUNCTION(grapheme_substr)
if ( UBRK_DONE == sub_str_end_pos) {
if(length < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 );
efree(ustr);
RETURN_FALSE;
@@ -583,7 +583,7 @@ PHP_FUNCTION(grapheme_substr)
}
if(sub_str_start_pos > sub_str_end_pos) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 );
efree(ustr);
RETURN_FALSE;
@@ -597,10 +597,10 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
if ( NULL != sub_str )
efree( sub_str );
@@ -624,17 +624,17 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
int ret_pos, uchar_pos;
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strstr: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strstr: unable to parse input param", 0 );
RETURN_FALSE;
}
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -666,7 +666,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
}
/* need to work in utf16 */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ );
if ( ret_pos < 0 ) {
RETURN_FALSE;
@@ -829,10 +829,10 @@ PHP_FUNCTION(grapheme_extract)
int ret_pos;
zval *next = NULL; /* return offset of next part of the string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_extract: unable to parse input param", 0 );
RETURN_FALSE;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(grapheme_extract)
if ( NULL != next ) {
if ( !Z_ISREF_P(next) ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: 'next' was not passed by reference", 0 TSRMLS_CC );
+ "grapheme_extract: 'next' was not passed by reference", 0 );
RETURN_FALSE;
}
@@ -856,18 +856,18 @@ PHP_FUNCTION(grapheme_extract)
if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: unknown extract type param", 0 TSRMLS_CC );
+ "grapheme_extract: unknown extract type param", 0 );
RETURN_FALSE;
}
if ( lstart > INT32_MAX || lstart < 0 || lstart >= str_len ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 );
RETURN_FALSE;
}
if ( size > INT32_MAX || size < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 );
RETURN_FALSE;
}
if (size == 0) {
@@ -887,7 +887,7 @@ PHP_FUNCTION(grapheme_extract)
pstr++;
if ( pstr >= str_end ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: invalid input string", 0 TSRMLS_CC );
+ "grapheme_extract: invalid input string", 0 );
RETURN_FALSE;
}
@@ -916,10 +916,10 @@ PHP_FUNCTION(grapheme_extract)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if ( NULL != ustr )
efree( ustr );
@@ -929,7 +929,7 @@ PHP_FUNCTION(grapheme_extract)
bi = NULL;
status = U_ZERO_ERROR;
- bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status );
ubrk_setText(bi, ustr, ustr_len, &status);
diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c
index 5e94eefc8a..bb4ecac084 100644
--- a/ext/intl/grapheme/grapheme_util.c
+++ b/ext/intl/grapheme/grapheme_util.c
@@ -38,7 +38,7 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
/* {{{ grapheme_close_global_iterator - clean up */
void
-grapheme_close_global_iterator( TSRMLS_D )
+grapheme_close_global_iterator( void )
{
UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator );
@@ -109,8 +109,8 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
#define STRPOS_CHECK_STATUS(status, error) \
if ( U_FAILURE( (status) ) ) { \
- intl_error_set_code( NULL, (status) TSRMLS_CC ); \
- intl_error_set_custom_msg( NULL, (error), 0 TSRMLS_CC ); \
+ intl_error_set_code( NULL, (status) ); \
+ intl_error_set_custom_msg( NULL, (error), 0 ); \
if (uhaystack) { \
efree( uhaystack ); \
} \
@@ -128,7 +128,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
/* {{{ grapheme_strpos_utf16 - strrpos using utf16*/
-int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC)
+int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last)
{
UChar *uhaystack = NULL, *uneedle = NULL;
int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0;
@@ -153,7 +153,7 @@ int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigne
/* get a pointer to the haystack taking into account the offset */
status = U_ZERO_ERROR;
- bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status );
STRPOS_CHECK_STATUS(status, "Failed to get iterator");
status = U_ZERO_ERROR;
ubrk_setText(bi, uhaystack, uhaystack_len, &status);
@@ -231,14 +231,14 @@ int grapheme_ascii_check(const unsigned char *day, int32_t len)
/* }}} */
/* {{{ grapheme_split_string: find and optionally return grapheme boundaries */
-int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC )
+int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len )
{
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];
UErrorCode status = U_ZERO_ERROR;
int ret_len, pos;
UBreakIterator* bi;
- bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status );
if( U_FAILURE(status) ) {
return -1;
@@ -374,7 +374,7 @@ grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned c
/* }}} */
/* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC )
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status )
{
int32_t buffer_size;
diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h
index a66796d80d..99021287fa 100644
--- a/ext/intl/grapheme/grapheme_util.h
+++ b/ext/intl/grapheme/grapheme_util.h
@@ -21,17 +21,17 @@
#include "intl_convert.h"
/* get_break_interator: get a break iterator from the global structure */
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC );
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
void grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len);
-int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC);
+int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case);
-int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last TSRMLS_DC);
+int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last);
int grapheme_ascii_check(const unsigned char *day, int32_t len);
-int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC );
+int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len );
int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len);
@@ -41,7 +41,7 @@ int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset);
int32_t grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset);
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC );
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
/* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */
#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset >= (zend_long) max_len) )
diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c
index 1d07dbba80..0848be94a7 100644
--- a/ext/intl/idn/idn.c
+++ b/ext/intl/idn/idn.c
@@ -111,15 +111,15 @@ enum {
};
/* like INTL_CHECK_STATUS, but as a function and varying the name of the func */
-static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode TSRMLS_DC)
+static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode)
{
- intl_error_set_code(NULL, err TSRMLS_CC);
+ intl_error_set_code(NULL, err);
if (U_FAILURE(err)) {
char *buff;
spprintf(&buff, 0, "%s: %s",
mode == INTL_IDN_TO_ASCII ? "idn_to_ascii" : "idn_to_utf8",
msg);
- intl_error_set_custom_msg(NULL, buff, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, buff, 1);
efree(buff);
return FAILURE;
}
@@ -127,9 +127,9 @@ static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode T
return SUCCESS;
}
-static inline void php_intl_bad_args(const char *msg, int mode TSRMLS_DC)
+static inline void php_intl_bad_args(const char *msg, int mode)
{
- php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode TSRMLS_CC);
+ php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode);
}
#ifdef HAVE_46_API
@@ -146,7 +146,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
uts46 = uidna_openUTS46(option, &status);
if (php_intl_idn_check_status(status, "failed to open UIDNA instance",
- mode TSRMLS_CC) == FAILURE) {
+ mode) == FAILURE) {
zend_string_free(buffer);
RETURN_FALSE;
}
@@ -159,13 +159,13 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
buffer->val, buffer_capac, &info, &status);
}
if (php_intl_idn_check_status(status, "failed to convert name",
- mode TSRMLS_CC) == FAILURE) {
+ mode) == FAILURE) {
uidna_close(uts46);
zend_string_free(buffer);
RETURN_FALSE;
}
if (len >= 255) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "ICU returned an unexpected length");
+ php_error_docref(NULL, E_ERROR, "ICU returned an unexpected length");
}
buffer->val[len] = '\0';
@@ -217,10 +217,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
intl_convert_utf8_to_utf16(&ustring, &ustring_len, domain, domain_len, &status);
if (U_FAILURE(status)) {
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustring) {
efree(ustring);
}
@@ -237,7 +237,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
efree(ustring);
if (U_FAILURE(status)) {
- intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 TSRMLS_CC );
+ intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 );
RETURN_FALSE;
}
@@ -246,10 +246,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
if (U_FAILURE(status)) {
/* Set global error code. */
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
efree(converted_utf8);
RETURN_FALSE;
}
@@ -269,42 +269,42 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
variant = INTL_IDN_VARIANT_2003;
zval *idna_info = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|llz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|llz/",
&domain, &domain_len, &option, &variant, &idna_info) == FAILURE) {
- php_intl_bad_args("bad arguments", mode TSRMLS_CC);
+ php_intl_bad_args("bad arguments", mode);
RETURN_NULL(); /* don't set FALSE because that's not the way it was before... */
}
#ifdef HAVE_46_API
if (variant != INTL_IDN_VARIANT_2003 && variant != INTL_IDN_VARIANT_UTS46) {
php_intl_bad_args("invalid variant, must be one of {"
- "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode TSRMLS_CC);
+ "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode);
RETURN_FALSE;
}
#else
if (variant != INTL_IDN_VARIANT_2003) {
php_intl_bad_args("invalid variant, PHP was compiled against "
"an old version of ICU and only supports INTL_IDN_VARIANT_2003",
- mode TSRMLS_CC);
+ mode);
RETURN_FALSE;
}
#endif
if (domain_len < 1) {
- php_intl_bad_args("empty domain name", mode TSRMLS_CC);
+ php_intl_bad_args("empty domain name", mode);
RETURN_FALSE;
}
if (domain_len > INT32_MAX - 1) {
- php_intl_bad_args("domain name too large", mode TSRMLS_CC);
+ php_intl_bad_args("domain name too large", mode);
RETURN_FALSE;
}
/* don't check options; it wasn't checked before */
if (idna_info != NULL) {
if (variant == INTL_IDN_VARIANT_2003) {
- php_error_docref0(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref0(NULL, E_NOTICE,
"4 arguments were provided, but INTL_IDNA_VARIANT_2003 only "
"takes 3 - extra argument ignored");
} else {
diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h
index a7afb36be9..6467d40909 100644
--- a/ext/intl/intl_data.h
+++ b/ext/intl/intl_data.h
@@ -35,7 +35,7 @@ typedef struct _intl_data {
#define INTL_METHOD_INIT_VARS(oclass, obj) \
zval* object = NULL; \
oclass##_object* obj = NULL; \
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
#define INTL_DATA_ERROR(obj) (((intl_object *)(obj))->error)
#define INTL_DATA_ERROR_P(obj) (&(INTL_DATA_ERROR((obj))))
@@ -43,32 +43,32 @@ typedef struct _intl_data {
#define INTL_METHOD_FETCH_OBJECT(oclass, obj) \
obj = Z_##oclass##_P( object ); \
- intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \
+ intl_error_reset( INTL_DATA_ERROR_P(obj) ); \
/* Check status by error code, if error - exit */
#define INTL_CHECK_STATUS(err, msg) \
- intl_error_set_code( NULL, (err) TSRMLS_CC ); \
+ intl_error_set_code( NULL, (err) ); \
if( U_FAILURE((err)) ) \
{ \
- intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \
+ intl_error_set_custom_msg( NULL, msg, 0 ); \
RETURN_FALSE; \
}
/* Check status in object, if error - exit */
#define INTL_METHOD_CHECK_STATUS(obj, msg) \
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
RETURN_FALSE; \
}
/* Check status, if error - destroy value and exit */
#define INTL_CTOR_CHECK_STATUS(obj, msg) \
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
/* yes, this is ugly, but it alreay is */ \
if (return_value != getThis()) { \
zval_dtor(return_value); \
@@ -96,14 +96,14 @@ typedef struct _intl_data {
#define INTL_CHECK_LOCALE_LEN(locale_len) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 ); \
RETURN_NULL(); \
}
#define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 ); \
zval_dtor(object); \
ZVAL_NULL(object); \
RETURN_NULL(); \
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index 9474834417..046fd5302d 100644
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -34,7 +34,7 @@ static zend_class_entry *IntlException_ce_ptr;
/* {{{ intl_error* intl_g_error_get()
* Return global error structure.
*/
-static intl_error* intl_g_error_get( TSRMLS_D )
+static intl_error* intl_g_error_get( void )
{
return &INTL_G( g_error );
}
@@ -43,9 +43,9 @@ static intl_error* intl_g_error_get( TSRMLS_D )
/* {{{ void intl_free_custom_error_msg( intl_error* err )
* Free mem.
*/
-static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC )
+static void intl_free_custom_error_msg( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
if(err->free_custom_error_message ) {
@@ -60,11 +60,11 @@ static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC )
/* {{{ intl_error* intl_error_create()
* Create and initialize internals of 'intl_error'.
*/
-intl_error* intl_error_create( TSRMLS_D )
+intl_error* intl_error_create( void )
{
intl_error* err = ecalloc( 1, sizeof( intl_error ) );
- intl_error_init( err TSRMLS_CC );
+ intl_error_init( err );
return err;
}
@@ -73,9 +73,9 @@ intl_error* intl_error_create( TSRMLS_D )
/* {{{ void intl_error_init( intl_error* coll_error )
* Initialize internals of 'intl_error'.
*/
-void intl_error_init( intl_error* err TSRMLS_DC )
+void intl_error_init( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = U_ZERO_ERROR;
@@ -87,36 +87,36 @@ void intl_error_init( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_reset( intl_error* err )
* Set last error code to 0 and unset last error message
*/
-void intl_error_reset( intl_error* err TSRMLS_DC )
+void intl_error_reset( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = U_ZERO_ERROR;
- intl_free_custom_error_msg( err TSRMLS_CC );
+ intl_free_custom_error_msg( err );
}
/* }}} */
/* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
* Set last error message to msg copying it if needed.
*/
-void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
+void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
{
if( !msg )
return;
if( !err ) {
if( INTL_G( error_level ) )
- php_error_docref( NULL TSRMLS_CC, INTL_G( error_level ), "%s", msg );
+ php_error_docref( NULL, INTL_G( error_level ), "%s", msg );
if( INTL_G( use_exceptions ) )
- zend_throw_exception_ex( IntlException_ce_ptr, 0 TSRMLS_CC, "%s", msg );
+ zend_throw_exception_ex( IntlException_ce_ptr, 0, "%s", msg );
}
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
/* Free previous message if any */
- intl_free_custom_error_msg( err TSRMLS_CC );
+ intl_free_custom_error_msg( err );
/* Mark message copied if any */
err->free_custom_error_message = copyMsg;
@@ -129,12 +129,12 @@ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_D
/* {{{ const char* intl_error_get_message( intl_error* err )
* Create output message in format "<intl_error_text>: <extra_user_error_text>".
*/
-zend_string * intl_error_get_message( intl_error* err TSRMLS_DC )
+zend_string * intl_error_get_message( intl_error* err )
{
const char *uErrorName = NULL;
zend_string *errMessage = 0;
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return STR_EMPTY_ALLOC();
uErrorName = u_errorName( err->code );
@@ -156,9 +156,9 @@ zend_string * intl_error_get_message( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_set_code( intl_error* err, UErrorCode err_code )
* Set last error code.
*/
-void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
+void intl_error_set_code( intl_error* err, UErrorCode err_code )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = err_code;
@@ -168,9 +168,9 @@ void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
/* {{{ void intl_error_get_code( intl_error* err )
* Return last error code.
*/
-UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC )
+UErrorCode intl_error_get_code( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return U_ZERO_ERROR;
return err->code;
@@ -180,67 +180,67 @@ UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
+void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
{
- intl_error_set_code( err, code TSRMLS_CC );
- intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_error_set_code( err, code );
+ intl_error_set_custom_msg( err, msg, copyMsg );
}
/* }}} */
/* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
+void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
{
- intl_errors_set_code( err, code TSRMLS_CC );
- intl_errors_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_errors_set_code( err, code );
+ intl_errors_set_custom_msg( err, msg, copyMsg );
}
/* }}} */
/* {{{ void intl_errors_reset( intl_error* err )
*/
-void intl_errors_reset( intl_error* err TSRMLS_DC )
+void intl_errors_reset( intl_error* err )
{
if(err) {
- intl_error_reset( err TSRMLS_CC );
+ intl_error_reset( err );
}
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
}
/* }}} */
/* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
*/
-void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
+void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
{
if(err) {
- intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_error_set_custom_msg( err, msg, copyMsg );
}
- intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, msg, copyMsg );
}
/* }}} */
/* {{{ intl_errors_set_code( intl_error* err, UErrorCode err_code )
*/
-void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
+void intl_errors_set_code( intl_error* err, UErrorCode err_code )
{
if(err) {
- intl_error_set_code( err, err_code TSRMLS_CC );
+ intl_error_set_code( err, err_code );
}
- intl_error_set_code( NULL, err_code TSRMLS_CC );
+ intl_error_set_code( NULL, err_code );
}
/* }}} */
-void intl_register_IntlException_class( TSRMLS_D )
+void intl_register_IntlException_class( void )
{
zend_class_entry ce,
*default_exception_ce;
- default_exception_ce = zend_exception_get_default( TSRMLS_C );
+ default_exception_ce = zend_exception_get_default( );
/* Create and register 'IntlException' class. */
INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
- default_exception_ce TSRMLS_CC );
+ default_exception_ce );
IntlException_ce_ptr->create_object = default_exception_ce->create_object;
}
diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h
index b800d10dbf..02d62f0299 100644
--- a/ext/intl/intl_error.h
+++ b/ext/intl/intl_error.h
@@ -31,25 +31,25 @@ typedef struct _intl_error {
int free_custom_error_message;
} intl_error;
-intl_error* intl_error_create( TSRMLS_D );
-void intl_error_init( intl_error* err TSRMLS_DC );
-void intl_error_reset( intl_error* err TSRMLS_DC );
-void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC );
-void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC );
-void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC );
-UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC );
-zend_string* intl_error_get_message( intl_error* err TSRMLS_DC );
+intl_error* intl_error_create( void );
+void intl_error_init( intl_error* err );
+void intl_error_reset( intl_error* err );
+void intl_error_set_code( intl_error* err, UErrorCode err_code );
+void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg );
+void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg );
+UErrorCode intl_error_get_code( intl_error* err );
+zend_string* intl_error_get_message( intl_error* err );
// Wrappers to synchonize object's and global error structures.
-void intl_errors_reset( intl_error* err TSRMLS_DC );
-void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC );
-void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC );
-void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC );
+void intl_errors_reset( intl_error* err );
+void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg );
+void intl_errors_set_code( intl_error* err, UErrorCode err_code );
+void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg );
// Other error helpers
smart_str intl_parse_error_to_string( UParseError* pe );
// exported to be called on extension MINIT
-void intl_register_IntlException_class( TSRMLS_D );
+void intl_register_IntlException_class( void );
#endif // INTL_ERROR_H
diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c
index 21c875ca5d..05141a9558 100644
--- a/ext/intl/locale/locale.c
+++ b/ext/intl/locale/locale.c
@@ -40,13 +40,13 @@ void locale_register_constants( INIT_FUNC_ARGS )
}
#define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC );
- #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x );
+ #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value );
LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE );
LOCALE_EXPOSE_CLASS_CONST( VALID_LOCALE );
- zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1 TSRMLS_CC);
+ zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1);
LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "LANG_TAG", LOC_LANG_TAG);
LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "EXTLANG_TAG", LOC_EXTLANG_TAG);
diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c
index eec4699b6d..6300666c59 100644
--- a/ext/intl/locale/locale_class.c
+++ b/ext/intl/locale/locale_class.c
@@ -92,14 +92,14 @@ zend_function_entry Locale_class_functions[] = {
/* {{{ locale_register_Locale_class
* Initialize 'Locale' class
*/
-void locale_register_Locale_class( TSRMLS_D )
+void locale_register_Locale_class( void )
{
zend_class_entry ce;
/* Create and register 'Locale' class. */
INIT_CLASS_ENTRY( ce, "Locale", Locale_class_functions );
ce.create_object = NULL;
- Locale_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Locale_ce_ptr = zend_register_internal_class( &ce );
/* Declare 'Locale' class properties. */
if( !Locale_ce_ptr )
diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h
index afae06c77c..1ff4df3a53 100644
--- a/ext/intl/locale/locale_class.h
+++ b/ext/intl/locale/locale_class.h
@@ -35,7 +35,7 @@ typedef struct {
} Locale_object;
-void locale_register_Locale_class( TSRMLS_D );
+void locale_register_Locale_class( void );
extern zend_class_entry *Locale_ce_ptr;
@@ -43,6 +43,6 @@ extern zend_class_entry *Locale_ce_ptr;
#define LOCALE_METHOD_INIT_VARS \
zval* object = NULL; \
- intl_error_reset( NULL TSRMLS_CC ); \
+ intl_error_reset( NULL ); \
#endif // #ifndef LOCALE_CLASS_H
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 27f917ffbb..e8f51398e6 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -211,7 +211,7 @@ static int getSingletonPos(const char* str)
Get default locale */
PHP_NAMED_FUNCTION(zif_locale_get_default)
{
- RETURN_STRING( intl_locale_get_default( TSRMLS_C ) );
+ RETURN_STRING( intl_locale_get_default( ) );
}
/* }}} */
@@ -227,10 +227,10 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
zend_string *ini_name;
char *default_locale = NULL;
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S", &locale_name) == FAILURE)
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "S", &locale_name) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_set_default: unable to parse input params", 0 TSRMLS_CC );
+ "locale_set_default: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -385,19 +385,19 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name ,&loc_name_len ) == FAILURE) {
spprintf(&msg , 0, "locale_get_%s : unable to parse input params", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
/* Call ICU get */
@@ -422,7 +422,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
/* Error encountered while fetching the value */
if( result ==0) {
spprintf(&msg , 0, "locale_get_%s : unable to get locale %s", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
RETURN_NULL();
}
@@ -493,14 +493,14 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
char* msg = NULL;
int grOffset = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|s",
&loc_name, &loc_name_len ,
&disp_loc_name ,&disp_loc_name_len ) == FAILURE)
{
spprintf(&msg , 0, "locale_get_display_%s : unable to parse input params", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
@@ -508,13 +508,13 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
if( strcmp(tag_name, DISP_NAME) != 0 ){
@@ -536,7 +536,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
/* Check if disp_loc_name passed , if not use default locale */
if( !disp_loc_name){
- disp_loc_name = estrdup(intl_locale_get_default(TSRMLS_C));
+ disp_loc_name = estrdup(intl_locale_get_default());
free_loc_name = 1;
}
@@ -567,7 +567,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
}
spprintf(&msg, 0, "locale_get_display_%s : unable to get locale %s", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
if( disp_name){
efree( disp_name );
@@ -596,7 +596,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
if( U_FAILURE( status ) )
{
spprintf(&msg, 0, "locale_get_display_%s :error converting display name for %s to UTF-8", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
RETURN_FALSE;
}
@@ -698,19 +698,19 @@ PHP_FUNCTION( locale_get_keywords )
char* kw_value = NULL;
int32_t kw_value_len = 100;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_get_keywords: unable to parse input params", 0 TSRMLS_CC );
+ "locale_get_keywords: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
/* Get the keywords */
@@ -733,7 +733,7 @@ PHP_FUNCTION( locale_get_keywords )
kw_value = erealloc( kw_value , kw_value_len+1);
}
if (U_FAILURE(status)) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 );
if( kw_value){
efree( kw_value );
}
@@ -811,7 +811,7 @@ static void add_prefix(smart_str* loc_name, char* key_name)
* returns 1 if successful , -1 if not found ,
* 0 if array element is not a string , -2 if buffer-overflow
*/
-static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name TSRMLS_DC)
+static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name)
{
zval *ele_value;
int i = 0;
@@ -885,12 +885,12 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
* returns 0 if locale_compose needs to be aborted
* otherwise returns 1
*/
-static int handleAppendResult( int result, smart_str* loc_name TSRMLS_DC)
+static int handleAppendResult( int result, smart_str* loc_name)
{
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( result == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: parameter array element is not a string", 0 TSRMLS_CC );
+ "locale_compose: parameter array element is not a string", 0 );
smart_str_free(loc_name);
return 0;
}
@@ -913,13 +913,13 @@ PHP_FUNCTION(locale_compose)
HashTable* hash_arr = NULL;
int result = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "a",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "a",
&arr) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: unable to parse input params", 0 TSRMLS_CC );
+ "locale_compose: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -933,7 +933,7 @@ PHP_FUNCTION(locale_compose)
if( result == SUCCESS){
RETURN_SMART_STR(loc_name);
}
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
@@ -941,41 +941,41 @@ PHP_FUNCTION(locale_compose)
result = append_key_value(loc_name, hash_arr , LOC_LANG_TAG);
if( result == LOC_NOT_FOUND ){
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: parameter array does not contain 'language' tag.", 0 TSRMLS_CC );
+ "locale_compose: parameter array does not contain 'language' tag.", 0 );
smart_str_free(loc_name);
RETURN_FALSE;
}
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Extlang */
- result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Script */
result = append_key_value(loc_name, hash_arr , LOC_SCRIPT_TAG);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Region */
result = append_key_value( loc_name, hash_arr , LOC_REGION_TAG);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Variant */
- result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Private */
- result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
@@ -1035,7 +1035,7 @@ static char* get_private_subtags(const char* loc_name)
/* {{{ code used by locale_parse
*/
-static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC)
+static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name)
{
char* key_value = NULL;
char* cur_key_name = NULL;
@@ -1104,19 +1104,19 @@ PHP_FUNCTION(locale_parse)
size_t loc_name_len = 0;
int grOffset = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_parse: unable to parse input params", 0 TSRMLS_CC );
+ "locale_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
array_init( return_value );
@@ -1127,11 +1127,11 @@ PHP_FUNCTION(locale_parse)
}
else{
/* Not grandfathered */
- add_array_entry( loc_name , return_value , LOC_LANG_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_REGION_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_VARIANT_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG TSRMLS_CC);
+ add_array_entry( loc_name , return_value , LOC_LANG_TAG);
+ add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG);
+ add_array_entry( loc_name , return_value , LOC_REGION_TAG);
+ add_array_entry( loc_name , return_value , LOC_VARIANT_TAG);
+ add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG);
}
}
/* }}} */
@@ -1152,19 +1152,19 @@ PHP_FUNCTION(locale_get_all_variants)
char* variant = NULL;
char* saved_ptr = NULL;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_parse: unable to parse input params", 0 TSRMLS_CC );
+ "locale_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
@@ -1257,20 +1257,20 @@ PHP_FUNCTION(locale_filter_matches)
zend_bool boolCanonical = 0;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "ss|b",
&lang_tag, &lang_tag_len , &loc_range , &loc_range_len ,
&boolCanonical) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_filter_matches: unable to parse input params", 0 TSRMLS_CC );
+ "locale_filter_matches: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_range_len == 0) {
- loc_range = intl_locale_get_default(TSRMLS_C);
+ loc_range = intl_locale_get_default();
}
if( strcmp(loc_range,"*")==0){
@@ -1282,7 +1282,7 @@ PHP_FUNCTION(locale_filter_matches)
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
if( result ==0) {
intl_error_set( NULL, status,
- "locale_filter_matches : unable to canonicalize loc_range" , 0 TSRMLS_CC );
+ "locale_filter_matches : unable to canonicalize loc_range" , 0 );
RETURN_FALSE;
}
@@ -1290,7 +1290,7 @@ PHP_FUNCTION(locale_filter_matches)
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
if( result ==0) {
intl_error_set( NULL, status,
- "locale_filter_matches : unable to canonicalize lang_tag" , 0 TSRMLS_CC );
+ "locale_filter_matches : unable to canonicalize lang_tag" , 0 );
RETURN_FALSE;
}
@@ -1417,7 +1417,7 @@ static void array_cleanup( char* arr[] , int arr_size)
* returns the lookup result to lookup_loc_range_src_php
* internal function
*/
-static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC)
+static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize )
{
int i = 0;
int cur_arr_len = 0;
@@ -1438,13 +1438,13 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
/* convert the array to lowercase , also replace hyphens with the underscore and store it in cur_arr */
if(Z_TYPE_P(ele_value)!= IS_STRING) {
/* element value is not a string */
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_P(ele_value), Z_STRLEN_P(ele_value));
result = strToMatch(Z_STRVAL_P(ele_value), cur_arr[cur_arr_len*2]);
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[cur_arr_len*2+1] = Z_STRVAL_P(ele_value);
@@ -1459,14 +1459,14 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
if(lang_tag) {
efree(lang_tag);
}
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[i*2] = erealloc(cur_arr[i*2], strlen(lang_tag)+1);
result = strToMatch(lang_tag, cur_arr[i*2]);
efree(lang_tag);
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
}
@@ -1478,7 +1478,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
can_loc_range = get_icu_value_internal(loc_range, LOC_CANONICALIZE_TAG, &result , 0);
if( result != 1 || can_loc_range == NULL || !can_loc_range[0]) {
/* Error */
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 TSRMLS_CC );
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 );
if(can_loc_range) {
efree(can_loc_range);
}
@@ -1495,7 +1495,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
efree(can_loc_range);
}
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
@@ -1540,16 +1540,16 @@ PHP_FUNCTION(locale_lookup)
zend_bool boolCanonical = 0;
char* result =NULL;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "as|bs", &arr, &loc_range, &loc_range_len,
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bs", &arr, &loc_range, &loc_range_len,
&boolCanonical, &fallback_loc, &fallback_loc_len) == FAILURE) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_range_len == 0) {
- loc_range = intl_locale_get_default(TSRMLS_C);
+ loc_range = intl_locale_get_default();
}
hash_arr = HASH_OF(arr);
@@ -1558,7 +1558,7 @@ PHP_FUNCTION(locale_lookup)
RETURN_EMPTY_STRING();
}
- result = lookup_loc_range(loc_range, hash_arr, boolCanonical TSRMLS_CC);
+ result = lookup_loc_range(loc_range, hash_arr, boolCanonical);
if(result == NULL || result[0] == '\0') {
if( fallback_loc ) {
result = estrndup(fallback_loc, fallback_loc_len);
@@ -1590,10 +1590,10 @@ PHP_FUNCTION(locale_accept_from_http)
char resultLocale[INTL_MAX_LOCALE_LEN+1];
UAcceptResult outResult;
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &http_accept, &http_accept_len) == FAILURE)
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &http_accept, &http_accept_len) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_accept_from_http: unable to parse input parameters", 0 TSRMLS_CC );
+ "locale_accept_from_http: unable to parse input parameters", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 2ca8ed9186..a9999dc141 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -35,15 +35,15 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int spattern_len = 0;
zval* object;
MessageFormatter_object* mfo;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_create: unable to parse input parameters", 0 TSRMLS_CC );
+ "msgfmt_create: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -61,7 +61,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
@@ -71,7 +71,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
#endif
if ((mfo)->mf_data.orig_format) {
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
@@ -114,7 +114,7 @@ PHP_METHOD( MessageFormatter, __construct )
msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -132,11 +132,11 @@ PHP_FUNCTION( msgfmt_get_error_code )
MessageFormatter_object* mfo = NULL;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -160,11 +160,11 @@ PHP_FUNCTION( msgfmt_get_error_message )
MessageFormatter_object* mfo = NULL;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -172,7 +172,7 @@ PHP_FUNCTION( msgfmt_get_error_message )
mfo = Z_INTL_MESSAGEFORMATTER_P( object );
/* Return last error message. */
- message = intl_error_get_message( &mfo->mf_data.error TSRMLS_CC );
+ message = intl_error_get_message( &mfo->mf_data.error );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index 79c04266e0..ca117c539f 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -36,10 +36,10 @@ PHP_FUNCTION( msgfmt_get_pattern )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -68,11 +68,11 @@ PHP_FUNCTION( msgfmt_set_pattern )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, MessageFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC);
+ "msgfmt_set_pattern: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -85,7 +85,7 @@ PHP_FUNCTION( msgfmt_set_pattern )
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -124,11 +124,11 @@ PHP_FUNCTION( msgfmt_get_locale )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 65f32bf683..9fdd07e607 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -34,31 +34,31 @@ static zend_object_handlers MessageFormatter_handlers;
*/
/* {{{ MessageFormatter_objects_dtor */
-static void MessageFormatter_object_dtor(zend_object *object TSRMLS_DC )
+static void MessageFormatter_object_dtor(zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ MessageFormatter_objects_free */
-void MessageFormatter_object_free( zend_object *object TSRMLS_DC )
+void MessageFormatter_object_free( zend_object *object )
{
MessageFormatter_object* mfo = php_intl_messageformatter_fetch_object(object);
- zend_object_std_dtor( &mfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &mfo->zo );
- msgformat_data_free( &mfo->mf_data TSRMLS_CC );
+ msgformat_data_free( &mfo->mf_data );
}
/* }}} */
/* {{{ MessageFormatter_object_create */
-zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *MessageFormatter_object_create(zend_class_entry *ce)
{
MessageFormatter_object* intern;
intern = ecalloc( 1, sizeof(MessageFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1));
- msgformat_data_init( &intern->mf_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ msgformat_data_init( &intern->mf_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &MessageFormatter_handlers;
@@ -68,16 +68,16 @@ zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ MessageFormatter_object_clone */
-zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *MessageFormatter_object_clone(zval *object)
{
MessageFormatter_object *mfo, *new_mfo;
zend_object *new_obj;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_mfo = php_intl_messageformatter_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_mfo->zo, &mfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_mfo->zo, &mfo->zo);
/* clone formatter object */
if (MSG_FORMAT_OBJECT(mfo) != NULL) {
@@ -86,11 +86,11 @@ zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo),
- "Failed to clone MessageFormatter object", 0 TSRMLS_CC);
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object");
+ "Failed to clone MessageFormatter object", 0);
+ zend_throw_exception_ex(NULL, 0, "Failed to clone MessageFormatter object");
}
} else {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter");
+ zend_throw_exception_ex(NULL, 0, "Cannot clone unconstructed MessageFormatter");
}
return new_obj;
}
@@ -150,14 +150,14 @@ static zend_function_entry MessageFormatter_class_functions[] = {
/* {{{ msgformat_register_class
* Initialize 'MessageFormatter' class
*/
-void msgformat_register_class( TSRMLS_D )
+void msgformat_register_class( void )
{
zend_class_entry ce;
/* Create and register 'MessageFormatter' class. */
INIT_CLASS_ENTRY( ce, "MessageFormatter", MessageFormatter_class_functions );
ce.create_object = MessageFormatter_object_create;
- MessageFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ MessageFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&MessageFormatter_handlers, zend_get_std_object_handlers(),
sizeof MessageFormatter_handlers);
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 8c2c29a7dd..a90042e58f 100644
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -37,7 +37,7 @@ static inline MessageFormatter_object *php_intl_messageformatter_fetch_object(ze
}
#define Z_INTL_MESSAGEFORMATTER_P(zv) php_intl_messageformatter_fetch_object(Z_OBJ_P(zv))
-void msgformat_register_class( TSRMLS_D );
+void msgformat_register_class( void );
extern zend_class_entry *MessageFormatter_ce_ptr;
/* Auxiliary macros */
@@ -48,7 +48,7 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
if (MSG_FORMAT_OBJECT(mfo) == NULL) { \
intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \
+ "Found unconstructed MessageFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index f94920d3e8..697fba114a 100644
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -26,7 +26,7 @@
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
* Initialize internals of msgformat_data.
*/
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
+void msgformat_data_init( msgformat_data* mf_data )
{
if( !mf_data )
return;
@@ -35,14 +35,14 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
mf_data->orig_format = NULL;
mf_data->arg_types = NULL;
mf_data->tz_set = 0;
- intl_error_reset( &mf_data->error TSRMLS_CC );
+ intl_error_reset( &mf_data->error );
}
/* }}} */
/* {{{ void msgformat_data_free( msgformat_data* mf_data )
* Clean up memory allocated for msgformat_data
*/
-void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
+void msgformat_data_free(msgformat_data* mf_data)
{
if (!mf_data)
return;
@@ -62,18 +62,18 @@ void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
}
mf_data->umsgf = NULL;
- intl_error_reset(&mf_data->error TSRMLS_CC);
+ intl_error_reset(&mf_data->error);
}
/* }}} */
/* {{{ msgformat_data* msgformat_data_create()
* Allocate memory for msgformat_data and initialize it with default values.
*/
-msgformat_data* msgformat_data_create( TSRMLS_D )
+msgformat_data* msgformat_data_create( void )
{
msgformat_data* mf_data = ecalloc( 1, sizeof(msgformat_data) );
- msgformat_data_init( mf_data TSRMLS_CC );
+ msgformat_data_init( mf_data );
return mf_data;
}
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index f3a594d25a..a4226664ae 100644
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -35,9 +35,9 @@ typedef struct {
int tz_set; /* if we've already the time zone in sub-formats */
} msgformat_data;
-msgformat_data* msgformat_data_create( TSRMLS_D );
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
-void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
+msgformat_data* msgformat_data_create( void );
+void msgformat_data_init( msgformat_data* mf_data );
+void msgformat_data_free( msgformat_data* mf_data );
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 36cd61c685..dda72249fc 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -32,7 +32,7 @@
#endif
/* {{{ */
-static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC)
+static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value)
{
int count;
UChar* formatted = NULL;
@@ -45,7 +45,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref);
- umsg_format_helper(mfo, args_copy, &formatted, &formatted_len TSRMLS_CC);
+ umsg_format_helper(mfo, args_copy, &formatted, &formatted_len);
zend_hash_destroy(args_copy);
efree(args_copy);
@@ -74,11 +74,11 @@ PHP_FUNCTION( msgfmt_format )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa",
&object, MessageFormatter_ce_ptr, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -86,7 +86,7 @@ PHP_FUNCTION( msgfmt_format )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
}
/* }}} */
@@ -108,23 +108,23 @@ PHP_FUNCTION( msgfmt_format_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "ssa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "ssa",
&slocale, &slocale_len, &pattern, &pattern_len, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -133,13 +133,13 @@ PHP_FUNCTION( msgfmt_format_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -151,10 +151,10 @@ PHP_FUNCTION( msgfmt_format_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 46ebe25a17..93c4290601 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -88,7 +88,7 @@ static void arg_types_dtor(zval *el) {
}
static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -114,7 +114,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
const Formattable::Type t = types[i];
if (zend_hash_index_update_mem(ret, (zend_ulong)i, (void*)&t, sizeof(t)) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
break;
}
}
@@ -134,7 +134,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
#ifdef HAS_MESSAGE_PATTERN
static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
const MessagePattern& mp,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -144,7 +144,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
}
if (!((MessageFormat *)mfo->mf_data.umsgf)->usesNamedArguments()) {
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
}
if (mfo->mf_data.arg_types) {
@@ -189,7 +189,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
if ((storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
(void*)&bogusType, sizeof(bogusType))) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
@@ -197,7 +197,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
int32_t argNumber = name_part.getValue();
if (argNumber < 0) {
intl_errors_set(&err, U_INVALID_FORMAT_ERROR,
- "Found part with negative number", 0 TSRMLS_CC);
+ "Found part with negative number", 0);
continue;
}
if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (zend_ulong)argNumber)) == NULL) {
@@ -205,12 +205,12 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
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 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
} else {
- intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0 TSRMLS_CC);
+ intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0);
continue;
}
@@ -255,7 +255,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
* is broken. */
intl_errors_set(&err, U_PARSE_ERROR,
"Expected UMSGPAT_PART_TYPE_ARG_TYPE part following "
- "UMSGPAT_ARG_TYPE_SIMPLE part", 0 TSRMLS_CC);
+ "UMSGPAT_ARG_TYPE_SIMPLE part", 0);
continue;
}
} else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
@@ -272,7 +272,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
/* 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 TSRMLS_CC);
+ "Inconsistent types declared for an argument", 0);
continue;
}
@@ -293,27 +293,27 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
#endif
static HashTable *umsg_get_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
#ifdef HAS_MESSAGE_PATTERN
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
- return umsg_parse_format(mfo, mp, err TSRMLS_CC);
+ return umsg_parse_format(mfo, mp, err);
#else
if (mf->usesNamedArguments()) {
intl_errors_set(&err, U_UNSUPPORTED_ERROR,
"This extension supports named arguments only on ICU 4.8+",
- 0 TSRMLS_CC);
+ 0);
return NULL;
}
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
#endif
}
static void umsg_set_timezone(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
TimeZone *used_tz = NULL;
@@ -333,7 +333,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (formats == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Out of memory retrieving subformats", 0 TSRMLS_CC);
+ "Out of memory retrieving subformats", 0);
}
for (int i = 0; U_SUCCESS(err.code) && i < count; i++) {
@@ -346,7 +346,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (used_tz == NULL) {
zval nullzv, *zvptr = &nullzv;
ZVAL_NULL(zvptr);
- used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format" TSRMLS_CC);
+ used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format");
if (used_tz == NULL) {
continue;
}
@@ -363,7 +363,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
HashTable *args,
UChar **formatted,
- int *formatted_len TSRMLS_DC)
+ int *formatted_len)
{
int arg_count = zend_hash_num_elements(args);
std::vector<Formattable> fargs;
@@ -376,9 +376,9 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
return;
}
- types = umsg_get_types(mfo, err TSRMLS_CC);
+ types = umsg_get_types(mfo, err);
- umsg_set_timezone(mfo, err TSRMLS_CC);
+ umsg_set_timezone(mfo, err);
fargs.resize(arg_count);
farg_names.resize(arg_count);
@@ -403,7 +403,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
/* includes case where index < 0 because it's exposed as unsigned */
if (num_index > (zend_ulong)INT32_MAX) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found negative or too large array key", 0 TSRMLS_CC);
+ "Found negative or too large array key", 0);
continue;
}
@@ -419,7 +419,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0,
"Invalid UTF-8 data in argument key: '%s'", str_index->val);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
continue;
}
@@ -453,7 +453,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0, "Invalid UTF-8 data in string argument: "
"'%s'", Z_STRVAL_P(elem));
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
delete text;
continue;
@@ -470,7 +470,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
d = (double)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
d = (Z_TYPE_P(elem) == IS_DOUBLE)
? Z_DVAL_P(elem)
: (double)Z_LVAL_P(elem);
@@ -487,7 +487,7 @@ retry_klong:
Z_DVAL_P(elem) < (double)INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "32 bit integer argument", 0 TSRMLS_CC);
+ "32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_DVAL_P(elem);
}
@@ -496,13 +496,13 @@ retry_klong:
Z_LVAL_P(elem) < INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP integer with absolute value too large "
- "for 32 bit integer argument", 0 TSRMLS_CC);
+ "for 32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_LVAL_P(elem);
}
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_klong;
}
formattable.setLong(tInt32);
@@ -517,7 +517,7 @@ retry_kint64:
Z_DVAL_P(elem) < (double)U_INT64_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "64 bit integer argument", 0 TSRMLS_CC);
+ "64 bit integer argument", 0);
} else {
tInt64 = (int64_t)Z_DVAL_P(elem);
}
@@ -526,7 +526,7 @@ retry_kint64:
tInt64 = (int64_t)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_kint64;
}
formattable.setInt64(tInt64);
@@ -534,7 +534,7 @@ retry_kint64:
}
case Formattable::kDate:
{
- double dd = intl_zval_to_millis(elem, &err, "msgfmt_format" TSRMLS_CC);
+ double dd = intl_zval_to_millis(elem, &err, "msgfmt_format");
if (U_FAILURE(err.code)) {
char *message, *key_char;
int key_len;
@@ -543,7 +543,7 @@ retry_kint64:
&status) == SUCCESS) {
spprintf(&message, 0, "The argument for key '%s' "
"cannot be used as a date or time", key_char);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(key_char);
efree(message);
}
@@ -554,7 +554,7 @@ retry_kint64:
}
default:
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found unsupported argument type", 0 TSRMLS_CC);
+ "Found unsupported argument type", 0);
break;
}
} else {
@@ -589,7 +589,7 @@ retry_kint64:
"value given for the argument with key '%s' "
"is available", key_char);
intl_errors_set(&err,
- U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(key_char);
efree(message);
}
@@ -612,7 +612,7 @@ retry_kint64:
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Call to ICU MessageFormat::format() has failed", 0 TSRMLS_CC);
+ "Call to ICU MessageFormat::format() has failed", 0);
return;
}
@@ -621,7 +621,7 @@ retry_kint64:
resultStr.extract(*formatted, *formatted_len+1, err.code);
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Error copying format() result", 0 TSRMLS_CC);
+ "Error copying format() result", 0);
return;
}
}
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 41d179f8d0..df05259574 100644
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -19,7 +19,7 @@
int32_t umsg_format_arg_count(UMessageFormat *fmt);
void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args,
- UChar **formatted, int *formatted_len TSRMLS_DC);
+ UChar **formatted, int *formatted_len);
void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args,
UChar *source, int source_len, UErrorCode *status);
#endif // MSG_FORMAT_HELPERS_H
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index add2f901eb..1474ff6ea8 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -28,7 +28,7 @@
#include "intl_convert.h"
/* {{{ */
-static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value TSRMLS_DC)
+static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value)
{
zval *fargs;
int count = 0;
@@ -66,11 +66,11 @@ PHP_FUNCTION( msgfmt_parse )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, MessageFormatter_ce_ptr, &source, &source_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -78,7 +78,7 @@ PHP_FUNCTION( msgfmt_parse )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_parse(mfo, source, source_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, source_len, return_value);
}
/* }}} */
@@ -101,23 +101,23 @@ PHP_FUNCTION( msgfmt_parse_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sss",
&slocale, &slocale_len, &pattern, &pattern_len, &source, &src_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -126,13 +126,13 @@ PHP_FUNCTION( msgfmt_parse_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -144,10 +144,10 @@ PHP_FUNCTION( msgfmt_parse_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_parse(mfo, source, src_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, src_len, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */
diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c
index 18c3cedcaf..3a0d526b77 100644
--- a/ext/intl/normalizer/normalizer.c
+++ b/ext/intl/normalizer/normalizer.c
@@ -38,8 +38,8 @@ void normalizer_register_constants( INIT_FUNC_ARGS )
}
#define NORMALIZER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC );
- #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x );
+ #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value );
/* Normalization form constants */
NORMALIZER_EXPOSE_CLASS_CONST( NONE );
diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c
index ccd8be3b29..93a5624663 100644
--- a/ext/intl/normalizer/normalizer_class.c
+++ b/ext/intl/normalizer/normalizer_class.c
@@ -51,14 +51,14 @@ zend_function_entry Normalizer_class_functions[] = {
/* {{{ normalizer_register_Normalizer_class
* Initialize 'Normalizer' class
*/
-void normalizer_register_Normalizer_class( TSRMLS_D )
+void normalizer_register_Normalizer_class( void )
{
zend_class_entry ce;
/* Create and register 'Normalizer' class. */
INIT_CLASS_ENTRY( ce, "Normalizer", Normalizer_class_functions );
ce.create_object = NULL;
- Normalizer_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Normalizer_ce_ptr = zend_register_internal_class( &ce );
/* Declare 'Normalizer' class properties. */
if( !Normalizer_ce_ptr )
diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h
index 3ce37fae88..de5a168a45 100644
--- a/ext/intl/normalizer/normalizer_class.h
+++ b/ext/intl/normalizer/normalizer_class.h
@@ -38,6 +38,6 @@ typedef struct {
#define NORMALIZER_ERROR_CODE(co) INTL_ERROR_CODE(NORMALIZER_ERROR(co))
#define NORMALIZER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(NORMALIZER_ERROR(co)))
-void normalizer_register_Normalizer_class( TSRMLS_D );
+void normalizer_register_Normalizer_class( void );
extern zend_class_entry *Normalizer_ce_ptr;
#endif // #ifndef NORMALIZER_CLASS_H
diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c
index d3ac07024b..97163a98c4 100644
--- a/ext/intl/normalizer/normalizer_normalize.c
+++ b/ext/intl/normalizer/normalizer_normalize.c
@@ -50,14 +50,14 @@ PHP_FUNCTION( normalizer_normalize )
int32_t size_needed;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l",
&input, &input_len, &form ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: unable to parse input params", 0 TSRMLS_CC );
+ "normalizer_normalize: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -78,7 +78,7 @@ PHP_FUNCTION( normalizer_normalize )
break;
default:
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC );
+ "normalizer_normalize: illegal normalization form", 0 );
RETURN_FALSE;
}
@@ -92,10 +92,10 @@ PHP_FUNCTION( normalizer_normalize )
if( U_FAILURE( status ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (uinput) {
efree( uinput );
}
@@ -136,7 +136,7 @@ PHP_FUNCTION( normalizer_normalize )
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
- intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL,"Error normalizing string", 0 );
efree( uret_buf );
efree( uinput );
RETURN_FALSE;
@@ -154,7 +154,7 @@ PHP_FUNCTION( normalizer_normalize )
if( U_FAILURE( status ) )
{
intl_error_set( NULL, status,
- "normalizer_normalize: error converting normalized text UTF-8", 0 TSRMLS_CC );
+ "normalizer_normalize: error converting normalized text UTF-8", 0 );
RETURN_FALSE;
}
@@ -183,14 +183,14 @@ PHP_FUNCTION( normalizer_is_normalized )
UBool uret = FALSE;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l",
&input, &input_len, &form) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_is_normalized: unable to parse input params", 0 TSRMLS_CC );
+ "normalizer_is_normalized: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -205,7 +205,7 @@ PHP_FUNCTION( normalizer_is_normalized )
break;
default:
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC );
+ "normalizer_normalize: illegal normalization form", 0 );
RETURN_FALSE;
}
@@ -220,10 +220,10 @@ PHP_FUNCTION( normalizer_is_normalized )
if( U_FAILURE( status ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 );
if (uinput) {
efree( uinput );
}
@@ -239,7 +239,7 @@ PHP_FUNCTION( normalizer_is_normalized )
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
- intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 2c5e74809d..2ac1888061 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -116,7 +116,7 @@
ZEND_DECLARE_MODULE_GLOBALS( intl )
-const char *intl_locale_get_default( TSRMLS_D )
+const char *intl_locale_get_default( void )
{
if( INTL_G(default_locale) == NULL ) {
return uloc_getDefault();
@@ -893,12 +893,18 @@ zend_module_entry intl_module_entry = {
/* }}} */
#ifdef COMPILE_DL_INTL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE( intl )
#endif
/* {{{ intl_init_globals */
static PHP_GINIT_FUNCTION(intl)
{
+#if defined(COMPILE_DL_INTL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset( intl_globals, 0, sizeof(zend_intl_globals) );
}
/* }}} */
@@ -917,53 +923,53 @@ PHP_MINIT_FUNCTION( intl )
#endif
/* Register 'Collator' PHP class */
- collator_register_Collator_class( TSRMLS_C );
+ collator_register_Collator_class( );
/* Expose Collator constants to PHP scripts */
collator_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'NumberFormatter' PHP class */
- formatter_register_class( TSRMLS_C );
+ formatter_register_class( );
/* Expose NumberFormatter constants to PHP scripts */
formatter_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'Normalizer' PHP class */
- normalizer_register_Normalizer_class( TSRMLS_C );
+ normalizer_register_Normalizer_class( );
/* Expose Normalizer constants to PHP scripts */
normalizer_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'Locale' PHP class */
- locale_register_Locale_class( TSRMLS_C );
+ locale_register_Locale_class( );
/* Expose Locale constants to PHP scripts */
locale_register_constants( INIT_FUNC_ARGS_PASSTHRU );
- msgformat_register_class(TSRMLS_C);
+ msgformat_register_class();
grapheme_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'DateFormat' PHP class */
- dateformat_register_IntlDateFormatter_class( TSRMLS_C );
+ dateformat_register_IntlDateFormatter_class( );
/* Expose DateFormat constants to PHP scripts */
dateformat_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'ResourceBundle' PHP class */
- resourcebundle_register_class( TSRMLS_C);
+ resourcebundle_register_class( );
/* Register 'Transliterator' PHP class */
- transliterator_register_Transliterator_class( TSRMLS_C );
+ transliterator_register_Transliterator_class( );
/* Register Transliterator constants */
transliterator_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'IntlTimeZone' PHP class */
- timezone_register_IntlTimeZone_class( TSRMLS_C );
+ timezone_register_IntlTimeZone_class( );
/* Register 'IntlCalendar' PHP class */
- calendar_register_IntlCalendar_class( TSRMLS_C );
+ calendar_register_IntlCalendar_class( );
/* Expose ICU error codes to PHP scripts. */
intl_expose_icu_error_codes( INIT_FUNC_ARGS_PASSTHRU );
@@ -973,26 +979,26 @@ PHP_MINIT_FUNCTION( intl )
#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
/* Register 'Spoofchecker' PHP class */
- spoofchecker_register_Spoofchecker_class( TSRMLS_C );
+ spoofchecker_register_Spoofchecker_class( );
/* Expose Spoofchecker constants to PHP scripts */
spoofchecker_register_constants( INIT_FUNC_ARGS_PASSTHRU );
#endif
/* Register 'IntlException' PHP class */
- intl_register_IntlException_class( TSRMLS_C );
+ intl_register_IntlException_class( );
/* Register 'IntlIterator' PHP class */
- intl_register_IntlIterator_class( TSRMLS_C );
+ intl_register_IntlIterator_class( );
/* Register 'BreakIterator' class */
- breakiterator_register_BreakIterator_class( TSRMLS_C );
+ breakiterator_register_BreakIterator_class( );
/* Register 'IntlPartsIterator' class */
- breakiterator_register_IntlPartsIterator_class( TSRMLS_C );
+ breakiterator_register_IntlPartsIterator_class( );
/* Global error handling. */
- intl_error_init( NULL TSRMLS_CC );
+ intl_error_init( NULL );
/* 'Converter' class for codepage conversions */
php_converter_minit(INIT_FUNC_ARGS_PASSTHRU);
@@ -1036,11 +1042,11 @@ PHP_RSHUTDOWN_FUNCTION( intl )
ZVAL_UNDEF(&INTL_G(current_collator));
}
if (INTL_G(grapheme_iterator)) {
- grapheme_close_global_iterator( TSRMLS_C );
+ grapheme_close_global_iterator( );
INTL_G(grapheme_iterator) = NULL;
}
- intl_error_reset( NULL TSRMLS_CC);
+ intl_error_reset( NULL);
return SUCCESS;
}
/* }}} */
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 3625c4fdcc..822ea02183 100644
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -56,7 +56,10 @@ ZEND_END_MODULE_GLOBALS(intl)
/* Macro to access request-wide global variables. */
#ifdef ZTS
-#define INTL_G(v) TSRMG(intl_globals_id, zend_intl_globals *, v)
+#define INTL_G(v) ZEND_TSRMG(intl_globals_id, zend_intl_globals *, v)
+#ifdef COMPILE_DL_INTL
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define INTL_G(v) (intl_globals.v)
#endif
@@ -69,7 +72,7 @@ PHP_RINIT_FUNCTION(intl);
PHP_RSHUTDOWN_FUNCTION(intl);
PHP_MINFO_FUNCTION(intl);
-const char *intl_locale_get_default( TSRMLS_D );
+const char *intl_locale_get_default( void );
#define PHP_INTL_VERSION "1.1.0"
diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c
index 9b6b734ed6..62a268c07f 100644
--- a/ext/intl/resourcebundle/resourcebundle.c
+++ b/ext/intl/resourcebundle/resourcebundle.c
@@ -24,7 +24,7 @@
#include "resourcebundle/resourcebundle_class.h"
/* {{{ ResourceBundle_extract_value */
-void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source TSRMLS_DC )
+void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source )
{
UResType restype;
const UChar* ufield;
@@ -71,11 +71,11 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so
newrb = Z_INTL_RESOURCEBUNDLE_P(return_value);
newrb->me = source->child;
source->child = NULL;
- intl_errors_reset(INTL_DATA_ERROR_P(source) TSRMLS_CC);
+ intl_errors_reset(INTL_DATA_ERROR_P(source));
break;
default:
- intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0 TSRMLS_CC);
+ intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0);
RETURN_FALSE;
break;
}
diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h
index e5aa9f092b..46a6ad5766 100644
--- a/ext/intl/resourcebundle/resourcebundle.h
+++ b/ext/intl/resourcebundle/resourcebundle.h
@@ -23,6 +23,6 @@
#include "resourcebundle/resourcebundle_class.h"
-void resourcebundle_extract_value( zval *target, ResourceBundle_object *source TSRMLS_DC);
+void resourcebundle_extract_value( zval *target, ResourceBundle_object *source);
#endif // #ifndef RESOURCEBUNDLE_CLASS_H
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 0fbf7931d4..67e2bae855 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -35,12 +35,12 @@ zend_class_entry *ResourceBundle_ce_ptr = NULL;
static zend_object_handlers ResourceBundle_object_handlers;
/* {{{ ResourceBundle_object_dtor */
-static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC )
+static void ResourceBundle_object_destroy( zend_object *object )
{
ResourceBundle_object *rb = php_intl_resourcebundle_fetch_object(object);
// only free local errors
- intl_error_reset( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
+ intl_error_reset( INTL_DATA_ERROR_P(rb) );
if (rb->me) {
ures_close( rb->me );
@@ -49,21 +49,21 @@ static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC )
ures_close( rb->child );
}
- //???zend_object_std_dtor( object TSRMLS_CC );
+ //???zend_object_std_dtor( object );
}
/* }}} */
/* {{{ ResourceBundle_object_create */
-static zend_object *ResourceBundle_object_create( zend_class_entry *ce TSRMLS_DC )
+static zend_object *ResourceBundle_object_create( zend_class_entry *ce )
{
ResourceBundle_object *rb;
rb = ecalloc( 1, sizeof(ResourceBundle_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- zend_object_std_init( &rb->zend, ce TSRMLS_CC );
+ zend_object_std_init( &rb->zend, ce );
object_properties_init( &rb->zend, ce);
- intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
+ intl_error_init( INTL_DATA_ERROR_P(rb) );
rb->me = NULL;
rb->child = NULL;
@@ -85,13 +85,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval *object = return_value;
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s!s!|b",
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_ctor: unable to parse input parameters", 0 TSRMLS_CC );
+ "resourcebundle_ctor: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -99,7 +99,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (locale == NULL) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
if (fallback) {
@@ -113,13 +113,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
char *pbuf;
- intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
+ intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb));
spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
"'%s' without fallback from %s to %s",
bundlename ? bundlename : "(default data)", locale,
ures_getLocaleByType(
rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
- intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
+ intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1);
efree(pbuf);
Z_OBJ_P(return_value) = NULL;
}
@@ -145,7 +145,7 @@ PHP_METHOD( ResourceBundle, __construct )
resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -166,7 +166,7 @@ PHP_FUNCTION( resourcebundle_create )
/* }}} */
/* {{{ resourcebundle_array_fetch */
-static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC)
+static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback)
{
int32_t meindex = 0;
char * mekey = NULL;
@@ -174,7 +174,7 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
char *pbuf;
ResourceBundle_object *rb;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
RESOURCEBUNDLE_METHOD_FETCH_OBJECT;
if(Z_TYPE_P(offset) == IS_LONG) {
@@ -186,18 +186,18 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) );
} else {
intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get: index should be integer or string", 0 TSRMLS_CC);
+ "resourcebundle_get: index should be integer or string", 0);
RETURN_NULL();
}
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) );
if (U_FAILURE(INTL_DATA_ERROR_CODE(rb))) {
if (is_numeric) {
spprintf( &pbuf, 0, "Cannot load resource element %d", meindex );
} else {
spprintf( &pbuf, 0, "Cannot load resource element '%s'", mekey );
}
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 );
efree(pbuf);
RETURN_NULL();
}
@@ -210,23 +210,23 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
} else {
spprintf( &pbuf, 0, "Cannot load element '%s' without fallback from to %s", mekey, locale );
}
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 );
efree(pbuf);
RETURN_NULL();
}
- resourcebundle_extract_value( return_value, rb TSRMLS_CC );
+ resourcebundle_extract_value( return_value, rb );
}
/* }}} */
/* {{{ resourcebundle_array_get */
-zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv)
{
if(offset == NULL) {
php_error( E_ERROR, "Cannot apply [] to ResourceBundle object" );
}
ZVAL_NULL(rv);
- resourcebundle_array_fetch(object, offset, rv, 1 TSRMLS_CC);
+ resourcebundle_array_fetch(object, offset, rv, 1);
return rv;
}
/* }}} */
@@ -248,25 +248,25 @@ PHP_FUNCTION( resourcebundle_get )
zval * offset;
zval * object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_get: unable to parse input params", 0);
RETURN_FALSE;
}
- resourcebundle_array_fetch(object, offset, return_value, fallback TSRMLS_CC);
+ resourcebundle_array_fetch(object, offset, return_value, fallback);
}
/* }}} */
/* {{{ resourcebundle_array_count */
-int resourcebundle_array_count(zval *object, zend_long *count TSRMLS_DC)
+int resourcebundle_array_count(zval *object, zend_long *count)
{
ResourceBundle_object *rb;
RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK;
if (rb->me == NULL) {
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR,
- "Found unconstructed ResourceBundle", 0 TSRMLS_CC);
+ "Found unconstructed ResourceBundle", 0);
return 0;
}
@@ -290,9 +290,9 @@ PHP_FUNCTION( resourcebundle_count )
int32_t len;
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) {
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_count: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_count: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -321,12 +321,12 @@ PHP_FUNCTION( resourcebundle_locales )
UEnumeration *icuenum;
UErrorCode icuerror = U_ZERO_ERROR;
- intl_errors_reset( NULL TSRMLS_CC );
+ intl_errors_reset( NULL );
- if( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &bundlename, &bundlename_len ) == FAILURE )
+ if( zend_parse_parameters(ZEND_NUM_ARGS(), "s", &bundlename, &bundlename_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_locales: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_locales: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -362,11 +362,11 @@ PHP_FUNCTION( resourcebundle_get_error_code )
{
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, ResourceBundle_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "resourcebundle_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -390,16 +390,16 @@ PHP_FUNCTION( resourcebundle_get_error_message )
zend_string* message = NULL;
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, ResourceBundle_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "resourcebundle_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
rb = Z_INTL_RESOURCEBUNDLE_P( object );
- message = intl_error_get_message(INTL_DATA_ERROR_P(rb) TSRMLS_CC);
+ message = intl_error_get_message(INTL_DATA_ERROR_P(rb));
RETURN_STR(message);
}
/* }}} */
@@ -422,7 +422,7 @@ static zend_function_entry ResourceBundle_class_functions[] = {
/* {{{ resourcebundle_register_class
* Initialize 'ResourceBundle' class
*/
-void resourcebundle_register_class( TSRMLS_D )
+void resourcebundle_register_class( void )
{
zend_class_entry ce;
@@ -431,7 +431,7 @@ void resourcebundle_register_class( TSRMLS_D )
ce.create_object = ResourceBundle_object_create;
ce.get_iterator = resourcebundle_get_iterator;
- ResourceBundle_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ ResourceBundle_ce_ptr = zend_register_internal_class( &ce );
if( !ResourceBundle_ce_ptr )
{
@@ -446,7 +446,7 @@ void resourcebundle_register_class( TSRMLS_D )
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
- zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(ResourceBundle_ce_ptr, 1, zend_ce_traversable);
}
/* }}} */
diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h
index 403b6beb17..0ac3635ba8 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.h
+++ b/ext/intl/resourcebundle/resourcebundle_class.h
@@ -43,14 +43,14 @@ static inline ResourceBundle_object *php_intl_resourcebundle_fetch_object(zend_o
INTL_METHOD_FETCH_OBJECT(INTL_RESOURCEBUNDLE, rb); \
if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \
+ "Found unconstructed ResourceBundle", 0); \
RETURN_FALSE; \
}
#define RESOURCEBUNDLE_OBJECT(rb) (rb)->me
-void resourcebundle_register_class( TSRMLS_D );
+void resourcebundle_register_class( void );
extern zend_class_entry *ResourceBundle_ce_ptr;
PHP_FUNCTION( resourcebundle_create );
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c
index cf38c6b676..8243e69268 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.c
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.c
@@ -29,7 +29,7 @@
*/
/* {{{ resourcebundle_iterator_read */
-static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRMLS_DC )
+static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator )
{
UErrorCode icuerror = U_ZERO_ERROR;
ResourceBundle_object *rb = iterator->subject;
@@ -41,17 +41,17 @@ static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRM
if (iterator->is_table) {
iterator->currentkey = estrdup( ures_getKey( rb->child ) );
}
- resourcebundle_extract_value( &iterator->current, rb TSRMLS_CC );
+ resourcebundle_extract_value( &iterator->current, rb );
}
else {
- // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0 TSRMLS_CC);
+ // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0);
ZVAL_UNDEF(&iterator->current);
}
}
/* }}} */
/* {{{ resourcebundle_iterator_invalidate */
-static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_invalidate( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
@@ -67,19 +67,19 @@ static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRML
/* }}} */
/* {{{ resourcebundle_iterator_dtor */
-static void resourcebundle_iterator_dtor( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_dtor( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
zval *object = &iterator->intern.data;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
zval_ptr_dtor(object);
}
/* }}} */
/* {{{ resourcebundle_iterator_has_more */
-static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_DC )
+static int resourcebundle_iterator_has_more( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
return (iterator->i < iterator->length) ? SUCCESS : FAILURE;
@@ -87,23 +87,23 @@ static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_D
/* }}} */
/* {{{ resourcebundle_iterator_current */
-static zval *resourcebundle_iterator_current( zend_object_iterator *iter TSRMLS_DC )
+static zval *resourcebundle_iterator_current( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
if (Z_ISUNDEF(iterator->current)) {
- resourcebundle_iterator_read( iterator TSRMLS_CC);
+ resourcebundle_iterator_read( iterator);
}
return &iterator->current;
}
/* }}} */
/* {{{ resourcebundle_iterator_key */
-static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key TSRMLS_DC )
+static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
if (Z_ISUNDEF(iterator->current)) {
- resourcebundle_iterator_read( iterator TSRMLS_CC);
+ resourcebundle_iterator_read( iterator);
}
if (iterator->is_table) {
@@ -115,22 +115,22 @@ static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key T
/* }}} */
/* {{{ resourcebundle_iterator_step */
-static void resourcebundle_iterator_step( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_step( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
iterator->i++;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
}
/* }}} */
/* {{{ resourcebundle_iterator_has_reset */
-static void resourcebundle_iterator_reset( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_reset( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
iterator->i = 0;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
}
/* }}} */
@@ -147,7 +147,7 @@ static zend_object_iterator_funcs resourcebundle_iterator_funcs = {
/* }}} */
/* {{{ resourcebundle_get_iterator */
-zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC )
+zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref )
{
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P(object );
ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) );
@@ -156,7 +156,7 @@ zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *o
php_error( E_ERROR, "ResourceBundle does not support writable iterators" );
}
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &resourcebundle_iterator_funcs;
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h
index b28fa91638..f27b76ad8b 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.h
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.h
@@ -31,6 +31,6 @@ typedef struct {
zend_long i;
} ResourceBundle_iterator;
-zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC );
+zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref );
#endif // #ifndef RESOURCEBUNDLE_ITERATOR_H
diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c
index 0a22875dcf..d61aea2e13 100644
--- a/ext/intl/spoofchecker/spoofchecker.c
+++ b/ext/intl/spoofchecker/spoofchecker.c
@@ -35,7 +35,7 @@ void spoofchecker_register_constants(INIT_FUNC_ARGS)
return;
}
- #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC);
+ #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x);
SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT_CONFUSABLE)
SPOOFCHECKER_EXPOSE_CLASS_CONST(MIXED_SCRIPT_CONFUSABLE)
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 5fb6ffb90c..84549ced83 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -30,32 +30,32 @@ static zend_object_handlers Spoofchecker_handlers;
*/
/* {{{ Spoofchecker_objects_dtor */
-static void Spoofchecker_objects_dtor(zend_object *object TSRMLS_DC)
+static void Spoofchecker_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ Spoofchecker_objects_free */
-void Spoofchecker_objects_free(zend_object *object TSRMLS_DC)
+void Spoofchecker_objects_free(zend_object *object)
{
Spoofchecker_object* co = php_intl_spoofchecker_fetch_object(object);
- zend_object_std_dtor(&co->zo TSRMLS_CC);
+ zend_object_std_dtor(&co->zo);
- spoofchecker_object_destroy(co TSRMLS_CC);
+ spoofchecker_object_destroy(co);
}
/* }}} */
/* {{{ Spoofchecker_object_create */
zend_object *Spoofchecker_object_create(
- zend_class_entry *ce TSRMLS_DC)
+ zend_class_entry *ce)
{
Spoofchecker_object* intern;
intern = ecalloc(1, sizeof(Spoofchecker_object) + sizeof(zval) * (ce->default_properties_count - 1));
- intl_error_init(SPOOFCHECKER_ERROR_P(intern) TSRMLS_CC);
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ intl_error_init(SPOOFCHECKER_ERROR_P(intern));
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &Spoofchecker_handlers;
@@ -107,24 +107,24 @@ zend_function_entry Spoofchecker_class_functions[] = {
};
/* }}} */
-static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */
+static zend_object *spoofchecker_clone_obj(zval *object) /* {{{ */
{
zend_object *new_obj_val;
Spoofchecker_object *sfo, *new_sfo;
sfo = Z_INTL_SPOOFCHECKER_P(object);
- intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC);
+ intl_error_reset(SPOOFCHECKER_ERROR_P(sfo));
- new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object));
new_sfo = php_intl_spoofchecker_fetch_object(new_obj_val);
/* clone standard parts */
- zend_objects_clone_members(&new_sfo->zo, &sfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_sfo->zo, &sfo->zo);
/* clone internal object */
new_sfo->uspoof = uspoof_clone(sfo->uspoof, SPOOFCHECKER_ERROR_CODE_P(new_sfo));
if(U_FAILURE(SPOOFCHECKER_ERROR_CODE(new_sfo))) {
/* set up error in case error handler is interested */
- intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 TSRMLS_CC );
- Spoofchecker_objects_dtor(&new_sfo->zo TSRMLS_CC); /* free new object */
+ intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 );
+ Spoofchecker_objects_dtor(&new_sfo->zo); /* free new object */
zend_error(E_ERROR, "Failed to clone SpoofChecker object");
}
return new_obj_val;
@@ -134,14 +134,14 @@ static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */
/* {{{ spoofchecker_register_Spoofchecker_class
* Initialize 'Spoofchecker' class
*/
-void spoofchecker_register_Spoofchecker_class(TSRMLS_D)
+void spoofchecker_register_Spoofchecker_class(void)
{
zend_class_entry ce;
/* Create and register 'Spoofchecker' class. */
INIT_CLASS_ENTRY(ce, "Spoofchecker", Spoofchecker_class_functions);
ce.create_object = Spoofchecker_object_create;
- Spoofchecker_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ Spoofchecker_ce_ptr = zend_register_internal_class(&ce);
memcpy(&Spoofchecker_handlers, zend_get_std_object_handlers(),
sizeof Spoofchecker_handlers);
@@ -163,20 +163,20 @@ void spoofchecker_register_Spoofchecker_class(TSRMLS_D)
* Initialize internals of Spoofchecker_object.
* Must be called before any other call to 'spoofchecker_object_...' functions.
*/
-void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC)
+void spoofchecker_object_init(Spoofchecker_object* co)
{
if (!co) {
return;
}
- intl_error_init(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC);
+ intl_error_init(SPOOFCHECKER_ERROR_P(co));
}
/* }}} */
/* {{{ void spoofchecker_object_destroy( Spoofchecker_object* co )
* Clean up mem allocted by internals of Spoofchecker_object
*/
-void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC)
+void spoofchecker_object_destroy(Spoofchecker_object* co)
{
if (!co) {
return;
@@ -187,7 +187,7 @@ void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC)
co->uspoof = NULL;
}
- intl_error_reset(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC);
+ intl_error_reset(SPOOFCHECKER_ERROR_P(co));
}
/* }}} */
diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h
index 847b0a97b5..7c5864b82f 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.h
+++ b/ext/intl/spoofchecker/spoofchecker_class.h
@@ -47,10 +47,10 @@ static inline Spoofchecker_object *php_intl_spoofchecker_fetch_object(zend_objec
#define SPOOFCHECKER_ERROR_CODE(co) INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co))
#define SPOOFCHECKER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co)))
-void spoofchecker_register_Spoofchecker_class(TSRMLS_D);
+void spoofchecker_register_Spoofchecker_class(void);
-void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC);
-void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC);
+void spoofchecker_object_init(Spoofchecker_object* co);
+void spoofchecker_object_destroy(Spoofchecker_object* co);
extern zend_class_entry *Spoofchecker_ce_ptr;
@@ -59,22 +59,22 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
#define SPOOFCHECKER_METHOD_INIT_VARS \
zval* object = getThis(); \
Spoofchecker_object* co = NULL; \
- intl_error_reset(NULL TSRMLS_CC); \
+ intl_error_reset(NULL); \
#define SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_SPOOFCHECKER, co)
#define SPOOFCHECKER_METHOD_FETCH_OBJECT \
SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; \
if (co->uspoof == NULL) { \
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed Spoofchecker", 0 TSRMLS_CC); \
+ "Found unconstructed Spoofchecker", 0); \
RETURN_FALSE; \
}
// Macro to check return value of a ucol_* function call.
#define SPOOFCHECKER_CHECK_STATUS(co, msg) \
- intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); \
+ intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co)); \
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { \
- intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0 TSRMLS_CC); \
+ intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0); \
RETURN_FALSE; \
} \
diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c
index 959a0c568f..fb0f1549a2 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.c
+++ b/ext/intl/spoofchecker/spoofchecker_main.c
@@ -32,7 +32,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &text, &text_len, &error_code)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &text, &text_len, &error_code)) {
return;
}
@@ -41,7 +41,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
ret = uspoof_checkUTF8(co->uspoof, text, text_len, NULL, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
RETURN_TRUE;
}
@@ -64,7 +64,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &s1, &s1_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &s1, &s1_len,
&s2, &s2_len, &error_code)) {
return;
}
@@ -74,7 +74,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
ret = uspoof_areConfusableUTF8(co->uspoof, s1, s1_len, s2, s2_len, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
RETURN_TRUE;
}
@@ -95,7 +95,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales)
size_t locales_len;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &locales, &locales_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &locales, &locales_len)) {
return;
}
@@ -104,7 +104,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales)
uspoof_setAllowedLocales(co->uspoof, locales, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
return;
}
}
@@ -118,7 +118,7 @@ PHP_METHOD(Spoofchecker, setChecks)
zend_long checks;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &checks)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &checks)) {
return;
}
@@ -127,7 +127,7 @@ PHP_METHOD(Spoofchecker, setChecks)
uspoof_setChecks(co->uspoof, checks, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
}
}
/* }}} */
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index d2aaa12344..6818d0d9d8 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -45,7 +45,7 @@ U_CDECL_END
/* }}} */
/* {{{ timezone_object_construct */
-U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC)
+U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned)
{
TimeZone_object *to;
@@ -60,7 +60,7 @@ U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int o
* Convert from TimeZone to DateTimeZone object */
U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
intl_error *outside_error,
- const char *func, zval *ret TSRMLS_DC)
+ const char *func, zval *ret)
{
UnicodeString id;
char *message = NULL;
@@ -71,7 +71,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
if (id.isBogus()) {
spprintf(&message, 0, "%s: could not obtain TimeZone id", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
goto error;
}
@@ -92,7 +92,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
if (intl_charFromString(id, &str, &str_len, &INTL_ERROR_CODE(*outside_error)) == FAILURE) {
spprintf(&message, 0, "%s: could not convert id to UTF-8", func);
intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error),
- message, 1 TSRMLS_CC);
+ message, 1);
goto error;
}
ZVAL_STRINGL(&arg, str, str_len);
@@ -103,8 +103,8 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
spprintf(&message, 0,
"%s: DateTimeZone constructor threw exception", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
- zend_object_store_ctor_failed(Z_OBJ_P(ret) TSRMLS_CC);
+ message, 1);
+ zend_object_store_ctor_failed(Z_OBJ_P(ret));
zval_ptr_dtor(&arg);
goto error;
}
@@ -130,14 +130,14 @@ error:
* TimeZone argument processor. outside_error may be NULL (for static functions/constructors) */
U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
intl_error *outside_error,
- const char *func TSRMLS_DC)
+ const char *func)
{
zval local_zv_tz;
char *message = NULL;
TimeZone *timeZone;
if (zv_timezone == NULL || Z_TYPE_P(zv_timezone) == IS_NULL) {
- timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C);
+ timelib_tzinfo *tzinfo = get_timezone_info();
ZVAL_STRING(&local_zv_tz, tzinfo->name);
zv_timezone = &local_zv_tz;
} else {
@@ -145,13 +145,13 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
}
if (Z_TYPE_P(zv_timezone) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr)) {
TimeZone_object *to = Z_INTL_TIMEZONE_P(zv_timezone);
if (to->utimezone == NULL) {
spprintf(&message, 0, "%s: passed IntlTimeZone is not "
"properly constructed", func);
if (message) {
- intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -161,20 +161,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
if (timeZone == NULL) {
spprintf(&message, 0, "%s: could not clone TimeZone", func);
if (message) {
- intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
return NULL;
}
} else if (Z_TYPE_P(zv_timezone) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce() TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce())) {
php_timezone_obj *tzobj = Z_PHPTIMEZONE_P(zv_timezone);
zval_dtor(&local_zv_tz);
return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
- outside_error, func TSRMLS_CC);
+ outside_error, func);
} else {
UnicodeString id,
gottenId;
@@ -185,7 +185,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
spprintf(&message, 0, "%s: Time zone identifier given is not a "
"valid UTF-8 string", func);
if (message) {
- intl_errors_set(outside_error, status, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, status, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -195,7 +195,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
if (timeZone == NULL) {
spprintf(&message, 0, "%s: could not create time zone", func);
if (message) {
- intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -205,7 +205,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
spprintf(&message, 0, "%s: no such time zone: '%s'",
func, Z_STRVAL_P(zv_timezone));
if (message) {
- intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -221,20 +221,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
/* }}} */
/* {{{ clone handler for TimeZone */
-static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
+static zend_object *TimeZone_clone_obj(zval *object)
{
TimeZone_object *to_orig,
*to_new;
zend_object *ret_val;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
to_orig = Z_INTL_TIMEZONE_P(object);
- intl_error_reset(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC);
+ intl_error_reset(TIMEZONE_ERROR_P(to_orig));
- ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object));
to_new = php_intl_timezone_fetch_object(ret_val);
- zend_objects_clone_members(&to_new->zo, &to_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&to_new->zo, &to_orig->zo);
if (to_orig->utimezone != NULL) {
TimeZone *newTimeZone;
@@ -244,17 +244,17 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
if (!newTimeZone) {
zend_string *err_msg;
intl_errors_set_code(TIMEZONE_ERROR_P(to_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(TIMEZONE_ERROR_P(to_orig),
- "Could not clone IntlTimeZone", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone IntlTimeZone", 0);
+ err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
to_new->utimezone = newTimeZone;
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0);
}
return ret_val;
@@ -263,7 +263,7 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
/* {{{ compare_objects handler for TimeZone
* Can't be used for >, >=, <, <= comparisons */
-static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
+static int TimeZone_compare_objects(zval *object1, zval *object2)
{
TimeZone_object *to1,
*to2;
@@ -272,7 +272,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
if (to1->utimezone == NULL || to2->utimezone == NULL) {
zend_throw_exception(NULL, "Comparison with at least one unconstructed "
- "IntlTimeZone operand", 0 TSRMLS_CC);
+ "IntlTimeZone operand", 0);
/* intentionally not returning */
} else {
if (*to1->utimezone == *to2->utimezone) {
@@ -285,7 +285,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
/* }}} */
/* {{{ get_debug_info handler for TimeZone */
-static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp)
{
zval zv;
TimeZone_object *to;
@@ -343,23 +343,23 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ void TimeZone_object_init(TimeZone_object* to)
* Initialize internals of TImeZone_object not specific to zend standard objects.
*/
-static void TimeZone_object_init(TimeZone_object *to TSRMLS_DC)
+static void TimeZone_object_init(TimeZone_object *to)
{
- intl_error_init(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ intl_error_init(TIMEZONE_ERROR_P(to));
to->utimezone = NULL;
to->should_delete = 0;
}
/* }}} */
/* {{{ TimeZone_objects_dtor */
-static void TimeZone_objects_dtor(zend_object *object TSRMLS_DC)
+static void TimeZone_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ TimeZone_objects_free */
-static void TimeZone_objects_free(zend_object *object TSRMLS_DC)
+static void TimeZone_objects_free(zend_object *object)
{
TimeZone_object* to = php_intl_timezone_fetch_object(object);
@@ -367,22 +367,22 @@ static void TimeZone_objects_free(zend_object *object TSRMLS_DC)
delete to->utimezone;
to->utimezone = NULL;
}
- intl_error_reset(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ intl_error_reset(TIMEZONE_ERROR_P(to));
- zend_object_std_dtor(&to->zo TSRMLS_CC);
+ zend_object_std_dtor(&to->zo);
}
/* }}} */
/* {{{ TimeZone_object_create */
-static zend_object *TimeZone_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *TimeZone_object_create(zend_class_entry *ce)
{
TimeZone_object* intern;
intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
- TimeZone_object_init(intern TSRMLS_CC);
+ TimeZone_object_init(intern);
intern->zo.handlers = &TimeZone_handlers;
@@ -487,17 +487,17 @@ static zend_function_entry TimeZone_class_functions[] = {
/* {{{ timezone_register_IntlTimeZone_class
* Initialize 'IntlTimeZone' class
*/
-U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D)
+U_CFUNC void timezone_register_IntlTimeZone_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlTimeZone' class. */
INIT_CLASS_ENTRY(ce, "IntlTimeZone", TimeZone_class_functions);
ce.create_object = TimeZone_object_create;
- TimeZone_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ TimeZone_ce_ptr = zend_register_internal_class(&ce);
if (!TimeZone_ce_ptr) {
//can't happen now without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlTimeZone: class registration has failed.");
return;
}
@@ -515,7 +515,7 @@ U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D)
/* Declare 'IntlTimeZone' class constants */
#define TIMEZONE_DECL_LONG_CONST(name, val) \
zend_declare_class_constant_long(TimeZone_ce_ptr, name, sizeof(name) - 1, \
- val TSRMLS_CC)
+ val)
TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT", TimeZone::SHORT);
TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG", TimeZone::LONG);
diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h
index 94b781b332..0667c78994 100644
--- a/ext/intl/timezone/timezone_class.h
+++ b/ext/intl/timezone/timezone_class.h
@@ -60,16 +60,16 @@ static inline TimeZone_object *php_intl_timezone_fetch_object(zend_object *obj)
#define TIMEZONE_METHOD_FETCH_OBJECT\
TIMEZONE_METHOD_FETCH_OBJECT_NO_CHECK; \
if (to->utimezone == NULL) { \
- intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0 TSRMLS_CC); \
+ intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0); \
RETURN_FALSE; \
}
-zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret TSRMLS_DC);
-TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func TSRMLS_DC);
+zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret);
+TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func);
-void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC);
+void timezone_object_construct(const TimeZone *zone, zval *object, int owned);
-void timezone_register_IntlTimeZone_class(TSRMLS_D);
+void timezone_register_IntlTimeZone_class(void);
extern zend_class_entry *TimeZone_ce_ptr;
extern zend_object_handlers TimeZone_handlers;
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index 033b216cdf..98ae6f97aa 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -41,19 +41,19 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
{
char *str_id;
size_t str_id_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_time_zone: bad arguments", 0);
RETURN_NULL();
}
@@ -61,13 +61,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
UnicodeString id = UnicodeString();
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_create_time_zone: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_create_time_zone: could not convert time zone id to UTF-16", 0);
RETURN_NULL();
}
//guaranteed non-null; GMT if timezone cannot be understood
TimeZone *tz = TimeZone::createTimeZone(id);
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
@@ -75,12 +75,12 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
zval *zv_timezone;
TimeZone *tz;
php_timezone_obj *tzobj;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O",
&zv_timezone, php_date_get_timezone_ce()) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_from_date_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_from_date_time_zone: bad arguments", 0);
RETURN_NULL();
}
@@ -88,58 +88,58 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
if (!tzobj->initialized) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_from_date_time_zone: DateTimeZone object is unconstructed",
- 0 TSRMLS_CC);
+ 0);
RETURN_NULL();
}
tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL,
- "intltz_from_date_time_zone" TSRMLS_CC);
+ "intltz_from_date_time_zone");
if (tz == NULL) {
RETURN_NULL();
}
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_create_default)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_default: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_default: bad arguments", 0);
RETURN_NULL();
}
TimeZone *tz = TimeZone::createDefault();
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_get_gmt)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_gmt: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_gmt: bad arguments", 0);
RETURN_NULL();
}
- timezone_object_construct(TimeZone::getGMT(), return_value, 0 TSRMLS_CC);
+ timezone_object_construct(TimeZone::getGMT(), return_value, 0);
}
#if U_ICU_VERSION_MAJOR_NUM >= 49
U_CFUNC PHP_FUNCTION(intltz_get_unknown)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_unknown: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_unknown: bad arguments", 0);
RETURN_NULL();
}
- timezone_object_construct(&TimeZone::getUnknown(), return_value, 0 TSRMLS_CC);
+ timezone_object_construct(&TimeZone::getUnknown(), return_value, 0);
}
#endif
@@ -147,13 +147,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
{
zval *arg = NULL;
StringEnumeration *se = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
/* double indirection to have the zend engine destroy the new zval that
* results from separation */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_enumeration: bad arguments", 0);
RETURN_FALSE;
}
@@ -164,7 +164,7 @@ int_offset:
if (Z_LVAL_P(arg) < (zend_long)INT32_MIN ||
Z_LVAL_P(arg) > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: value is out of range", 0 TSRMLS_CC);
+ "intltz_create_enumeration: value is out of range", 0);
RETURN_FALSE;
} else {
se = TimeZone::createEnumeration((int32_t) Z_LVAL_P(arg));
@@ -193,15 +193,15 @@ double_offset:
se = TimeZone::createEnumeration(Z_STRVAL_P(arg));
} else {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: invalid argument type", 0 TSRMLS_CC);
+ "intltz_create_enumeration: invalid argument type", 0);
RETURN_FALSE;
}
if (se) {
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
} else {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: error obtaining enumeration", 0 TSRMLS_CC);
+ "intltz_create_enumeration: error obtaining enumeration", 0);
RETVAL_FALSE;
}
}
@@ -210,12 +210,12 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
{
char *str_id;
size_t str_id_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_count_equivalent_ids: bad arguments", 0 TSRMLS_CC);
+ "intltz_count_equivalent_ids: bad arguments", 0);
RETURN_FALSE;
}
@@ -223,7 +223,7 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
UnicodeString id = UnicodeString();
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -241,7 +241,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
int32_t offset,
*offsetp = NULL;
int arg3isnull = 0;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
/* must come before zpp because zpp would convert the arg in the stack to 0 */
if (ZEND_NUM_ARGS() == 3) {
@@ -250,24 +250,24 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
!= FAILURE && Z_TYPE_P(zvoffset) == IS_NULL;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s!l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l",
&zoneType, &region, &region_len, &offset_arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: bad arguments", 0);
RETURN_FALSE;
}
if (zoneType != UCAL_ZONE_TYPE_ANY && zoneType != UCAL_ZONE_TYPE_CANONICAL
&& zoneType != UCAL_ZONE_TYPE_CANONICAL_LOCATION) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: bad zone type", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: bad zone type", 0);
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 3) {
if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: offset out of bounds", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: offset out of bounds", 0);
RETURN_FALSE;
}
@@ -284,7 +284,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
INTL_CHECK_STATUS(uec, "intltz_create_time_zone_id_enumeration: "
"Error obtaining time zone id enumeration")
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
}
#endif
@@ -293,12 +293,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
char *str_id;
size_t str_id_len;
zval *is_systemid = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z",
&str_id, &str_id_len, &is_systemid) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_canonical_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_canonical_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -306,7 +306,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -337,12 +337,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
char *str_id;
size_t str_id_len;
char outbuf[3];
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_region: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_region: bad arguments", 0);
RETURN_FALSE;
}
@@ -350,7 +350,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_region: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_region: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -363,11 +363,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_tz_data_version: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_tz_data_version: bad arguments", 0);
RETURN_FALSE;
}
@@ -384,13 +384,13 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
char *str_id;
size_t str_id_len;
zend_long index;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl",
&str_id, &str_id_len, &index) == FAILURE ||
index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_equivalent_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_equivalent_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -398,7 +398,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -418,10 +418,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_id)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -446,10 +446,10 @@ U_CFUNC PHP_FUNCTION(intltz_use_daylight_time)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_use_daylight_time: bad arguments", 0 TSRMLS_CC);
+ "intltz_use_daylight_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -468,11 +468,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_offset)
dstOffset;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Odbz/z/", &object, TimeZone_ce_ptr, &date, &local, &rawOffsetArg,
&dstOffsetArg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_offset: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_offset: bad arguments", 0);
RETURN_FALSE;
}
@@ -497,10 +497,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_raw_offset)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_raw_offset: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_raw_offset: bad arguments", 0);
RETURN_FALSE;
}
@@ -515,18 +515,18 @@ U_CFUNC PHP_FUNCTION(intltz_has_same_rules)
TimeZone_object *other_to;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, TimeZone_ce_ptr, &other_object, TimeZone_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_has_same_rules: bad arguments", 0 TSRMLS_CC);
+ "intltz_has_same_rules: bad arguments", 0);
RETURN_FALSE;
}
TIMEZONE_METHOD_FETCH_OBJECT;
other_to = Z_INTL_TIMEZONE_P(other_object);
if (other_to->utimezone == NULL) {
intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0 TSRMLS_CC);
+ "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0);
RETURN_FALSE;
}
@@ -550,11 +550,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
size_t dummy = 0;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|bls!", &object, TimeZone_ce_ptr, &daylight, &display_type,
&locale_str, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_display_name: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_display_name: bad arguments", 0);
RETURN_FALSE;
}
@@ -565,12 +565,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
}
if (!found) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_display_name: wrong display type", 0 TSRMLS_CC);
+ "intltz_get_display_name: wrong display type", 0);
RETURN_FALSE;
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
TIMEZONE_METHOD_FETCH_OBJECT;
@@ -594,10 +594,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_dst_savings: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_dst_savings: bad arguments", 0);
RETURN_FALSE;
}
@@ -611,17 +611,17 @@ U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone)
zval tmp;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_to_date_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_to_date_time_zone: bad arguments", 0);
RETURN_FALSE;
}
TIMEZONE_METHOD_FETCH_OBJECT;
zval *ret = timezone_convert_to_datetimezone(to->utimezone,
- &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp TSRMLS_CC);
+ &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp);
if (ret) {
RETURN_ZVAL(ret, 1, 1);
@@ -634,10 +634,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code)
{
TIMEZONE_METHOD_INIT_VARS
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -654,10 +654,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message)
zend_string* message = NULL;
TIMEZONE_METHOD_INIT_VARS
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "intltz_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -668,6 +668,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ message = intl_error_get_message(TIMEZONE_ERROR_P(to));
RETURN_STR(message);
}
diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c
index fda183b85a..e7f2ffd72c 100644
--- a/ext/intl/transliterator/transliterator.c
+++ b/ext/intl/transliterator/transliterator.c
@@ -36,8 +36,8 @@ void transliterator_register_constants( INIT_FUNC_ARGS )
}
#define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_LONG_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS )
- #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x TSRMLS_CC );
- #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );*/
+ #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x );
+ #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value );*/
/* Normalization form constants */
TRANSLITERATOR_EXPOSE_CLASS_CONST( FORWARD );
diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c
index 647ece8ba0..4b799d1802 100644
--- a/ext/intl/transliterator/transliterator_class.c
+++ b/ext/intl/transliterator/transliterator_class.c
@@ -27,12 +27,12 @@ zend_class_entry *Transliterator_ce_ptr = NULL;
zend_object_handlers Transliterator_handlers;
-/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status TSRMLS_DC )
+/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status )
* Initialize internals of Transliterator_object.
*/
int transliterator_object_construct( zval *object,
UTransliterator *utrans,
- UErrorCode *status TSRMLS_DC )
+ UErrorCode *status )
{
const UChar *ustr_id;
int32_t ustr_id_len;
@@ -56,7 +56,7 @@ int transliterator_object_construct( zval *object,
}
zend_update_property_stringl(Transliterator_ce_ptr, object,
- "id", sizeof( "id" ) - 1, str_id, str_id_len TSRMLS_CC );
+ "id", sizeof( "id" ) - 1, str_id, str_id_len );
efree( str_id );
return SUCCESS;
}
@@ -69,19 +69,19 @@ int transliterator_object_construct( zval *object,
/* {{{ void transliterator_object_init( Transliterator_object* to )
* Initialize internals of Transliterator_object.
*/
-static void transliterator_object_init( Transliterator_object* to TSRMLS_DC )
+static void transliterator_object_init( Transliterator_object* to )
{
if( !to )
return;
- intl_error_init( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_init( TRANSLITERATOR_ERROR_P( to ) );
}
/* }}} */
/* {{{ void transliterator_object_destroy( Transliterator_object* to )
* Clean up mem allocted by internals of Transliterator_object
*/
-static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC )
+static void transliterator_object_destroy( Transliterator_object* to )
{
if( !to )
return;
@@ -92,40 +92,40 @@ static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC )
to->utrans = NULL;
}
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
}
/* }}} */
/* {{{ Transliterator_objects_dtor */
static void Transliterator_objects_dtor(
- zend_object *object TSRMLS_DC )
+ zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ Transliterator_objects_free */
-static void Transliterator_objects_free( zend_object *object TSRMLS_DC )
+static void Transliterator_objects_free( zend_object *object )
{
Transliterator_object* to = php_intl_transliterator_fetch_object(object);
- zend_object_std_dtor( &to->zo TSRMLS_CC );
+ zend_object_std_dtor( &to->zo );
- transliterator_object_destroy( to TSRMLS_CC );
+ transliterator_object_destroy( to );
}
/* }}} */
/* {{{ Transliterator_object_create */
static zend_object *Transliterator_object_create(
- zend_class_entry *ce TSRMLS_DC )
+ zend_class_entry *ce )
{
Transliterator_object* intern;
intern = ecalloc( 1, sizeof( Transliterator_object ) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init( &intern->zo, ce );
- transliterator_object_init( intern TSRMLS_CC );
+ transliterator_object_init( intern );
intern->zo.handlers = &Transliterator_handlers;
@@ -138,19 +138,19 @@ static zend_object *Transliterator_object_create(
*/
/* {{{ clone handler for Transliterator */
-static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
+static zend_object *Transliterator_clone_obj( zval *object )
{
Transliterator_object *to_orig,
*to_new;
zend_object *ret_val;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
to_orig = Z_INTL_TRANSLITERATOR_P( object );
- intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC );
- ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC );
+ intl_error_reset( INTL_DATA_ERROR_P( to_orig ) );
+ ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) );
to_new = php_intl_transliterator_fetch_object( ret_val );
- zend_objects_clone_members( &to_new->zo, &to_orig->zo TSRMLS_CC );
+ zend_objects_clone_members( &to_new->zo, &to_orig->zo );
if( to_orig->utrans != NULL )
{
@@ -165,7 +165,7 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
ZVAL_OBJ(&tempz, ret_val);
transliterator_object_construct( &tempz, utrans,
- TRANSLITERATOR_ERROR_CODE_P( to_orig ) TSRMLS_CC );
+ TRANSLITERATOR_ERROR_CODE_P( to_orig ) );
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to_orig ) ) )
{
@@ -173,16 +173,16 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
err:
if( utrans != NULL )
- transliterator_object_destroy( to_new TSRMLS_CC );
+ transliterator_object_destroy( to_new );
/* set the error anyway, in case in the future we decide not to
* throw an error. It also helps build the error message */
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) );
intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to_orig ),
- "Could not clone transliterator", 0 TSRMLS_CC );
+ "Could not clone transliterator", 0 );
- err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) TSRMLS_CC );
- php_error_docref( NULL TSRMLS_CC, E_ERROR, "%s", err_msg->val );
+ err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) );
+ php_error_docref( NULL, E_ERROR, "%s", err_msg->val );
zend_string_free( err_msg ); /* if it's changed into a warning */
/* do not destroy tempz; we need to return something */
}
@@ -190,7 +190,7 @@ err:
else
{
/* We shouldn't have unconstructed objects in the first place */
- php_error_docref( NULL TSRMLS_CC, E_WARNING,
+ php_error_docref( NULL, E_WARNING,
"Cloning unconstructed transliterator." );
}
@@ -216,7 +216,7 @@ err:
}
/* {{{ get_property_ptr_ptr handler */
-static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot TSRMLS_DC )
+static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot )
{
zval *retval;
@@ -229,7 +229,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in
}
else
{
- retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot TSRMLS_CC );
+ retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -239,7 +239,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in
/* }}} */
/* {{{ read_property handler */
-static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC )
+static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv )
{
zval *retval;
@@ -249,12 +249,12 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
retval = &EG( uninitialized_zval );
}
else
{
- retval = std_object_handlers.read_property( object, member, type, cache_slot, rv TSRMLS_CC );
+ retval = std_object_handlers.read_property( object, member, type, cache_slot, rv );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -266,7 +266,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
/* {{{ write_property handler */
static void Transliterator_write_property( zval *object, zval *member, zval *value,
- void **cache_slot TSRMLS_DC )
+ void **cache_slot )
{
TRANSLITERATOR_PROPERTY_HANDLER_PROLOG;
@@ -274,11 +274,11 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
}
else
{
- std_object_handlers.write_property( object, member, value, cache_slot TSRMLS_CC );
+ std_object_handlers.write_property( object, member, value, cache_slot );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -339,14 +339,14 @@ zend_function_entry Transliterator_class_functions[] = {
/* {{{ transliterator_register_Transliterator_class
* Initialize 'Transliterator' class
*/
-void transliterator_register_Transliterator_class( TSRMLS_D )
+void transliterator_register_Transliterator_class( void )
{
zend_class_entry ce;
/* Create and register 'Transliterator' class. */
INIT_CLASS_ENTRY( ce, "Transliterator", Transliterator_class_functions );
ce.create_object = Transliterator_object_create;
- Transliterator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Transliterator_ce_ptr = zend_register_internal_class( &ce );
memcpy( &Transliterator_handlers, zend_get_std_object_handlers(),
sizeof Transliterator_handlers );
Transliterator_handlers.offset = XtOffsetOf(Transliterator_object, zo);
@@ -366,7 +366,7 @@ void transliterator_register_Transliterator_class( TSRMLS_D )
return;
}
zend_declare_property_null( Transliterator_ce_ptr,
- "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC TSRMLS_CC );
+ "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC );
/* constants are declared in transliterator_register_constants, called from MINIT */
diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h
index f70e86995f..83e99b6f73 100644
--- a/ext/intl/transliterator/transliterator_class.h
+++ b/ext/intl/transliterator/transliterator_class.h
@@ -54,15 +54,15 @@ static inline Transliterator_object *php_intl_transliterator_fetch_object(zend_o
TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
if( to->utrans == NULL ) \
{ \
- intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 TSRMLS_CC ); \
+ intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 ); \
RETURN_FALSE; \
}
int transliterator_object_construct( zval *object,
UTransliterator *utrans,
- UErrorCode *status TSRMLS_DC );
+ UErrorCode *status );
-void transliterator_register_Transliterator_class( TSRMLS_D );
+void transliterator_register_Transliterator_class( void );
extern zend_class_entry *Transliterator_ce_ptr;
extern zend_object_handlers Transliterator_handlers;
diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c
index e79aeb1621..66db8bf522 100644
--- a/ext/intl/transliterator/transliterator_methods.c
+++ b/ext/intl/transliterator/transliterator_methods.c
@@ -27,7 +27,7 @@
#include <zend_exceptions.h>
-static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object TSRMLS_DC )
+static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object )
{
Transliterator_object *to;
UChar *ustr_id = NULL;
@@ -35,12 +35,12 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
UTransliterator *utrans;
UParseError parse_error = {0, -1};
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create: invalid direction", 0 TSRMLS_CC );
+ "transliterator_create: invalid direction", 0 );
return FAILURE;
}
@@ -51,8 +51,8 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
intl_convert_utf8_to_utf16( &ustr_id, &ustr_id_len, str_id, str_id_len, TRANSLITERATOR_ERROR_CODE_P( to ) );
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
- intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
+ intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 );
zval_dtor( object );
return FAILURE;
}
@@ -67,29 +67,29 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
char *buf = NULL;
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
spprintf( &buf, 0, "transliterator_create: unable to open ICU transliterator"
" with id \"%s\"", str_id );
if( buf == NULL ) {
intl_error_set_custom_msg( NULL,
- "transliterator_create: unable to open ICU transliterator", 0 TSRMLS_CC );
+ "transliterator_create: unable to open ICU transliterator", 0 );
}
else
{
- intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 );
efree( buf );
}
zval_dtor( object );
return FAILURE;
}
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
intl_error_set_custom_msg( NULL,
- "transliterator_create: internal constructor call failed", 0 TSRMLS_CC );
+ "transliterator_create: internal constructor call failed", 0 );
zval_dtor( object );
return FAILURE;
}
@@ -112,16 +112,16 @@ PHP_FUNCTION( transliterator_create )
(void) to; /* unused */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l",
&str_id, &str_id_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create: bad arguments", 0 );
RETURN_NULL();
}
object = return_value;
- res = create_transliterator( str_id, str_id_len, direction, object TSRMLS_CC );
+ res = create_transliterator( str_id, str_id_len, direction, object );
if( res == FAILURE )
RETURN_NULL();
@@ -146,18 +146,18 @@ PHP_FUNCTION( transliterator_create_from_rules )
0x61, 0x6E, 0x73, 0x50, 0x48, 0x50, 0}; /* RulesTransPHP */
TRANSLITERATOR_METHOD_INIT_VARS;
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l",
&str_rules, &str_rules_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_from_rules: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create_from_rules: bad arguments", 0 );
RETURN_NULL();
}
if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_from_rules: invalid direction", 0 TSRMLS_CC );
+ "transliterator_create_from_rules: invalid direction", 0 );
RETURN_NULL();
}
@@ -178,7 +178,7 @@ PHP_FUNCTION( transliterator_create_from_rules )
efree( ustr_rules );
}
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) );
if( U_FAILURE( INTL_DATA_ERROR_CODE( to ) ) )
{
char *msg = NULL;
@@ -189,13 +189,13 @@ PHP_FUNCTION( transliterator_create_from_rules )
smart_str_free( &parse_error_str );
if( msg != NULL )
{
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 );
efree( msg );
}
zval_dtor( return_value );
RETURN_NULL();
}
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
INTL_CTOR_CHECK_STATUS( to, "transliterator_create_from_rules: internal constructor call failed" );
}
@@ -211,11 +211,11 @@ PHP_FUNCTION( transliterator_create_inverse )
UTransliterator *utrans;
TRANSLITERATOR_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_inverse: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create_inverse: bad arguments", 0 );
RETURN_NULL();
}
@@ -229,7 +229,7 @@ PHP_FUNCTION( transliterator_create_inverse )
utrans = utrans_openInverse( to_orig->utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
INTL_CTOR_CHECK_STATUS( to, "transliterator_create_inverse: could not create "
"inverse ICU transliterator" );
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
INTL_CTOR_CHECK_STATUS( to, "transliterator_create: internal constructor call failed" );
}
@@ -246,7 +246,7 @@ PHP_FUNCTION( transliterator_list_ids )
int32_t elem_len;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( zend_parse_parameters_none() == FAILURE )
{
@@ -254,7 +254,7 @@ PHP_FUNCTION( transliterator_list_ids )
* null on bad parameter types, except on constructors and factory
* methods */
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_list_ids: bad arguments", 0 TSRMLS_CC );
+ "transliterator_list_ids: bad arguments", 0 );
RETURN_FALSE;
}
@@ -284,13 +284,13 @@ PHP_FUNCTION( transliterator_list_ids )
}
uenum_close( en );
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
if( U_FAILURE( status ) )
{
zval_dtor( return_value );
RETVAL_FALSE;
intl_error_set_custom_msg( NULL, "transliterator_list_ids: "
- "Failed to build array of registered transliterators", 0 TSRMLS_CC );
+ "Failed to build array of registered transliterators", 0 );
}
}
/* }}} */
@@ -320,16 +320,16 @@ PHP_FUNCTION( transliterator_transliterate )
{
/* in non-OOP version, accept both a transliterator and a string */
zval *arg1;
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "zs|ll",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "zs|ll",
&arg1, &str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_transliterate: bad arguments", 0 TSRMLS_CC );
+ "transliterator_transliterate: bad arguments", 0 );
RETURN_FALSE;
}
if( Z_TYPE_P( arg1 ) == IS_OBJECT &&
- instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr TSRMLS_CC ) )
+ instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr ) )
{
object = arg1;
}
@@ -343,11 +343,11 @@ PHP_FUNCTION( transliterator_transliterate )
}
object = &tmp_object;
res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ),
- TRANSLITERATOR_FORWARD, object TSRMLS_CC );
+ TRANSLITERATOR_FORWARD, object );
if( res == FAILURE )
{
- zend_string *message = intl_error_get_message( NULL TSRMLS_CC );
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "Could not create "
+ zend_string *message = intl_error_get_message( NULL );
+ php_error_docref0( NULL, E_WARNING, "Could not create "
"transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), message->val );
zend_string_free( message );
/* don't set U_ILLEGAL_ARGUMENT_ERROR to allow fetching of inner error */
@@ -355,11 +355,11 @@ PHP_FUNCTION( transliterator_transliterate )
}
}
}
- else if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|ll",
+ else if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll",
&str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_transliterate: bad arguments", 0 TSRMLS_CC );
+ "transliterator_transliterate: bad arguments", 0 );
RETURN_FALSE;
}
@@ -367,7 +367,7 @@ PHP_FUNCTION( transliterator_transliterate )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"end\" argument should be "
- "either non-negative or -1", 0 TSRMLS_CC );
+ "either non-negative or -1", 0 );
RETURN_FALSE;
}
@@ -375,7 +375,7 @@ PHP_FUNCTION( transliterator_transliterate )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"start\" argument should be "
- "non-negative and not bigger than \"end\" (if defined)", 0 TSRMLS_CC );
+ "non-negative and not bigger than \"end\" (if defined)", 0 );
RETURN_FALSE;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION( transliterator_transliterate )
if(msg != NULL )
{
intl_errors_set( TRANSLITERATOR_ERROR_P( to ), U_ILLEGAL_ARGUMENT_ERROR,
- msg, 1 TSRMLS_CC );
+ msg, 1 );
efree( msg );
}
RETVAL_FALSE;
@@ -424,20 +424,20 @@ PHP_FUNCTION( transliterator_transliterate )
uresult = safe_emalloc( uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) );
capacity = uresult_len + 1;
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
}
else if(TRANSLITERATOR_ERROR_CODE( to ) == U_STRING_NOT_TERMINATED_WARNING )
{
uresult = safe_erealloc( uresult, uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) );
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
break;
}
else if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to ),
- "transliterator_transliterate: transliteration failed", 0 TSRMLS_CC );
+ "transliterator_transliterate: transliteration failed", 0 );
goto cleanup;
}
else
@@ -472,7 +472,7 @@ PHP_METHOD( Transliterator, __construct )
/* this constructor shouldn't be called as it's private */
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator.",
- 0 TSRMLS_CC );
+ 0 );
}
/* {{{ proto int transliterator_get_error_code( Transliterator trans )
@@ -483,11 +483,11 @@ PHP_FUNCTION( transliterator_get_error_code )
{
TRANSLITERATOR_METHOD_INIT_VARS
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "transliterator_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -511,11 +511,11 @@ PHP_FUNCTION( transliterator_get_error_message )
zend_string* message = NULL;
TRANSLITERATOR_METHOD_INIT_VARS
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "transliterator_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -527,7 +527,7 @@ PHP_FUNCTION( transliterator_get_error_message )
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) );
RETURN_STR( message );
}
/* }}} */
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index d78ec35a2e..2e4f258b1e 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -291,7 +291,7 @@ static int dehexchar(char c)
}
-static void json_create_zval(zval *z, smart_str *buf, int type, int options TSRMLS_DC)
+static void json_create_zval(zval *z, smart_str *buf, int type, int options)
{
if (type == IS_LONG)
{
@@ -393,11 +393,11 @@ static void utf16_to_utf8(smart_str *buf, unsigned short utf16)
}
}
-static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key, zval *zv TSRMLS_DC)
+static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key, zval *zv)
{
zend_bool empty_key = !key->s || key->s->len == 0;
if (!assoc) {
- add_property_zval_ex(target, empty_key ? "_empty_" : key->s->val, empty_key ? sizeof("_empty_")-1 : key->s->len, zv TSRMLS_CC);
+ add_property_zval_ex(target, empty_key ? "_empty_" : key->s->val, empty_key ? sizeof("_empty_")-1 : key->s->len, zv);
if (Z_REFCOUNTED_P(zv)) Z_DELREF_P(zv);
} else {
add_assoc_zval_ex(target, empty_key ? "" : key->s->val, empty_key ? 0 : key->s->len, zv);
@@ -407,7 +407,7 @@ static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key
}
}
-static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int assoc TSRMLS_DC)
+static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int assoc)
{
zval *root = &jp->the_zstack[up];
zval *child = &jp->the_zstack[cur];
@@ -419,7 +419,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
}
else if (up_mode == MODE_OBJECT)
{
- add_assoc_or_property(assoc, root, key, child TSRMLS_CC);
+ add_assoc_or_property(assoc, root, key, child);
}
}
@@ -444,7 +444,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
machine with a stack.
*/
int
-parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC)
+parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options)
{
int next_char; /* the next character */
int next_class; /* the next character class */
@@ -557,9 +557,9 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
zval mval;
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
- add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval TSRMLS_CC);
+ add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval);
if (buf.s) { buf.s->len = 0; }
JSON_RESET_TYPE();
@@ -580,7 +580,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
zval mval;
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
add_next_index_zval(&jp->the_zstack[jp->top], &mval);
buf.s->len = 0;
JSON_RESET_TYPE();
@@ -615,7 +615,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
}
if (jp->top > 1) {
- attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC);
+ attach_zval(jp, jp->top - 1, jp->top, &key, assoc);
}
JSON_RESET_TYPE();
@@ -640,7 +640,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
}
if (jp->top > 1) {
- attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC);
+ attach_zval(jp, jp->top - 1, jp->top, &key, assoc);
}
JSON_RESET_TYPE();
@@ -689,14 +689,14 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
jp->stack[jp->top] == MODE_ARRAY))
{
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
}
switch (jp->stack[jp->top]) {
case MODE_OBJECT:
if (pop(jp, MODE_OBJECT) && push(jp, MODE_KEY)) {
if (type != -1) {
- add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval TSRMLS_CC);
+ add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval);
}
jp->state = KE;
}
diff --git a/ext/json/JSON_parser.h b/ext/json/JSON_parser.h
index da47f4078f..91081e8bf6 100644
--- a/ext/json/JSON_parser.h
+++ b/ext/json/JSON_parser.h
@@ -32,12 +32,12 @@ enum error_codes {
};
extern JSON_parser new_JSON_parser(int depth);
-extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC);
+extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options);
extern int free_JSON_parser(JSON_parser jp);
-static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC)
+static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc)
{
- return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC);
+ return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0);
}
#endif
diff --git a/ext/json/config.m4 b/ext/json/config.m4
index 26c43a0e3f..9c83a5d893 100644
--- a/ext/json/config.m4
+++ b/ext/json/config.m4
@@ -9,7 +9,7 @@ if test "$PHP_JSON" != "no"; then
AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
AC_HEADER_STDC
- PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared)
+ PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
PHP_SUBST(JSON_SHARED_LIBADD)
fi
diff --git a/ext/json/config.w32 b/ext/json/config.w32
index cedbf42829..60ccf91630 100644
--- a/ext/json/config.w32
+++ b/ext/json/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("json", "JavaScript Object Serialization support", "yes");
if (PHP_JSON != "no") {
- EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
+ EXTENSION('json', 'json.c', PHP_JSON_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c", "json");
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
}
diff --git a/ext/json/json.c b/ext/json/json.c
index 8f4f281ef1..481ab756ed 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -91,7 +91,7 @@ static PHP_MINIT_FUNCTION(json)
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "JsonSerializable", json_serializable_interface);
- php_json_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC);
+ php_json_serializable_ce = zend_register_internal_interface(&ce);
REGISTER_LONG_CONSTANT("JSON_HEX_TAG", PHP_JSON_HEX_TAG, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_HEX_AMP", PHP_JSON_HEX_AMP, CONST_CS | CONST_PERSISTENT);
@@ -125,6 +125,9 @@ static PHP_MINIT_FUNCTION(json)
*/
static PHP_GINIT_FUNCTION(json)
{
+#if defined(COMPILE_DL_JSON) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
json_globals->encoder_depth = 0;
json_globals->error_code = 0;
json_globals->encode_max_depth = 0;
@@ -153,6 +156,9 @@ zend_module_entry json_module_entry = {
/* }}} */
#ifdef COMPILE_DL_JSON
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(json)
#endif
@@ -167,9 +173,9 @@ static PHP_MINFO_FUNCTION(json)
}
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, size_t len, int options TSRMLS_DC);
+static void json_escape_string(smart_str *buf, char *s, size_t len, int options);
-static int json_determine_array_type(zval *val TSRMLS_DC) /* {{{ */
+static int json_determine_array_type(zval *val) /* {{{ */
{
int i;
HashTable *myht = HASH_OF(val);
@@ -198,7 +204,7 @@ static int json_determine_array_type(zval *val TSRMLS_DC) /* {{{ */
/* {{{ Pretty printing support functions */
-static inline void json_pretty_print_char(smart_str *buf, int options, char c TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_char(smart_str *buf, int options, char c) /* {{{ */
{
if (options & PHP_JSON_PRETTY_PRINT) {
smart_str_appendc(buf, c);
@@ -206,7 +212,7 @@ static inline void json_pretty_print_char(smart_str *buf, int options, char c TS
}
/* }}} */
-static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_indent(smart_str *buf, int options) /* {{{ */
{
int i;
@@ -220,14 +226,14 @@ static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_D
/* }}} */
-static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+static void json_encode_array(smart_str *buf, zval *val, int options) /* {{{ */
{
int i, r, need_comma = 0;
HashTable *myht;
if (Z_TYPE_P(val) == IS_ARRAY) {
myht = HASH_OF(val);
- r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val TSRMLS_CC);
+ r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val);
} else {
myht = Z_OBJPROP_P(val);
r = PHP_JSON_OUTPUT_OBJECT;
@@ -269,9 +275,9 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
- php_json_encode(buf, data, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
+ php_json_encode(buf, data, options);
} else if (r == PHP_JSON_OUTPUT_OBJECT) {
if (key) {
if (key->val[0] == '\0' && Z_TYPE_P(val) == IS_OBJECT) {
@@ -288,15 +294,15 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
- json_escape_string(buf, key->val, key->len, options & ~PHP_JSON_NUMERIC_CHECK TSRMLS_CC);
+ json_escape_string(buf, key->val, key->len, options & ~PHP_JSON_NUMERIC_CHECK);
smart_str_appendc(buf, ':');
- json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
+ json_pretty_print_char(buf, options, ' ');
- php_json_encode(buf, data, options TSRMLS_CC);
+ php_json_encode(buf, data, options);
} else {
if (need_comma) {
smart_str_appendc(buf, ',');
@@ -304,17 +310,17 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
smart_str_appendc(buf, '"');
smart_str_append_long(buf, (zend_long) index);
smart_str_appendc(buf, '"');
smart_str_appendc(buf, ':');
- json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
+ json_pretty_print_char(buf, options, ' ');
- php_json_encode(buf, data, options TSRMLS_CC);
+ php_json_encode(buf, data, options);
}
}
@@ -331,8 +337,8 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
/* Only keep closing bracket on same line for empty arrays/objects */
if (need_comma) {
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
}
if (r == PHP_JSON_OUTPUT_ARRAY) {
@@ -380,7 +386,7 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{
}
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, size_t len, int options TSRMLS_DC) /* {{{ */
+static void json_escape_string(smart_str *buf, char *s, size_t len, int options) /* {{{ */
{
int status;
unsigned int us, next_us = 0;
@@ -550,7 +556,7 @@ static void json_escape_string(smart_str *buf, char *s, size_t len, int options
}
/* }}} */
-static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+static void json_encode_serializable_object(smart_str *buf, zval *val, int options) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(val);
zval retval, fname;
@@ -570,8 +576,8 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
ZVAL_STRING(&fname, "jsonSerialize");
- if (FAILURE == call_user_function_ex(EG(function_table), val, &fname, &retval, 0, NULL, 1, NULL TSRMLS_CC) || Z_TYPE(retval) == IS_UNDEF) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name->val);
+ if (FAILURE == call_user_function_ex(EG(function_table), val, &fname, &retval, 0, NULL, 1, NULL) || Z_TYPE(retval) == IS_UNDEF) {
+ zend_throw_exception_ex(NULL, 0, "Failed calling %s::jsonSerialize()", ce->name->val);
smart_str_appendl(buf, "null", sizeof("null") - 1);
zval_ptr_dtor(&fname);
return;
@@ -588,10 +594,10 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
if ((Z_TYPE(retval) == IS_OBJECT) &&
(Z_OBJ_HANDLE(retval) == Z_OBJ_HANDLE_P(val))) {
/* Handle the case where jsonSerialize does: return $this; by going straight to encode array */
- json_encode_array(buf, &retval, options TSRMLS_CC);
+ json_encode_array(buf, &retval, options);
} else {
/* All other types, encode as normal */
- php_json_encode(buf, &retval, options TSRMLS_CC);
+ php_json_encode(buf, &retval, options);
}
zval_ptr_dtor(&retval);
@@ -599,7 +605,7 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
}
/* }}} */
-PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options) /* {{{ */
{
again:
switch (Z_TYPE_P(val))
@@ -637,17 +643,17 @@ again:
break;
case IS_STRING:
- json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options TSRMLS_CC);
+ json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options);
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce TSRMLS_CC)) {
- json_encode_serializable_object(buf, val, options TSRMLS_CC);
+ if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce)) {
+ json_encode_serializable_object(buf, val, options);
break;
}
/* fallthrough -- Non-serializable object */
case IS_ARRAY:
- json_encode_array(buf, val, options TSRMLS_CC);
+ json_encode_array(buf, val, options);
break;
case IS_REFERENCE:
@@ -664,7 +670,7 @@ again:
}
/* }}} */
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth) /* {{{ */
{
size_t utf16_len;
unsigned short *utf16;
@@ -682,13 +688,13 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_l
}
if (depth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Depth must be greater than zero");
efree(utf16);
RETURN_NULL();
}
jp = new_JSON_parser(depth);
- if (!parse_JSON_ex(jp, return_value, utf16, utf16_len, options TSRMLS_CC)) {
+ if (!parse_JSON_ex(jp, return_value, utf16, utf16_len, options)) {
double d;
int type, overflow_info;
zend_long p;
@@ -774,7 +780,7 @@ static PHP_FUNCTION(json_encode)
zend_long options = 0;
zend_long depth = JSON_PARSER_DEFAULT_DEPTH;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &parameter, &options, &depth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &parameter, &options, &depth) == FAILURE) {
return;
}
@@ -782,7 +788,7 @@ static PHP_FUNCTION(json_encode)
JSON_G(encode_max_depth) = depth;
- php_json_encode(&buf, parameter, options TSRMLS_CC);
+ php_json_encode(&buf, parameter, options);
if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && !(options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) {
smart_str_free(&buf);
@@ -804,7 +810,7 @@ static PHP_FUNCTION(json_decode)
zend_long depth = JSON_PARSER_DEFAULT_DEPTH;
zend_long options = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
return;
}
@@ -821,7 +827,7 @@ static PHP_FUNCTION(json_decode)
options &= ~PHP_JSON_OBJECT_AS_ARRAY;
}
- php_json_decode_ex(return_value, str, str_len, options, depth TSRMLS_CC);
+ php_json_decode_ex(return_value, str, str_len, options, depth);
}
/* }}} */
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 5b2dc127dd..62eca734a2 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -44,13 +44,16 @@ ZEND_BEGIN_MODULE_GLOBALS(json)
ZEND_END_MODULE_GLOBALS(json)
#ifdef ZTS
-# define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v)
+# define JSON_G(v) ZEND_TSRMG(json_globals_id, zend_json_globals *, v)
+# ifdef COMPILE_DL_JSON
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define JSON_G(v) (json_globals.v)
#endif
-PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth TSRMLS_DC);
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options);
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth);
extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
@@ -74,9 +77,9 @@ extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
#define PHP_JSON_OBJECT_AS_ARRAY (1<<0)
#define PHP_JSON_BIGINT_AS_STRING (1<<1)
-static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth TSRMLS_DC)
+static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth)
{
- php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth TSRMLS_CC);
+ php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth);
}
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index f74de699ee..5fea1ce26e 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -92,7 +92,7 @@ static int le_link, le_result, le_result_entry;
ZEND_GET_MODULE(ldap)
#endif
-static void _close_ldap_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _close_ldap_link(zend_resource *rsrc) /* {{{ */
{
ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr;
@@ -105,14 +105,14 @@ static void _close_ldap_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _free_ldap_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _free_ldap_result(zend_resource *rsrc) /* {{{ */
{
LDAPMessage *result = (LDAPMessage *)rsrc->ptr;
ldap_msgfree(result);
}
/* }}} */
-static void _free_ldap_result_entry(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _free_ldap_result_entry(zend_resource *rsrc) /* {{{ */
{
ldap_resultentry *entry = (ldap_resultentry *)rsrc->ptr;
@@ -310,7 +310,7 @@ PHP_FUNCTION(ldap_connect)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) {
RETURN_FALSE;
}
@@ -318,13 +318,13 @@ PHP_FUNCTION(ldap_connect)
ssl = 1;
}
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &host, &hostlen, &port) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sl", &host, &hostlen, &port) != SUCCESS) {
RETURN_FALSE;
}
#endif
if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
RETURN_FALSE;
}
@@ -337,7 +337,7 @@ PHP_FUNCTION(ldap_connect)
rc = ldap_initialize(&ldap, host);
if (rc != LDAP_SUCCESS) {
efree(ld);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create session handle: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Could not create session handle: %s", ldap_err2string(rc));
RETURN_FALSE;
}
} else {
@@ -355,7 +355,7 @@ PHP_FUNCTION(ldap_connect)
if (ssl) {
if (ldap_init_SSL(&ldap->ld_sb, wallet, walletpasswd, authmode)) {
efree(ld);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL init failed");
+ php_error_docref(NULL, E_WARNING, "SSL init failed");
RETURN_FALSE;
}
}
@@ -415,7 +415,7 @@ PHP_FUNCTION(ldap_bind)
ldap_linkdata *ld;
int rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
RETURN_FALSE;
}
@@ -423,18 +423,18 @@ PHP_FUNCTION(ldap_bind)
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
+ php_error_docref(NULL, E_WARNING, "DN contains a null byte");
RETURN_FALSE;
}
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
+ php_error_docref(NULL, E_WARNING, "Password contains a null byte");
RETURN_FALSE;
}
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -543,7 +543,7 @@ PHP_FUNCTION(ldap_sasl_bind)
size_t rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, authz_id_len, props_len;
php_ldap_bictx *ctx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
RETURN_FALSE;
}
@@ -557,7 +557,7 @@ PHP_FUNCTION(ldap_sasl_bind)
rc = ldap_sasl_interactive_bind_s(ld->link, binddn, ctx->mech, NULL, NULL, LDAP_SASL_QUIET, _php_sasl_interact, ctx);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -574,7 +574,7 @@ PHP_FUNCTION(ldap_unbind)
zval *link;
ldap_linkdata *ld;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
RETURN_FALSE;
}
@@ -637,7 +637,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
int old_ldap_sizelimit = -1, old_ldap_timelimit = -1, old_ldap_deref = -1;
int num_attribs = 0, ret = 1, i, errno, argcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argcount TSRMLS_CC, "zzz|allll", &link, &base_dn, &filter, &attrs, &attrsonly,
+ if (zend_parse_parameters(argcount, "zzz|allll", &link, &base_dn, &filter, &attrs, &attrsonly,
&sizelimit, &timelimit, &deref) == FAILURE) {
return;
}
@@ -658,7 +658,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
for (i = 0; i<num_attribs; i++) {
if ((attr = zend_hash_index_find(Z_ARRVAL_P(attrs), i)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array initialization wrong");
+ php_error_docref(NULL, E_WARNING, "Array initialization wrong");
ret = 0;
goto cleanup;
}
@@ -680,7 +680,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
nlinks = zend_hash_num_elements(Z_ARRVAL_P(link));
if (nlinks == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No links in link array");
+ php_error_docref(NULL, E_WARNING, "No links in link array");
ret = 0;
goto cleanup;
}
@@ -688,7 +688,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
if (Z_TYPE_P(base_dn) == IS_ARRAY) {
nbases = zend_hash_num_elements(Z_ARRVAL_P(base_dn));
if (nbases != nlinks) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Base must either be a string, or an array with the same number of elements as the links array");
+ php_error_docref(NULL, E_WARNING, "Base must either be a string, or an array with the same number of elements as the links array");
ret = 0;
goto cleanup;
}
@@ -706,7 +706,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
if (Z_TYPE_P(filter) == IS_ARRAY) {
nfilters = zend_hash_num_elements(Z_ARRVAL_P(filter));
if (nfilters != nlinks) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter must either be a string, or an array with the same number of elements as the links array");
+ php_error_docref(NULL, E_WARNING, "Filter must either be a string, or an array with the same number of elements as the links array");
ret = 0;
goto cleanup;
}
@@ -724,7 +724,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
for (i=0; i<nlinks; i++) {
entry = zend_hash_get_current_data(Z_ARRVAL_P(link));
- ld = (ldap_linkdata *) zend_fetch_resource(entry TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(entry, -1, "ldap link", NULL, 1, le_link);
if (ld == NULL) {
ret = 0;
goto cleanup_parallel;
@@ -782,7 +782,7 @@ cleanup_parallel:
ldap_base_dn = Z_STRVAL_P(base_dn);
}
- ld = (ldap_linkdata *) zend_fetch_resource(link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(link, -1, "ldap link", NULL, 1, le_link);
if (ld == NULL) {
ret = 0;
goto cleanup;
@@ -802,15 +802,15 @@ cleanup_parallel:
&& errno != LDAP_REFERRAL
#endif
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search: %s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "Search: %s", ldap_err2string(errno));
ret = 0;
} else {
if (errno == LDAP_SIZELIMIT_EXCEEDED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Sizelimit exceeded");
+ php_error_docref(NULL, E_WARNING, "Partial search results returned: Sizelimit exceeded");
}
#ifdef LDAP_ADMINLIMIT_EXCEEDED
else if (errno == LDAP_ADMINLIMIT_EXCEEDED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Adminlimit exceeded");
+ php_error_docref(NULL, E_WARNING, "Partial search results returned: Adminlimit exceeded");
}
#endif
@@ -863,7 +863,7 @@ PHP_FUNCTION(ldap_free_result)
zval *result;
LDAPMessage *ldap_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) != SUCCESS) {
return;
}
@@ -882,7 +882,7 @@ PHP_FUNCTION(ldap_count_entries)
ldap_linkdata *ld;
LDAPMessage *ldap_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -902,7 +902,7 @@ PHP_FUNCTION(ldap_first_entry)
ldap_resultentry *resultentry;
LDAPMessage *ldap_result, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -930,7 +930,7 @@ PHP_FUNCTION(ldap_next_entry)
ldap_resultentry *resultentry, *resultentry_next;
LDAPMessage *entry_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -965,7 +965,7 @@ PHP_FUNCTION(ldap_get_entries)
struct berval **ldap_value;
char *dn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -1052,7 +1052,7 @@ PHP_FUNCTION(ldap_first_attribute)
char *attribute;
zend_long dummy_ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
return;
}
@@ -1080,7 +1080,7 @@ PHP_FUNCTION(ldap_next_attribute)
char *attribute;
zend_long dummy_ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
return;
}
@@ -1088,7 +1088,7 @@ PHP_FUNCTION(ldap_next_attribute)
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry);
if (resultentry->ber == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "called before calling ldap_first_attribute() or no attributes found in result entry");
+ php_error_docref(NULL, E_WARNING, "called before calling ldap_first_attribute() or no attributes found in result entry");
RETURN_FALSE;
}
@@ -1122,7 +1122,7 @@ PHP_FUNCTION(ldap_get_attributes)
int i, num_values, num_attrib;
BerElement *ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -1175,7 +1175,7 @@ PHP_FUNCTION(ldap_get_values_len)
int i, num_values;
size_t attr_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result_entry, &attr, &attr_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result_entry, &attr, &attr_len) != SUCCESS) {
return;
}
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(ldap_get_values_len)
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry);
if ((ldap_value_len = ldap_get_values_len(ld->link, resultentry->data, attr)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link)));
+ php_error_docref(NULL, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link)));
RETURN_FALSE;
}
@@ -1209,7 +1209,7 @@ PHP_FUNCTION(ldap_get_dn)
ldap_resultentry *resultentry;
char *text;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -1239,7 +1239,7 @@ PHP_FUNCTION(ldap_explode_dn)
int i, count;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &dn, &dn_len, &with_attrib) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &dn, &dn_len, &with_attrib) != SUCCESS) {
return;
}
@@ -1270,7 +1270,7 @@ PHP_FUNCTION(ldap_dn2ufn)
char *dn, *ufn;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dn, &dn_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &dn, &dn_len) != SUCCESS) {
return;
}
@@ -1305,7 +1305,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
zend_ulong index;
int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
return;
}
@@ -1331,7 +1331,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index, 0) == HASH_KEY_IS_STRING) {
ldap_mods[i]->mod_type = estrndup(attribute->val, attribute->len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown attribute in the data");
+ php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
/* Free allocated memory */
while (i >= 0) {
if (ldap_mods[i]->mod_type) {
@@ -1365,7 +1365,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
} else {
for (j = 0; j < num_values; j++) {
if ((ivalue = zend_hash_index_find(Z_ARRVAL_P(value), j)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Value array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "Value array must have consecutive indices 0, 1, ...");
num_berval[i] = j;
num_attribs = i + 1;
RETVAL_FALSE;
@@ -1385,12 +1385,12 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
/* check flag to see if do_mod was called to perform full add , gerrit thomson */
if (is_full_add == 1) {
if ((i = ldap_add_s(ld->link, dn, ldap_mods)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Add: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Add: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
} else {
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modify: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
}
@@ -1456,14 +1456,14 @@ PHP_FUNCTION(ldap_delete)
int rc;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &link, &dn, &dn_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link, &dn, &dn_len) != SUCCESS) {
return;
}
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
if ((rc = ldap_delete_s(ld->link, dn)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delete: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Delete: %s", ldap_err2string(rc));
RETURN_FALSE;
}
@@ -1553,7 +1553,7 @@ PHP_FUNCTION(ldap_modify_batch)
);
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
return;
}
@@ -1569,14 +1569,14 @@ PHP_FUNCTION(ldap_modify_batch)
/* make sure the DN contains no NUL bytes */
if (_ldap_strlen_max(dn, dn_len) != dn_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN must not contain NUL bytes");
+ php_error_docref(NULL, E_WARNING, "DN must not contain NUL bytes");
RETURN_FALSE;
}
/* make sure the top level is a normal array */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(mods));
if (zend_hash_get_current_key_type(Z_ARRVAL_P(mods)) != HASH_KEY_IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must not be string-indexed");
+ php_error_docref(NULL, E_WARNING, "Modifications array must not be string-indexed");
RETURN_FALSE;
}
@@ -1585,14 +1585,14 @@ PHP_FUNCTION(ldap_modify_batch)
for (i = 0; i < num_mods; i++) {
/* is the numbering consecutive? */
if ((fetched = zend_hash_index_find(Z_ARRVAL_P(mods), i)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "Modifications array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
mod = fetched;
/* is it an array? */
if (Z_TYPE_P(mod) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be an array itself");
+ php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be an array itself");
RETURN_FALSE;
}
@@ -1603,7 +1603,7 @@ PHP_FUNCTION(ldap_modify_batch)
for (j = 0; j < num_modprops; j++) {
/* are the keys strings? */
if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong, 0) != HASH_KEY_IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be string-indexed");
+ php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be string-indexed");
RETURN_FALSE;
}
@@ -1613,7 +1613,7 @@ PHP_FUNCTION(ldap_modify_batch)
!_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE) &&
!_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
+ php_error_docref(NULL, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
RETURN_FALSE;
}
@@ -1623,18 +1623,18 @@ PHP_FUNCTION(ldap_modify_batch)
/* does the value type match the key? */
if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_ATTRIB)) {
if (Z_TYPE_P(modinfo) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
RETURN_FALSE;
}
if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
RETURN_FALSE;
}
}
else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE)) {
if (Z_TYPE_P(modinfo) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
RETURN_FALSE;
}
@@ -1646,27 +1646,27 @@ PHP_FUNCTION(ldap_modify_batch)
modtype != LDAP_MODIFY_BATCH_REPLACE &&
modtype != LDAP_MODIFY_BATCH_REMOVE_ALL
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants");
+ php_error_docref(NULL, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants");
RETURN_FALSE;
}
/* if it's REMOVE_ALL, there must not be a values array; otherwise, there must */
if (modtype == LDAP_MODIFY_BATCH_REMOVE_ALL) {
if (zend_hash_str_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided");
+ php_error_docref(NULL, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided");
RETURN_FALSE;
}
}
else {
if (!zend_hash_str_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided");
+ php_error_docref(NULL, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided");
RETURN_FALSE;
}
}
}
else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)) {
if (Z_TYPE_P(modinfo) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
RETURN_FALSE;
}
@@ -1674,27 +1674,27 @@ PHP_FUNCTION(ldap_modify_batch)
zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo));
num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo));
if (num_modvals == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element");
RETURN_FALSE;
}
/* are its keys integers? */
if (zend_hash_get_current_key_type(Z_ARRVAL_P(modinfo)) != HASH_KEY_IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed");
RETURN_FALSE;
}
/* are the keys consecutive? */
for (k = 0; k < num_modvals; k++) {
if ((fetched = zend_hash_index_find(Z_ARRVAL_P(modinfo), k)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
modval = fetched;
/* is the data element a string? */
if (Z_TYPE_P(modval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string");
+ php_error_docref(NULL, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string");
RETURN_FALSE;
}
}
@@ -1735,7 +1735,7 @@ PHP_FUNCTION(ldap_modify_batch)
oper = LDAP_MOD_REPLACE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown and uncaught modification type.");
+ php_error_docref(NULL, E_ERROR, "Unknown and uncaught modification type.");
RETURN_FALSE;
}
@@ -1776,7 +1776,7 @@ PHP_FUNCTION(ldap_modify_batch)
/* perform (finally) */
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
@@ -1817,7 +1817,7 @@ PHP_FUNCTION(ldap_errno)
zval *link;
ldap_linkdata *ld;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -1833,7 +1833,7 @@ PHP_FUNCTION(ldap_err2str)
{
zend_long perrno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &perrno) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &perrno) != SUCCESS) {
return;
}
@@ -1849,7 +1849,7 @@ PHP_FUNCTION(ldap_error)
ldap_linkdata *ld;
int ld_errno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -1871,7 +1871,7 @@ PHP_FUNCTION(ldap_compare)
ldap_linkdata *ld;
int errno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len) != SUCCESS) {
return;
}
@@ -1889,7 +1889,7 @@ PHP_FUNCTION(ldap_compare)
break;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Compare: %s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "Compare: %s", ldap_err2string(errno));
RETURN_LONG(-1);
}
/* }}} */
@@ -1904,19 +1904,19 @@ PHP_FUNCTION(ldap_sort)
size_t sflen;
zend_resource *le;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
if ((le = zend_hash_index_find_ptr(&EG(regular_list), Z_RES_HANDLE_P(result))) == NULL || le->type != le_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied resource is not a valid ldap result resource");
+ php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource");
RETURN_FALSE;
}
if (ldap_sort_entries(ld->link, (LDAPMessage **) &le->ptr, sflen ? sortfilter : NULL, strcmp) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "%s", ldap_err2string(errno));
RETURN_FALSE;
}
@@ -1933,7 +1933,7 @@ PHP_FUNCTION(ldap_get_option)
ldap_linkdata *ld;
zend_long option;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz/", &link, &option, &retval) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz/", &link, &option, &retval) != SUCCESS) {
return;
}
@@ -2038,7 +2038,7 @@ PHP_FUNCTION(ldap_set_option)
LDAP *ldap;
zend_long option;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlz", &link, &option, &newval) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zlz", &link, &option, &newval) != SUCCESS) {
return;
}
@@ -2138,7 +2138,7 @@ PHP_FUNCTION(ldap_set_option)
char error=0;
if ((Z_TYPE_P(newval) != IS_ARRAY) || !(ncontrols = zend_hash_num_elements(Z_ARRVAL_P(newval)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected non-empty array value for this option");
+ php_error_docref(NULL, E_WARNING, "Expected non-empty array value for this option");
RETURN_FALSE;
}
ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
@@ -2146,12 +2146,12 @@ PHP_FUNCTION(ldap_set_option)
ctrlp = ctrls;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(newval), ctrlval) {
if (Z_TYPE_P(ctrlval) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array value must contain only arrays, where each array is a control");
+ php_error_docref(NULL, E_WARNING, "The array value must contain only arrays, where each array is a control");
error = 1;
break;
}
if ((val = zend_hash_str_find(Z_ARRVAL_P(ctrlval), "oid", sizeof("oid") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Control must have an oid key");
+ php_error_docref(NULL, E_WARNING, "Control must have an oid key");
error = 1;
break;
}
@@ -2208,7 +2208,7 @@ PHP_FUNCTION(ldap_parse_result)
char *lmatcheddn, *lerrmsg;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz/|z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/|z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals) != SUCCESS) {
return;
}
@@ -2222,7 +2222,7 @@ PHP_FUNCTION(ldap_parse_result)
NULL /* &serverctrls */,
0);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc));
RETURN_FALSE;
}
@@ -2273,7 +2273,7 @@ PHP_FUNCTION(ldap_first_reference)
ldap_resultentry *resultentry;
LDAPMessage *ldap_result, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -2301,7 +2301,7 @@ PHP_FUNCTION(ldap_next_reference)
ldap_resultentry *resultentry, *resultentry_next;
LDAPMessage *entry_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -2330,7 +2330,7 @@ PHP_FUNCTION(ldap_parse_reference)
ldap_resultentry *resultentry;
char **lreferrals, **refp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz/", &link, &result_entry, &referrals) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/", &link, &result_entry, &referrals) != SUCCESS) {
return;
}
@@ -2367,7 +2367,7 @@ PHP_FUNCTION(ldap_rename)
size_t dn_len, newrdn_len, newparent_len;
zend_bool deleteoldrdn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsssb", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsssb", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn) != SUCCESS) {
return;
}
@@ -2381,7 +2381,7 @@ PHP_FUNCTION(ldap_rename)
rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, NULL, NULL);
#else
if (newparent_len != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN");
+ php_error_docref(NULL, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN");
RETURN_FALSE;
}
/* could support old APIs but need check for ldap_modrdn2()/ldap_modrdn() */
@@ -2404,7 +2404,7 @@ PHP_FUNCTION(ldap_start_tls)
ldap_linkdata *ld;
int rc, protocol = LDAP_VERSION3;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -2413,7 +2413,7 @@ PHP_FUNCTION(ldap_start_tls)
if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) != LDAP_SUCCESS) ||
((rc = ldap_start_tls_s(ld->link, NULL, NULL)) != LDAP_SUCCESS)
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to start TLS: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING,"Unable to start TLS: %s", ldap_err2string(rc));
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -2433,25 +2433,24 @@ int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgi
zval cb_args[2];
zval cb_retval;
zval *cb_link = (zval *) params;
- TSRMLS_FETCH();
- ld = (ldap_linkdata *) zend_fetch_resource(cb_link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(cb_link, -1, "ldap link", NULL, 1, le_link);
/* link exists and callback set? */
if (ld == NULL || Z_ISUNDEF(ld->rebindproc)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link not found or no callback set");
+ php_error_docref(NULL, E_WARNING, "Link not found or no callback set");
return LDAP_OTHER;
}
/* callback */
ZVAL_COPY_VALUE(&cb_args[0], cb_link);
ZVAL_STRING(&cb_args[1], url);
- if (call_user_function_ex(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL TSRMLS_CC) == SUCCESS && !Z_ISUNDEF(cb_retval)) {
+ if (call_user_function_ex(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL) == SUCCESS && !Z_ISUNDEF(cb_retval)) {
convert_to_long_ex(&cb_retval);
retval = Z_LVAL(cb_retval);
zval_ptr_dtor(&cb_retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "rebind_proc PHP callback failed");
+ php_error_docref(NULL, E_WARNING, "rebind_proc PHP callback failed");
retval = LDAP_OTHER;
}
zval_ptr_dtor(&cb_args[1]);
@@ -2467,7 +2466,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
ldap_linkdata *ld;
zend_string *callback_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &link, &callback) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &link, &callback) != SUCCESS) {
RETURN_FALSE;
}
@@ -2484,8 +2483,8 @@ PHP_FUNCTION(ldap_set_rebind_proc)
}
/* callable? */
- if (!zend_is_callable(callback, 0, &callback_name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Two arguments expected for '%s' to be a valid callback", callback_name->val);
+ if (!zend_is_callable(callback, 0, &callback_name)) {
+ php_error_docref(NULL, E_WARNING, "Two arguments expected for '%s' to be a valid callback", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
}
@@ -2549,7 +2548,7 @@ PHP_FUNCTION(ldap_escape)
zend_long flags = 0;
zend_bool map[256] = {0}, havecharlist = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) {
return;
}
@@ -2591,7 +2590,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
char *value;
int result, ldap_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) != SUCCESS) {
return;
}
@@ -2609,7 +2608,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
RETVAL_STRINGL(value, value_len);
free(value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Conversion from iso-8859-1 to t61 failed: %s", ldap_err2string(result));
+ php_error_docref(NULL, E_WARNING, "Conversion from iso-8859-1 to t61 failed: %s", ldap_err2string(result));
RETVAL_FALSE;
}
}
@@ -2649,7 +2648,7 @@ PHP_FUNCTION(ldap_control_paged_result)
LDAPControl ctrl, *ctrlsp[2];
int rc, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|bs", &link, &pagesize, &iscritical, &cookie, &cookie_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|bs", &link, &pagesize, &iscritical, &cookie, &cookie_len) != SUCCESS) {
return;
}
@@ -2662,7 +2661,7 @@ PHP_FUNCTION(ldap_control_paged_result)
ber = ber_alloc_t(LBER_USE_DER);
if (ber == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to alloc BER encoding resources for paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to alloc BER encoding resources for paged results control");
RETURN_FALSE;
}
@@ -2679,13 +2678,13 @@ PHP_FUNCTION(ldap_control_paged_result)
}
if (ber_printf(ber, "{iO}", (int)pagesize, &lcookie) == LBER_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to BER printf paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to BER printf paged results control");
RETVAL_FALSE;
goto lcpr_error_out;
}
rc = ber_flatten2(ber, &ctrl.ldctl_value, 0);
if (rc == LBER_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to BER encode paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to BER encode paged results control");
RETVAL_FALSE;
goto lcpr_error_out;
}
@@ -2699,7 +2698,7 @@ PHP_FUNCTION(ldap_control_paged_result)
rc = ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, ctrlsp);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set paged results control: %s (%d)", ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Unable to set paged results control: %s (%d)", ldap_err2string(rc), rc);
RETVAL_FALSE;
goto lcpr_error_out;
}
@@ -2739,7 +2738,7 @@ PHP_FUNCTION(ldap_control_paged_result_response)
ber_tag_t tag;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|z/z/", &link, &result, &cookie, &estimated) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|z/z/", &link, &result, &cookie, &estimated) != SUCCESS) {
return;
}
@@ -2756,31 +2755,31 @@ PHP_FUNCTION(ldap_control_paged_result_response)
0);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse result: %s (%d)", ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Unable to parse result: %s (%d)", ldap_err2string(rc), rc);
RETURN_FALSE;
}
if (lerrcode != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result is: %s (%d)", ldap_err2string(lerrcode), lerrcode);
+ php_error_docref(NULL, E_WARNING, "Result is: %s (%d)", ldap_err2string(lerrcode), lerrcode);
RETURN_FALSE;
}
if (lserverctrls == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No server controls in result");
+ php_error_docref(NULL, E_WARNING, "No server controls in result");
RETURN_FALSE;
}
lctrl = ldap_find_control(LDAP_CONTROL_PAGEDRESULTS, lserverctrls);
if (lctrl == NULL) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No paged results control response in result");
+ php_error_docref(NULL, E_WARNING, "No paged results control response in result");
RETURN_FALSE;
}
ber = ber_init(&lctrl->ldctl_value);
if (ber == NULL) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to alloc BER decoding resources for paged results control response");
+ php_error_docref(NULL, E_WARNING, "Unable to alloc BER decoding resources for paged results control response");
RETURN_FALSE;
}
@@ -2789,13 +2788,13 @@ PHP_FUNCTION(ldap_control_paged_result_response)
if (tag == LBER_ERROR) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode paged results control response");
+ php_error_docref(NULL, E_WARNING, "Unable to decode paged results control response");
RETURN_FALSE;
}
if (lestimated < 0) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid paged results control response value");
+ php_error_docref(NULL, E_WARNING, "Invalid paged results control response value");
RETURN_FALSE;
}
diff --git a/ext/libxml/config.w32 b/ext/libxml/config.w32
index 92144f9ad0..e6ad0dc1ab 100644
--- a/ext/libxml/config.w32
+++ b/ext/libxml/config.w32
@@ -9,7 +9,7 @@ if (PHP_LIBXML == "yes") {
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML") &&
ADD_EXTENSION_DEP('libxml', 'iconv')) {
- EXTENSION("libxml", "libxml.c", false /* never shared */);
+ EXTENSION("libxml", "libxml.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS ");
if (!PHP_LIBXML_SHARED) {
diff --git a/ext/libxml/config0.m4 b/ext/libxml/config0.m4
index 14f5868493..79e94a40ad 100644
--- a/ext/libxml/config0.m4
+++ b/ext/libxml/config0.m4
@@ -17,7 +17,7 @@ if test "$PHP_LIBXML" != "no"; then
PHP_SETUP_LIBXML(LIBXML_SHARED_LIBADD, [
AC_DEFINE(HAVE_LIBXML,1,[ ])
- PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared)
+ PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 3e4fb60825..07502433f8 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -79,6 +79,9 @@ static zend_class_entry *libxmlerror_class_entry;
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_LIBXML
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(libxml)
#endif /* COMPILE_DL_LIBXML */
/* }}} */
@@ -152,16 +155,16 @@ zend_module_entry libxml_module_entry = {
/* }}} */
/* {{{ internal functions for interoperability */
-static int php_libxml_clear_object(php_libxml_node_object *object TSRMLS_DC)
+static int php_libxml_clear_object(php_libxml_node_object *object)
{
if (object->properties) {
object->properties = NULL;
}
- php_libxml_decrement_node_ptr(object TSRMLS_CC);
- return php_libxml_decrement_doc_ref(object TSRMLS_CC);
+ php_libxml_decrement_node_ptr(object);
+ return php_libxml_decrement_doc_ref(object);
}
-static int php_libxml_unregister_node(xmlNodePtr nodep TSRMLS_DC)
+static int php_libxml_unregister_node(xmlNodePtr nodep)
{
php_libxml_node_object *wrapper;
@@ -170,7 +173,7 @@ static int php_libxml_unregister_node(xmlNodePtr nodep TSRMLS_DC)
if (nodeptr != NULL) {
wrapper = nodeptr->_private;
if (wrapper) {
- php_libxml_clear_object(wrapper TSRMLS_CC);
+ php_libxml_clear_object(wrapper);
} else {
if (nodeptr->node != NULL && nodeptr->node->type != XML_DOCUMENT_NODE) {
nodeptr->node->_private = NULL;
@@ -221,7 +224,7 @@ static void php_libxml_node_free(xmlNodePtr node)
}
}
-static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
+static void php_libxml_node_free_list(xmlNodePtr node)
{
xmlNodePtr curnode;
@@ -235,7 +238,7 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
case XML_ENTITY_DECL:
break;
case XML_ENTITY_REF_NODE:
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
break;
case XML_ATTRIBUTE_NODE:
if ((node->doc != NULL) && (((xmlAttrPtr) node)->atype == XML_ATTRIBUTE_ID)) {
@@ -246,16 +249,16 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
case XML_DOCUMENT_TYPE_NODE:
case XML_NAMESPACE_DECL:
case XML_TEXT_NODE:
- php_libxml_node_free_list(node->children TSRMLS_CC);
+ php_libxml_node_free_list(node->children);
break;
default:
- php_libxml_node_free_list(node->children TSRMLS_CC);
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list(node->children);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
}
curnode = node->next;
xmlUnlinkNode(node);
- if (php_libxml_unregister_node(node TSRMLS_CC) == 0) {
+ if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_node_free(node);
@@ -268,6 +271,9 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
/* {{{ startup, shutdown and info functions */
static PHP_GINIT_FUNCTION(libxml)
{
+#if defined(COMPILE_DL_LIBXML) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
ZVAL_UNDEF(&libxml_globals->stream_context);
libxml_globals->error_buffer.s = NULL;
libxml_globals->error_list = NULL;
@@ -302,7 +308,6 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
int isescaped=0;
xmlURI *uri;
- TSRMLS_FETCH();
uri = xmlParseURI(filename);
if (uri && (uri->scheme == NULL ||
@@ -327,9 +332,9 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
that the streams layer puts out at times, but for libxml we
may try to open files that don't exist, but it is not a failure
in xml processing (eg. DTD files) */
- wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 0);
if (wrapper && read_only && wrapper->wops->url_stat) {
- if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) {
+ if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL) == -1) {
if (isescaped) {
xmlFree(resolved_path);
}
@@ -358,19 +363,16 @@ static void *php_libxml_streams_IO_open_write_wrapper(const char *filename)
static int php_libxml_streams_IO_read(void *context, char *buffer, int len)
{
- TSRMLS_FETCH();
return php_stream_read((php_stream*)context, buffer, len);
}
static int php_libxml_streams_IO_write(void *context, const char *buffer, int len)
{
- TSRMLS_FETCH();
return php_stream_write((php_stream*)context, buffer, len);
}
static int php_libxml_streams_IO_close(void *context)
{
- TSRMLS_FETCH();
return php_stream_close((php_stream*)context);
}
@@ -379,7 +381,6 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
xmlParserInputBufferPtr ret;
void *context = NULL;
- TSRMLS_FETCH();
if (LIBXML(entity_loader_disabled)) {
return NULL;
@@ -463,7 +464,6 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
xmlError error_copy;
int ret;
- TSRMLS_FETCH();
memset(&error_copy, 0, sizeof(xmlError));
@@ -491,7 +491,7 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
}
}
-static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSRMLS_DC)
+static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg)
{
xmlParserCtxtPtr parser;
@@ -499,19 +499,19 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSR
if (parser != NULL && parser->input != NULL) {
if (parser->input->filename) {
- php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line);
+ php_error_docref(NULL, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line);
} else {
- php_error_docref(NULL TSRMLS_CC, level, "%s in Entity, line: %d", msg, parser->input->line);
+ php_error_docref(NULL, level, "%s in Entity, line: %d", msg, parser->input->line);
}
}
}
-void php_libxml_issue_error(int level, const char *msg TSRMLS_DC)
+void php_libxml_issue_error(int level, const char *msg)
{
if (LIBXML(error_list)) {
_php_list_set_error_structure(NULL, msg);
} else {
- php_error_docref(NULL TSRMLS_CC, level, "%s", msg);
+ php_error_docref(NULL, level, "%s", msg);
}
}
@@ -520,7 +520,6 @@ static void php_libxml_internal_error_handler(int error_type, void *ctx, const c
char *buf;
int len, len_iter, output = 0;
- TSRMLS_FETCH();
len = vspprintf(&buf, 0, *msg, ap);
len_iter = len;
@@ -541,13 +540,13 @@ static void php_libxml_internal_error_handler(int error_type, void *ctx, const c
} else {
switch (error_type) {
case PHP_LIBXML_CTX_ERROR:
- php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).s->val TSRMLS_CC);
+ php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).s->val);
break;
case PHP_LIBXML_CTX_WARNING:
- php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).s->val TSRMLS_CC);
+ php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).s->val);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", LIBXML(error_buffer).s->val);
+ php_error_docref(NULL, E_WARNING, "%s", LIBXML(error_buffer).s->val);
}
}
smart_str_free(&LIBXML(error_buffer));
@@ -563,7 +562,6 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
zval params[3];
int status;
zend_fcall_info *fci;
- TSRMLS_FETCH();
fci = &LIBXML(entity_loader).fci;
@@ -605,7 +603,7 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
fci->param_count = sizeof(params)/sizeof(*params);
fci->no_separation = 1;
- status = zend_call_function(fci, &LIBXML(entity_loader).fcc TSRMLS_CC);
+ status = zend_call_function(fci, &LIBXML(entity_loader).fcc);
if (status != SUCCESS || Z_ISUNDEF(retval)) {
php_libxml_ctx_error(context,
"Call to user entity loader callback '%s' has failed",
@@ -680,7 +678,6 @@ is_string:
static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
const char *ID, xmlParserCtxtPtr context)
{
- TSRMLS_FETCH();
/* Check whether we're running in a PHP context, since the entity loader
* we've defined is an application level (true global) setting.
@@ -763,7 +760,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
}
}
-PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext)
{
if (oldcontext) {
ZVAL_COPY_VALUE(oldcontext, &LIBXML(stream_context));
@@ -826,7 +823,7 @@ static PHP_MINIT_FUNCTION(libxml)
REGISTER_LONG_CONSTANT("LIBXML_ERR_FATAL", XML_ERR_FATAL, CONST_CS | CONST_PERSISTENT);
INIT_CLASS_ENTRY(ce, "LibXMLError", NULL);
- libxmlerror_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ libxmlerror_class_entry = zend_register_internal_class(&ce);
if (sapi_module.name) {
static const char * const supported_sapis[] = {
@@ -889,7 +886,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml)
static int php_libxml_post_deactivate(void)
{
- TSRMLS_FETCH();
/* reset libxml generic error handling */
if (_php_libxml_per_request_initialization) {
xmlSetGenericErrorFunc(NULL, NULL);
@@ -930,7 +926,7 @@ static PHP_FUNCTION(libxml_set_streams_context)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg) == FAILURE) {
return;
}
if (!Z_ISUNDEF(LIBXML(stream_context))) {
@@ -948,7 +944,7 @@ static PHP_FUNCTION(libxml_use_internal_errors)
xmlStructuredErrorFunc current_handler;
zend_bool use_errors=0, retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &use_errors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &use_errors) == FAILURE) {
return;
}
@@ -1030,20 +1026,20 @@ static PHP_FUNCTION(libxml_get_errors)
zval z_error;
object_init_ex(&z_error, libxmlerror_class_entry);
- add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level TSRMLS_CC);
- add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code TSRMLS_CC);
- add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 TSRMLS_CC);
+ add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level);
+ add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code);
+ add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 );
if (error->message) {
- add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message TSRMLS_CC);
+ add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message);
} else {
- add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0 TSRMLS_CC);
+ add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0);
}
if (error->file) {
- add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file TSRMLS_CC);
+ add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file);
} else {
- add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0 TSRMLS_CC);
+ add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0);
}
- add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line TSRMLS_CC);
+ add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line);
add_next_index_zval(return_value, &z_error);
error = zend_llist_get_next(LIBXML(error_list));
@@ -1063,7 +1059,7 @@ static PHP_FUNCTION(libxml_clear_errors)
}
/* }}} */
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC) /* {{{ */
+PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable) /* {{{ */
{
zend_bool old = LIBXML(entity_loader_disabled);
@@ -1077,11 +1073,11 @@ static PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &disable) == FAILURE) {
return;
}
- RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC));
+ RETURN_BOOL(php_libxml_disable_entity_loader(disable));
}
/* }}} */
@@ -1091,7 +1087,7 @@ static PHP_FUNCTION(libxml_set_external_entity_loader)
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!", &fci, &fcc)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc)
== FAILURE) {
return;
}
@@ -1150,7 +1146,7 @@ zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node ex
return zend_hash_add_mem(&php_libxml_exports, ce->name, &export_hnd, sizeof(export_hnd));
}
-PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
+PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object)
{
zend_class_entry *ce = NULL;
xmlNodePtr node = NULL;
@@ -1162,13 +1158,13 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
ce = ce->parent;
}
if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name))) {
- node = export_hnd->export_func(object TSRMLS_CC);
+ node = export_hnd->export_func(object);
}
}
return node;
}
-PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data)
{
int ret_refcount = -1;
@@ -1177,7 +1173,7 @@ PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object,
if (object->node->node == node) {
return object->node->refcount;
} else {
- php_libxml_decrement_node_ptr(object TSRMLS_CC);
+ php_libxml_decrement_node_ptr(object);
}
}
if (node->_private != NULL) {
@@ -1200,7 +1196,7 @@ PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object,
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object)
{
int ret_refcount = -1;
php_libxml_node_ptr *obj_node;
@@ -1220,7 +1216,7 @@ PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp)
{
int ret_refcount = -1;
@@ -1238,7 +1234,7 @@ PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object,
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object)
{
int ret_refcount = -1;
@@ -1263,7 +1259,7 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object T
return ret_refcount;
}
-PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node)
{
if (!node) {
return;
@@ -1275,7 +1271,7 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
break;
default:
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
- php_libxml_node_free_list((xmlNodePtr) node->children TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->children);
switch (node->type) {
/* Skip property freeing for the following types */
case XML_ATTRIBUTE_DECL:
@@ -1287,19 +1283,19 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
case XML_TEXT_NODE:
break;
default:
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
}
- if (php_libxml_unregister_node(node TSRMLS_CC) == 0) {
+ if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_node_free(node);
} else {
- php_libxml_unregister_node(node TSRMLS_CC);
+ php_libxml_unregister_node(node);
}
}
}
-PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object)
{
int ret_refcount = -1;
xmlNodePtr nodep;
@@ -1308,9 +1304,9 @@ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *o
if (object != NULL && object->node != NULL) {
obj_node = (php_libxml_node_ptr *) object->node;
nodep = object->node->node;
- ret_refcount = php_libxml_decrement_node_ptr(object TSRMLS_CC);
+ ret_refcount = php_libxml_decrement_node_ptr(object);
if (ret_refcount == 0) {
- php_libxml_node_free_resource(nodep TSRMLS_CC);
+ php_libxml_node_free_resource(nodep);
} else {
if (obj_node && object == obj_node->_private) {
obj_node->_private = NULL;
@@ -1319,7 +1315,7 @@ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *o
}
if (object != NULL && object->document != NULL) {
/* Safe to call as if the resource were freed then doc pointer is NULL */
- php_libxml_decrement_doc_ref(object TSRMLS_CC);
+ php_libxml_decrement_doc_ref(object);
}
}
/* }}} */
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index cccc83f8db..9bd2170540 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -88,32 +88,35 @@ static inline php_libxml_node_object *php_libxml_node_fetch_object(zend_object *
#define Z_LIBXML_NODE_P(zv) php_libxml_node_fetch_object(Z_OBJ_P((zv)))
-typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC);
+typedef void * (*php_libxml_export_node) (zval *object);
-PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC);
-PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC);
+PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data);
+PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object);
+PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp);
+PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object);
+PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object);
PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
/* When an explicit freeing of node and children is required */
-PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node);
/* When object dtor is called as node may still be referenced */
-PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object);
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...);
PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
-PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext TSRMLS_DC);
-PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext);
+PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg);
+PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize(void);
PHP_LIBXML_API void php_libxml_shutdown(void);
#ifdef ZTS
-#define LIBXML(v) TSRMG(libxml_globals_id, zend_libxml_globals *, v)
+#define LIBXML(v) ZEND_TSRMG(libxml_globals_id, zend_libxml_globals *, v)
+#ifdef COMPILE_DL_LIBXML
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define LIBXML(v) (libxml_globals.v)
#endif
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4
index 25bf238761..bd88ee4b63 100644
--- a/ext/mbstring/config.m4
+++ b/ext/mbstring/config.m4
@@ -31,7 +31,7 @@ AC_DEFUN([PHP_MBSTRING_ADD_INSTALL_HEADERS], [
])
AC_DEFUN([PHP_MBSTRING_EXTENSION], [
- PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS)
+ PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MBSTRING_SHARED_LIBADD)
for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index cf6143699b..ca1fbcdf28 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -19,7 +19,7 @@ if (PHP_MBSTRING != "no") {
ADD_FLAG("CFLAGS_MBSTRING", get_define("CFLAGS_LIBMBFL") +
" /I ext/mbstring/oniguruma /D NOT_RUBY=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D EXPORT");
+ /D HAVE_STRICMP /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h");
} else {
@@ -28,7 +28,7 @@ if (PHP_MBSTRING != "no") {
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT")
+ /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
"ext\\mbstring\\libmbfl\\config.h", true);
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
index 56c364d867..f9d34fbfab 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
@@ -238,7 +238,7 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
CK((*filter->output_function)(c, filter->data));
}
filter->status = 0;
- /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/
+ /*php_error_docref("ref.mbstring", E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/
} else {
/* named entity */
buffer[filter->status] = 0;
@@ -254,12 +254,12 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
/* decoded */
CK((*filter->output_function)(ent, filter->data));
filter->status = 0;
- /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE,"mbstring decoded '%s'=%d", buffer, ent);*/
+ /*php_error_docref("ref.mbstring", E_NOTICE,"mbstring decoded '%s'=%d", buffer, ent);*/
} else {
/* failure */
buffer[filter->status++] = ';';
buffer[filter->status] = 0;
- /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer); */
+ /* php_error_docref("ref.mbstring", E_WARNING, "mbstring cannot decode '%s'", buffer); */
mbfl_filt_conv_html_dec_flush(filter);
}
}
@@ -273,7 +273,7 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
if (c=='&')
filter->status--;
buffer[filter->status] = 0;
- /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer)l */
+ /* php_error_docref("ref.mbstring", E_WARNING, "mbstring cannot decode '%s'", buffer)l */
mbfl_filt_conv_html_dec_flush(filter);
if (c=='&')
{
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index a50768f6d0..86cbba4ded 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -62,11 +62,11 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
if (arg != PARSE_STRING) {
char *value = MBSTRG(internal_encoding_name);
- _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC);
+ _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0);
}
if (!MBSTRG(encoding_translation)) {
- php_default_treat_data(arg, str, destArray TSRMLS_CC);
+ php_default_treat_data(arg, str, destArray);
return;
}
@@ -93,7 +93,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
}
if (arg == PARSE_POST) {
- sapi_handle_post(&v_array TSRMLS_CC);
+ sapi_handle_post(&v_array);
return;
}
@@ -159,7 +159,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
MBSTRG(illegalchars) = 0;
- detected = _php_mb_encoding_handler_ex(&info, &v_array, res TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, &v_array, res);
MBSTRG(http_input_identify) = detected;
if (detected) {
@@ -190,7 +190,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
/* }}} */
/* {{{ mbfl_no_encoding _php_mb_encoding_handler_ex() */
-const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC)
+const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res)
{
char *var, *val;
const char *s1, *s2;
@@ -254,7 +254,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
if (n > (PG(max_input_vars) * 2)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ php_error_docref(NULL, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
goto out;
}
@@ -284,7 +284,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
if (!from_encoding) {
if (info->report_errors) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
}
from_encoding = &mbfl_encoding_pass;
}
@@ -298,7 +298,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
} else {
if (info->report_errors) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
}
goto out;
}
@@ -329,9 +329,9 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
n++;
/* we need val to be emalloc()ed */
val = estrndup(val, val_len);
- if (sapi_module.input_filter(info->data_type, var, &val, val_len, &new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(info->data_type, var, &val, val_len, &new_val_len)) {
/* add variable to symbol table */
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
+ php_register_variable_safe(var, val, new_val_len, array_ptr);
}
efree(val);
@@ -377,7 +377,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
php_stream_rewind(SG(request_info).request_body);
post_data_str = php_stream_copy_to_mem(SG(request_info).request_body, PHP_STREAM_COPY_ALL, 0);
- detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str->val TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str->val);
zend_string_release(post_data_str);
MBSTRG(http_input_identify) = detected;
diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h
index 091d8e2d9b..c45c8250cc 100644
--- a/ext/mbstring/mb_gpc.h
+++ b/ext/mbstring/mb_gpc.h
@@ -47,7 +47,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler);
MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data);
int _php_mb_enable_encoding_translation(int flag);
-const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC);
+const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res);
/* }}} */
#endif /* HAVE_MBSTRING */
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 691391ab92..1e7cb5bd73 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -96,13 +96,13 @@ ZEND_DECLARE_MODULE_GLOBALS(mbstring)
static PHP_GINIT_FUNCTION(mbstring);
static PHP_GSHUTDOWN_FUNCTION(mbstring);
-static void php_mb_populate_current_detect_order_list(TSRMLS_D);
+static void php_mb_populate_current_detect_order_list(void);
-static int php_mb_encoding_translation(TSRMLS_D);
+static int php_mb_encoding_translation(void);
-static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size TSRMLS_DC);
+static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size);
-static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding TSRMLS_DC);
+static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding);
/* }}} */
@@ -597,10 +597,13 @@ static sapi_post_entry php_post_entries[] = {
/* }}} */
#ifdef COMPILE_DL_MBSTRING
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mbstring)
#endif
-static char *get_internal_encoding(TSRMLS_D) {
+static char *get_internal_encoding(void) {
if (PG(internal_encoding) && PG(internal_encoding)[0]) {
return PG(internal_encoding);
} else if (SG(default_charset)) {
@@ -609,7 +612,7 @@ static char *get_internal_encoding(TSRMLS_D) {
return "";
}
-static char *get_input_encoding(TSRMLS_D) {
+static char *get_input_encoding(void) {
if (PG(input_encoding) && PG(input_encoding)[0]) {
return PG(input_encoding);
} else if (SG(default_charset)) {
@@ -618,7 +621,7 @@ static char *get_input_encoding(TSRMLS_D) {
return "";
}
-static char *get_output_encoding(TSRMLS_D) {
+static char *get_output_encoding(void) {
if (PG(output_encoding) && PG(output_encoding)[0]) {
return PG(output_encoding);
} else if (SG(default_charset)) {
@@ -689,7 +692,7 @@ static sapi_post_entry mbstr_post_entries[] = {
* of parsed encodings.
*/
static int
-php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_encoding ***return_list, size_t *return_size, int persistent)
{
int size, bauto, ret = SUCCESS;
size_t n;
@@ -808,7 +811,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
* of parsed encodings.
*/
static int
-php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, size_t *return_size, int persistent)
{
zval *hash_entry;
HashTable *target_hash;
@@ -882,7 +885,7 @@ php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, siz
/* }}} */
/* {{{ zend_multibyte interface */
-static const zend_encoding* php_mb_zend_encoding_fetcher(const char *encoding_name TSRMLS_DC)
+static const zend_encoding* php_mb_zend_encoding_fetcher(const char *encoding_name)
{
return (const zend_encoding*)mbfl_name2encoding(encoding_name);
}
@@ -904,7 +907,7 @@ static int php_mb_zend_encoding_lexer_compatibility_checker(const zend_encoding
return 0;
}
-static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *arg_string, size_t arg_length, const zend_encoding **list, size_t list_size TSRMLS_DC)
+static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *arg_string, size_t arg_length, const zend_encoding **list, size_t list_size)
{
mbfl_string string;
@@ -920,7 +923,7 @@ static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *a
return (const zend_encoding *) mbfl_identify_encoding2(&string, (const mbfl_encoding **)list, list_size, 0);
}
-static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC)
+static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from)
{
mbfl_string string, result;
mbfl_buffer_converter *convd;
@@ -964,17 +967,17 @@ static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_leng
return loc;
}
-static int php_mb_zend_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+static int php_mb_zend_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent)
{
- return php_mb_parse_encoding_list(encoding_list, encoding_list_len, (const mbfl_encoding ***)return_list, return_size, persistent TSRMLS_CC);
+ return php_mb_parse_encoding_list(encoding_list, encoding_list_len, (const mbfl_encoding ***)return_list, return_size, persistent);
}
-static const zend_encoding *php_mb_zend_internal_encoding_getter(TSRMLS_D)
+static const zend_encoding *php_mb_zend_internal_encoding_getter(void)
{
return (const zend_encoding *)MBSTRG(internal_encoding);
}
-static int php_mb_zend_internal_encoding_setter(const zend_encoding *encoding TSRMLS_DC)
+static int php_mb_zend_internal_encoding_setter(const zend_encoding *encoding)
{
MBSTRG(internal_encoding) = (const mbfl_encoding *)encoding;
return SUCCESS;
@@ -993,13 +996,13 @@ static zend_multibyte_functions php_mb_zend_multibyte_functions = {
};
/* }}} */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC);
+static void *_php_mb_compile_regex(const char *pattern);
static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len);
static void _php_mb_free_regex(void *opaque);
#if HAVE_ONIG
/* {{{ _php_mb_compile_regex */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
+static void *_php_mb_compile_regex(const char *pattern)
{
php_mb_regex_t *retval;
OnigErrorInfo err_info;
@@ -1012,7 +1015,7 @@ static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
ONIG_ENCODING_ASCII, &OnigSyntaxPerl, &err_info))) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err_code, err_info);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", pattern, err_str);
+ php_error_docref(NULL, E_WARNING, "%s: %s", pattern, err_str);
retval = NULL;
}
return retval;
@@ -1036,7 +1039,7 @@ static void _php_mb_free_regex(void *opaque)
/* }}} */
#elif HAVE_PCRE || HAVE_BUNDLED_PCRE
/* {{{ _php_mb_compile_regex */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
+static void *_php_mb_compile_regex(const char *pattern)
{
pcre *retval;
const char *err_str;
@@ -1044,7 +1047,7 @@ static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
if (!(retval = pcre_compile(pattern,
PCRE_CASELESS, &err_str, &err_offset, NULL))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (offset=%d): %s", pattern, err_offset, err_str);
+ php_error_docref(NULL, E_WARNING, "%s (offset=%d): %s", pattern, err_offset, err_str);
}
return retval;
}
@@ -1085,7 +1088,7 @@ static int php_mb_nls_get_default_detect_order_list(enum mbfl_no_language lang,
}
/* }}} */
-static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, int len, char quote TSRMLS_DC)
+static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, int len, char quote)
{
char *result = emalloc(len + 2);
char *resp = result;
@@ -1108,7 +1111,7 @@ static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *
return result;
}
-static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, char stop TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, char stop) /* {{{ */
{
char *pos = *line, quote;
char *res;
@@ -1148,7 +1151,7 @@ static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line,
}
/* }}} */
-static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *str TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *str) /* {{{ */
{
while (*str && isspace(*(unsigned char *)str)) {
++str;
@@ -1162,19 +1165,19 @@ static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *st
char quote = *str;
str++;
- return php_mb_rfc1867_substring_conf(encoding, str, strlen(str), quote TSRMLS_CC);
+ return php_mb_rfc1867_substring_conf(encoding, str, strlen(str), quote);
} else {
char *strend = str;
while (*strend && !isspace(*(unsigned char *)strend)) {
++strend;
}
- return php_mb_rfc1867_substring_conf(encoding, str, strend - str, 0 TSRMLS_CC);
+ return php_mb_rfc1867_substring_conf(encoding, str, strend - str, 0);
}
}
/* }}} */
-static char *php_mb_rfc1867_basename(const zend_encoding *encoding, char *filename TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_basename(const zend_encoding *encoding, char *filename) /* {{{ */
{
char *s, *s2;
const size_t filename_len = strlen(filename);
@@ -1235,7 +1238,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1)) {
return FAILURE;
}
@@ -1258,7 +1261,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
if (MBSTRG(http_input_list)) {
pefree(MBSTRG(http_input_list), 1);
}
- if (SUCCESS == php_mb_parse_encoding_list(get_input_encoding(TSRMLS_C), strlen(get_input_encoding(TSRMLS_C))+1, &list, &size, 1 TSRMLS_CC)) {
+ if (SUCCESS == php_mb_parse_encoding_list(get_input_encoding(), strlen(get_input_encoding())+1, &list, &size, 1)) {
MBSTRG(http_input_list) = list;
MBSTRG(http_input_list_size) = size;
return SUCCESS;
@@ -1268,7 +1271,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1)) {
return FAILURE;
}
@@ -1279,7 +1282,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
MBSTRG(http_input_list_size) = size;
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_input is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.http_input is deprecated");
}
return SUCCESS;
@@ -1292,7 +1295,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
const mbfl_encoding *encoding;
if (new_value == NULL || new_value->len == 0) {
- encoding = mbfl_name2encoding(get_output_encoding(TSRMLS_C));
+ encoding = mbfl_name2encoding(get_output_encoding());
if (!encoding) {
MBSTRG(http_output_encoding) = &mbfl_encoding_pass;
MBSTRG(current_http_output_encoding) = &mbfl_encoding_pass;
@@ -1310,7 +1313,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
MBSTRG(current_http_output_encoding) = encoding;
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_output is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.http_output is deprecated");
}
return SUCCESS;
@@ -1318,7 +1321,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
/* }}} */
/* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length)
{
const mbfl_encoding *encoding;
@@ -1331,12 +1334,12 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
#if HAVE_MBREGEX
{
const char *enc_name = new_value;
- if (FAILURE == php_mb_regex_set_default_mbctype(enc_name TSRMLS_CC)) {
+ if (FAILURE == php_mb_regex_set_default_mbctype(enc_name)) {
/* falls back to UTF-8 if an unknown encoding name is given */
enc_name = "UTF-8";
- php_mb_regex_set_default_mbctype(enc_name TSRMLS_CC);
+ php_mb_regex_set_default_mbctype(enc_name);
}
- php_mb_regex_set_mbctype(new_value TSRMLS_CC);
+ php_mb_regex_set_mbctype(new_value);
}
#endif
return SUCCESS;
@@ -1347,18 +1350,18 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
{
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
}
- if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage) == FAILURE) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_STARTUP | PHP_INI_STAGE_SHUTDOWN | PHP_INI_STAGE_RUNTIME)) {
if (new_value && new_value->len) {
- return _php_mb_ini_mbstring_internal_encoding_set(new_value->val, new_value->len TSRMLS_CC);
+ return _php_mb_ini_mbstring_internal_encoding_set(new_value->val, new_value->len);
} else {
- return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(TSRMLS_C), strlen(get_internal_encoding(TSRMLS_C))+1 TSRMLS_CC);
+ return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(), strlen(get_internal_encoding())+1);
}
} else {
/* the corresponding mbstring globals needs to be set according to the
@@ -1417,14 +1420,14 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
return FAILURE;
}
- OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
if (MBSTRG(encoding_translation)) {
- sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
- sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_unregister_post_entry(php_post_entries);
+ sapi_register_post_entries(mbstr_post_entries);
} else {
- sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
- sapi_register_post_entries(php_post_entries TSRMLS_CC);
+ sapi_unregister_post_entry(mbstr_post_entries);
+ sapi_register_post_entries(php_post_entries);
}
return SUCCESS;
@@ -1440,10 +1443,10 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes)
if (!new_value) {
new_value = entry->orig_value;
}
- php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3 TSRMLS_CC);
+ php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3);
if (Z_STRLEN(tmp) > 0) {
- if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp) TSRMLS_CC))) {
+ if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp)))) {
zval_dtor(&tmp);
return FAILURE;
}
@@ -1491,6 +1494,10 @@ PHP_INI_END()
/* {{{ module global initialize handler */
static PHP_GINIT_FUNCTION(mbstring)
{
+#if defined(COMPILE_DL_MBSTRING) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
mbstring_globals->language = mbfl_no_language_uni;
mbstring_globals->internal_encoding = NULL;
mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding;
@@ -1520,7 +1527,7 @@ static PHP_GINIT_FUNCTION(mbstring)
mbstring_globals->outconv = NULL;
mbstring_globals->http_output_conv_mimetypes = NULL;
#if HAVE_MBREGEX
- mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc(TSRMLS_C);
+ mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc();
#endif
}
/* }}} */
@@ -1538,7 +1545,7 @@ static PHP_GSHUTDOWN_FUNCTION(mbstring)
_php_mb_free_regex(mbstring_globals->http_output_conv_mimetypes);
}
#if HAVE_MBREGEX
- php_mb_regex_globals_free(mbstring_globals->mb_regex_globals TSRMLS_CC);
+ php_mb_regex_globals_free(mbstring_globals->mb_regex_globals);
#endif
}
/* }}} */
@@ -1551,11 +1558,11 @@ PHP_MINIT_FUNCTION(mbstring)
REGISTER_INI_ENTRIES();
/* This is a global handler. Should not be set in a per-request handler. */
- sapi_register_treat_data(mbstr_treat_data TSRMLS_CC);
+ sapi_register_treat_data(mbstr_treat_data);
/* Post handlers are stored in the thread-local context. */
if (MBSTRG(encoding_translation)) {
- sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_register_post_entries(mbstr_post_entries);
}
REGISTER_LONG_CONSTANT("MB_OVERLOAD_MAIL", MB_OVERLOAD_MAIL, CONST_CS | CONST_PERSISTENT);
@@ -1570,7 +1577,7 @@ PHP_MINIT_FUNCTION(mbstring)
PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
- if (FAILURE == zend_multibyte_set_functions(&php_mb_zend_multibyte_functions TSRMLS_CC)) {
+ if (FAILURE == zend_multibyte_set_functions(&php_mb_zend_multibyte_functions)) {
return FAILURE;
}
@@ -1612,7 +1619,7 @@ PHP_RINIT_FUNCTION(mbstring)
MBSTRG(illegalchars) = 0;
- php_mb_populate_current_detect_order_list(TSRMLS_C);
+ php_mb_populate_current_detect_order_list();
/* override original function. */
if (MBSTRG(func_overload)){
@@ -1626,7 +1633,7 @@ PHP_RINIT_FUNCTION(mbstring)
func = zend_hash_str_find_ptr(EG(function_table), p->ovld_func, strlen(p->ovld_func));
if ((orig = zend_hash_str_find_ptr(EG(function_table), p->orig_func, strlen(p->orig_func))) == NULL) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't find function %s.", p->orig_func);
+ php_error_docref("ref.mbstring", E_WARNING, "mbstring couldn't find function %s.", p->orig_func);
return FAILURE;
} else {
ZEND_ASSERT(orig->type == ZEND_INTERNAL_FUNCTION);
@@ -1634,7 +1641,7 @@ PHP_RINIT_FUNCTION(mbstring)
function_add_ref(orig);
if (zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func), func, sizeof(zend_internal_function)) == NULL) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't replace function %s.", p->orig_func);
+ php_error_docref("ref.mbstring", E_WARNING, "mbstring couldn't replace function %s.", p->orig_func);
return FAILURE;
}
@@ -1647,7 +1654,7 @@ PHP_RINIT_FUNCTION(mbstring)
#if HAVE_MBREGEX
PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
- zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding) TSRMLS_CC);
+ zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding));
return SUCCESS;
}
@@ -1733,7 +1740,7 @@ PHP_FUNCTION(mb_language)
{
zend_string *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
if (name == NULL) {
@@ -1741,7 +1748,7 @@ PHP_FUNCTION(mb_language)
} else {
zend_string *ini_name = zend_string_init("mbstring.language", sizeof("mbstring.language") - 1, 0);
if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name->val);
+ php_error_docref(NULL, E_WARNING, "Unknown language \"%s\"", name->val);
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1759,7 +1766,7 @@ PHP_FUNCTION(mb_internal_encoding)
size_t name_len;
const mbfl_encoding *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
if (name == NULL) {
@@ -1772,7 +1779,7 @@ PHP_FUNCTION(mb_internal_encoding)
} else {
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
} else {
MBSTRG(current_internal_encoding) = encoding;
@@ -1793,7 +1800,7 @@ PHP_FUNCTION(mb_http_input)
const mbfl_encoding *result = NULL;
retname = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &typ, &typ_len) == FAILURE) {
return;
}
if (typ == NULL) {
@@ -1882,7 +1889,7 @@ PHP_FUNCTION(mb_http_output)
size_t name_len;
const mbfl_encoding *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
@@ -1896,7 +1903,7 @@ PHP_FUNCTION(mb_http_output)
} else {
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
} else {
MBSTRG(current_http_output_encoding) = encoding;
@@ -1912,7 +1919,7 @@ PHP_FUNCTION(mb_detect_order)
{
zval *arg1 = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1) == FAILURE) {
return;
}
@@ -1930,7 +1937,7 @@ PHP_FUNCTION(mb_detect_order)
size_t size = 0;
switch (Z_TYPE_P(arg1)) {
case IS_ARRAY:
- if (FAILURE == php_mb_parse_encoding_array(arg1, &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_array(arg1, &list, &size, 0)) {
if (list) {
efree(list);
}
@@ -1939,7 +1946,7 @@ PHP_FUNCTION(mb_detect_order)
break;
default:
convert_to_string_ex(arg1);
- if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), &list, &size, 0)) {
if (list) {
efree(list);
}
@@ -1968,7 +1975,7 @@ PHP_FUNCTION(mb_substitute_character)
{
zval *arg1 = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1) == FAILURE) {
return;
}
@@ -2000,7 +2007,7 @@ PHP_FUNCTION(mb_substitute_character)
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character.");
+ php_error_docref(NULL, E_WARNING, "Unknown character.");
RETURN_FALSE;
}
}
@@ -2011,7 +2018,7 @@ PHP_FUNCTION(mb_substitute_character)
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character.");
+ php_error_docref(NULL, E_WARNING, "Unknown character.");
RETURN_FALSE;
}
break;
@@ -2028,17 +2035,17 @@ PHP_FUNCTION(mb_preferred_mime_name)
char *name = NULL;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
} else {
no_encoding = mbfl_name2no_encoding(name);
if (no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETVAL_FALSE;
} else {
const char *preferred_name = mbfl_no2preferred_mime_name(no_encoding);
if (preferred_name == NULL || *preferred_name == '\0') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name);
RETVAL_FALSE;
} else {
RETVAL_STRING((char *)preferred_name);
@@ -2062,7 +2069,7 @@ PHP_FUNCTION(mb_parse_str)
const mbfl_encoding *detected;
track_vars_array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &encstr, &encstr_len, &track_vars_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &encstr, &encstr_len, &track_vars_array) == FAILURE) {
return;
}
@@ -2084,13 +2091,13 @@ PHP_FUNCTION(mb_parse_str)
info.from_language = MBSTRG(language);
if (track_vars_array != NULL) {
- detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr);
} else {
zval tmp;
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
ZVAL_ARR(&tmp, symbol_table);
- detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr);
}
MBSTRG(http_input_identify) = detected;
@@ -2116,7 +2123,7 @@ PHP_FUNCTION(mb_output_handler)
unsigned char send_text_mimetype = 0;
char *s, *mimetype = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &arg_string, &arg_string_len, &arg_status) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &arg_string, &arg_string_len, &arg_status) == FAILURE) {
return;
}
@@ -2216,7 +2223,7 @@ PHP_FUNCTION(mb_strlen)
mbfl_string_init(&string);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
@@ -2226,7 +2233,7 @@ PHP_FUNCTION(mb_strlen)
} else {
string.no_encoding = mbfl_name2no_encoding(enc_name);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2258,24 +2265,24 @@ PHP_FUNCTION(mb_strpos)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (offset < 0 || offset > mbfl_strlen(&haystack)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
if (needle.len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
@@ -2287,16 +2294,16 @@ PHP_FUNCTION(mb_strpos)
case 1:
break;
case 2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Needle has not positive length");
+ php_error_docref(NULL, E_WARNING, "Needle has not positive length");
break;
case 4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding or conversion error");
+ php_error_docref(NULL, E_WARNING, "Unknown encoding or conversion error");
break;
case 8:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is empty");
+ php_error_docref(NULL, E_NOTICE, "Argument is empty");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in mb_strpos");
+ php_error_docref(NULL, E_WARNING, "Unknown error in mb_strpos");
break;
}
RETVAL_FALSE;
@@ -2324,7 +2331,7 @@ PHP_FUNCTION(mb_strrpos)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
@@ -2372,7 +2379,7 @@ PHP_FUNCTION(mb_strrpos)
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2388,7 +2395,7 @@ PHP_FUNCTION(mb_strrpos)
int haystack_char_len = mbfl_strlen(&haystack);
if ((offset > 0 && offset > haystack_char_len) ||
(offset < 0 && -offset > haystack_char_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
}
@@ -2414,14 +2421,14 @@ PHP_FUNCTION(mb_stripos)
n = -1;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
if (needle.len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
- n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
if (n >= 0) {
RETVAL_LONG(n);
@@ -2443,11 +2450,11 @@ PHP_FUNCTION(mb_strripos)
n = -1;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
if (n >= 0) {
RETVAL_LONG(n);
@@ -2474,20 +2481,20 @@ PHP_FUNCTION(mb_strstr)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (needle.len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
n = mbfl_strpos(&haystack, &needle, 0, 0);
@@ -2536,14 +2543,14 @@ PHP_FUNCTION(mb_strrchr)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2600,22 +2607,22 @@ PHP_FUNCTION(mb_stristr)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
if (!needle.len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
RETURN_FALSE;
}
- n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
if (n <0) {
RETURN_FALSE;
@@ -2663,17 +2670,17 @@ PHP_FUNCTION(mb_strrichr)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
RETURN_FALSE;
}
- n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
if (n <0) {
RETURN_FALSE;
@@ -2720,20 +2727,20 @@ PHP_FUNCTION(mb_substr_count)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (needle.len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring");
+ php_error_docref(NULL, E_WARNING, "Empty substring");
RETURN_FALSE;
}
@@ -2758,7 +2765,7 @@ PHP_FUNCTION(mb_substr)
zval *z_len = NULL;
mbfl_string string, result, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2769,7 +2776,7 @@ PHP_FUNCTION(mb_substr)
if (argc == 4) {
string.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2841,14 +2848,14 @@ PHP_FUNCTION(mb_strcut)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
if (argc == 4) {
string.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2909,14 +2916,14 @@ PHP_FUNCTION(mb_strwidth)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
string.no_encoding = mbfl_name2no_encoding(enc_name);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2939,7 +2946,7 @@ PHP_FUNCTION(mb_strimwidth)
size_t str_len, trimmarker_len, encoding_len;
mbfl_string string, result, marker, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|ss", &str, &str_len, &from, &width, &trimmarker, &trimmarker_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|ss", &str, &str_len, &from, &width, &trimmarker, &trimmarker_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2955,7 +2962,7 @@ PHP_FUNCTION(mb_strimwidth)
if (ZEND_NUM_ARGS() == 5) {
string.no_encoding = marker.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2964,12 +2971,12 @@ PHP_FUNCTION(mb_strimwidth)
string.len = str_len;
if (from < 0 || (size_t)from > str_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range");
+ php_error_docref(NULL, E_WARNING, "Start position is out of range");
RETURN_FALSE;
}
if (width < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width is negative value");
+ php_error_docref(NULL, E_WARNING, "Width is negative value");
RETURN_FALSE;
}
@@ -2990,7 +2997,7 @@ PHP_FUNCTION(mb_strimwidth)
/* }}} */
/* {{{ MBSTRING_API char *php_mb_convert_encoding() */
-MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len TSRMLS_DC)
+MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len)
{
mbfl_string string, result, *ret;
const mbfl_encoding *from_encoding, *to_encoding;
@@ -3009,7 +3016,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (_to_encoding && strlen(_to_encoding)) {
to_encoding = mbfl_name2encoding(_to_encoding);
if (!to_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", _to_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", _to_encoding);
return NULL;
}
} else {
@@ -3029,7 +3036,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (_from_encodings) {
list = NULL;
size = 0;
- php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0 TSRMLS_CC);
+ php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0);
if (size == 1) {
from_encoding = *list;
string.no_encoding = from_encoding->no_encoding;
@@ -3039,13 +3046,13 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (from_encoding) {
string.no_encoding = from_encoding->no_encoding;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect character encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect character encoding");
from_encoding = &mbfl_encoding_pass;
to_encoding = from_encoding;
string.no_encoding = from_encoding->no_encoding;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal character encoding specified");
+ php_error_docref(NULL, E_WARNING, "Illegal character encoding specified");
}
if (list != NULL) {
efree((void *)list);
@@ -3055,7 +3062,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
/* initialize converter */
convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, string.len);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create character encoding converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create character encoding converter");
return NULL;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
@@ -3089,7 +3096,7 @@ PHP_FUNCTION(mb_convert_encoding)
zval *hash_entry;
HashTable *target_hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &arg_str, &str_len, &arg_new, &new_len, &arg_old) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &arg_str, &str_len, &arg_new, &new_len, &arg_old) == FAILURE) {
return;
}
@@ -3128,7 +3135,7 @@ PHP_FUNCTION(mb_convert_encoding)
}
/* new encoding */
- ret = php_mb_convert_encoding(arg_str, str_len, arg_new, _from_encodings, &size TSRMLS_CC);
+ ret = php_mb_convert_encoding(arg_str, str_len, arg_new, _from_encodings, &size);
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL(ret, size); /* the string is already strdup()'ed */
@@ -3155,12 +3162,12 @@ PHP_FUNCTION(mb_convert_case)
size_t ret_len;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|s!", &str, &str_len,
&case_mode, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3181,11 +3188,11 @@ PHP_FUNCTION(mb_strtoupper)
char *newstr;
size_t ret_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3208,11 +3215,11 @@ PHP_FUNCTION(mb_strtolower)
char *newstr;
size_t ret_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3238,7 +3245,7 @@ PHP_FUNCTION(mb_detect_encoding)
const mbfl_encoding **elist, **list;
size_t size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zb", &str, &str_len, &encoding_list, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|zb", &str, &str_len, &encoding_list, &strict) == FAILURE) {
return;
}
@@ -3248,7 +3255,7 @@ PHP_FUNCTION(mb_detect_encoding)
if (ZEND_NUM_ARGS() >= 2 && !Z_ISNULL_P(encoding_list)) {
switch (Z_TYPE_P(encoding_list)) {
case IS_ARRAY:
- if (FAILURE == php_mb_parse_encoding_array(encoding_list, &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_array(encoding_list, &list, &size, 0)) {
if (list) {
efree(list);
list = NULL;
@@ -3258,7 +3265,7 @@ PHP_FUNCTION(mb_detect_encoding)
break;
default:
convert_to_string(encoding_list);
- if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0)) {
if (list) {
efree(list);
list = NULL;
@@ -3268,7 +3275,7 @@ PHP_FUNCTION(mb_detect_encoding)
break;
}
if (size <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal argument");
+ php_error_docref(NULL, E_WARNING, "Illegal argument");
}
}
@@ -3326,13 +3333,13 @@ PHP_FUNCTION(mb_encoding_aliases)
char *name = NULL;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
}
@@ -3364,7 +3371,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
return;
}
@@ -3374,7 +3381,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
if (charset_name != NULL) {
charset = mbfl_name2no_encoding(charset_name);
if (charset == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", charset_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", charset_name);
RETURN_FALSE;
}
} else {
@@ -3415,7 +3422,7 @@ PHP_FUNCTION(mb_decode_mimeheader)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string.val, &string.len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string.val, &string.len) == FAILURE) {
return;
}
@@ -3446,7 +3453,7 @@ PHP_FUNCTION(mb_convert_kana)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
return;
}
@@ -3520,7 +3527,7 @@ PHP_FUNCTION(mb_convert_kana)
if (encname != NULL) {
string.no_encoding = mbfl_name2no_encoding(encname);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encname);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encname);
RETURN_FALSE;
}
}
@@ -3555,14 +3562,14 @@ PHP_FUNCTION(mb_convert_variables)
char *to_enc;
void *ptmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz+", &to_enc, &to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz+", &to_enc, &to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
return;
}
/* new encoding */
to_encoding = mbfl_name2encoding(to_enc);
if (!to_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", to_enc);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", to_enc);
RETURN_FALSE;
}
@@ -3578,11 +3585,11 @@ PHP_FUNCTION(mb_convert_variables)
elistsz = 0;
switch (Z_TYPE_P(zfrom_enc)) {
case IS_ARRAY:
- php_mb_parse_encoding_array(zfrom_enc, &elist, &elistsz, 0 TSRMLS_CC);
+ php_mb_parse_encoding_array(zfrom_enc, &elist, &elistsz, 0);
break;
default:
convert_to_string_ex(zfrom_enc);
- php_mb_parse_encoding_list(Z_STRVAL_P(zfrom_enc), Z_STRLEN_P(zfrom_enc), &elist, &elistsz, 0 TSRMLS_CC);
+ php_mb_parse_encoding_list(Z_STRVAL_P(zfrom_enc), Z_STRLEN_P(zfrom_enc), &elist, &elistsz, 0);
break;
}
@@ -3661,7 +3668,7 @@ detect_end:
efree(stack);
if (!from_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
from_encoding = &mbfl_encoding_pass;
}
}
@@ -3673,7 +3680,7 @@ detect_end:
if (from_encoding != &mbfl_encoding_pass) {
convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, 0);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
@@ -3780,7 +3787,7 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
mbfl_string string, result, *ret;
enum mbfl_no_encoding no_encoding;
- if (zend_parse_parameters(argc TSRMLS_CC, "sz|sb", &str, &str_len, &zconvmap, &encoding, &encoding_len, &is_hex) == FAILURE) {
+ if (zend_parse_parameters(argc, "sz|sb", &str, &str_len, &zconvmap, &encoding, &encoding_len, &is_hex) == FAILURE) {
return;
}
@@ -3794,7 +3801,7 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
if ((argc == 3 || argc == 4) && encoding_len > 0) {
no_encoding = mbfl_name2no_encoding(encoding);
if (no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
} else {
string.no_encoding = no_encoding;
@@ -4090,7 +4097,7 @@ PHP_FUNCTION(mb_send_mail)
body_enc = lang->mail_body_encoding;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
return;
}
@@ -4135,7 +4142,7 @@ PHP_FUNCTION(mb_send_mail)
}
if (_tran_cs == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset);
+ php_error_docref(NULL, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset);
_tran_cs = mbfl_no_encoding_ascii;
}
tran_cs = _tran_cs;
@@ -4158,7 +4165,7 @@ PHP_FUNCTION(mb_send_mail)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", Z_STRVAL_P(s));
+ php_error_docref(NULL, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", Z_STRVAL_P(s));
body_enc = mbfl_no_encoding_8bit;
break;
}
@@ -4190,7 +4197,7 @@ PHP_FUNCTION(mb_send_mail)
to_r = to;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing To: field");
+ php_error_docref(NULL, E_WARNING, "Missing To: field");
err = 1;
}
@@ -4209,7 +4216,7 @@ PHP_FUNCTION(mb_send_mail)
subject_buf = subject = (char *)pstr->val;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing Subject: field");
+ php_error_docref(NULL, E_WARNING, "Missing Subject: field");
err = 1;
}
@@ -4240,7 +4247,7 @@ PHP_FUNCTION(mb_send_mail)
}
} else {
/* this is not really an error, so it is allowed. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty message body");
+ php_error_docref(NULL, E_WARNING, "Empty message body");
message = NULL;
}
@@ -4293,7 +4300,7 @@ PHP_FUNCTION(mb_send_mail)
extra_cmd = php_escape_shell_cmd(extra_cmd->val);
}
- if (!err && php_mail(to_r, subject, message, headers, extra_cmd ? extra_cmd->val : NULL TSRMLS_CC)) {
+ if (!err && php_mail(to_r, subject, message, headers, extra_cmd ? extra_cmd->val : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -4337,7 +4344,7 @@ PHP_FUNCTION(mb_get_info)
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
const mbfl_encoding **entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &typ, &typ_len) == FAILURE) {
return;
}
@@ -4515,7 +4522,7 @@ PHP_FUNCTION(mb_check_encoding)
mbfl_string string, result, *ret = NULL;
long illegalchars = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &var, &var_len, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ss", &var, &var_len, &enc, &enc_len) == FAILURE) {
return;
}
@@ -4526,14 +4533,14 @@ PHP_FUNCTION(mb_check_encoding)
if (enc != NULL) {
encoding = mbfl_name2encoding(enc);
if (!encoding || encoding == &mbfl_encoding_pass) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid encoding \"%s\"", enc);
+ php_error_docref(NULL, E_WARNING, "Invalid encoding \"%s\"", enc);
RETURN_FALSE;
}
}
convd = mbfl_buffer_converter_new2(encoding, encoding, 0);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE);
@@ -4560,7 +4567,7 @@ PHP_FUNCTION(mb_check_encoding)
/* }}} */
/* {{{ php_mb_populate_current_detect_order_list */
-static void php_mb_populate_current_detect_order_list(TSRMLS_D)
+static void php_mb_populate_current_detect_order_list(void)
{
const mbfl_encoding **entry = 0;
size_t nentries;
@@ -4588,7 +4595,7 @@ static void php_mb_populate_current_detect_order_list(TSRMLS_D)
/* }}} */
/* {{{ static int php_mb_encoding_translation() */
-static int php_mb_encoding_translation(TSRMLS_D)
+static int php_mb_encoding_translation(void)
{
return MBSTRG(encoding_translation);
}
@@ -4613,7 +4620,7 @@ MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *e
/* }}} */
/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes() */
-MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC)
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s)
{
return php_mb_mbchar_bytes_ex(s, MBSTRG(internal_encoding));
}
@@ -4661,7 +4668,7 @@ MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t
/* }}} */
/* {{{ MBSTRING_API char *php_mb_safe_strrchr() */
-MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes TSRMLS_DC)
+MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes)
{
return php_mb_safe_strrchr_ex(s, c, nbytes, MBSTRG(internal_encoding));
}
@@ -4669,7 +4676,7 @@ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nby
/* {{{ MBSTRING_API int php_mb_stripos()
*/
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding TSRMLS_DC)
+MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding)
{
int n;
mbfl_string haystack, needle;
@@ -4684,7 +4691,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
do {
size_t len = 0;
- haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_haystack, old_haystack_len, &len, from_encoding TSRMLS_CC);
+ haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_haystack, old_haystack_len, &len, from_encoding);
haystack.len = len;
if (!haystack.val) {
@@ -4695,7 +4702,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
break;
}
- needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_needle, old_needle_len, &len, from_encoding TSRMLS_CC);
+ needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_needle, old_needle_len, &len, from_encoding);
needle.len = len;
if (!needle.val) {
@@ -4708,7 +4715,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
break;
}
@@ -4718,12 +4725,12 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
if (mode) {
if ((offset > 0 && offset > haystack_char_len) ||
(offset < 0 && -offset > haystack_char_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
break;
}
} else {
if (offset < 0 || offset > haystack_char_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
break;
}
}
@@ -4744,14 +4751,14 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
}
/* }}} */
-static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size TSRMLS_DC) /* {{{ */
+static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size) /* {{{ */
{
*list = (const zend_encoding **)MBSTRG(http_input_list);
*list_size = MBSTRG(http_input_list_size);
}
/* }}} */
-static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding TSRMLS_DC) /* {{{ */
+static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding) /* {{{ */
{
MBSTRG(http_input_identify) = (const mbfl_encoding*)encoding;
}
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 0136f8ef7d..7f4b5dbafc 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -131,27 +131,27 @@ PHP_FUNCTION(mb_check_encoding);
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
size_t nbytes, const mbfl_encoding *enc);
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
- size_t nbytes TSRMLS_DC);
+ size_t nbytes);
MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
const char *_to_encoding,
const char *_from_encodings,
- size_t *output_len TSRMLS_DC);
+ size_t *output_len);
-MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
+MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list);
MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
-MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
- char *arg_list TSRMLS_DC);
+ char *arg_list);
MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
- const char *encoding_from TSRMLS_DC);
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding TSRMLS_DC);
+ const char *encoding_from);
+MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding);
/* internal use only */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC);
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length);
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
char *internal_encoding_name;
@@ -200,7 +200,8 @@ struct mb_overload_def {
};
#ifdef ZTS
-#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+#define MBSTRG(v) ZEND_TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define MBSTRG(v) (mbstring_globals.v)
#endif
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 8be88c3fee..6f3954e013 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -61,7 +61,7 @@ static void php_mb_regex_free_cache(zval *el) {
/* }}} */
/* {{{ _php_mb_regex_globals_ctor */
-static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
{
pglobals->default_mbctype = ONIG_ENCODING_UTF8;
pglobals->current_mbctype = ONIG_ENCODING_UTF8;
@@ -77,21 +77,21 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
/* }}} */
/* {{{ _php_mb_regex_globals_dtor */
-static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
zend_hash_destroy(&pglobals->ht_rc);
}
/* }}} */
/* {{{ php_mb_regex_globals_alloc */
-zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
+zend_mb_regex_globals *php_mb_regex_globals_alloc(void)
{
zend_mb_regex_globals *pglobals = pemalloc(
sizeof(zend_mb_regex_globals), 1);
if (!pglobals) {
return NULL;
}
- if (SUCCESS != _php_mb_regex_globals_ctor(pglobals TSRMLS_CC)) {
+ if (SUCCESS != _php_mb_regex_globals_ctor(pglobals)) {
pefree(pglobals, 1);
return NULL;
}
@@ -100,12 +100,12 @@ zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
/* }}} */
/* {{{ php_mb_regex_globals_free */
-void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals TSRMLS_DC)
+void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals)
{
if (!pglobals) {
return;
}
- _php_mb_regex_globals_dtor(pglobals TSRMLS_CC);
+ _php_mb_regex_globals_dtor(pglobals);
pefree(pglobals, 1);
}
/* }}} */
@@ -403,7 +403,7 @@ static const char *_php_mb_regex_mbctype2name(OnigEncoding mbctype)
/* }}} */
/* {{{ php_mb_regex_set_mbctype */
-int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -415,7 +415,7 @@ int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_set_default_mbctype */
-int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_default_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -427,14 +427,14 @@ int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_get_mbctype */
-const char *php_mb_regex_get_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(current_mbctype));
}
/* }}} */
/* {{{ php_mb_regex_get_default_mbctype */
-const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_default_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(default_mbctype));
}
@@ -444,7 +444,7 @@ const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
* regex cache
*/
/* {{{ php_mbregex_compile_pattern */
-static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC)
+static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax)
{
int err_code = 0;
php_mb_regex_t *retval = NULL, *rc = NULL;
@@ -455,7 +455,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
onig_error_code_to_str(err_str, err_code, err_info);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
retval = NULL;
goto out;
}
@@ -658,7 +658,7 @@ PHP_FUNCTION(mb_regex_encoding)
size_t encoding_len;
OnigEncoding mbctype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -674,7 +674,7 @@ PHP_FUNCTION(mb_regex_encoding)
mbctype = _php_mb_regex_name2mbctype(encoding);
if (mbctype == ONIG_ENCODING_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
@@ -698,7 +698,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
RETURN_FALSE;
}
@@ -718,12 +718,12 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (Z_STRLEN_P(arg_pattern) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
+ php_error_docref(NULL, E_WARNING, "empty pattern");
RETVAL_FALSE;
goto out;
}
- re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC);
+ re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax));
if (re == NULL) {
RETVAL_FALSE;
goto out;
@@ -819,7 +819,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
current_enc_name = _php_mb_regex_mbctype2name(MBREX(current_mbctype));
if (current_enc_name == NULL ||
(enc = mbfl_name2encoding(current_enc_name)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
RETURN_FALSE;
}
}
@@ -829,7 +829,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
size_t option_str_len = 0;
if (!is_callable) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zss|s",
&arg_pattern_zval,
&replace, &replace_len,
&string, &string_len,
@@ -837,7 +837,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zfs|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zfs|s",
&arg_pattern_zval,
&arg_replace_fci, &arg_replace_fci_cache,
&string, &string_len,
@@ -866,14 +866,14 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_pattern_len = 1;
}
/* create regex pattern buffer */
- re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax TSRMLS_CC);
+ re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax);
if (re == NULL) {
RETURN_FALSE;
}
if (eval || is_callable) {
pbuf = &eval_buf;
- description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC);
+ description = zend_make_compiled_string_description("mbregex replace");
} else {
pbuf = &out_buf;
description = NULL;
@@ -881,7 +881,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (is_callable) {
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback");
+ php_error_docref(NULL, E_WARNING, "Option 'e' cannot be used with replacement callback");
RETURN_FALSE;
}
}
@@ -896,13 +896,13 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
break;
}
if (err >= 0) {
#if moriyoshi_0
if (regs->beg[0] == regs->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
break;
}
#endif
@@ -939,9 +939,9 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
/* null terminate buffer */
smart_str_0(&eval_buf);
/* do eval */
- if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description TSRMLS_CC) == FAILURE) {
+ if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description) == FAILURE) {
efree(description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
+ php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
/* zend_error() does not return in this case */
}
@@ -968,7 +968,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_replace_fci.param_count = 1;
arg_replace_fci.params = args;
arg_replace_fci.retval = &retval;
- if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache TSRMLS_CC) == SUCCESS &&
+ if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache) == SUCCESS &&
!Z_ISUNDEF(retval)) {
convert_to_string_ex(&retval);
smart_str_appendl(&out_buf, Z_STRVAL(retval), Z_STRLEN(retval));
@@ -979,7 +979,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
} else {
efree(description);
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+ php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
}
}
zval_ptr_dtor(&subpats);
@@ -1062,7 +1062,7 @@ PHP_FUNCTION(mb_split)
int n, err;
zend_long count = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
RETURN_FALSE;
}
@@ -1071,7 +1071,7 @@ PHP_FUNCTION(mb_split)
}
/* create regex pattern buffer */
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
@@ -1111,7 +1111,7 @@ PHP_FUNCTION(mb_split)
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(mb_ereg_match)
char *option_str = NULL;
size_t option_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s",
&arg_pattern, &arg_pattern_len, &string, &string_len,
&option_str, &option_str_len)==FAILURE) {
RETURN_FALSE;
@@ -1159,7 +1159,7 @@ PHP_FUNCTION(mb_ereg_match)
}
}
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
@@ -1186,7 +1186,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
OnigUChar *str;
OnigSyntaxType *syntax;
- if (zend_parse_parameters(argc TSRMLS_CC, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
@@ -1199,7 +1199,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (argc > 0) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
}
@@ -1213,12 +1213,12 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
if (MBREX(search_re) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No regex given");
+ php_error_docref(NULL, E_WARNING, "No regex given");
RETURN_FALSE;
}
if (str == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No string given");
+ php_error_docref(NULL, E_WARNING, "No string given");
RETURN_FALSE;
}
@@ -1234,11 +1234,11 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
} else if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
RETVAL_FALSE;
} else {
if (MBREX(search_regs)->beg[0] == MBREX(search_regs)->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
}
switch (mode) {
case 1:
@@ -1315,12 +1315,12 @@ PHP_FUNCTION(mb_ereg_search_init)
OnigSyntaxType *syntax = NULL;
OnigOptionType option;
- if (zend_parse_parameters(argc TSRMLS_CC, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
if (argc > 1 && arg_pattern_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty pattern");
+ php_error_docref(NULL, E_WARNING, "Empty pattern");
RETURN_FALSE;
}
@@ -1334,7 +1334,7 @@ PHP_FUNCTION(mb_ereg_search_init)
if (argc > 1) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
}
@@ -1398,12 +1398,12 @@ PHP_FUNCTION(mb_ereg_search_setpos)
{
zend_long position;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) {
return;
}
if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range");
+ php_error_docref(NULL, E_WARNING, "Position is out of range");
MBREX(search_pos) = 0;
RETURN_FALSE;
}
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
/* }}} */
/* {{{ php_mb_regex_set_options */
-static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC)
+static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax)
{
if (prev_options != NULL) {
*prev_options = MBREX(regex_default_options);
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(mb_regex_set_options)
size_t string_len;
char buf[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&string, &string_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(mb_regex_set_options)
opt = 0;
syntax = NULL;
_php_mb_regex_init_options(string, string_len, &opt, &syntax, NULL);
- _php_mb_regex_set_options(opt, syntax, NULL, NULL TSRMLS_CC);
+ _php_mb_regex_set_options(opt, syntax, NULL, NULL);
} else {
opt = MBREX(regex_default_options);
syntax = MBREX(regex_default_syntax);
diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h
index 0088b0a716..c819f2c17c 100644
--- a/ext/mbstring/php_mbregex.h
+++ b/ext/mbstring/php_mbregex.h
@@ -70,12 +70,12 @@ PHP_MINFO_FUNCTION(mb_regex);
typedef struct _zend_mb_regex_globals zend_mb_regex_globals;
-zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D);
-void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals TSRMLS_DC);
-int php_mb_regex_set_mbctype(const char *enc TSRMLS_DC);
-int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC);
-const char *php_mb_regex_get_mbctype(TSRMLS_D);
-const char *php_mb_regex_get_default_mbctype(TSRMLS_D);
+zend_mb_regex_globals *php_mb_regex_globals_alloc(void);
+void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals);
+int php_mb_regex_set_mbctype(const char *enc);
+int php_mb_regex_set_default_mbctype(const char *encname);
+const char *php_mb_regex_get_mbctype(void);
+const char *php_mb_regex_get_default_mbctype(void);
PHP_FUNCTION(mb_regex_encoding);
PHP_FUNCTION(mb_ereg);
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index ee5b75e67a..75973c9b47 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -160,7 +160,7 @@ MBSTRING_API unsigned long php_turkish_tolower(unsigned long code, long l, long
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -191,7 +191,7 @@ MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -222,7 +222,7 @@ MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -268,7 +268,7 @@ MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_
}
MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *ret_len,
- const char *src_encoding TSRMLS_DC)
+ const char *src_encoding)
{
char *unicode, *newstr;
size_t unicode_len;
@@ -277,11 +277,11 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
enum mbfl_no_encoding _src_encoding = mbfl_name2no_encoding(src_encoding);
if (_src_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", src_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", src_encoding);
return NULL;
}
- unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len TSRMLS_CC);
+ unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len);
if (unicode == NULL)
return NULL;
@@ -291,14 +291,14 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
case PHP_UNICODE_CASE_UPPER:
for (i = 0; i < unicode_len; i+=4) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
break;
case PHP_UNICODE_CASE_LOWER:
for (i = 0; i < unicode_len; i+=4) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
break;
@@ -312,7 +312,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
if (mode) {
if (res) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
} else {
mode = 0;
}
@@ -320,7 +320,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
if (res) {
mode = 1;
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
}
}
@@ -328,7 +328,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
}
- newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len TSRMLS_CC);
+ newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len);
efree(unicode);
return newstr;
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index e376895cbd..7bdeb86faa 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -104,7 +104,7 @@
MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
unsigned long mask2);
MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *retlen,
- const char *src_encoding TSRMLS_DC);
+ const char *src_encoding);
#define PHP_UNICODE_CASE_UPPER 0
#define PHP_UNICODE_CASE_LOWER 1
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index d33cdd5972..7b5823ec41 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -330,7 +330,7 @@ typedef enum {
*/
#define MCRYPT_GET_CRYPT_ARGS \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssz|s", \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssz|s", \
&cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &iv, &iv_len) == FAILURE) { \
return; \
}
@@ -338,7 +338,7 @@ typedef enum {
#define MCRYPT_GET_TD_ARG \
zval *mcryptind; \
php_mcrypt *pm; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mcryptind) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mcryptind) == FAILURE) { \
return; \
} \
ZEND_FETCH_RESOURCE (pm, php_mcrypt *, mcryptind, -1, "MCrypt", le_mcrypt);
@@ -348,7 +348,7 @@ typedef enum {
size_t dir_len; \
char *module; \
size_t module_len; \
- if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, \
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), \
"s|s", &module, &module_len, &dir, &dir_len) == FAILURE) { \
return; \
}
@@ -360,7 +360,7 @@ typedef enum {
#define PHP_MCRYPT_INIT_CHECK \
if (!pm->init) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation disallowed prior to mcrypt_generic_init()."); \
+ php_error_docref(NULL, E_WARNING, "Operation disallowed prior to mcrypt_generic_init()."); \
RETURN_FALSE; \
} \
@@ -369,7 +369,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("mcrypt.modes_dir", NULL, PHP_INI_ALL, OnUpdateString, modes_dir, zend_mcrypt_globals, mcrypt_globals)
PHP_INI_END()
-static void php_mcrypt_module_dtor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_mcrypt_module_dtor(zend_resource *rsrc) /* {{{ */
{
php_mcrypt *pm = (php_mcrypt *) rsrc->ptr;
if (pm) {
@@ -435,8 +435,8 @@ static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
MCRYPT_ENTRY2_2_4(MODE_STREAM, "stream");
REGISTER_INI_ENTRIES();
- php_stream_filter_register_factory("mcrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
- php_stream_filter_register_factory("mdecrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
+ php_stream_filter_register_factory("mcrypt.*", &php_mcrypt_filter_factory);
+ php_stream_filter_register_factory("mdecrypt.*", &php_mcrypt_filter_factory);
return SUCCESS;
}
@@ -444,8 +444,8 @@ static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
{
- php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
- php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
+ php_stream_filter_unregister_factory("mcrypt.*");
+ php_stream_filter_unregister_factory("mdecrypt.*");
UNREGISTER_INI_ENTRIES();
return SUCCESS;
@@ -513,7 +513,7 @@ PHP_FUNCTION(mcrypt_module_open)
MCRYPT td;
php_mcrypt *pm;
- if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ssss",
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "ssss",
&cipher, &cipher_len, &cipher_dir, &cipher_dir_len,
&mode, &mode_len, &mode_dir, &mode_dir_len)) {
return;
@@ -527,7 +527,7 @@ PHP_FUNCTION(mcrypt_module_open)
);
if (td == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module");
+ php_error_docref(NULL, E_WARNING, "Could not open encryption module");
RETURN_FALSE;
} else {
pm = emalloc(sizeof(php_mcrypt));
@@ -550,7 +550,7 @@ PHP_FUNCTION(mcrypt_generic_init)
php_mcrypt *pm;
int result = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &mcryptind, &key, &key_len, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &mcryptind, &key, &key_len, &iv, &iv_len) == FAILURE) {
return;
}
@@ -560,7 +560,7 @@ PHP_FUNCTION(mcrypt_generic_init)
iv_size = mcrypt_enc_get_iv_size(pm->td);
if (key_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size is 0");
+ php_error_docref(NULL, E_WARNING, "Key size is 0");
}
key_s = emalloc(key_len);
@@ -570,7 +570,7 @@ PHP_FUNCTION(mcrypt_generic_init)
memset(iv_s, 0, iv_size + 1);
if (key_len > max_key_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size);
+ php_error_docref(NULL, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size);
key_size = max_key_size;
} else {
key_size = (int)key_len;
@@ -578,7 +578,7 @@ PHP_FUNCTION(mcrypt_generic_init)
memcpy(key_s, key, key_len);
if (iv_len != iv_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", iv_len, iv_size);
+ php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", iv_len, iv_size);
if (iv_len > iv_size) {
iv_len = iv_size;
}
@@ -594,14 +594,14 @@ PHP_FUNCTION(mcrypt_generic_init)
zend_list_close(Z_RES_P(mcryptind));
switch (result) {
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect");
+ php_error_docref(NULL, E_WARNING, "Key length incorrect");
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation error");
+ php_error_docref(NULL, E_WARNING, "Memory allocation error");
break;
case -1:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
break;
}
} else {
@@ -625,7 +625,7 @@ PHP_FUNCTION(mcrypt_generic)
char* data_s;
int block_size, data_size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &mcryptind, &data, &data_len) == FAILURE) {
return;
}
@@ -633,7 +633,7 @@ PHP_FUNCTION(mcrypt_generic)
PHP_MCRYPT_INIT_CHECK
if (data_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ php_error_docref(NULL, E_WARNING, "An empty string was passed");
RETURN_FALSE
}
@@ -670,7 +670,7 @@ PHP_FUNCTION(mdecrypt_generic)
char* data_s;
int block_size, data_size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &mcryptind, &data, &data_len) == FAILURE) {
return;
}
@@ -678,7 +678,7 @@ PHP_FUNCTION(mdecrypt_generic)
PHP_MCRYPT_INIT_CHECK
if (data_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ php_error_docref(NULL, E_WARNING, "An empty string was passed");
RETURN_FALSE
}
@@ -749,7 +749,7 @@ PHP_FUNCTION(mcrypt_generic_deinit)
MCRYPT_GET_TD_ARG
if (mcrypt_generic_deinit(pm->td) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not terminate encryption specifier");
+ php_error_docref(NULL, E_WARNING, "Could not terminate encryption specifier");
RETURN_FALSE
}
pm->init = 0;
@@ -956,7 +956,7 @@ PHP_FUNCTION(mcrypt_list_algorithms)
size_t lib_dir_len;
int i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&lib_dir, &lib_dir_len) == FAILURE) {
return;
}
@@ -965,7 +965,7 @@ PHP_FUNCTION(mcrypt_list_algorithms)
modules = mcrypt_list_algorithms(lib_dir, &count);
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No algorithms found in module dir");
+ php_error_docref(NULL, E_WARNING, "No algorithms found in module dir");
}
for (i = 0; i < count; i++) {
add_index_string(return_value, i, modules[i]);
@@ -983,7 +983,7 @@ PHP_FUNCTION(mcrypt_list_modes)
size_t lib_dir_len;
int i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&lib_dir, &lib_dir_len) == FAILURE) {
return;
}
@@ -992,7 +992,7 @@ PHP_FUNCTION(mcrypt_list_modes)
modules = mcrypt_list_modes(lib_dir, &count);
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No modes found in module dir");
+ php_error_docref(NULL, E_WARNING, "No modes found in module dir");
}
for (i = 0; i < count; i++) {
add_index_string(return_value, i, modules[i]);
@@ -1014,7 +1014,7 @@ PHP_FUNCTION(mcrypt_get_key_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1024,7 +1024,7 @@ PHP_FUNCTION(mcrypt_get_key_size)
RETVAL_LONG(mcrypt_enc_get_key_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1043,7 +1043,7 @@ PHP_FUNCTION(mcrypt_get_block_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1053,7 +1053,7 @@ PHP_FUNCTION(mcrypt_get_block_size)
RETVAL_LONG(mcrypt_enc_get_block_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1072,7 +1072,7 @@ PHP_FUNCTION(mcrypt_get_iv_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1082,7 +1082,7 @@ PHP_FUNCTION(mcrypt_get_iv_size)
RETVAL_LONG(mcrypt_enc_get_iv_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1101,7 +1101,7 @@ PHP_FUNCTION(mcrypt_get_cipher_name)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&cipher, &cipher_len) == FAILURE) {
return;
}
@@ -1122,7 +1122,7 @@ PHP_FUNCTION(mcrypt_get_cipher_name)
RETVAL_STRING(cipher_name);
mcrypt_free(cipher_name);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1190,7 +1190,7 @@ static zend_bool php_mcrypt_is_valid_key_size(
}
/* }}} */
-static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /* {{{ */
+static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size) /* {{{ */
{
int key_size_count;
int max_key_size = mcrypt_enc_get_key_size(td);
@@ -1203,7 +1203,7 @@ static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /
char *key_size_str = php_mcrypt_get_key_size_str(
max_key_size, key_sizes, key_size_count
);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Key of size %d not supported by this algorithm. %s", key_size, key_size_str
);
efree(key_size_str);
@@ -1217,20 +1217,20 @@ static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /
}
/* }}} */
-static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSRMLS_DC) /* {{{ */
+static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size) /* {{{ */
{
if (mcrypt_enc_mode_has_iv(td) == 1) {
int expected_iv_size = mcrypt_enc_get_iv_size(td);
if (!iv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Encryption mode requires an initialization vector of size %d", expected_iv_size
);
return FAILURE;
}
if (iv_size != expected_iv_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Received initialization vector of size %d, but size %d is required "
"for this encryption mode", iv_size, expected_iv_size
);
@@ -1242,7 +1242,7 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSR
}
/* }}} */
-static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
+static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value) /* {{{ */
{
char *cipher_dir_string;
char *module_dir_string;
@@ -1254,16 +1254,16 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, c
td = mcrypt_module_open(cipher, cipher_dir_string, mode, module_dir_string);
if (td == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_key_size(td, (int)key_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_key_size(td, (int)key_len) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
@@ -1282,7 +1282,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, c
}
if (mcrypt_generic_init(td, (void *) key, (int)key_len, (void *) iv) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
mcrypt_module_close(td);
RETURN_FALSE;
}
@@ -1310,12 +1310,12 @@ PHP_FUNCTION(mcrypt_encrypt)
char *cipher, *key, *data, *mode, *iv = NULL;
size_t cipher_len, key_len, data_len, mode_len, iv_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssss|s", &cipher, &cipher_len,
&key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) {
return;
}
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_ENCRYPT, return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_ENCRYPT, return_value);
}
/* }}} */
@@ -1326,12 +1326,12 @@ PHP_FUNCTION(mcrypt_decrypt)
char *cipher, *key, *data, *mode, *iv = NULL;
size_t cipher_len, key_len, data_len, mode_len, iv_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssss|s", &cipher, &cipher_len,
&key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) {
return;
}
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_DECRYPT, return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_DECRYPT, return_value);
}
/* }}} */
@@ -1347,7 +1347,7 @@ PHP_FUNCTION(mcrypt_ecb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1363,7 +1363,7 @@ PHP_FUNCTION(mcrypt_cbc)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1379,7 +1379,7 @@ PHP_FUNCTION(mcrypt_cfb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1395,7 +1395,7 @@ PHP_FUNCTION(mcrypt_ofb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1408,12 +1408,12 @@ PHP_FUNCTION(mcrypt_create_iv)
zend_long size;
int n = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &size, &source) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &size, &source) == FAILURE) {
return;
}
if (size <= 0 || size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create an IV with a size of less than 1 or greater than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Cannot create an IV with a size of less than 1 or greater than %d", INT_MAX);
RETURN_FALSE;
}
@@ -1425,7 +1425,7 @@ PHP_FUNCTION(mcrypt_create_iv)
BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
+ php_error_docref(NULL, E_WARNING, "Could not gather sufficient random data");
RETURN_FALSE;
}
n = (int)size;
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(mcrypt_create_iv)
fd = open(source == RANDOM ? "/dev/random" : "/dev/urandom", O_RDONLY);
if (fd < 0) {
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open source device");
+ php_error_docref(NULL, E_WARNING, "Cannot open source device");
RETURN_FALSE;
}
while (read_bytes < size) {
@@ -1450,14 +1450,14 @@ PHP_FUNCTION(mcrypt_create_iv)
close(fd);
if (n < size) {
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
+ php_error_docref(NULL, E_WARNING, "Could not gather sufficient random data");
RETURN_FALSE;
}
#endif
} else {
n = (int)size;
while (size) {
- iv[--size] = (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX);
+ iv[--size] = (char) (255.0 * php_rand() / RAND_MAX);
}
}
RETVAL_STRINGL(iv, n);
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index c36e9494e3..ed3aba22cc 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -39,7 +39,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
- int flags TSRMLS_DC)
+ int flags)
{
php_mcrypt_filter_data *data;
php_stream_bucket *bucket;
@@ -80,22 +80,22 @@ static php_stream_filter_status_t php_mcrypt_filter(
data->block_used = chunklen - n;
memcpy(data->block_buffer, outchunk + n, data->block_used);
- newbucket = php_stream_bucket_new(stream, outchunk, n, 1, data->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, newbucket TSRMLS_CC);
+ newbucket = php_stream_bucket_new(stream, outchunk, n, 1, data->persistent);
+ php_stream_bucket_append(buckets_out, newbucket);
exit_status = PSFS_PASS_ON;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
} else {
/* Stream cipher */
- php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ php_stream_bucket_make_writeable(bucket);
if (data->encrypt) {
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
mdecrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
}
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
exit_status = PSFS_PASS_ON;
}
@@ -111,8 +111,8 @@ static php_stream_filter_status_t php_mcrypt_filter(
mdecrypt_generic(data->module, data->block_buffer, data->blocksize);
}
- newbucket = php_stream_bucket_new(stream, data->block_buffer, data->blocksize, 0, data->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, newbucket TSRMLS_CC);
+ newbucket = php_stream_bucket_new(stream, data->block_buffer, data->blocksize, 0, data->persistent);
+ php_stream_bucket_append(buckets_out, newbucket);
exit_status = PSFS_PASS_ON;
}
@@ -124,7 +124,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
return exit_status;
}
-static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_mcrypt_filter_data *data = (php_mcrypt_filter_data*) Z_PTR(thisfilter->abstract);
@@ -149,7 +149,7 @@ static php_stream_filter_ops php_mcrypt_filter_ops = {
/* {{{ php_mcrypt_filter_create
* Instantiate mcrypt filter
*/
-static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, int persistent)
{
int encrypt = 1, iv_len, key_len, keyl, result;
const char *cipher = filtername + sizeof("mcrypt.") - 1;
@@ -170,7 +170,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
}
if (!filterparams || Z_TYPE_P(filterparams) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter parameters for %s must be an array", filtername);
+ php_error_docref(NULL, E_WARNING, "Filter parameters for %s must be an array", filtername);
return NULL;
}
@@ -178,7 +178,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mode is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "mode is not a string, ignoring");
}
}
@@ -186,7 +186,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
algo_dir = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "algorithms_dir is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "algorithms_dir is not a string, ignoring");
}
}
@@ -194,7 +194,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode_dir = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "modes_dir is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "modes_dir is not a string, ignoring");
}
}
@@ -203,13 +203,13 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
key = Z_STRVAL_P(tmpzval);
key_len = (int)Z_STRLEN_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key not specified or is not a string");
+ php_error_docref(NULL, E_WARNING, "key not specified or is not a string");
return NULL;
}
mcrypt_module = mcrypt_module_open((char *)cipher, algo_dir, mode, mode_dir);
if (mcrypt_module == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module");
+ php_error_docref(NULL, E_WARNING, "Could not open encryption module");
return NULL;
}
iv_len = mcrypt_enc_get_iv_size(mcrypt_module);
@@ -220,7 +220,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (!(tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("iv"))) ||
Z_TYPE_P(tmpzval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter parameter[iv] not provided or not of type: string");
+ php_error_docref(NULL, E_WARNING, "Filter parameter[iv] not provided or not of type: string");
mcrypt_module_close(mcrypt_module);
return NULL;
}
@@ -238,14 +238,14 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (result < 0) {
switch (result) {
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect");
+ php_error_docref(NULL, E_WARNING, "Key length incorrect");
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation error");
+ php_error_docref(NULL, E_WARNING, "Memory allocation error");
break;
case -1:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
break;
}
mcrypt_module_close(mcrypt_module);
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 1ba77ca8c4..f4dee9a0f1 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -42,8 +42,8 @@
static int le_result, le_link, le_plink, le_statement;
-static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC);
-static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC);
+static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type);
+static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type);
static void _mssql_bind_hash_dtor(void *data);
@@ -210,14 +210,13 @@ zend_module_entry mssql_module_entry =
ZEND_GET_MODULE(mssql)
#endif
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
/* {{{ PHP_INI_DISP
*/
static PHP_INI_DISP(display_text_size)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
@@ -266,10 +265,9 @@ PHP_INI_END()
/* error handler */
static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
{
- TSRMLS_FETCH();
if (severity >= MS_SQL_G(min_error_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (severity %d)", dberrstr, severity);
+ php_error_docref(NULL, E_WARNING, "%s (severity %d)", dberrstr, severity);
}
return INT_CANCEL;
}
@@ -279,10 +277,9 @@ static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, i
/* message handler */
static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate, int severity,char *msgtext,char *srvname, char *procname,DBUSMALLINT line)
{
- TSRMLS_FETCH();
if (severity >= MS_SQL_G(min_message_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "message: %s (severity %d)", msgtext, severity);
+ php_error_docref(NULL, E_WARNING, "message: %s (severity %d)", msgtext, severity);
}
if (MS_SQL_G(server_message)) {
zend_string_free(MS_SQL_G(server_message));
@@ -295,7 +292,7 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate
/* {{{ _clean_invalid_results
*/
-static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC)
+static int _clean_invalid_results(zend_rsrc_list_entry *le)
{
if (Z_TYPE_P(le) == le_result) {
mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr;
@@ -340,7 +337,7 @@ static void _free_result(mssql_result *result, int free_fields)
/* {{{ _free_mssql_statement
*/
-static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_mssql_statement(zend_rsrc_list_entry *rsrc)
{
mssql_statement *statement = (mssql_statement *)rsrc->ptr;
@@ -355,7 +352,7 @@ static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ _free_mssql_result
*/
-static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_mssql_result(zend_rsrc_list_entry *rsrc)
{
mssql_result *result = (mssql_result *)rsrc->ptr;
@@ -367,7 +364,7 @@ static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ php_mssql_set_defaullt_link
*/
-static void php_mssql_set_default_link(int id TSRMLS_DC)
+static void php_mssql_set_default_link(int id)
{
if (MS_SQL_G(default_link)!=-1) {
zend_list_delete(MS_SQL_G(default_link));
@@ -379,12 +376,12 @@ static void php_mssql_set_default_link(int id TSRMLS_DC)
/* {{{ _close_mssql_link
*/
-static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_mssql_link(zend_rsrc_list_entry *rsrc)
{
mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr;
mssql_ptr->valid = 0;
- zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC);
+ zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results);
dbclose(mssql_ptr->link);
dbfreelogin(mssql_ptr->login);
efree(mssql_ptr);
@@ -394,7 +391,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ _close_mssql_plink
*/
-static void _close_mssql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_mssql_plink(zend_rsrc_list_entry *rsrc)
{
mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr;
@@ -551,7 +548,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
mssql_link mssql, *mssql_ptr;
char buffer[40];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) {
return;
}
@@ -587,7 +584,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (hashed_details == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory");
+ php_error_docref(NULL, E_WARNING, "Out of memory");
RETURN_FALSE;
}
@@ -596,7 +593,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* set a DBLOGIN record */
if ((mssql.login = dblogin()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate login record");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate login record");
RETURN_FALSE;
}
@@ -644,20 +641,20 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_rsrc_list_entry new_le;
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
/* create the link */
if ((mssql.link = dbopen(mssql.login, host)) == FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -714,7 +711,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server);
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!");
+ php_error_docref(NULL, E_WARNING, "Hashed persistent link is not a MS SQL link!");
efree(hashed_details);
RETURN_FALSE;
}
@@ -730,7 +727,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server);
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING, "Link to server lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
efree(hashed_details);
dbfreelogin(mssql_ptr->login);
@@ -774,7 +771,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ptr && (type==le_link || type==le_plink)) {
zend_list_addref(link);
Z_LVAL_P(return_value) = link;
- php_mssql_set_default_link(link TSRMLS_CC);
+ php_mssql_set_default_link(link);
Z_TYPE_P(return_value) = IS_RESOURCE;
dbfreelogin(mssql.login);
efree(hashed_details);
@@ -784,14 +781,14 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
if ((mssql.link=dbopen(mssql.login, host))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -837,7 +834,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
MS_SQL_G(num_links)++;
}
efree(hashed_details);
- php_mssql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
+ php_mssql_set_default_link(Z_LVAL_P(return_value));
}
/* }}} */
@@ -877,7 +874,7 @@ PHP_FUNCTION(mssql_close)
int id = -1;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mssql_link_index) == FAILURE) {
return;
}
@@ -908,7 +905,7 @@ PHP_FUNCTION(mssql_select_db)
int id = -1;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mssql_link_index) == FAILURE) {
return;
}
@@ -920,7 +917,7 @@ PHP_FUNCTION(mssql_select_db)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbuse(mssql_ptr->link, db)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to select database: %s", db);
+ php_error_docref(NULL, E_WARNING, "Unable to select database: %s", db);
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -930,7 +927,7 @@ PHP_FUNCTION(mssql_select_db)
/* {{{ php_mssql_get_column_content_with_type
*/
-static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
+static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type )
{
if (dbdata(mssql_ptr->link,offset) == NULL && dbdatlen(mssql_ptr->link,offset) == 0) {
ZVAL_NULL(result);
@@ -1047,7 +1044,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
ZVAL_STRINGL(result, res_buf, res_length, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
+ php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
ZVAL_FALSE(result);
}
}
@@ -1057,7 +1054,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
/* {{{ php_mssql_get_column_content_without_type
*/
-static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
+static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type)
{
if (dbdatlen(mssql_ptr->link,offset) == 0) {
ZVAL_NULL(result);
@@ -1127,7 +1124,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
ZVAL_STRINGL(result, res_buf, res_length, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
+ php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
ZVAL_FALSE(result);
}
}
@@ -1135,7 +1132,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
/* {{{ _mssql_get_sp_result
*/
-static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement TSRMLS_DC)
+static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement)
{
int i, num_rets, type;
char *parameter;
@@ -1187,7 +1184,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
}
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An output parameter variable was not provided");
+ php_error_docref(NULL, E_WARNING, "An output parameter variable was not provided");
}
}
}
@@ -1199,7 +1196,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL");
+ php_error_docref(NULL, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL");
}
}
}
@@ -1208,7 +1205,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
/* {{{ _mssql_fetch_batch
*/
-static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC)
+static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue)
{
int i, j = 0;
char computed_buf[16];
@@ -1274,7 +1271,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0);
for (j=0; j<result->num_fields; j++) {
INIT_ZVAL(result->data[i][j]);
- MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type TSRMLS_CC));
+ MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type));
}
if (i<result->batchsize || result->batchsize==0) {
i++;
@@ -1286,7 +1283,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->lastresult = retvalue;
}
if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) {
- _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, result->statement);
}
return i;
}
@@ -1300,7 +1297,7 @@ PHP_FUNCTION(mssql_fetch_batch)
mssql_result *result;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1313,7 +1310,7 @@ PHP_FUNCTION(mssql_fetch_batch)
mssql_ptr = result->mssql_ptr;
_free_result(result, 0);
result->cur_row=result->num_rows=0;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult);
RETURN_LONG(result->num_rows);
}
@@ -1334,7 +1331,7 @@ PHP_FUNCTION(mssql_query)
dbsettime(MS_SQL_G(timeout));
batchsize = MS_SQL_G(batchsize);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) {
return;
}
@@ -1351,11 +1348,11 @@ PHP_FUNCTION(mssql_query)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbcmd(mssql_ptr->link, query)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query");
+ php_error_docref(NULL, E_WARNING, "Unable to set query");
RETURN_FALSE;
}
if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue = dbresults(mssql_ptr->link))==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
+ php_error_docref(NULL, E_WARNING, "Query failed");
dbcancel(mssql_ptr->link);
RETURN_FALSE;
}
@@ -1388,7 +1385,7 @@ PHP_FUNCTION(mssql_query)
result->have_fields = 0;
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
}
@@ -1401,7 +1398,7 @@ PHP_FUNCTION(mssql_rows_affected)
zval *mssql_link_index;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_link_index) == FAILURE) {
return;
}
@@ -1419,7 +1416,7 @@ PHP_FUNCTION(mssql_free_result)
mssql_result *result;
int retvalue;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1462,7 +1459,7 @@ PHP_FUNCTION(mssql_num_rows)
zval *mssql_result_index;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1479,7 +1476,7 @@ PHP_FUNCTION(mssql_num_fields)
zval *mssql_result_index;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1501,12 +1498,12 @@ static void php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
switch (result_type) {
case MSSQL_NUM:
case MSSQL_ASSOC:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
break;
case MSSQL_BOTH:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &resulttype) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &resulttype) == FAILURE) {
return;
}
result_type = (resulttype > 0 && (resulttype & MSSQL_BOTH)) ? resulttype : result_type;
@@ -1615,14 +1612,14 @@ PHP_FUNCTION(mssql_data_seek)
long offset;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (offset < 0 || offset >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset");
+ php_error_docref(NULL, E_WARNING, "Bad row offset");
RETURN_FALSE;
}
@@ -1698,7 +1695,7 @@ PHP_FUNCTION(mssql_fetch_field)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1711,7 +1708,7 @@ PHP_FUNCTION(mssql_fetch_field)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1734,7 +1731,7 @@ PHP_FUNCTION(mssql_field_length)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1747,7 +1744,7 @@ PHP_FUNCTION(mssql_field_length)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1764,7 +1761,7 @@ PHP_FUNCTION(mssql_field_name)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1777,7 +1774,7 @@ PHP_FUNCTION(mssql_field_name)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1794,7 +1791,7 @@ PHP_FUNCTION(mssql_field_type)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1807,7 +1804,7 @@ PHP_FUNCTION(mssql_field_type)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1824,14 +1821,14 @@ PHP_FUNCTION(mssql_field_seek)
long field_offset;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (field_offset<0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
RETURN_FALSE;
}
@@ -1849,14 +1846,14 @@ PHP_FUNCTION(mssql_result)
int field_offset=0;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &mssql_result_index, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlZ", &mssql_result_index, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (row < 0 || row >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset (%ld)", row);
+ php_error_docref(NULL, E_WARNING, "Bad row offset (%ld)", row);
RETURN_FALSE;
}
@@ -1871,7 +1868,7 @@ PHP_FUNCTION(mssql_result)
}
}
if (i>=result->num_fields) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field));
+ php_error_docref(NULL, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field));
RETURN_FALSE;
}
break;
@@ -1880,7 +1877,7 @@ PHP_FUNCTION(mssql_result)
convert_to_long_ex(field);
field_offset = Z_LVAL_PP(field);
if (field_offset<0 || field_offset>=result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -1900,7 +1897,7 @@ PHP_FUNCTION(mssql_next_result)
mssql_result *result;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1918,7 +1915,7 @@ PHP_FUNCTION(mssql_next_result)
}
else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) {
if (result->statement) {
- _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, result->statement);
}
RETURN_FALSE;
}
@@ -1931,7 +1928,7 @@ PHP_FUNCTION(mssql_next_result)
result->num_fields = dbnumcols(mssql_ptr->link);
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
result->have_fields = 0;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
RETURN_TRUE;
}
@@ -1945,7 +1942,7 @@ PHP_FUNCTION(mssql_min_error_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -1960,7 +1957,7 @@ PHP_FUNCTION(mssql_min_message_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -1979,7 +1976,7 @@ PHP_FUNCTION(mssql_init)
mssql_statement *statement;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) {
return;
}
@@ -1991,7 +1988,7 @@ PHP_FUNCTION(mssql_init)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbrpcinit(mssql_ptr->link, sp_name,0)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to init stored procedure");
+ php_error_docref(NULL, E_WARNING, "unable to init stored procedure");
RETURN_FALSE;
}
@@ -2000,7 +1997,7 @@ PHP_FUNCTION(mssql_init)
statement->link = mssql_ptr;
statement->executed=FALSE;
- statement->id = zend_list_insert(statement,le_statement TSRMLS_CC);
+ statement->id = zend_list_insert(statement,le_statement);
RETURN_RESOURCE(statement->id);
}
@@ -2021,7 +2018,7 @@ PHP_FUNCTION(mssql_bind)
mssql_bind bind,*bindp;
LPBYTE value = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZl|bbl", &stmt, &param_name, &param_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsZl|bbl", &stmt, &param_name, &param_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) {
return;
}
@@ -2072,7 +2069,7 @@ PHP_FUNCTION(mssql_bind)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported type");
+ php_error_docref(NULL, E_WARNING, "unsupported type");
RETURN_FALSE;
break;
}
@@ -2101,7 +2098,7 @@ PHP_FUNCTION(mssql_bind)
/* no call to dbrpcparam if RETVAL */
if ( strcmp("RETVAL", param_name)!=0 ) {
if (dbrpcparam(mssql_ptr->link, param_name, (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter");
+ php_error_docref(NULL, E_WARNING, "Unable to set parameter");
RETURN_FALSE;
}
}
@@ -2127,7 +2124,7 @@ PHP_FUNCTION(mssql_execute)
batchsize = MS_SQL_G(batchsize);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &stmt, &skip_results) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &stmt, &skip_results) == FAILURE) {
return;
}
@@ -2137,7 +2134,7 @@ PHP_FUNCTION(mssql_execute)
exec_retval = dbrpcexec(mssql_ptr->link);
if (exec_retval == FAIL || dbsqlok(mssql_ptr->link) == FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed");
+ php_error_docref(NULL, E_WARNING, "stored procedure execution failed");
if (exec_retval == FAIL) {
dbcancel(mssql_ptr->link);
@@ -2149,7 +2146,7 @@ PHP_FUNCTION(mssql_execute)
retval_results=dbresults(mssql_ptr->link);
if (retval_results==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results");
+ php_error_docref(NULL, E_WARNING, "could not retrieve results");
dbcancel(mssql_ptr->link);
RETURN_FALSE;
}
@@ -2183,12 +2180,12 @@ PHP_FUNCTION(mssql_execute)
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), num_fields, 0);
result->statement = statement;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
}
}
}
if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) {
- _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, statement);
}
if (result==NULL) {
@@ -2208,7 +2205,7 @@ PHP_FUNCTION(mssql_free_statement)
mssql_statement *statement;
int retvalue;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_statement_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_statement_index) == FAILURE) {
return;
}
@@ -2238,7 +2235,7 @@ PHP_FUNCTION(mssql_guid_string)
char buffer[32+1];
char buffer2[36+1];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &binary, &binary_len, &sf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &binary, &binary_len, &sf) == FAILURE) {
return;
}
diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h
index b0313a160a..f0f793ed03 100644
--- a/ext/mssql/php_mssql.h
+++ b/ext/mssql/php_mssql.h
@@ -167,7 +167,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mssql)
long cfg_min_error_severity, cfg_min_message_severity;
long connect_timeout, timeout;
zend_bool compatibility_mode;
- void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type TSRMLS_DC);
+ void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type );
long textsize, textlimit, batchsize;
zend_bool datetimeconvert;
HashTable *resource_list, *resource_plist;
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4
index fd7f52ef3a..70bfd7110b 100644
--- a/ext/mysql/config.m4
+++ b/ext/mysql/config.m4
@@ -158,7 +158,7 @@ if test "$PHP_MYSQL" != "no"; then
fi
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
- PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
+ PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MYSQL_SHARED_LIBADD)
if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then
diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32
index 2a929b4165..0af94d9623 100644
--- a/ext/mysql/config.w32
+++ b/ext/mysql/config.w32
@@ -10,7 +10,7 @@ if (PHP_MYSQL != "no") {
PHP_MYSQL = "no";
WARNING("mysql not enabled; mysqlnd is not enabled");
} else {
- EXTENSION("mysql", "php_mysql.c");
+ EXTENSION("mysql", "php_mysql.c", PHP_MYSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
MESSAGE("\tusing mysqlnd build");
}
@@ -18,7 +18,7 @@ if (PHP_MYSQL != "no") {
if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL",
PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
- EXTENSION("mysql", "php_mysql.c");
+ EXTENSION("mysql", "php_mysql.c", PHP_MYSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
MESSAGE("\tusing libmysql");
} else {
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 4fcc9ca83a..af5743c124 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -352,12 +352,15 @@ zend_module_entry mysql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_MYSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysql)
#endif
void timeout(int sig);
-#define CHECK_LINK(link) { if (link == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link == NULL) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
#if defined(MYSQL_USE_MYSQLND)
#define PHPMY_UNBUFFERED_QUERY_CHECK() \
@@ -370,7 +373,7 @@ void timeout(int sig);
mysql->active_result_res->type == le_result) { \
if (mysql_result_is_unbuffered(_mysql_result) && \
!mysql_eof(_mysql_result)) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Function called without first fetching all " \
"rows from a previous unbuffered query"); \
} \
@@ -390,7 +393,7 @@ void timeout(int sig);
if (mysql_result && \
mysql->active_result_res->type == le_result) { \
if (!mysql_eof(mysql_result)) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Function called without first fetching " \
"all rows from a previous unbuffered query"); \
while (mysql_fetch_row(mysql_result)); \
@@ -407,7 +410,7 @@ void timeout(int sig);
* This wrapper is required since mysql_free_result() returns an integer, and
* thus, cannot be used directly
*/
-static void _free_mysql_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_mysql_result(zend_resource *rsrc)
{
MYSQL_RES *mysql_result = (MYSQL_RES *)rsrc->ptr;
@@ -418,7 +421,7 @@ static void _free_mysql_result(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_mysql_set_default_link
*/
-static void php_mysql_set_default_link(zend_resource *link TSRMLS_DC)
+static void php_mysql_set_default_link(zend_resource *link)
{
if (MySG(default_link) != NULL) {
zend_list_delete(MySG(default_link));
@@ -430,7 +433,7 @@ static void php_mysql_set_default_link(zend_resource *link TSRMLS_DC)
/* {{{ php_mysql_select_db
*/
-static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC)
+static int php_mysql_select_db(php_mysql_conn *mysql, char *db)
{
PHPMY_UNBUFFERED_QUERY_CHECK();
@@ -444,7 +447,7 @@ static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC)
/* {{{ _close_mysql_link
*/
-static void _close_mysql_link(zend_resource *rsrc TSRMLS_DC)
+static void _close_mysql_link(zend_resource *rsrc)
{
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
void (*handler)(int);
@@ -459,7 +462,7 @@ static void _close_mysql_link(zend_resource *rsrc TSRMLS_DC)
/* {{{ _close_mysql_plink
*/
-static void _close_mysql_plink(zend_resource *rsrc TSRMLS_DC)
+static void _close_mysql_plink(zend_resource *rsrc)
{
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
void (*handler) (int);
@@ -512,6 +515,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(mysql)
{
+#if defined(COMPILE_DL_MYSQL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysql_globals->num_persistent = 0;
mysql_globals->default_socket = NULL;
mysql_globals->default_host = NULL;
@@ -528,7 +534,7 @@ static PHP_GINIT_FUNCTION(mysql)
#ifdef MYSQL_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv TSRMLS_DC)
+static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv)
{
php_mysql_conn *mysql;
@@ -537,7 +543,7 @@ static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv TSRMLS_DC)
return NULL;
}
- mysql = zend_fetch_resource(zv TSRMLS_CC, -1, "MySQL-Link", NULL, 2, le_link, le_plink);
+ mysql = zend_fetch_resource(zv, -1, "MySQL-Link", NULL, 2, le_link, le_plink);
if (!mysql) {
return NULL;
@@ -581,7 +587,7 @@ ZEND_MODULE_STARTUP_D(mysql)
#endif
#ifdef MYSQL_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&mysql_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&mysql_reverse_api);
#endif
return SUCCESS;
@@ -635,7 +641,7 @@ PHP_RINIT_FUNCTION(mysql)
/* }}} */
#if defined(A0) && defined(MYSQL_USE_MYSQLND)
-static int php_mysql_persistent_helper(zval *el TSRMLS_DC)
+static int php_mysql_persistent_helper(zval *el)
{
zend_resource *le = (zend_resource *)Z_PTR_P(el);
if (le->type == le_plink) {
@@ -656,7 +662,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
if (MySG(trace_mode)) {
if (MySG(result_allocated)){
- php_error_docref("function.mysql-free-result" TSRMLS_CC, E_WARNING, "%pu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated));
+ php_error_docref("function.mysql-free-result", E_WARNING, "%pu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated));
}
}
@@ -665,7 +671,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
}
#if defined(A0) && defined(MYSQL_USE_MYSQLND)
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysql_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysql_persistent_helper);
#endif
return SUCCESS;
@@ -730,13 +736,13 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_string *hashed_details = NULL;
zend_bool free_host = 0, new_link = 0;
- php_error_docref(NULL TSRMLS_CC,
+ php_error_docref(NULL,
E_DEPRECATED,
"The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead");
#if !defined(MYSQL_USE_MYSQLND)
if ((MYSQL_VERSION_ID / 100) != (mysql_get_client_version() / 100)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Headers and client library minor version mismatch. Headers:%d Library:%ld",
MYSQL_VERSION_ID, mysql_get_client_version());
}
@@ -765,22 +771,22 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (PG(sql_safe_mode)) {
if (ZEND_NUM_ARGS()>0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
+ php_error_docref(NULL, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
}
- user = php_get_current_user(TSRMLS_C);
+ user = php_get_current_user();
hashed_details = zend_string_alloc(sizeof("mysql___") + strlen(user) - 1, 0);
snprintf(hashed_details->val, hashed_details->len + 1, "mysql__%s_", user);
client_flags = CLIENT_INTERACTIVE;
} else {
/* mysql_pconnect does not support new_link parameter */
if (persistent) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!l", &host_and_port, &host_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!l", &host_and_port, &host_len,
&user, &user_len, &passwd, &passwd_len,
&client_flags)==FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!bl", &host_and_port, &host_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!bl", &host_and_port, &host_len,
&user, &user_len, &passwd, &passwd_len,
&new_link, &client_flags)==FAILURE) {
return;
@@ -856,20 +862,20 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zval new_le;
if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MySG(num_links));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
if (MySG(max_persistent) != -1 && MySG(num_persistent) >= MySG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%pd)", MySG(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%pd)", MySG(num_persistent));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
/* create the link */
mysql = (php_mysql_conn *)malloc(sizeof(php_mysql_conn));
if (!mysql) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref(NULL, E_ERROR,
"Out of memory while allocating memory for a persistent link");
}
mysql->active_result_res = NULL;
@@ -891,7 +897,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Populate connect error globals so that the error functions can read them */
@@ -900,7 +906,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
MySG(connect_error) = estrdup(mysql_error(mysql->conn));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error));
+ php_error_docref(NULL, E_WARNING, "%s", MySG(connect_error));
#if defined(HAVE_MYSQL_ERRNO)
MySG(connect_errno) = mysql_errno(mysql->conn);
#endif
@@ -944,10 +950,10 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING, "Link to server lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), hashed_details);
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
@@ -981,7 +987,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (link && (link->type == le_link || link->type == le_plink)) {
GC_REFCOUNT(link)++;
ZVAL_RES(return_value, link);
- php_mysql_set_default_link(link TSRMLS_CC);
+ php_mysql_set_default_link(link);
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_CLEANUP();
return;
@@ -991,7 +997,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MySG(num_links));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
@@ -1009,7 +1015,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
if (!mysql->conn) {
MySG(connect_error) = estrdup("OOM");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OOM");
+ php_error_docref(NULL, E_WARNING, "OOM");
zend_string_release(hashed_details);
efree(mysql);
MYSQL_DO_CONNECT_RETURN_FALSE();
@@ -1022,7 +1028,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Populate connect error globals so that the error functions can read them */
@@ -1030,7 +1036,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(MySG(connect_error));
}
MySG(connect_error) = estrdup(mysql_error(mysql->conn));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error));
+ php_error_docref(NULL, E_WARNING, "%s", MySG(connect_error));
#if defined(HAVE_MYSQL_ERRNO)
MySG(connect_errno) = mysql_errno(mysql->conn);
#endif
@@ -1059,7 +1065,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
zend_string_release(hashed_details);
- php_mysql_set_default_link(Z_RES_P(return_value) TSRMLS_CC);
+ php_mysql_set_default_link(Z_RES_P(return_value));
MYSQL_DO_CONNECT_CLEANUP();
}
/* }}} */
@@ -1100,7 +1106,7 @@ PHP_FUNCTION(mysql_close)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1143,7 +1149,7 @@ PHP_FUNCTION(mysql_select_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1155,7 +1161,7 @@ PHP_FUNCTION(mysql_select_db)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (php_mysql_select_db(mysql, db)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1184,7 +1190,7 @@ PHP_FUNCTION(mysql_get_host_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1207,7 +1213,7 @@ PHP_FUNCTION(mysql_get_proto_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1230,7 +1236,7 @@ PHP_FUNCTION(mysql_get_server_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1254,7 +1260,7 @@ PHP_FUNCTION(mysql_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1281,7 +1287,7 @@ PHP_FUNCTION(mysql_thread_id)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1310,7 +1316,7 @@ PHP_FUNCTION(mysql_stat)
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1343,7 +1349,7 @@ PHP_FUNCTION(mysql_client_encoding)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1370,7 +1376,7 @@ PHP_FUNCTION(mysql_set_charset)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &csname, &csname_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &csname, &csname_len, &mysql_link) == FAILURE) {
return;
}
@@ -1402,7 +1408,7 @@ PHP_FUNCTION(mysql_create_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1433,7 +1439,7 @@ PHP_FUNCTION(mysql_drop_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1457,12 +1463,12 @@ PHP_FUNCTION(mysql_drop_db)
/* {{{ php_mysql_do_query_general
*/
-static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int query_len, char *db, int use_store, zval *return_value TSRMLS_DC)
+static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int query_len, char *db, int use_store, zval *return_value)
{
MYSQL_RES *mysql_result;
if (db) {
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
}
@@ -1482,16 +1488,16 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
mysql_real_query(mysql->conn, newquery, newql);
efree (newquery);
if (mysql_errno(mysql->conn)) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
RETURN_FALSE;
}
else {
mysql_result = mysql_use_result(mysql->conn);
while ((row = mysql_fetch_row(mysql_result))) {
if (!strcmp("ALL", row[1])) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
} else if (!strcmp("INDEX", row[1])) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
}
}
mysql_free_result(mysql_result);
@@ -1506,7 +1512,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
/* check possible error */
if (MySG(trace_mode)){
if (mysql_errno(mysql->conn)){
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
}
}
RETURN_FALSE;
@@ -1516,7 +1522,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
/* check possible error */
if (MySG(trace_mode)){
if (mysql_errno(mysql->conn)){
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
}
}
RETURN_FALSE;
@@ -1529,7 +1535,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
}
if (!mysql_result) {
if (PHP_MYSQL_VALID_RESULT(mysql->conn)) { /* query should have returned rows */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save result set");
+ php_error_docref(NULL, E_WARNING, "Unable to save result set");
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -1553,7 +1559,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &query, &query_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &query, &query_len, &mysql_link) == FAILURE) {
return;
}
@@ -1565,7 +1571,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_mysql_do_query_general(mysql, query, query_len, NULL, use_store, return_value TSRMLS_CC);
+ php_mysql_do_query_general(mysql, query, query_len, NULL, use_store, return_value);
}
/* }}} */
@@ -1594,7 +1600,7 @@ PHP_FUNCTION(mysql_db_query)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &db, &db_len, &query, &query_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|r", &db, &db_len, &query, &query_len, &mysql_link) == FAILURE) {
return;
}
@@ -1606,9 +1612,9 @@ PHP_FUNCTION(mysql_db_query)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() instead");
+ php_error_docref(NULL, E_DEPRECATED, "This function is deprecated; use mysql_query() instead");
- php_mysql_do_query_general(mysql, query, query_len, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC);
+ php_mysql_do_query_general(mysql, query, query_len, db, MYSQL_STORE_RESULT, return_value);
}
/* }}} */
@@ -1620,7 +1626,7 @@ PHP_FUNCTION(mysql_list_dbs)
MYSQL_RES *mysql_result;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1632,12 +1638,12 @@ PHP_FUNCTION(mysql_list_dbs)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() with SHOW DATABASES instead");
+ php_error_docref(NULL, E_DEPRECATED, "This function is deprecated; use mysql_query() with SHOW DATABASES instead");
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result = mysql_list_dbs(mysql->conn, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
@@ -1656,7 +1662,7 @@ PHP_FUNCTION(mysql_list_tables)
zval *mysql_link = NULL;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1668,14 +1674,14 @@ PHP_FUNCTION(mysql_list_tables)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result = mysql_list_tables(mysql->conn, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
MySG(result_allocated)++;
@@ -1693,7 +1699,7 @@ PHP_FUNCTION(mysql_list_fields)
php_mysql_conn *mysql;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &db, &db_len, &table, &table_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|r", &db, &db_len, &table, &table_len, &mysql_link) == FAILURE) {
return;
}
@@ -1705,14 +1711,14 @@ PHP_FUNCTION(mysql_list_fields)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result=mysql_list_fields(mysql->conn, table, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
MySG(result_allocated)++;
@@ -1728,7 +1734,7 @@ PHP_FUNCTION(mysql_list_processes)
zval *mysql_link = NULL;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1744,7 +1750,7 @@ PHP_FUNCTION(mysql_list_processes)
mysql_result = mysql_list_processes(mysql->conn);
if (mysql_result == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
@@ -1760,7 +1766,7 @@ PHP_FUNCTION(mysql_error)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1789,7 +1795,7 @@ PHP_FUNCTION(mysql_errno)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1818,7 +1824,7 @@ PHP_FUNCTION(mysql_affected_rows)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1843,7 +1849,7 @@ PHP_FUNCTION(mysql_escape_string)
size_t str_len;
zend_string *escaped_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -1854,7 +1860,7 @@ PHP_FUNCTION(mysql_escape_string)
escaped_str = zend_string_alloc(str_len * 2, 0);
escaped_str->len = mysql_escape_string(escaped_str->val, str, str_len);
- php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
+ php_error_docref("function.mysql-real-escape-string", E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
RETURN_STR(escaped_str);
}
/* }}} */
@@ -1869,7 +1875,7 @@ PHP_FUNCTION(mysql_real_escape_string)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &str, &str_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &str, &str_len, &mysql_link) == FAILURE) {
return;
}
@@ -1899,7 +1905,7 @@ PHP_FUNCTION(mysql_insert_id)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1934,14 +1940,14 @@ johannes TODO:
Do 2 zend_parse_parameters calls instead of type "z" and switch below
Q: String or long first?
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z", &result, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (row < 0 || row >= (int)mysql_num_rows(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on MySQL result index %pd", row, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on MySQL result index %pd", row, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_data_seek(mysql_result, row);
@@ -1971,7 +1977,7 @@ Q: String or long first?
i++;
}
if (!tmp_field) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in MySQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "%s%s%s not found in MySQL result index %pd",
(table_name?table_name:""), (table_name?".":""), field_name, Z_RES_P(result)->handle);
efree(field_name);
if (table_name) {
@@ -1989,7 +1995,7 @@ Q: String or long first?
convert_to_long_ex(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -2004,7 +2010,7 @@ Q: String or long first?
if (sql_row[field_offset]) {
#if PHP_API_VERSION < 20100412
if (PG(magic_quotes_runtime)) {
- RETVAL_STR(php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset], 0 TSRMLS_CC));
+ RETVAL_STR(php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset], 0));
} else {
#endif
RETVAL_STRINGL(sql_row[field_offset], sql_row_lengths[field_offset]);
@@ -2027,7 +2033,7 @@ PHP_FUNCTION(mysql_num_rows)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2045,7 +2051,7 @@ PHP_FUNCTION(mysql_num_fields)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2072,23 +2078,23 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|Sz", &res, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|Sz", &res, &class_name, &ctor_params) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() < 2) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
result_type = MYSQL_ASSOC;
} else
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &result_type) == FAILURE) {
return;
}
if (!result_type) {
@@ -2098,7 +2104,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
}
if (result_type & ~MYSQL_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
+ php_error_docref(NULL, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
result_type = MYSQL_BOTH;
}
@@ -2122,7 +2128,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
#if PHP_API_VERSION < 20100412
if (PG(magic_quotes_runtime)) {
- ZVAL_STR(&data, php_addslashes(mysql_row[i], mysql_row_lengths[i], 0 TSRMLS_CC));
+ ZVAL_STR(&data, php_addslashes(mysql_row[i], mysql_row_lengths[i], 0));
} else {
#endif
ZVAL_STRINGL(&data, mysql_row[i], mysql_row_lengths[i]);
@@ -2168,7 +2174,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_dtor(&dataset);
}
@@ -2184,14 +2190,14 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -2202,8 +2208,8 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
} else {
if (!Z_ISUNDEF(retval)) {
zval_ptr_dtor(&retval);
@@ -2213,7 +2219,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
efree(fci.params);
}
} else if (ctor_params) {
- 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->val);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
@@ -2264,14 +2270,14 @@ PHP_FUNCTION(mysql_data_seek)
zend_long offset;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &offset)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &offset)) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (offset < 0 || offset >= (int)mysql_num_rows(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset %pd is invalid for MySQL result index %pd (or the query data is unbuffered)", offset, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Offset %pd is invalid for MySQL result index %pd (or the query data is unbuffered)", offset, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_data_seek(mysql_result, offset);
@@ -2289,7 +2295,7 @@ PHP_FUNCTION(mysql_fetch_lengths)
int num_fields;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2392,7 +2398,7 @@ PHP_FUNCTION(mysql_fetch_field)
MYSQL_RES *mysql_result;
const MYSQL_FIELD *mysql_field;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result, &field) == FAILURE) {
return;
}
@@ -2400,7 +2406,7 @@ PHP_FUNCTION(mysql_fetch_field)
if (ZEND_NUM_ARGS() > 1) {
if (field<0 || field >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset");
+ php_error_docref(NULL, E_WARNING, "Bad field offset");
RETURN_FALSE;
}
mysql_field_seek(mysql_result, field);
@@ -2438,13 +2444,13 @@ PHP_FUNCTION(mysql_field_seek)
zend_long offset;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (offset < 0 || offset >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", offset, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Field %pd is invalid for MySQL result index %pd", offset, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_field_seek(mysql_result, offset);
@@ -2469,14 +2475,14 @@ static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
char buf[512];
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (field < 0 || field >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", field, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Field %pd is invalid for MySQL result index %pd", field, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_field_seek(mysql_result, field);
@@ -2626,7 +2632,7 @@ PHP_FUNCTION(mysql_free_result)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2644,7 +2650,7 @@ PHP_FUNCTION(mysql_ping)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link)==FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link)==FAILURE) {
return;
}
diff --git a/ext/mysql/php_mysql_structs.h b/ext/mysql/php_mysql_structs.h
index 8eb9aa1d29..214a5c689b 100644
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -127,7 +127,10 @@ ZEND_BEGIN_MODULE_GLOBALS(mysql)
ZEND_END_MODULE_GLOBALS(mysql)
#ifdef ZTS
-# define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v)
+# define MySG(v) ZEND_TSRMG(mysql_globals_id, zend_mysql_globals *, v)
+# ifdef COMPILE_DL_MYSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define MySG(v) (mysql_globals.v)
#endif
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4
index f6c86e762b..dedd1bc4a7 100644
--- a/ext/mysqli/config.m4
+++ b/ext/mysqli/config.m4
@@ -75,7 +75,7 @@ if test "$PHP_MYSQLI" != "no"; then
mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
mysqli_exception.c mysqli_result_iterator.c $mysqli_extra_sources"
- PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared)
+ PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h])
diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32
index ab8bcd0087..9213931393 100644
--- a/ext/mysqli/config.w32
+++ b/ext/mysqli/config.w32
@@ -23,7 +23,7 @@ if (PHP_MYSQLI != "no") {
"mysqli_warning.c";
if (PHP_MYSQLI == "yes" || PHP_MYSQLI == "mysqlnd") {
- EXTENSION("mysqli", mysqli_source);
+ EXTENSION("mysqli", mysqli_source, PHP_MYSQLI_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('MYSQLI_USE_MYSQLND', 1, 'Using MySQL native driver');
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
@@ -34,7 +34,7 @@ if (PHP_MYSQLI != "no") {
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI +
"\\include;" + PHP_PHP_BUILD +
"\\include\\mysql;" + PHP_MYSQLI)) {
- EXTENSION("mysqli", mysqli_source);
+ EXTENSION("mysqli", mysqli_source, PHP_MYSQLI_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
MESSAGE("\tlibmysql build");
PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 6d7210fe59..379bf5f855 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -44,7 +44,7 @@ static PHP_GINIT_FUNCTION(mysqli);
int i = 0; \
while (b[i].pname != NULL) { \
mysqli_add_property((a), (b)[i].pname, (b)[i].pname_length, \
- (mysqli_read_t)(b)[i].r_func, (mysqli_write_t)(b)[i].w_func TSRMLS_CC); \
+ (mysqli_read_t)(b)[i].r_func, (mysqli_write_t)(b)[i].w_func); \
i++; \
} \
}
@@ -70,8 +70,8 @@ zend_class_entry *mysqli_warning_class_entry;
zend_class_entry *mysqli_exception_class_entry;
-typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv TSRMLS_DC);
-typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval TSRMLS_DC);
+typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv);
+typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval);
typedef struct _mysqli_prop_handler {
zend_string *name;
@@ -89,7 +89,6 @@ static void free_prop_handler(zval *el) {
void php_mysqli_dtor_p_elements(void *data)
{
MYSQL *mysql = (MYSQL *)data;
- TSRMLS_FETCH();
mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT);
}
@@ -152,11 +151,11 @@ void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type)
#endif
/* {{{ php_clear_stmt_bind */
-void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
+void php_clear_stmt_bind(MY_STMT *stmt)
{
if (stmt->stmt) {
if (mysqli_stmt_close(stmt->stmt, TRUE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement");
+ php_error_docref(NULL, E_WARNING, "Error occurred while closing statement");
return;
}
}
@@ -197,13 +196,13 @@ void php_clear_mysql(MY_MYSQL *mysql) {
/* {{{ mysqli_objects_free_storage
*/
-static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_objects_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
my_efree(my_res);
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
@@ -211,7 +210,7 @@ static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
/* {{{ mysqli_link_free_storage
*/
-static void mysqli_link_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_link_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -219,41 +218,41 @@ static void mysqli_link_free_storage(zend_object *object TSRMLS_DC)
if (my_res && my_res->ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
if (mysql->mysql) {
- php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, my_res->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, my_res->status);
}
php_clear_mysql(mysql);
efree(mysql);
my_res->status = MYSQLI_STATUS_UNKNOWN;
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysql_driver_free_storage */
-static void mysqli_driver_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_driver_free_storage(zend_object *object)
{
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_stmt_free_storage
*/
-static void mysqli_stmt_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_stmt_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
if (my_res && my_res->ptr) {
MY_STMT *stmt = (MY_STMT *)my_res->ptr;
- php_clear_stmt_bind(stmt TSRMLS_CC);
+ php_clear_stmt_bind(stmt);
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_result_free_storage
*/
-static void mysqli_result_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_result_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -261,13 +260,13 @@ static void mysqli_result_free_storage(zend_object *object TSRMLS_DC)
if (my_res && my_res->ptr) {
mysql_free_result(my_res->ptr);
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_warning_free_storage
*/
-static void mysqli_warning_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_warning_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -276,28 +275,28 @@ static void mysqli_warning_free_storage(zend_object *object TSRMLS_DC)
php_clear_warnings((MYSQLI_WARNING *)my_res->info);
my_res->ptr = NULL;
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_read_na */
-static zval *mysqli_read_na(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *mysqli_read_na(mysqli_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property");
+ php_error_docref(NULL, E_ERROR, "Cannot read property");
return NULL;
}
/* }}} */
/* {{{ mysqli_write_na */
-static int mysqli_write_na(mysqli_object *obj, zval *newval TSRMLS_DC)
+static int mysqli_write_na(mysqli_object *obj, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property");
+ php_error_docref(NULL, E_ERROR, "Cannot write property");
return FAILURE;
}
/* }}} */
/* {{{ mysqli_read_property */
-zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval tmp_member;
zval *retval;
@@ -317,13 +316,13 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
}
if (hnd) {
- retval = hnd->read_func(obj, rv TSRMLS_CC);
+ retval = hnd->read_func(obj, rv);
if (retval == NULL) {
retval = &EG(uninitialized_zval);
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -335,7 +334,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
/* }}} */
/* {{{ mysqli_write_property */
-void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
mysqli_object *obj;
@@ -354,7 +353,7 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
}
if (hnd) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
/* ???
if (! PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
Z_ADDREF_P(value);
@@ -362,7 +361,7 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
} */
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -371,8 +370,8 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
}
/* }}} */
-/* {{{ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) */
-void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) {
+/* {{{ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func) */
+void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysqli_read_t r_func, mysqli_write_t w_func) {
mysqli_prop_handler p;
p.name = zend_string_init(pname, pname_len, 1);
@@ -383,7 +382,7 @@ void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysq
}
/* }}} */
-static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
mysqli_object *obj = Z_MYSQLI_P(object);
mysqli_prop_handler *p;
@@ -396,7 +395,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
break;
case 1: {
zval rv;
- zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
convert_to_boolean(value);
ret = Z_TYPE_P(value) == IS_TRUE ? 1 : 0;
@@ -405,7 +404,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
}
case 0:{
zval rv;
- zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
zval_ptr_dtor(value);
@@ -413,17 +412,17 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for has_set_exists");
+ php_error_docref(NULL, E_WARNING, "Invalid value for has_set_exists");
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- ret = std_hnd->has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ ret = std_hnd->has_property(object, member, has_set_exists, cache_slot);
}
return ret;
} /* }}} */
-HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp)
{
mysqli_object *obj = Z_MYSQLI_P(object);
HashTable *retval, *props = obj->prop_handler;
@@ -436,7 +435,7 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
zval rv, member;
zval *value;
ZVAL_STR(&member, entry->name);
- value = mysqli_read_property(object, &member, BP_VAR_IS, 0, &rv TSRMLS_CC);
+ value = mysqli_read_property(object, &member, BP_VAR_IS, 0, &rv);
if (value != &EG(uninitialized_zval)) {
zend_hash_add(retval, Z_STR(member), value);
}
@@ -448,7 +447,7 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ mysqli_objects_new
*/
-PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC)
+PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type)
{
mysqli_object *intern;
zend_class_entry *mysqli_base_class;
@@ -463,19 +462,19 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type
}
intern->prop_handler = zend_hash_find_ptr(&classes, mysqli_base_class->name);
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
/* link object */
- if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) {
+ if (instanceof_function(class_type, mysqli_link_class_entry)) {
handlers = &mysqli_object_link_handlers;
- } else if (instanceof_function(class_type, mysqli_driver_class_entry TSRMLS_CC)) { /* driver object */
+ } else if (instanceof_function(class_type, mysqli_driver_class_entry)) { /* driver object */
handlers = &mysqli_object_driver_handlers;
- } else if (instanceof_function(class_type, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
+ } else if (instanceof_function(class_type, mysqli_stmt_class_entry)) { /* stmt object */
handlers = &mysqli_object_stmt_handlers;
- } else if (instanceof_function(class_type, mysqli_result_class_entry TSRMLS_CC)) { /* result object */
+ } else if (instanceof_function(class_type, mysqli_result_class_entry)) { /* result object */
handlers = &mysqli_object_result_handlers;
- } else if (instanceof_function(class_type, mysqli_warning_class_entry TSRMLS_CC)) { /* warning object */
+ } else if (instanceof_function(class_type, mysqli_warning_class_entry)) { /* warning object */
handlers = &mysqli_object_warning_handlers;
} else {
handlers = &mysqli_object_handlers;
@@ -489,15 +488,15 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type
#ifdef MYSQLI_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC)
+static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv)
{
- if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry TSRMLS_CC)) {
+ if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry)) {
MY_MYSQL *mysql;
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(zv);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
/* We know that we have a mysqli object, so this failure should be emitted */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);
return NULL;
}
mysql = (MY_MYSQL *)(my_res->ptr);
@@ -537,6 +536,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(mysqli)
{
+#if defined(COMPILE_DL_MYSQLI) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysqli_globals->num_links = 0;
mysqli_globals->num_active_persistent = 0;
mysqli_globals->num_inactive_persistent = 0;
@@ -607,24 +609,24 @@ PHP_MINIT_FUNCTION(mysqli)
INIT_CLASS_ENTRY(cex, "mysqli_sql_exception", mysqli_exception_methods);
#ifdef HAVE_SPL
- mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException TSRMLS_CC);
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default());
#endif
mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
- zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC);
+ zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_driver", mysqli_driver_class_entry, mysqli_driver_methods);
ce = mysqli_driver_class_entry;
zend_hash_init(&mysqli_driver_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_driver_properties, mysqli_driver_property_entries);
- zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "driver_version", sizeof("driver_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "embedded", sizeof("embedded") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "reconnect", sizeof("reconnect") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "report_mode", sizeof("report_mode") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "driver_version", sizeof("driver_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "embedded", sizeof("embedded") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "reconnect", sizeof("reconnect") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "report_mode", sizeof("report_mode") - 1, ZEND_ACC_PUBLIC);
ce->ce_flags |= ZEND_ACC_FINAL;
zend_hash_add_ptr(&classes, ce->name, &mysqli_driver_properties);
@@ -632,25 +634,25 @@ PHP_MINIT_FUNCTION(mysqli)
ce = mysqli_link_class_entry;
zend_hash_init(&mysqli_link_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_link_properties, mysqli_link_property_entries);
- zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "connect_errno", sizeof("connect_errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "connect_error", sizeof("connect_error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "host_info", sizeof("host_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "info", sizeof("info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "server_info", sizeof("server_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "server_version", sizeof("server_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "stat", sizeof("stat") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "protocol_version", sizeof("protocol_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "thread_id", sizeof("thread_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "warning_count", sizeof("warning_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "connect_errno", sizeof("connect_errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "connect_error", sizeof("connect_error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "host_info", sizeof("host_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "info", sizeof("info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "server_info", sizeof("server_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "server_version", sizeof("server_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "stat", sizeof("stat") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "protocol_version", sizeof("protocol_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "thread_id", sizeof("thread_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "warning_count", sizeof("warning_count") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_link_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_warning", mysqli_warning_class_entry, mysqli_warning_methods);
@@ -658,39 +660,39 @@ PHP_MINIT_FUNCTION(mysqli)
ce->ce_flags |= ZEND_ACC_FINAL;
zend_hash_init(&mysqli_warning_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_warning_properties, mysqli_warning_property_entries);
- zend_declare_property_null(ce, "message", sizeof("message") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "message", sizeof("message") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_warning_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_result", mysqli_result_class_entry, mysqli_result_methods);
ce = mysqli_result_class_entry;
zend_hash_init(&mysqli_result_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_result_properties, mysqli_result_property_entries);
- zend_declare_property_null(ce, "current_field", sizeof("current_field") - 1,ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "lengths", sizeof("lengths") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "type", sizeof("type") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "current_field", sizeof("current_field") - 1,ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "lengths", sizeof("lengths") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "type", sizeof("type") - 1, ZEND_ACC_PUBLIC);
mysqli_result_class_entry->get_iterator = php_mysqli_result_get_iterator;
mysqli_result_class_entry->iterator_funcs.funcs = &php_mysqli_result_iterator_funcs;
- zend_class_implements(mysqli_result_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(mysqli_result_class_entry, 1, zend_ce_traversable);
zend_hash_add_ptr(&classes, ce->name, &mysqli_result_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_stmt", mysqli_stmt_class_entry, mysqli_stmt_methods);
ce = mysqli_stmt_class_entry;
zend_hash_init(&mysqli_stmt_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_stmt_properties, mysqli_stmt_property_entries);
- zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "param_count", sizeof("param_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "id", sizeof("id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "param_count", sizeof("param_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "id", sizeof("id") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_stmt_properties);
/* mysqli_options */
@@ -870,7 +872,7 @@ PHP_MINIT_FUNCTION(mysqli)
#ifdef MYSQLI_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&mysqli_reverse_api);
#endif
return SUCCESS;
@@ -930,12 +932,11 @@ PHP_RINIT_FUNCTION(mysqli)
#if defined(A0) && defined(MYSQLI_USE_MYSQLND)
static void php_mysqli_persistent_helper_for_every(void *p)
{
- TSRMLS_FETCH();
mysqlnd_end_psession((MYSQLND *) p);
} /* }}} */
-static int php_mysqli_persistent_helper_once(zend_rsrc_list_entry *le TSRMLS_DC)
+static int php_mysqli_persistent_helper_once(zend_rsrc_list_entry *le)
{
if (le->type == php_le_pmysqli()) {
mysqli_plist_entry *plist = (mysqli_plist_entry *) le->ptr;
@@ -960,7 +961,7 @@ PHP_RSHUTDOWN_FUNCTION(mysqli)
}
#if defined(A0) && defined(MYSQLI_USE_MYSQLND)
/* psession is being called when the connection is freed - explicitly or implicitly */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysqli_persistent_helper_once TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysqli_persistent_helper_once);
#endif
return SUCCESS;
}
@@ -1030,6 +1031,9 @@ zend_module_entry mysqli_module_entry = {
/* }}} */
#ifdef COMPILE_DL_MYSQLI
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysqli)
#endif
@@ -1052,7 +1056,7 @@ PHP_FUNCTION(mysqli_stmt_construct)
switch (ZEND_NUM_ARGS())
{
case 1: /* mysql_stmt_init */
- if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1062,7 +1066,7 @@ PHP_FUNCTION(mysqli_stmt_construct)
stmt->stmt = mysql_stmt_init(mysql->mysql);
break;
case 2:
- if (zend_parse_parameters(2 TSRMLS_CC, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
+ if (zend_parse_parameters(2, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1109,12 +1113,12 @@ PHP_FUNCTION(mysqli_result_construct)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
return;
}
break;
case 2:
- if (zend_parse_parameters(2 TSRMLS_CC, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) {
+ if (zend_parse_parameters(2, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) {
return;
}
break;
@@ -1132,7 +1136,7 @@ PHP_FUNCTION(mysqli_result_construct)
result = mysql_use_result(mysql->mysql);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for resultmode");
+ php_error_docref(NULL, E_WARNING, "Invalid value for resultmode");
}
if (!result) {
@@ -1149,7 +1153,7 @@ PHP_FUNCTION(mysqli_result_construct)
/* {{{ php_mysqli_fetch_into_hash_aux
*/
-void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype TSRMLS_DC)
+void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype)
{
#if !defined(MYSQLI_USE_MYSQLND)
MYSQL_ROW row;
@@ -1199,7 +1203,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
#if PHP_API_VERSION < 20100412
/* check if we need magic quotes */
if (PG(magic_quotes_runtime)) {
- ZVAL_STR(&res, php_addslashes(row[i], field_len[i], 0 TSRMLS_CC));
+ ZVAL_STR(&res, php_addslashes(row[i], field_len[i], 0));
} else {
#endif
ZVAL_STRINGL(&res, row[i], field_len[i]);
@@ -1245,28 +1249,28 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|Sz", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|Sz", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
return;
}
if (class_name == NULL) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
fetchtype = MYSQLI_ASSOC;
} else {
if (override_flags) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
fetchtype = override_flags;
} else {
fetchtype = MYSQLI_BOTH;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
return;
}
}
@@ -1274,11 +1278,11 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
+ php_error_docref(NULL, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
RETURN_FALSE;
}
- php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC);
+ php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype);
if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) {
zval dataset, retval;
@@ -1293,7 +1297,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_ptr_dtor(&dataset);
}
@@ -1309,14 +1313,14 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -1327,8 +1331,8 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
} else {
zval_ptr_dtor(&retval);
}
@@ -1336,7 +1340,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(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
}
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 69799729b7..698e6bb5ba 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -68,7 +68,7 @@ static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str
/* {{{ mysqlnd_escape_string_for_tx_name_in_comment */
char *
-mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
+mysqli_escape_string_for_tx_name_in_comment(const char * const name)
{
char * ret = NULL;
if (name) {
@@ -94,7 +94,7 @@ mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
{
*p_copy++ = v;
} else if (warned == FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
+ php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
warned = TRUE;
}
++p_orig;
@@ -108,7 +108,7 @@ mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
/* }}} */
/* {{{ mysqli_commit_or_rollback_libmysql */
-static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const uint32_t mode, const char * const name TSRMLS_DC)
+static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const uint32_t mode, const char * const name)
{
int ret;
smart_str tmp_str = {0};
@@ -117,7 +117,7 @@ static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, co
{
char *query;
- char *name_esc = mysqli_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char *name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
size_t query_len;
query_len = spprintf(&query, 0,
@@ -144,7 +144,7 @@ PHP_FUNCTION(mysqli_affected_rows)
zval *mysql_link;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -166,7 +166,7 @@ PHP_FUNCTION(mysqli_autocommit)
zval *mysql_link;
zend_bool automode;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -182,7 +182,7 @@ PHP_FUNCTION(mysqli_autocommit)
#ifndef MYSQLI_USE_MYSQLND
static
int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned int num_vars,
- zval *args, unsigned int start, const char * const types TSRMLS_DC)
+ zval *args, unsigned int start, const char * const types)
{
int i, ofs;
MYSQL_BIND *bind;
@@ -234,7 +234,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i+1);
+ php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i+1);
rc = 1;
goto end_1;
}
@@ -263,7 +263,7 @@ end_1:
#else
static
int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned int num_vars,
- zval *args, unsigned int start, const char * const types TSRMLS_DC)
+ zval *args, unsigned int start, const char * const types)
{
unsigned int i;
MYSQLND_PARAM_BIND *params;
@@ -298,7 +298,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
break;
default:
/* We count parameters from 1 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + start + 1);
+ php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + start + 1);
ret = FAIL;
mysqlnd_stmt_free_param_bind(stmt->stmt, params);
goto end;
@@ -334,7 +334,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
WRONG_PARAM_COUNT;
}
- if (zend_parse_method_parameters((getThis()) ? 1:2 TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry,
+ if (zend_parse_method_parameters((getThis()) ? 1:2, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry,
&types, &types_len) == FAILURE) {
return;
}
@@ -349,28 +349,28 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
--num_vars;
}
if (!types_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type or no types specified");
+ php_error_docref(NULL, E_WARNING, "Invalid type or no types specified");
RETURN_FALSE;
}
if (types_len != argc - start) {
/* number of bind variables doesn't match number of elements in type definition string */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
+ php_error_docref(NULL, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
RETURN_FALSE;
}
if (types_len != mysql_stmt_param_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement");
+ php_error_docref(NULL, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement");
RETURN_FALSE;
}
args = safe_emalloc(argc, sizeof(zval), 0);
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- zend_wrong_param_count(TSRMLS_C);
+ zend_wrong_param_count();
rc = 1;
} else {
- rc = mysqli_stmt_bind_param_do_bind(stmt, argc, num_vars, args, start, types TSRMLS_CC);
+ rc = mysqli_stmt_bind_param_do_bind(stmt, argc, num_vars, args, start, types);
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
}
@@ -386,7 +386,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
do_alloca, free_alloca
*/
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start TSRMLS_DC)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
{
MYSQL_BIND *bind;
int i, ofs;
@@ -525,7 +525,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Server returned unknown type %ld. Probably your client library is incompatible with the server version you use!", col_type);
+ php_error_docref(NULL, E_WARNING, "Server returned unknown type %ld. Probably your client library is incompatible with the server version you use!", col_type);
break;
}
}
@@ -556,7 +556,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
}
#else
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start TSRMLS_DC)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
{
unsigned int i;
MYSQLND_RESULT_BIND *params = mysqlnd_stmt_alloc_result_bind(stmt->stmt);
@@ -586,7 +586,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
start = 0;
}
- if (zend_parse_method_parameters((getThis()) ? 0:1 TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters((getThis()) ? 0:1, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -597,7 +597,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
}
if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
+ php_error_docref(NULL, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
RETURN_FALSE;
}
@@ -608,7 +608,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
WRONG_PARAM_COUNT;
}
- rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start TSRMLS_CC);
+ rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start);
efree(args);
@@ -629,7 +629,7 @@ PHP_FUNCTION(mysqli_change_user)
const CHARSET_INFO * old_charset;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -671,7 +671,7 @@ PHP_FUNCTION(mysqli_character_set_name)
zval *mysql_link;
const char *cs_name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -684,7 +684,7 @@ PHP_FUNCTION(mysqli_character_set_name)
/* }}} */
/* {{{ php_mysqli_close */
-void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC)
+void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status)
{
if (resource_status > MYSQLI_STATUS_INITIALIZED) {
MyG(num_links)--;
@@ -703,7 +703,7 @@ void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRM
if (MyG(rollback_on_cached_plink) &&
#if !defined(MYSQLI_USE_MYSQLND)
- mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, TRANS_COR_NO_OPT, NULL TSRMLS_CC))
+ mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, TRANS_COR_NO_OPT, NULL))
#else
FAIL == mysqlnd_rollback(mysql->mysql, TRANS_COR_NO_OPT, NULL))
#endif
@@ -731,13 +731,13 @@ PHP_FUNCTION(mysqli_close)
zval *mysql_link;
MY_MYSQL *mysql;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
- php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, ((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, ((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status);
((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status = MYSQLI_STATUS_UNKNOWN;
MYSQLI_CLEAR_RESOURCE(mysql_link);
@@ -756,13 +756,13 @@ PHP_FUNCTION(mysqli_commit)
char * name = NULL;
size_t name_len = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name TSRMLS_CC)) {
+ if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name)) {
#else
if (FAIL == mysqlnd_commit(mysql->mysql, flags, name)) {
#endif
@@ -780,14 +780,14 @@ PHP_FUNCTION(mysqli_data_seek)
zval *mysql_result;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (mysqli_result_is_unbuffered(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
+ php_error_docref(NULL, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
RETURN_FALSE;
}
@@ -807,7 +807,7 @@ PHP_FUNCTION(mysqli_debug)
char *debug;
size_t debug_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &debug, &debug_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &debug, &debug_len) == FAILURE) {
return;
}
@@ -823,7 +823,7 @@ PHP_FUNCTION(mysqli_dump_debug_info)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -839,7 +839,7 @@ PHP_FUNCTION(mysqli_errno)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -855,7 +855,7 @@ PHP_FUNCTION(mysqli_error)
zval *mysql_link;
const char *err;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -876,7 +876,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
unsigned int i;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -938,7 +938,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt) TSRMLS_CC);
+ php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt));
}
}
/* }}} */
@@ -956,7 +956,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
my_ulonglong llval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1117,7 +1117,7 @@ void mysqli_stmt_fetch_mysqlnd(INTERNAL_FUNCTION_PARAMETERS)
zval *mysql_stmt;
zend_bool fetched_anything;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1146,7 +1146,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
/* }}} */
/* {{{ php_add_field_properties */
-static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC)
+static void php_add_field_properties(zval *value, const MYSQL_FIELD *field)
{
#ifdef MYSQLI_USE_MYSQLND
add_property_str(value, "name", zend_string_copy(field->sname));
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(mysqli_fetch_field)
zval *mysql_result;
const MYSQL_FIELD *field;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1194,7 +1194,7 @@ PHP_FUNCTION(mysqli_fetch_field)
}
object_init(return_value);
- php_add_field_properties(return_value, field TSRMLS_CC);
+ php_add_field_properties(return_value, field);
}
/* }}} */
@@ -1208,7 +1208,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
unsigned int i;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1221,7 +1221,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
object_init(&obj);
- php_add_field_properties(&obj, field TSRMLS_CC);
+ php_add_field_properties(&obj, field);
add_index_zval(return_value, i, &obj);
}
}
@@ -1236,14 +1236,14 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
const MYSQL_FIELD *field;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (offset < 0 || offset >= (zend_long) mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset");
+ php_error_docref(NULL, E_WARNING, "Field offset is invalid for resultset");
RETURN_FALSE;
}
@@ -1252,7 +1252,7 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
}
object_init(return_value);
- php_add_field_properties(return_value, field TSRMLS_CC);
+ php_add_field_properties(return_value, field);
}
/* }}} */
@@ -1265,7 +1265,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
unsigned int i;
zend_ulong *ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1299,7 +1299,7 @@ PHP_FUNCTION(mysqli_field_count)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1317,13 +1317,13 @@ PHP_FUNCTION(mysqli_field_seek)
zval *mysql_result;
zend_long fieldnr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid field offset");
+ php_error_docref(NULL, E_WARNING, "Invalid field offset");
RETURN_FALSE;
}
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(mysqli_field_tell)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1355,7 +1355,7 @@ PHP_FUNCTION(mysqli_free_result)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(mysqli_get_host_info)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1410,7 +1410,7 @@ PHP_FUNCTION(mysqli_get_proto_info)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1426,7 +1426,7 @@ PHP_FUNCTION(mysqli_get_server_info)
zval *mysql_link = NULL;
const char *info;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(mysqli_get_server_version)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1462,7 +1462,7 @@ PHP_FUNCTION(mysqli_info)
zval *mysql_link = NULL;
const char *info;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1485,7 +1485,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
// To solve the problem, we added instanceof check for the class of $this
// ???
if (getThis() &&
- instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry) &&
(Z_MYSQLI_P(getThis()))->ptr) {
//??? if (getThis() && (Z_MYSQLI_P(getThis()))->ptr) {
return;
@@ -1511,7 +1511,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
mysqli_resource->ptr = (void *)mysql;
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
- if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC)) {
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
(Z_MYSQLI_P(getThis()))->ptr = mysqli_resource;
@@ -1535,7 +1535,7 @@ PHP_FUNCTION(mysqli_insert_id)
my_ulonglong rc;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1552,13 +1552,13 @@ PHP_FUNCTION(mysqli_kill)
zval *mysql_link;
zend_long processid;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (processid <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "processid should have positive value");
+ php_error_docref(NULL, E_WARNING, "processid should have positive value");
RETURN_FALSE;
}
@@ -1577,7 +1577,7 @@ PHP_FUNCTION(mysqli_more_results)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1592,13 +1592,13 @@ PHP_FUNCTION(mysqli_next_result) {
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!mysql_more_results(mysql->mysql)) {
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "There is no next result set. "
+ php_error_docref(NULL, E_STRICT, "There is no next result set. "
"Please, call mysqli_more_results()/mysqli::more_results() to check "
"whether to call this function/method");
}
@@ -1615,7 +1615,7 @@ PHP_FUNCTION(mysqli_stmt_more_results)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1630,13 +1630,13 @@ PHP_FUNCTION(mysqli_stmt_next_result) {
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (!mysqlnd_stmt_more_results(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "There is no next result set. "
+ php_error_docref(NULL, E_STRICT, "There is no next result set. "
"Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check "
"whether to call this function/method");
}
@@ -1653,7 +1653,7 @@ PHP_FUNCTION(mysqli_num_fields)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1669,13 +1669,13 @@ PHP_FUNCTION(mysqli_num_rows)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (mysqli_result_is_unbuffered_and_not_everything_is_fetched(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
+ php_error_docref(NULL, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
RETURN_LONG(0);
}
@@ -1766,7 +1766,7 @@ PHP_FUNCTION(mysqli_options)
zend_long ret;
int expected_type;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -1818,7 +1818,7 @@ PHP_FUNCTION(mysqli_ping)
zval *mysql_link;
zend_long rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1840,14 +1840,14 @@ PHP_FUNCTION(mysqli_prepare)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",&mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os",&mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
if (mysql->mysql->status == MYSQL_STATUS_GET_RESULT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be fetched before a new statement prepare takes place");
+ php_error_docref(NULL, E_WARNING, "All data must be fetched before a new statement prepare takes place");
RETURN_FALSE;
}
#endif
@@ -1926,7 +1926,7 @@ PHP_FUNCTION(mysqli_real_query)
char *query = NULL;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1940,7 +1940,7 @@ PHP_FUNCTION(mysqli_real_query)
if (!mysql_field_count(mysql->mysql)) {
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
}
@@ -1957,7 +1957,7 @@ PHP_FUNCTION(mysqli_real_escape_string) {
size_t escapestr_len;
zend_string *newstr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1980,13 +1980,13 @@ PHP_FUNCTION(mysqli_rollback)
char * name = NULL;
size_t name_len = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, flags, name TSRMLS_CC)) {
+ if (mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, flags, name)) {
#else
if (FAIL == mysqlnd_rollback(mysql->mysql, flags, name)) {
#endif
@@ -2006,13 +2006,13 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
zend_long param_nr;
size_t data_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (param_nr < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter number");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter number");
RETURN_FALSE;
}
if (mysql_stmt_send_long_data(stmt->stmt, param_nr, data, data_len)) {
@@ -2030,7 +2030,7 @@ PHP_FUNCTION(mysqli_stmt_affected_rows)
zval *mysql_stmt;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2050,14 +2050,14 @@ PHP_FUNCTION(mysqli_stmt_close)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
mysqli_stmt_close(stmt->stmt, FALSE);
stmt->stmt = NULL;
- php_clear_stmt_bind(stmt TSRMLS_CC);
+ php_clear_stmt_bind(stmt);
MYSQLI_CLEAR_RESOURCE(mysql_stmt);
RETURN_TRUE;
}
@@ -2071,11 +2071,11 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
zval *mysql_stmt;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) {
return;
}
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be positive");
+ php_error_docref(NULL, E_WARNING, "Offset must be positive");
RETURN_FALSE;
}
@@ -2092,7 +2092,7 @@ PHP_FUNCTION(mysqli_stmt_field_count)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2108,7 +2108,7 @@ PHP_FUNCTION(mysqli_stmt_free_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2126,7 +2126,7 @@ PHP_FUNCTION(mysqli_stmt_insert_id)
my_ulonglong rc;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2142,7 +2142,7 @@ PHP_FUNCTION(mysqli_stmt_param_count)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2158,7 +2158,7 @@ PHP_FUNCTION(mysqli_stmt_reset)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2179,7 +2179,7 @@ PHP_FUNCTION(mysqli_stmt_num_rows)
zval *mysql_stmt;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2199,7 +2199,7 @@ PHP_FUNCTION(mysqli_select_db)
char *dbname;
size_t dbname_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2220,7 +2220,7 @@ PHP_FUNCTION(mysqli_sqlstate)
zval *mysql_link;
const char *state;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2240,7 +2240,7 @@ PHP_FUNCTION(mysqli_ssl_set)
char *ssl_parm[5];
size_t ssl_parm_len[5], i;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osssss", &mysql_link, mysqli_link_class_entry, &ssl_parm[0], &ssl_parm_len[0], &ssl_parm[1], &ssl_parm_len[1], &ssl_parm[2], &ssl_parm_len[2], &ssl_parm[3], &ssl_parm_len[3], &ssl_parm[4], &ssl_parm_len[4]) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osssss", &mysql_link, mysqli_link_class_entry, &ssl_parm[0], &ssl_parm_len[0], &ssl_parm[1], &ssl_parm_len[1], &ssl_parm[2], &ssl_parm_len[2], &ssl_parm[3], &ssl_parm_len[3], &ssl_parm[4], &ssl_parm_len[4]) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -2269,7 +2269,7 @@ PHP_FUNCTION(mysqli_stat)
char *stat;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2298,7 +2298,7 @@ PHP_FUNCTION(mysqli_refresh)
zval *mysql_link = NULL;
zend_long options;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &options) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -2324,13 +2324,13 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
zend_long attr;
void *mode_p;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode_in) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode_in) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (mode_in < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
+ php_error_docref(NULL, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
RETURN_FALSE;
}
@@ -2367,7 +2367,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
zend_long attr;
int rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2391,7 +2391,7 @@ PHP_FUNCTION(mysqli_stmt_errno)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2408,7 +2408,7 @@ PHP_FUNCTION(mysqli_stmt_error)
zval *mysql_stmt;
const char * err;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2430,7 +2430,7 @@ PHP_FUNCTION(mysqli_stmt_init)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2462,7 +2462,7 @@ PHP_FUNCTION(mysqli_stmt_prepare)
char *query;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2486,7 +2486,7 @@ PHP_FUNCTION(mysqli_stmt_result_metadata)
zval *mysql_stmt;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2510,7 +2510,7 @@ PHP_FUNCTION(mysqli_stmt_store_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2560,7 +2560,7 @@ PHP_FUNCTION(mysqli_stmt_sqlstate)
zval *mysql_stmt;
const char * state;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2583,7 +2583,7 @@ PHP_FUNCTION(mysqli_store_result)
zend_long flags = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_link, mysqli_link_class_entry, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_link, mysqli_link_class_entry, &flags) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2597,7 +2597,7 @@ PHP_FUNCTION(mysqli_store_result)
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -2614,7 +2614,7 @@ PHP_FUNCTION(mysqli_thread_id)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2640,7 +2640,7 @@ PHP_FUNCTION(mysqli_use_result)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2651,7 +2651,7 @@ PHP_FUNCTION(mysqli_use_result)
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)result;
@@ -2667,7 +2667,7 @@ PHP_FUNCTION(mysqli_warning_count)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index 95096f4a61..bdb0a3796b 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -30,59 +30,59 @@
#include "mysqli_fe.h"
#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_BOOL(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_BOOL_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_LVAL_P(value) > 0; \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_LONG_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_LONG(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_LONG_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_LVAL_P(value); \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_STRING_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_STRING(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_STRING_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_STRVAL_P(value); \
return SUCCESS; \
} \
/* {{{ property driver_report_write */
-static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC)
+static int driver_report_write(mysqli_object *obj, zval *value)
{
MyG(report_mode) = Z_LVAL_P(value);
/*FIXME*/
- /* zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL TSRMLS_CC); */
+ /* zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL); */
return SUCCESS;
}
/* }}} */
/* {{{ property driver_embedded_read */
-static zval *driver_embedded_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_embedded_read(mysqli_object *obj, zval *retval)
{
#ifdef HAVE_EMBEDDED_MYSQLI
ZVAL_BOOL(retval, 1);
@@ -94,7 +94,7 @@ static zval *driver_embedded_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property driver_client_version_read */
-static zval *driver_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_client_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQL_VERSION_ID);
return retval;
@@ -102,7 +102,7 @@ static zval *driver_client_version_read(mysqli_object *obj, zval *retval TSRMLS_
/* }}} */
/* {{{ property driver_client_info_read */
-static zval *driver_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_client_info_read(mysqli_object *obj, zval *retval)
{
ZVAL_STRING(retval, (char *)mysql_get_client_info());
return retval;
@@ -110,7 +110,7 @@ static zval *driver_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property driver_driver_version_read */
-static zval *driver_driver_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_driver_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQLI_VERSION_ID);
return retval;
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 4c1c4a37a5..772cecf0fd 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -42,7 +42,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
HashPosition pos;
int index, rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "laa", &start, &args, &grps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "laa", &start, &args, &grps) == FAILURE) {
return;
}
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index ec86b9d740..5a8f84c2bc 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -36,7 +36,7 @@ const zend_function_entry mysqli_exception_methods[] = {
};
/* }}} */
-void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
+void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...)
{
zval sql_ex;
va_list arg;
@@ -47,7 +47,7 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
va_end(arg);;
if (!(MyG(report_mode) & MYSQLI_REPORT_STRICT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message);
+ php_error_docref(NULL, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message);
efree(message);
return;
}
@@ -56,21 +56,21 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
if (message) {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "message", sizeof("message") - 1,
- message TSRMLS_CC);
+ message);
}
if (sqlstate) {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
- sqlstate TSRMLS_CC);
+ sqlstate);
} else {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
- "00000" TSRMLS_CC);
+ "00000");
}
efree(message);
- zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
+ zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno);
- zend_throw_exception_object(&sql_ex TSRMLS_CC);
+ zend_throw_exception_object(&sql_ex);
}
/*
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index db0d0ee677..32bdcdfa69 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -37,12 +37,12 @@
#ifndef zend_parse_parameters_none
#define zend_parse_parameters_none() \
- zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
+ zend_parse_parameters(ZEND_NUM_ARGS(), "")
#endif
/* {{{ php_mysqli_set_error
*/
-static void php_mysqli_set_error(zend_long mysql_errno, char *mysql_err TSRMLS_DC)
+static void php_mysqli_set_error(zend_long mysql_errno, char *mysql_err)
{
MyG(error_no) = mysql_errno;
if (MyG(error_msg)) {
@@ -74,7 +74,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
#if !defined(MYSQL_USE_MYSQLND)
if ((MYSQL_VERSION_ID / 100) != (mysql_get_client_version() / 100)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Headers and client library minor version mismatch. Headers:%d Library:%ld",
MYSQL_VERSION_ID, mysql_get_client_version());
}
@@ -87,12 +87,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
hostname = username = dbname = passwd = socket = NULL;
if (!is_real_connect) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssssls", &hostname, &hostname_len, &username, &username_len,
&passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) {
return;
}
- if (object && instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
+ if (object && instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) {
mysqli_resource = (Z_MYSQLI_P(object))->ptr;
if (mysqli_resource && mysqli_resource->ptr) {
mysql = (MY_MYSQL*) mysqli_resource->ptr;
@@ -105,7 +105,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */
} else {
/* We have flags too */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sssslsl", &object, mysqli_link_class_entry,
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|sssslsl", &object, mysqli_link_class_entry,
&hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len,
&flags) == FAILURE) {
return;
@@ -144,13 +144,13 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
(mysqli_resource->status > MYSQLI_STATUS_INITIALIZED))
{
/* already connected, we should close the connection */
- php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status);
}
if (strlen(SAFE_STR(hostname)) > 2 && !strncasecmp(hostname, "p:", 2)) {
hostname += 2;
if (!MyG(allow_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
+ php_error_docref(NULL, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
} else {
mysql->persistent = persistent = TRUE;
@@ -200,14 +200,14 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
}
}
if (MyG(max_links) != -1 && MyG(num_links) >= MyG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MyG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MyG(num_links));
goto err;
}
if (persistent && MyG(max_persistent) != -1 &&
(MyG(num_active_persistent) + MyG(num_inactive_persistent))>= MyG(max_persistent))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%pd)",
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%pd)",
MyG(num_active_persistent) + MyG(num_inactive_persistent));
goto err;
}
@@ -238,12 +238,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == NULL)
#else
if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
- port, socket, flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ port, socket, flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Save error messages - for mysqli_connect_error() & mysqli_connect_errno() */
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
if (!is_real_connect) {
/* free mysql structure */
@@ -254,7 +254,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
}
/* clear error */
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
+ php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
#if !defined(MYSQLI_USE_MYSQLND)
mysql->mysql->reconnect = MyG(reconnect);
@@ -278,7 +278,7 @@ end:
mysql->multi_query = 0;
- if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
(Z_MYSQLI_P(object))->ptr = mysqli_resource;
@@ -362,13 +362,13 @@ PHP_FUNCTION(mysqli_fetch_all)
zval *mysql_result;
zend_long mode = MYSQLND_FETCH_NUM;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (!mode || (mode & ~MYSQLND_FETCH_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode can be only MYSQLI_FETCH_NUM, "
+ php_error_docref(NULL, E_WARNING, "Mode can be only MYSQLI_FETCH_NUM, "
"MYSQLI_FETCH_ASSOC or MYSQLI_FETCH_BOTH");
RETURN_FALSE;
}
@@ -395,7 +395,7 @@ PHP_FUNCTION(mysqli_get_connection_stats)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -413,7 +413,7 @@ PHP_FUNCTION(mysqli_error_list)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -454,7 +454,7 @@ PHP_FUNCTION(mysqli_stmt_error_list)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -505,7 +505,7 @@ PHP_FUNCTION(mysqli_multi_query)
char *query = NULL;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -551,12 +551,12 @@ PHP_FUNCTION(mysqli_query)
size_t query_len;
zend_long resultmode = MYSQLI_STORE_RESULT;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) {
return;
}
if (!query_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty query");
+ php_error_docref(NULL, E_WARNING, "Empty query");
RETURN_FALSE;
}
#ifdef MYSQLI_USE_MYSQLND
@@ -564,7 +564,7 @@ PHP_FUNCTION(mysqli_query)
#else
if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && (resultmode & ~MYSQLI_ASYNC) != MYSQLI_STORE_RESULT) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for resultmode");
+ php_error_docref(NULL, E_WARNING, "Invalid value for resultmode");
RETURN_FALSE;
}
@@ -592,7 +592,7 @@ PHP_FUNCTION(mysqli_query)
if (!mysql_field_count(mysql->mysql)) {
/* no result set - not a SELECT */
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
RETURN_TRUE;
}
@@ -615,13 +615,13 @@ PHP_FUNCTION(mysqli_query)
break;
}
if (!result) {
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -634,7 +634,7 @@ PHP_FUNCTION(mysqli_query)
#if defined(MYSQLI_USE_MYSQLND)
#include "php_network.h"
/* {{{ mysqlnd_zval_array_to_mysqlnd_array functions */
-static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_array TSRMLS_DC)
+static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_array)
{
zval *elem;
int i = 0, current = 0;
@@ -646,19 +646,19 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(in_array), elem) {
i++;
if (Z_TYPE_P(elem) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d not a mysqli object", i);
+ !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry)) {
+ php_error_docref(NULL, E_WARNING, "Parameter %d not a mysqli object", i);
} else {
MY_MYSQL *mysql;
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
continue;
}
mysql = (MY_MYSQL*) my_res->ptr;
if (MYSQLI_STATUS_VALID && my_res->status < MYSQLI_STATUS_VALID) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object %d or resource %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid object %d or resource %s", i, intern->zo.ce->name->val);
continue;
}
(*out_array)[current++] = mysql->mysql;
@@ -669,7 +669,7 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
/* }}} */
/* {{{ mysqlnd_zval_array_from_mysqlnd_array */
-static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_array TSRMLS_DC)
+static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_array)
{
MYSQLND **p = in_array;
zval dest_array;
@@ -681,7 +681,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(out_array), elem) {
i++;
if (Z_TYPE_P(elem) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry)) {
continue;
}
{
@@ -689,7 +689,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
continue;
}
mysql = (MY_MYSQL *) my_res->ptr;
@@ -713,7 +713,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
/* }}} */
/* {{{ mysqlnd_dont_poll_zval_array_from_mysqlnd_array */
-static int mysqlnd_dont_poll_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *in_zval_array, zval *out_array TSRMLS_DC)
+static int mysqlnd_dont_poll_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *in_zval_array, zval *out_array)
{
MYSQLND **p = in_array;
zval proxy, *elem, *dest_elem;
@@ -754,35 +754,35 @@ PHP_FUNCTION(mysqli_poll)
enum_func_status ret;
int desc_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) {
return;
}
if (sec < 0 || usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative values passed for sec and/or usec");
+ php_error_docref(NULL, E_WARNING, "Negative values passed for sec and/or usec");
RETURN_FALSE;
}
if (!r_array && !e_array) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, "No stream arrays were passed");
RETURN_FALSE;
}
if (r_array != NULL) {
- mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array TSRMLS_CC);
+ mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array);
}
if (e_array != NULL) {
- mysqlnd_zval_array_to_mysqlnd_array(e_array, &new_e_array TSRMLS_CC);
+ mysqlnd_zval_array_to_mysqlnd_array(e_array, &new_e_array);
}
ret = mysqlnd_poll(new_r_array, new_e_array, &new_dont_poll_array, sec, usec, &desc_num);
- mysqlnd_dont_poll_zval_array_from_mysqlnd_array(r_array != NULL ? new_dont_poll_array:NULL, r_array, dont_poll_array TSRMLS_CC);
+ mysqlnd_dont_poll_zval_array_from_mysqlnd_array(r_array != NULL ? new_dont_poll_array:NULL, r_array, dont_poll_array);
if (r_array != NULL) {
- mysqlnd_zval_array_from_mysqlnd_array(new_r_array, r_array TSRMLS_CC);
+ mysqlnd_zval_array_from_mysqlnd_array(new_r_array, r_array);
}
if (e_array != NULL) {
- mysqlnd_zval_array_from_mysqlnd_array(new_e_array, e_array TSRMLS_CC);
+ mysqlnd_zval_array_from_mysqlnd_array(new_e_array, e_array);
}
if (new_dont_poll_array) {
@@ -811,7 +811,7 @@ PHP_FUNCTION(mysqli_reap_async_query)
MYSQLI_RESOURCE *mysqli_resource;
MYSQL_RES *result = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -824,7 +824,7 @@ PHP_FUNCTION(mysqli_reap_async_query)
if (!mysql_field_count(mysql->mysql)) {
/* no result set - not a SELECT */
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
-/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql) TSRMLS_CC); */
+/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql)); */
}
RETURN_TRUE;
}
@@ -839,13 +839,13 @@ PHP_FUNCTION(mysqli_reap_async_query)
}
if (!result) {
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
-/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql) TSRMLS_CC); */
+/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql)); */
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -864,7 +864,7 @@ PHP_FUNCTION(mysqli_stmt_get_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -890,16 +890,16 @@ PHP_FUNCTION(mysqli_get_warnings)
MYSQLI_RESOURCE *mysqli_resource;
MYSQLI_WARNING *w;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (mysql_warning_count(mysql->mysql)) {
#ifdef MYSQLI_USE_MYSQLND
- w = php_get_warnings(mysql->mysql->data TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql->data);
#else
- w = php_get_warnings(mysql->mysql TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql);
#endif
} else {
RETURN_FALSE;
@@ -919,13 +919,13 @@ PHP_FUNCTION(mysqli_stmt_get_warnings)
MYSQLI_RESOURCE *mysqli_resource;
MYSQLI_WARNING *w;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, stmt_link, MYSQLI_STATUS_VALID);
if (mysqli_stmt_warning_count(stmt->stmt)) {
- w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
+ w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt));
} else {
RETURN_FALSE;
}
@@ -946,7 +946,7 @@ PHP_FUNCTION(mysqli_set_charset)
char *cs_name;
size_t csname_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &csname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &csname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -974,7 +974,7 @@ PHP_FUNCTION(mysqli_get_charset)
const MYSQLND_CHARSET *cs;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -993,7 +993,7 @@ PHP_FUNCTION(mysqli_get_charset)
#else
cs = mysql->mysql->data->charset;
if (!cs) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The connection has no charset associated");
+ php_error_docref(NULL, E_WARNING, "The connection has no charset associated");
RETURN_NULL();
}
name = cs->name;
@@ -1019,10 +1019,10 @@ PHP_FUNCTION(mysqli_get_charset)
#endif
#if !defined(MYSQLI_USE_MYSQLND)
-extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC);
+extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const name);
/* {{{ proto bool mysqli_begin_transaction_libmysql */
-static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name TSRMLS_DC)
+static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name)
{
int ret;
zend_bool err = FALSE;
@@ -1035,7 +1035,7 @@ static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mo
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
if (mysql_get_server_version(conn) < 50605L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
+ php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
err = TRUE;
} else if (mode & TRANS_START_READ_WRITE) {
if (tmp_str.s) {
@@ -1052,7 +1052,7 @@ static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mo
smart_str_0(&tmp_str);
if (err == FALSE){
- char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
char * query;
unsigned int query_len = spprintf(&query, 0, "START TRANSACTION%s %s",
name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
@@ -1081,16 +1081,16 @@ PHP_FUNCTION(mysqli_begin_transaction)
size_t name_len = -1;
zend_bool err = FALSE;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (flags < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%pd)", flags);
+ php_error_docref(NULL, E_WARNING, "Invalid value for parameter flags (%pd)", flags);
err = TRUE;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
err = TRUE;
}
if (TRUE == err) {
@@ -1098,7 +1098,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
}
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name TSRMLS_CC)) {
+ if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) {
RETURN_FALSE;
}
#else
@@ -1133,12 +1133,12 @@ PHP_FUNCTION(mysqli_savepoint)
char * name = NULL;
size_t name_len = -1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!name || !name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
RETURN_FALSE;
}
@@ -1162,12 +1162,12 @@ PHP_FUNCTION(mysqli_release_savepoint)
char * name = NULL;
size_t name_len = -1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!name || !name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
RETURN_FALSE;
}
#if !defined(MYSQLI_USE_MYSQLND)
@@ -1186,7 +1186,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
PHP_FUNCTION(mysqli_get_links_stats)
{
if (ZEND_NUM_ARGS()) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no parameters expected");
+ php_error_docref(NULL, E_WARNING, "no parameters expected");
return;
}
array_init(return_value);
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index cff28400ed..4040b338d1 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -61,22 +61,22 @@ extern const zend_property_info mysqli_warning_property_info_entries[];
extern int php_le_pmysqli(void);
extern void php_mysqli_dtor_p_elements(void *data);
-extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC);
+extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
-extern void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC);
+extern void php_clear_stmt_bind(MY_STMT *stmt);
extern void php_clear_mysql(MY_MYSQL *);
#ifdef MYSQLI_USE_MYSQLND
-extern MYSQLI_WARNING *php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC);
+extern MYSQLI_WARNING *php_get_warnings(MYSQLND_CONN_DATA * mysql);
#else
-extern MYSQLI_WARNING *php_get_warnings(MYSQL * mysql TSRMLS_DC);
+extern MYSQLI_WARNING *php_get_warnings(MYSQL * mysql);
#endif
extern void php_clear_warnings(MYSQLI_WARNING *w);
extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type);
-extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC);
-extern void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC);
-extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
+extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error);
+extern void php_mysqli_report_index(const char *query, unsigned int status);
+extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
@@ -84,7 +84,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
#define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type
-PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry * TSRMLS_DC);
+PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *);
#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
@@ -136,12 +136,12 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry * TSRMLS_DC
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_errno(mysql)) { \
- php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql) TSRMLS_CC); \
+ php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql)); \
}
#define MYSQLI_REPORT_STMT_ERROR(stmt) \
if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_stmt_errno(stmt)) { \
- php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt) TSRMLS_CC); \
+ php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt)); \
}
void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_connect, zend_bool in_ctor);
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 1354e0db93..e4377ff273 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -33,7 +33,7 @@
#define CHECK_STATUS(value) \
if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
+ php_error_docref(NULL, E_WARNING, "Property access is not allowed yet"); \
ZVAL_NULL(retval); \
return retval; \
} \
@@ -41,7 +41,7 @@
#define MYSQLI_GET_MYSQL(statusval) \
MYSQL *p; \
if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -52,7 +52,7 @@ if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
#define MYSQLI_GET_RESULT(statusval) \
MYSQL_RES *p; \
if (!obj->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -64,7 +64,7 @@ if (!obj->ptr) { \
#define MYSQLI_GET_STMT(statusval) \
MYSQL_STMT *p; \
if (!obj->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -73,7 +73,7 @@ if (!obj->ptr) { \
}
#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
-static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *__func(mysqli_object *obj, zval *retval) \
{\
__ret_type l;\
__get_type;\
@@ -91,7 +91,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
}
#define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
-static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC)\
+static zval *__func(mysqli_object *obj, zval *retval)\
{\
char *c;\
__get_type;\
@@ -109,7 +109,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC)\
}
/* {{{ property link_client_version_read */
-static zval *link_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_client_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQL_VERSION_ID);
return retval;
@@ -117,7 +117,7 @@ static zval *link_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC
/* }}} */
/* {{{ property link_client_info_read */
-static zval *link_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_client_info_read(mysqli_object *obj, zval *retval)
{
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
ZVAL_STRING(retval, MYSQL_SERVER_VERSION);
@@ -126,7 +126,7 @@ static zval *link_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_connect_errno_read */
-static zval *link_connect_errno_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_connect_errno_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, (zend_long)MyG(error_no));
return retval;
@@ -134,7 +134,7 @@ static zval *link_connect_errno_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_connect_error_read */
-static zval *link_connect_error_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_connect_error_read(mysqli_object *obj, zval *retval)
{
if (MyG(error_msg)) {
ZVAL_STRING(retval, MyG(error_msg));
@@ -146,7 +146,7 @@ static zval *link_connect_error_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_affected_rows_read */
-static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_affected_rows_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
my_ulonglong rc;
@@ -178,7 +178,7 @@ static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_error_list_read */
-static zval *link_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_error_list_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
@@ -235,7 +235,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_M
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
/* {{{ property link_stat_read */
-static zval *link_stat_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_stat_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
@@ -269,7 +269,7 @@ static zval *link_stat_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* result properties */
/* {{{ property result_type_read */
-static zval *result_type_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *result_type_read(mysqli_object *obj, zval *retval)
{
MYSQL_RES *p;
@@ -286,7 +286,7 @@ static zval *result_type_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property result_lengths_read */
-static zval *result_lengths_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *result_lengths_read(mysqli_object *obj, zval *retval)
{
MYSQL_RES *p;
zend_ulong *ret;
@@ -317,7 +317,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_R
/* statement properties */
/* {{{ property stmt_id_read */
-static zval *stmt_id_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_id_read(mysqli_object *obj, zval *retval)
{
MY_STMT *p;
@@ -335,7 +335,7 @@ static zval *stmt_id_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property stmt_affected_rows_read */
-static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval)
{
MY_STMT *p;
my_ulonglong rc;
@@ -365,7 +365,7 @@ static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property stmt_error_list_read */
-static zval *stmt_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_error_list_read(mysqli_object *obj, zval *retval)
{
MY_STMT * stmt;
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index ceec68efb4..bdd36b557d 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -27,7 +27,7 @@
#include "ext/standard/info.h"
#include "php_mysqli_structs.h"
-extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
+extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
/* {{{ proto bool mysqli_report(int flags)
sets report level */
@@ -36,7 +36,7 @@ PHP_FUNCTION(mysqli_report)
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -47,14 +47,14 @@ PHP_FUNCTION(mysqli_report)
/* }}} */
/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
-void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC)
+void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error)
{
- php_mysqli_throw_sql_exception((char *)sqlstate, errorno TSRMLS_CC, "%s", error);
+ php_mysqli_throw_sql_exception((char *)sqlstate, errorno, "%s", error);
}
/* }}} */
/* {{{ void php_mysqli_report_index() */
-void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
+void php_mysqli_report_index(const char *query, unsigned int status) {
char index[15];
if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) {
@@ -64,7 +64,7 @@ void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
} else {
return;
}
- php_mysqli_throw_sql_exception("00000", 0 TSRMLS_CC, "%s used in query/prepared statement %s", index, query);
+ php_mysqli_throw_sql_exception("00000", 0, "%s used in query/prepared statement %s", index, query);
}
/* }}} */
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c
index 5caa926b47..db8fa1dc2a 100644
--- a/ext/mysqli/mysqli_result_iterator.c
+++ b/ext/mysqli/mysqli_result_iterator.c
@@ -44,7 +44,7 @@ typedef struct {
/* {{{ */
-zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
php_mysqli_result_iterator *iterator;
@@ -52,7 +52,7 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = ecalloc(1, sizeof(php_mysqli_result_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_mysqli_result_iterator_funcs;
@@ -64,7 +64,7 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*)iter;
@@ -75,7 +75,7 @@ static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter TSRMLS_DC
/* }}} */
/* {{{ */
-static int php_mysqli_result_iterator_valid(zend_object_iterator *iter TSRMLS_DC)
+static int php_mysqli_result_iterator_valid(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -84,7 +84,7 @@ static int php_mysqli_result_iterator_valid(zend_object_iterator *iter TSRMLS_DC
/* }}} */
/* {{{ */
-static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -93,7 +93,7 @@ static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -103,7 +103,7 @@ static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter T
MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, "mysqli_result", MYSQLI_STATUS_VALID);
zval_ptr_dtor(&iterator->current_row);
- php_mysqli_fetch_into_hash_aux(&iterator->current_row, result, MYSQLI_ASSOC TSRMLS_CC);
+ php_mysqli_fetch_into_hash_aux(&iterator->current_row, result, MYSQLI_ASSOC);
if (Z_TYPE(iterator->current_row) == IS_ARRAY) {
iterator->row_num++;
}
@@ -111,7 +111,7 @@ static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter T
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
mysqli_object *intern = iterator->result;
@@ -125,19 +125,19 @@ static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter TSRMLS_
#else
if (result->eof) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data fetched with MYSQLI_USE_RESULT can be iterated only once");
+ php_error_docref(NULL, E_WARNING, "Data fetched with MYSQLI_USE_RESULT can be iterated only once");
return;
}
} else {
mysql_data_seek(result, 0);
}
iterator->row_num = -1;
- php_mysqli_result_iterator_move_forward(iter TSRMLS_CC);
+ php_mysqli_result_iterator_move_forward(iter);
}
/* }}} */
/* {{{ php_mysqli_result_iterator_current_key */
-static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, zval *key)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 084bc58581..db9c9dd5ee 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -53,7 +53,7 @@ void php_clear_warnings(MYSQLI_WARNING *w)
#ifndef MYSQLI_USE_MYSQLND
/* {{{ MYSQLI_WARNING *php_new_warning */
static
-MYSQLI_WARNING *php_new_warning(const char *reason, int errorno TSRMLS_DC)
+MYSQLI_WARNING *php_new_warning(const char *reason, int errorno)
{
MYSQLI_WARNING *w;
@@ -69,8 +69,8 @@ MYSQLI_WARNING *php_new_warning(const char *reason, int errorno TSRMLS_DC)
}
/* }}} */
-/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC) */
-MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
+/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */
+MYSQLI_WARNING *php_get_warnings(MYSQL *mysql)
{
MYSQLI_WARNING *w, *first = NULL, *prev = NULL;
MYSQL_RES *result;
@@ -83,7 +83,7 @@ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
result = mysql_store_result(mysql);
while ((row = mysql_fetch_row(result))) {
- w = php_new_warning(row[2], atoi(row[1]) TSRMLS_CC);
+ w = php_new_warning(row[2], atoi(row[1]));
if (!first) {
first = w;
}
@@ -99,7 +99,7 @@ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
#else
/* {{{ MYSQLI_WARNING *php_new_warning */
static
-MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno TSRMLS_DC)
+MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno)
{
MYSQLI_WARNING *w;
@@ -118,18 +118,18 @@ MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno TSRMLS_DC)
}
/* }}} */
-/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC) */
-MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
+/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */
+MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql)
{
MYSQLI_WARNING *w, *first = NULL, *prev = NULL;
MYSQL_RES *result;
zval row;
- if (mysql->m->query(mysql, "SHOW WARNINGS", 13 TSRMLS_CC)) {
+ if (mysql->m->query(mysql, "SHOW WARNINGS", 13)) {
return NULL;
}
- result = mysql->m->use_result(mysql, 0 TSRMLS_CC);
+ result = mysql->m->use_result(mysql, 0);
for (;;) {
zval *entry;
@@ -153,7 +153,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
/* 2. Here comes the reason */
entry = zend_hash_get_current_data(Z_ARRVAL(row));
- w = php_new_warning(entry, errno TSRMLS_CC);
+ w = php_new_warning(entry, errno);
/*
Don't destroy entry, because the row destroy will decrease
the refcounter. Decreased twice then mysqlnd_free_result()
@@ -184,7 +184,7 @@ PHP_METHOD(mysqli_warning, next)
mysqli_object *obj = Z_MYSQLI_P(getThis());
if (obj->ptr) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&mysqli_warning, mysqli_warning_class_entry) == FAILURE) {
return;
}
@@ -203,7 +203,7 @@ PHP_METHOD(mysqli_warning, next)
/* {{{ property mysqli_warning_message */
static
-zval *mysqli_warning_message(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_message(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -219,7 +219,7 @@ zval *mysqli_warning_message(mysqli_object *obj, zval *retval TSRMLS_DC)
/* {{{ property mysqli_warning_sqlstate */
static
-zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -235,7 +235,7 @@ zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval TSRMLS_DC)
/* {{{ property mysqli_warning_error */
static
-zval *mysqli_warning_errno(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_errno(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -262,7 +262,7 @@ PHP_METHOD(mysqli_warning, __construct)
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "o", &z)==FAILURE) {
+ if (zend_parse_parameters(1, "o", &z)==FAILURE) {
return;
}
obj = Z_MYSQLI_P(z);
@@ -272,12 +272,12 @@ PHP_METHOD(mysqli_warning, __construct)
MYSQLI_FETCH_RESOURCE_CONN(mysql, z, MYSQLI_STATUS_VALID);
if (mysql_warning_count(mysql->mysql)) {
#ifndef MYSQLI_USE_MYSQLND
- w = php_get_warnings(mysql->mysql TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql);
#else
- w = php_get_warnings(mysql->mysql->data TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql->data);
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No warnings found");
+ php_error_docref(NULL, E_WARNING, "No warnings found");
RETURN_FALSE;
}
} else if (obj->zo.ce == mysqli_stmt_class_entry) {
@@ -286,17 +286,17 @@ PHP_METHOD(mysqli_warning, __construct)
#ifndef MYSQLI_USE_MYSQLND
hdl = mysqli_stmt_get_connection(stmt->stmt);
if (mysql_warning_count(hdl)) {
- w = php_get_warnings(hdl TSRMLS_CC);
+ w = php_get_warnings(hdl);
#else
if (mysqlnd_stmt_warning_count(stmt->stmt)) {
- w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
+ w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt));
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No warnings found");
+ php_error_docref(NULL, E_WARNING, "No warnings found");
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid class argument");
+ php_error_docref(NULL, E_WARNING, "invalid class argument");
RETURN_FALSE;
}
@@ -304,7 +304,7 @@ PHP_METHOD(mysqli_warning, __construct)
mysqli_resource->ptr = mysqli_resource->info = (void *)w;
mysqli_resource->status = MYSQLI_STATUS_VALID;
- if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) {
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
} else {
(Z_MYSQLI_P(getThis()))->ptr = mysqli_resource;
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index d815df3eee..673440e093 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -164,8 +164,8 @@ struct st_mysqli_warning {
typedef struct _mysqli_property_entry {
const char *pname;
size_t pname_length;
- zval *(*r_func)(mysqli_object *obj, zval *retval TSRMLS_DC);
- int (*w_func)(mysqli_object *obj, zval *value TSRMLS_DC);
+ zval *(*r_func)(mysqli_object *obj, zval *retval);
+ int (*w_func)(mysqli_object *obj, zval *value);
} mysqli_property_entry;
typedef struct {
@@ -209,12 +209,12 @@ extern zend_class_entry *mysqli_exception_class_entry;
extern int php_le_pmysqli(void);
extern void php_mysqli_dtor_p_elements(void *data);
-extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC);
+extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
extern zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
-extern zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+extern zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype TSRMLS_DC);
+extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype);
#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
@@ -234,22 +234,22 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
zend_class_entry ce; \
INIT_CLASS_ENTRY(ce, name,class_functions); \
ce.create_object = mysqli_objects_new; \
- mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
+ mysqli_entry = zend_register_internal_class(&ce); \
} \
#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval) \
(Z_MYSQLI_P(__zval))->ptr = __ptr;
#define MYSQLI_RETURN_RESOURCE(__ptr, __ce) \
- RETVAL_OBJ(mysqli_objects_new(__ce TSRMLS_CC)); \
+ RETVAL_OBJ(mysqli_objects_new(__ce)); \
MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value)
#define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \
{\
zval *object = getThis(); \
- if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) { \
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) { \
object = return_value; \
- ZVAL_OBJ(object, mysqli_objects_new(__ce TSRMLS_CC)); \
+ ZVAL_OBJ(object, mysqli_objects_new(__ce)); \
} \
MYSQLI_REGISTER_RESOURCE_EX(__ptr, object)\
}
@@ -259,12 +259,12 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_RESOURCE *my_res; \
mysqli_object *intern = Z_MYSQLI_P(__id); \
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
RETURN_NULL();\
}\
__ptr = (__type)my_res->ptr; \
if (__check && my_res->status < __check) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL();\
}\
}
@@ -273,12 +273,12 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
{ \
MYSQLI_RESOURCE *my_res; \
if (!(my_res = (MYSQLI_RESOURCE *)(__obj->ptr))) {\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
return;\
}\
__ptr = (__type)my_res->ptr; \
if (__check && my_res->status < __check) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
return;\
}\
}
@@ -288,7 +288,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_FETCH_RESOURCE((__ptr), MY_MYSQL *, (__id), "mysqli_link", (__check)); \
if (!(__ptr)->mysql) { \
mysqli_object *intern = Z_MYSQLI_P(__id); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL(); \
} \
}
@@ -298,7 +298,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_FETCH_RESOURCE((__ptr), MY_STMT *, (__id), "mysqli_stmt", (__check)); \
if (!(__ptr)->stmt) { \
mysqli_object *intern = Z_MYSQLI_P(__id); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL();\
} \
}
@@ -344,7 +344,10 @@ ZEND_END_MODULE_GLOBALS(mysqli)
#ifdef ZTS
-#define MyG(v) TSRMG(mysqli_globals_id, zend_mysqli_globals *, v)
+#define MyG(v) ZEND_TSRMG(mysqli_globals_id, zend_mysqli_globals *, v)
+#ifdef COMPILE_DL_MYSQLI
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define MyG(v) (mysqli_globals.v)
#endif
diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32
index b13a81530a..ff102310dd 100644
--- a/ext/mysqlnd/config.w32
+++ b/ext/mysqlnd/config.w32
@@ -25,7 +25,7 @@ if (PHP_MYSQLND != "no") {
"mysqlnd_statistics.c " +
"mysqlnd_wireprotocol.c " +
"php_mysqlnd.c ";
- EXTENSION("mysqlnd", mysqlnd_source, false);
+ EXTENSION("mysqlnd", mysqlnd_source, false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) ||
(PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4
index 1a0136d8db..756a325014 100644
--- a/ext/mysqlnd/config9.m4
+++ b/ext/mysqlnd/config9.m4
@@ -41,7 +41,7 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then
fi
mysqlnd_sources="$mysqlnd_base_sources $mysqlnd_ps_sources"
- PHP_NEW_EXTENSION(mysqlnd, $mysqlnd_sources, $ext_shared)
+ PHP_NEW_EXTENSION(mysqlnd, $mysqlnd_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR([ext/mysqlnd], 1)
PHP_INSTALL_HEADERS([ext/mysqlnd/])
fi
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 08a10dbbd1..3da185ae29 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -67,7 +67,7 @@ PHPAPI MYSQLND_STATS *mysqlnd_global_stats = NULL;
/* {{{ mysqlnd_conn_data::free_options */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn)
{
zend_bool pers = conn->persistent;
@@ -107,19 +107,19 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn TSRMLS_
/* {{{ mysqlnd_conn_data::free_contents */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn)
{
zend_bool pers = conn->persistent;
DBG_ENTER("mysqlnd_conn_data::free_contents");
if (conn->current_result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
conn->current_result = NULL;
}
if (conn->net) {
- conn->net->data->m.free_contents(conn->net TSRMLS_CC);
+ conn->net->data->m.free_contents(conn->net);
}
DBG_INF("Freeing memory of members");
@@ -180,21 +180,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn TSRMLS
/* {{{ mysqlnd_conn_data::dtor */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::dtor");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- conn->m->free_contents(conn TSRMLS_CC);
- conn->m->free_options(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
+ conn->m->free_options(conn);
if (conn->net) {
- mysqlnd_net_free(conn->net, conn->stats, conn->error_info TSRMLS_CC);
+ mysqlnd_net_free(conn->net, conn->stats, conn->error_info);
conn->net = NULL;
}
if (conn->protocol) {
- mysqlnd_protocol_free(conn->protocol TSRMLS_CC);
+ mysqlnd_protocol_free(conn->protocol);
conn->protocol = NULL;
}
@@ -213,7 +213,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn TSRMLS_
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet,
zend_bool silent, enum php_mysqlnd_server_command command,
- zend_bool ignore_upsert_status TSRMLS_DC)
+ zend_bool ignore_upsert_status)
{
enum_func_status ret = FAIL;
@@ -222,7 +222,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
switch (ok_packet) {
case PROT_OK_PACKET:{
- MYSQLND_PACKET_OK * ok_response = conn->protocol->m.get_ok_packet(conn->protocol, FALSE TSRMLS_CC);
+ MYSQLND_PACKET_OK * ok_response = conn->protocol->m.get_ok_packet(conn->protocol, FALSE);
if (!ok_response) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -230,7 +230,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
if (!silent) {
DBG_ERR_FMT("Error while reading %s's OK packet", mysqlnd_command_to_text[command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's OK packet. PID=%u",
+ php_error_docref(NULL, E_WARNING, "Error while reading %s's OK packet. PID=%u",
mysqlnd_command_to_text[command], getpid());
}
} else {
@@ -268,7 +268,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
break;
}
case PROT_EOF_PACKET:{
- MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
+ MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE);
if (!ok_response) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -278,7 +278,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
"Malformed packet");
if (!silent) {
DBG_ERR_FMT("Error while reading %s's EOF packet", mysqlnd_command_to_text[command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's EOF packet. PID=%d",
+ php_error_docref(NULL, E_WARNING, "Error while reading %s's EOF packet. PID=%d",
mysqlnd_command_to_text[command], getpid());
}
} else if (0xFF == ok_response->field_count) {
@@ -289,7 +289,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
SET_CLIENT_ERROR(*conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet");
if (!silent) {
DBG_ERR_FMT("EOF packet expected, field count wasn't 0xFE but 0x%2X", ok_response->field_count);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet expected, field count wasn't 0xFE but 0x%2X",
+ php_error_docref(NULL, E_WARNING, "EOF packet expected, field count wasn't 0xFE but 0x%2X",
ok_response->field_count);
}
} else {
@@ -300,7 +300,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
}
default:
SET_CLIENT_ERROR(*conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet");
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong response packet %u passed to the function", ok_packet);
+ php_error_docref(NULL, E_ERROR, "Wrong response packet %u passed to the function", ok_packet);
break;
}
DBG_INF(ret == PASS ? "PASS":"FAIL");
@@ -312,7 +312,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
/* {{{ mysqlnd_conn_data::simple_command_send_request */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
- const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC)
+ const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status)
{
enum_func_status ret = PASS;
MYSQLND_PACKET_COMMAND * cmd_packet;
@@ -338,7 +338,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
SET_ERROR_AFF_ROWS(conn);
SET_EMPTY_ERROR(*conn->error_info);
- cmd_packet = conn->protocol->m.get_command_packet(conn->protocol, FALSE TSRMLS_CC);
+ cmd_packet = conn->protocol->m.get_command_packet(conn->protocol, FALSE);
if (!cmd_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -358,7 +358,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
php_error(E_WARNING, "Error while sending %s packet. PID=%d", mysqlnd_command_to_text[command], getpid());
}
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
DBG_ERR("Server is gone");
ret = FAIL;
}
@@ -372,14 +372,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent,
- zend_bool ignore_upsert_status TSRMLS_DC)
+ zend_bool ignore_upsert_status)
{
enum_func_status ret;
DBG_ENTER("mysqlnd_conn_data::simple_command");
- ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status TSRMLS_CC);
+ ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status);
if (PASS == ret && ok_packet != PROT_LAST) {
- ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status TSRMLS_CC);
+ ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status);
}
DBG_INF(ret == PASS ? "PASS":"FAIL");
@@ -390,18 +390,18 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum
/* {{{ mysqlnd_conn_data::set_server_option */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_server_option);
zend_uchar buffer[2];
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::set_server_option");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int2store(buffer, (unsigned int) option);
- ret = conn->m->simple_command(conn, COM_SET_OPTION, buffer, sizeof(buffer), PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_SET_OPTION, buffer, sizeof(buffer), PROT_EOF_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -410,7 +410,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::restart_psession */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::restart_psession");
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_REUSED);
@@ -426,7 +426,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn TSR
/* {{{ mysqlnd_conn_data::end_psession */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::end_psession");
DBG_RETURN(PASS);
@@ -440,9 +440,7 @@ mysqlnd_switch_to_ssl_if_needed(
MYSQLND_CONN_DATA * conn,
const MYSQLND_PACKET_GREET * const greet_packet,
const MYSQLND_OPTIONS * const options,
- zend_ulong mysql_flags
- TSRMLS_DC
- )
+ zend_ulong mysql_flags)
{
enum_func_status ret = FAIL;
const MYSQLND_CHARSET * charset;
@@ -474,7 +472,7 @@ mysqlnd_switch_to_ssl_if_needed(
DBG_INF_FMT("CLIENT_SSL_VERIFY_SERVER_CERT= %d", mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? 1:0);
DBG_INF_FMT("CLIENT_REMEMBER_OPTIONS= %d", mysql_flags & CLIENT_REMEMBER_OPTIONS? 1:0);
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -494,14 +492,14 @@ mysqlnd_switch_to_ssl_if_needed(
DBG_INF("Switching to SSL");
if (!PACKET_WRITE(auth_packet, conn)) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
goto end;
}
- conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
+ conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify);
- if (FAIL == conn->net->data->m.enable_ssl(conn->net TSRMLS_CC)) {
+ if (FAIL == conn->net->data->m.enable_ssl(conn->net)) {
goto end;
}
}
@@ -516,7 +514,7 @@ end:
/* {{{ mysqlnd_conn_data::fetch_auth_plugin_by_name */
static struct st_mysqlnd_authentication_plugin *
-MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol)
{
struct st_mysqlnd_authentication_plugin * auth_plugin;
char * plugin_name = NULL;
@@ -549,7 +547,7 @@ mysqlnd_run_authentication(
zend_ulong mysql_flags,
zend_bool silent,
zend_bool is_change_user
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
zend_bool first_call = TRUE;
@@ -576,10 +574,10 @@ mysqlnd_run_authentication(
}
do {
- struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol TSRMLS_CC);
+ struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol);
if (!auth_plugin) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
+ php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
goto end;
}
@@ -610,7 +608,7 @@ mysqlnd_run_authentication(
/* The data should be allocated with malloc() */
scrambled_data =
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
- plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
+ plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags);
if (conn->error_info->error_no) {
goto end;
}
@@ -622,7 +620,7 @@ mysqlnd_run_authentication(
scrambled_data, scrambled_data_len,
&switch_to_auth_protocol, &switch_to_auth_protocol_len,
&switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
- TSRMLS_CC);
+ );
} else {
ret = mysqlnd_auth_change_user(conn, user, strlen(user), passwd, passwd_len, db, db_len, silent,
first_call,
@@ -630,7 +628,7 @@ mysqlnd_run_authentication(
scrambled_data, scrambled_data_len,
&switch_to_auth_protocol, &switch_to_auth_protocol_len,
&switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
- TSRMLS_CC);
+ );
}
first_call = FALSE;
free(scrambled_data);
@@ -652,7 +650,7 @@ mysqlnd_run_authentication(
if (ret == PASS) {
DBG_INF_FMT("saving requested_protocol=%s", requested_protocol);
- conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
+ conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol);
}
end:
if (plugin_data) {
@@ -679,16 +677,16 @@ mysqlnd_connect_run_authentication(
const MYSQLND_PACKET_GREET * const greet_packet,
const MYSQLND_OPTIONS * const options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_connect_run_authentication");
- ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC);
+ ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags);
if (PASS == ret) {
ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len,
greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol,
- greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/ TSRMLS_CC);
+ greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/);
}
DBG_RETURN(ret);
}
@@ -697,7 +695,7 @@ mysqlnd_connect_run_authentication(
/* {{{ mysqlnd_conn_data::execute_init_commands */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn)
{
enum_func_status ret = PASS;
@@ -708,15 +706,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * con
const char * const command = conn->options->init_commands[current_command];
if (command) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT);
- if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) {
+ if (PASS != conn->m->query(conn, command, strlen(command))) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT);
ret = FAIL;
break;
}
if (conn->last_query_type == QUERY_SELECT) {
- MYSQLND_RES * result = conn->m->use_result(conn, 0 TSRMLS_CC);
+ MYSQLND_RES * result = conn->m->use_result(conn, 0);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
}
}
@@ -729,7 +727,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::get_updated_connect_flags */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags)
{
MYSQLND_NET * net = conn->net;
@@ -775,30 +773,30 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
const char * const host, const char * const user,
const char * const passwd, const unsigned int passwd_len,
const char * const db, const unsigned int db_len,
- const unsigned int mysql_flags TSRMLS_DC)
+ const unsigned int mysql_flags)
{
MYSQLND_PACKET_GREET * greet_packet;
MYSQLND_NET * net = conn->net;
DBG_ENTER("mysqlnd_conn_data::connect_handshake");
- greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE TSRMLS_CC);
+ greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE);
if (!greet_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL); /* OOM */
}
if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
- conn->stats, conn->error_info TSRMLS_CC))
+ conn->stats, conn->error_info))
{
goto err;
}
- DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC));
+ DBG_INF_FMT("stream=%p", net->data->m.get_stream(net));
if (FAIL == PACKET_READ(greet_packet, conn)) {
DBG_ERR("Error while reading greeting packet");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
+ php_error_docref(NULL, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
goto err;
} else if (greet_packet->error_no) {
DBG_ERR_FMT("errorno=%u error=%s", greet_packet->error_no, greet_packet->error);
@@ -806,7 +804,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
goto err;
} else if (greet_packet->pre41) {
DBG_ERR_FMT("Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet->server_version);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
+ php_error_docref(NULL, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
" is not supported. Server is %-.32s", greet_packet->server_version);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
"Connecting to 3.22, 3.23 & 4.0 servers is not supported");
@@ -819,7 +817,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
if (!conn->greet_charset) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
"Server sent charset unknown to the client. Please, report to the developers");
@@ -830,7 +828,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
conn->server_capabilities = greet_packet->server_capabilities;
if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len,
- greet_packet, conn->options, mysql_flags TSRMLS_CC))
+ greet_packet, conn->options, mysql_flags))
{
goto err;
}
@@ -859,7 +857,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
unsigned int port,
const char *socket_or_pipe,
unsigned int mysql_flags
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect);
size_t host_len;
@@ -873,7 +871,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_conn_data::connect");
DBG_INF_FMT("conn=%p", conn);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto err;
}
local_tx_started = TRUE;
@@ -891,10 +889,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
if (CONN_GET_STATE(conn) < CONN_QUIT_SENT) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CLOSE_IMPLICIT);
reconnect = TRUE;
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
}
- conn->m->free_contents(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_CONNECTIONS);
if (conn->persistent) {
MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_PERSISTENT_CONNECTIONS);
@@ -914,7 +912,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
}
} else {
unsigned int max_allowed_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE;
- conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size TSRMLS_CC);
+ conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size);
}
if (!host || !host[0]) {
@@ -978,9 +976,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
}
}
- mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags TSRMLS_CC);
+ mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags);
- if (FAIL == conn->m->connect_handshake(conn, host, user, passwd, passwd_len, db, db_len, mysql_flags TSRMLS_CC)) {
+ if (FAIL == conn->m->connect_handshake(conn, host, user, passwd, passwd_len, db, db_len, mysql_flags)) {
goto err;
}
@@ -1049,7 +1047,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
goto err; /* OOM */
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Impossible. Should be either socket or a pipe. Report a bug!");
+ php_error_docref(NULL, E_WARNING, "Impossible. Should be either socket or a pipe. Report a bug!");
}
if (!conn->unix_socket || !conn->host_info) {
SET_OOM_ERROR(*conn->error_info);
@@ -1064,7 +1062,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
mysqlnd_local_infile_default(conn);
- if (FAIL == conn->m->execute_init_commands(conn TSRMLS_CC)) {
+ if (FAIL == conn->m->execute_init_commands(conn)) {
goto err;
}
@@ -1078,7 +1076,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
DBG_INF_FMT("connection_id=%llu", conn->thread_id);
- conn->m->local_tx_end(conn, this_func, PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, PASS);
DBG_RETURN(PASS);
}
err:
@@ -1086,14 +1084,14 @@ err:
DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme);
if (!conn->error_info->error_no) {
SET_CLIENT_ERROR(*conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, conn->error_info->error? conn->error_info->error:"Unknown error");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%u] %.128s (trying to connect via %s)",
+ php_error_docref(NULL, E_WARNING, "[%u] %.128s (trying to connect via %s)",
conn->error_info->error_no, conn->error_info->error, conn->scheme);
}
- conn->m->free_contents(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_FAILURE);
if (TRUE == local_tx_started) {
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
}
DBG_RETURN(FAIL);
@@ -1110,7 +1108,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
unsigned int port,
const char * socket_or_pipe,
unsigned int mysql_flags
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect);
enum_func_status ret = FAIL;
@@ -1118,11 +1116,11 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
DBG_ENTER("mysqlnd_conn::connect");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd");
- ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
+ ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
}
DBG_RETURN(ret);
}
@@ -1138,7 +1136,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
const char * socket_or_pipe,
unsigned int mysql_flags,
unsigned int client_api_flags
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
zend_bool self_alloced = FALSE;
@@ -1154,7 +1152,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
}
}
- ret = conn_handle->m->connect(conn_handle, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
+ ret = conn_handle->m->connect(conn_handle, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags);
if (ret == FAIL) {
if (self_alloced) {
@@ -1162,7 +1160,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
We have alloced, thus there are no references to this
object - we are free to kill it!
*/
- conn_handle->m->dtor(conn_handle TSRMLS_CC);
+ conn_handle->m->dtor(conn_handle);
}
DBG_RETURN(NULL);
}
@@ -1177,23 +1175,23 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
Still the result from the query is PASS
*/
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, query);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::query");
DBG_INF_FMT("conn=%p conn=%llu query=%s", conn, conn->thread_id, query);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- if (PASS == conn->m->send_query(conn, query, query_len TSRMLS_CC) &&
- PASS == conn->m->reap_query(conn TSRMLS_CC))
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ if (PASS == conn->m->send_query(conn, query, query_len) &&
+ PASS == conn->m->reap_query(conn))
{
ret = PASS;
if (conn->last_query_type == QUERY_UPSERT && conn->upsert_status->affected_rows) {
MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status->affected_rows);
}
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1202,7 +1200,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char *
/* {{{ mysqlnd_conn_data::send_query */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query);
enum_func_status ret = FAIL;
@@ -1210,14 +1208,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch
DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query);
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
ret = conn->m->simple_command(conn, COM_QUERY, (zend_uchar *) query, query_len,
PROT_LAST /* we will handle the OK packet*/,
- FALSE, FALSE TSRMLS_CC);
+ FALSE, FALSE);
if (PASS == ret) {
CONN_SET_STATE(conn, CONN_QUERY_SENT);
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(ret);
@@ -1227,7 +1225,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch
/* {{{ mysqlnd_conn_data::reap_query */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, reap_query);
enum_mysqlnd_connection_state state = CONN_GET_STATE(conn);
@@ -1236,15 +1234,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC
DBG_INF_FMT("conn=%llu", conn->thread_id);
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (state <= CONN_READY || state == CONN_QUIT_SENT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection not opened, clear or has been closed");
+ php_error_docref(NULL, E_WARNING, "Connection not opened, clear or has been closed");
DBG_ERR_FMT("Connection not opened, clear or has been closed. State=%u", state);
DBG_RETURN(ret);
}
- ret = conn->m->query_read_result_set_header(conn, NULL TSRMLS_CC);
+ ret = conn->m->query_read_result_set_header(conn, NULL);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(ret);
@@ -1255,7 +1253,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC
#include "php_network.h"
/* {{{ mysqlnd_stream_array_to_fd_set */
-MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC)
+MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array)
{
int cnt = 0;
MYSQLND **p = conn_array, **p_p;
@@ -1289,7 +1287,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
/* {{{ mysqlnd_stream_array_to_fd_set */
-static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC)
+static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd)
{
php_socket_t this_fd;
php_stream *stream = NULL;
@@ -1303,7 +1301,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
* when casting. It is only used here so that the buffered data warning
* is not displayed.
* */
- stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC);
+ stream = (*p)->data->net->data->m.get_stream((*p)->data->net);
DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
(void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
@@ -1323,7 +1321,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
/* {{{ mysqlnd_stream_array_from_fd_set */
-static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC)
+static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds)
{
php_socket_t this_fd;
php_stream *stream = NULL;
@@ -1333,7 +1331,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
DBG_ENTER("mysqlnd_stream_array_from_fd_set");
while (*fwd) {
- stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC);
+ stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net);
DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
(void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
@@ -1366,7 +1364,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
/* {{{ _mysqlnd_poll */
PHPAPI enum_func_status
-_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC)
+_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num)
{
struct timeval tv;
struct timeval *tv_p = NULL;
@@ -1377,7 +1375,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
DBG_ENTER("_mysqlnd_poll");
if (sec < 0 || usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative values passed for sec and/or usec");
+ php_error_docref(NULL, E_WARNING, "Negative values passed for sec and/or usec");
DBG_RETURN(FAIL);
}
@@ -1386,8 +1384,8 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
FD_ZERO(&efds);
if (r_array != NULL) {
- *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC);
- set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
+ *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array);
+ set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd);
if (set_count > max_set_count) {
max_set_count = set_count;
}
@@ -1395,7 +1393,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
}
if (e_array != NULL) {
- set_count = mysqlnd_stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ set_count = mysqlnd_stream_array_to_fd_set(e_array, &efds, &max_fd);
if (set_count > max_set_count) {
max_set_count = set_count;
}
@@ -1403,7 +1401,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
}
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, *dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, *dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
DBG_ERR_FMT(*dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
DBG_RETURN(FAIL);
}
@@ -1424,16 +1422,16 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
retval = php_select(max_fd + 1, &rfds, &wfds, &efds, tv_p);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
errno, strerror(errno), max_fd);
DBG_RETURN(FAIL);
}
if (r_array != NULL) {
- mysqlnd_stream_array_from_fd_set(r_array, &rfds TSRMLS_CC);
+ mysqlnd_stream_array_from_fd_set(r_array, &rfds);
}
if (e_array != NULL) {
- mysqlnd_stream_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ mysqlnd_stream_array_from_fd_set(e_array, &efds);
}
*desc_num = retval;
@@ -1451,7 +1449,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
/* {{{ mysqlnd_conn_data::list_fields */
MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_fields);
/* db + \0 + wild + \0 (for wild) */
@@ -1461,7 +1459,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
DBG_ENTER("mysqlnd_conn_data::list_fields");
DBG_INF_FMT("conn=%llu table=%s wild=%s", conn->thread_id, table? table:"",achtung_wild? achtung_wild:"");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
p = buff;
if (table && (table_len = strlen(table))) {
@@ -1480,8 +1478,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
if (PASS != conn->m->simple_command(conn, COM_FIELD_LIST, buff, p - buff,
PROT_LAST /* we will handle the OK packet*/,
- FALSE, TRUE TSRMLS_CC)) {
- conn->m->local_tx_end(conn, 0, FAIL TSRMLS_CC);
+ FALSE, TRUE)) {
+ conn->m->local_tx_end(conn, 0, FAIL);
break;
}
@@ -1489,30 +1487,30 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
Prepare for the worst case.
MyISAM goes to 2500 BIT columns, double it for safety.
*/
- result = conn->m->result_init(5000, conn->persistent TSRMLS_CC);
+ result = conn->m->result_init(5000, conn->persistent);
if (!result) {
break;
}
- if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) {
+ if (FAIL == result->m.read_result_metadata(result, conn)) {
DBG_ERR("Error occurred while reading metadata");
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
result = NULL;
break;
}
result->type = MYSQLND_RES_NORMAL;
- result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, FALSE, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, FALSE, result->persistent);
if (!result->unbuf) {
/* OOM */
SET_OOM_ERROR(*conn->error_info);
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
result = NULL;
break;
}
result->unbuf->eof_reached = TRUE;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
@@ -1522,7 +1520,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
/* {{{ mysqlnd_conn_data::list_method */
MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char *achtung_wild, char *par1 TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char *achtung_wild, char *par1)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_method);
char * show_query = NULL;
@@ -1532,7 +1530,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
DBG_ENTER("mysqlnd_conn_data::list_method");
DBG_INF_FMT("conn=%llu query=%s wild=%u", conn->thread_id, query, achtung_wild);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (par1) {
if (achtung_wild) {
show_query_len = mnd_sprintf(&show_query, 0, query, par1, achtung_wild);
@@ -1547,13 +1545,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
}
}
- if (PASS == conn->m->query(conn, show_query, show_query_len TSRMLS_CC)) {
- result = conn->m->store_result(conn, MYSQLND_STORE_NO_COPY TSRMLS_CC);
+ if (PASS == conn->m->query(conn, show_query, show_query_len)) {
+ result = conn->m->store_result(conn, MYSQLND_STORE_NO_COPY);
}
if (show_query != query) {
mnd_sprintf_free(show_query);
}
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
}
@@ -1562,7 +1560,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
/* {{{ mysqlnd_conn_data::errno */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->error_no;
}
@@ -1571,7 +1569,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn TS
/* {{{ mysqlnd_conn_data::error */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->error;
}
@@ -1580,7 +1578,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn TS
/* {{{ mysqlnd_conn_data::sqlstate */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->sqlstate[0] ? conn->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
}
@@ -1589,10 +1587,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn
/* {{{ mysqlnd_old_escape_string */
PHPAPI zend_ulong
-mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC)
+mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len)
{
DBG_ENTER("mysqlnd_old_escape_string");
- DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name("latin1"), newstr, escapestr, escapestr_len TSRMLS_CC));
+ DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name("latin1"), newstr, escapestr, escapestr_len));
}
/* }}} */
@@ -1600,21 +1598,21 @@ mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapest
/* {{{ mysqlnd_conn_data::ssl_set */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert,
- const char * const ca, const char * const capath, const char * const cipher TSRMLS_DC)
+ const char * const ca, const char * const capath, const char * const cipher)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ssl_set);
enum_func_status ret = FAIL;
MYSQLND_NET * net = conn->net;
DBG_ENTER("mysqlnd_conn_data::ssl_set");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = (PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = (PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_KEY, key) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CERT, cert) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CA, ca) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CAPATH, capath) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CIPHER, cipher)) ? PASS : FAIL;
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1623,21 +1621,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const
/* {{{ mysqlnd_conn_data::escape_string */
static zend_ulong
-MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string);
zend_ulong ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::escape_string");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
DBG_INF_FMT("server_status=%u", conn->upsert_status->server_status);
if (conn->upsert_status->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) {
- ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len TSRMLS_CC);
+ ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len);
} else {
- ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len TSRMLS_CC);
+ ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len);
}
- conn->m->local_tx_end(conn, this_func, PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, PASS);
}
DBG_RETURN(ret);
}
@@ -1646,16 +1644,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn,
/* {{{ mysqlnd_conn_data::dump_debug_info */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, server_dump_debug_information);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::dump_debug_info");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_DEBUG, NULL, 0, PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_DEBUG, NULL, 0, PROT_EOF_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -1665,7 +1663,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::select_db */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, select_db);
enum_func_status ret = FAIL;
@@ -1673,8 +1671,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
DBG_ENTER("mysqlnd_conn_data::select_db");
DBG_INF_FMT("conn=%llu db=%s", conn->thread_id, db);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_INIT_DB, (zend_uchar*) db, db_len, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_INIT_DB, (zend_uchar*) db, db_len, PROT_OK_PACKET, FALSE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
@@ -1692,7 +1690,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
ret = FAIL;
}
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1701,7 +1699,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
/* {{{ mysqlnd_conn_data::ping */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ping);
enum_func_status ret = FAIL;
@@ -1709,15 +1707,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC
DBG_ENTER("mysqlnd_conn_data::ping");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_PING, NULL, 0, PROT_OK_PACKET, TRUE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_PING, NULL, 0, PROT_OK_PACKET, TRUE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
*/
SET_ERROR_AFF_ROWS(conn);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("ret=%u", ret);
DBG_RETURN(ret);
@@ -1727,7 +1725,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC
/* {{{ mysqlnd_conn_data::statistic */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, get_server_statistics);
enum_func_status ret = FAIL;
@@ -1736,13 +1734,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
DBG_ENTER("mysqlnd_conn_data::statistic");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
- ret = conn->m->simple_command(conn, COM_STATISTICS, NULL, 0, PROT_LAST, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_STATISTICS, NULL, 0, PROT_LAST, FALSE, TRUE);
if (FAIL == ret) {
break;
}
- stats_header = conn->protocol->m.get_stats_packet(conn->protocol, FALSE TSRMLS_CC);
+ stats_header = conn->protocol->m.get_stats_packet(conn->protocol, FALSE);
if (!stats_header) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -1756,7 +1754,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
PACKET_FREE(stats_header);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1765,7 +1763,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
/* {{{ mysqlnd_conn_data::kill */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, kill_connection);
enum_func_status ret = FAIL;
@@ -1774,23 +1772,23 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p
DBG_ENTER("mysqlnd_conn_data::kill");
DBG_INF_FMT("conn=%llu pid=%u", conn->thread_id, pid);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int4store(buff, pid);
/* If we kill ourselves don't expect OK packet, PROT_LAST will skip it */
if (pid != conn->thread_id) {
- ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_OK_PACKET, FALSE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
*/
SET_ERROR_AFF_ROWS(conn);
- } else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE TSRMLS_CC))) {
+ } else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE))) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1799,7 +1797,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p
/* {{{ mysqlnd_conn_data::set_charset */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const csname TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const csname)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_charset);
enum_func_status ret = FAIL;
@@ -1814,12 +1812,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
DBG_RETURN(ret);
}
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
char * query;
size_t query_len = mnd_sprintf(&query, 0, "SET NAMES %s", csname);
- if (FAIL == (ret = conn->m->query(conn, query, query_len TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error executing query");
+ if (FAIL == (ret = conn->m->query(conn, query, query_len))) {
+ php_error_docref(NULL, E_WARNING, "Error executing query");
} else if (conn->error_info->error_no) {
ret = FAIL;
} else {
@@ -1827,7 +1825,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
}
mnd_sprintf_free(query);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF(ret == PASS? "PASS":"FAIL");
@@ -1838,7 +1836,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
/* {{{ mysqlnd_conn_data::refresh */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, refresh_server);
enum_func_status ret = FAIL;
@@ -1846,12 +1844,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8
DBG_ENTER("mysqlnd_conn_data::refresh");
DBG_INF_FMT("conn=%llu options=%lu", conn->thread_id, options);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int1store(bits, options);
- ret = conn->m->simple_command(conn, COM_REFRESH, bits, 1, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_REFRESH, bits, 1, PROT_OK_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1860,7 +1858,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8
/* {{{ mysqlnd_conn_data::shutdown */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, shutdown_server);
enum_func_status ret = FAIL;
@@ -1868,12 +1866,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint
DBG_ENTER("mysqlnd_conn_data::shutdown");
DBG_INF_FMT("conn=%llu level=%lu", conn->thread_id, level);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int1store(bits, level);
- ret = conn->m->simple_command(conn, COM_SHUTDOWN, bits, 1, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_SHUTDOWN, bits, 1, PROT_OK_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1882,11 +1880,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint
/* {{{ mysqlnd_send_close */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn)
{
enum_func_status ret = PASS;
MYSQLND_NET * net = conn->net;
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
enum mysqlnd_connection_state state;
DBG_ENTER("mysqlnd_send_close");
@@ -1904,8 +1902,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
case CONN_READY:
DBG_INF("Connection clean, sending COM_QUIT");
if (net_stream) {
- ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE TSRMLS_CC);
- net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE);
+ net->data->m.close_stream(net, conn->stats, conn->error_info);
}
CONN_SET_STATE(conn, CONN_QUIT_SENT);
break;
@@ -1935,7 +1933,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
/* Fall-through */
case CONN_QUIT_SENT:
/* The user has killed its own connection */
- net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
+ net->data->m.close_stream(net, conn->stats, conn->error_info);
break;
}
@@ -1946,7 +1944,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
/* {{{ mysqlnd_conn_data::get_reference */
static MYSQLND_CONN_DATA *
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_reference");
++conn->refcount;
@@ -1958,7 +1956,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::free_reference */
static enum_func_status
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn)
{
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::free_reference");
@@ -1969,8 +1967,8 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * co
This will free the object too, of course because references has
reached zero.
*/
- ret = conn->m->send_close(conn TSRMLS_CC);
- conn->m->dtor(conn TSRMLS_CC);
+ ret = conn->m->send_close(conn);
+ conn->m->dtor(conn);
}
DBG_RETURN(ret);
}
@@ -1979,7 +1977,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * co
/* {{{ mysqlnd_conn_data::get_state */
static enum mysqlnd_connection_state
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_state");
DBG_RETURN(conn->state);
@@ -1989,7 +1987,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * c
/* {{{ mysqlnd_conn_data::set_state */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state)
{
DBG_ENTER("mysqlnd_conn_data::set_state");
DBG_INF_FMT("New state=%u", new_state);
@@ -2001,7 +1999,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::field_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn)
{
return conn->field_count;
}
@@ -2010,7 +2008,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::server_status */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->server_status;
}
@@ -2019,7 +2017,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::insert_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->last_insert_id;
}
@@ -2028,7 +2026,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::affected_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->affected_rows;
}
@@ -2037,7 +2035,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::warning_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->warning_count;
}
@@ -2046,7 +2044,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->last_message;
}
@@ -2070,7 +2068,7 @@ PHPAPI unsigned int mysqlnd_get_client_version()
/* {{{ mysqlnd_conn_data::get_server_info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->server_version;
}
@@ -2079,7 +2077,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::get_host_info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->host_info;
}
@@ -2088,7 +2086,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::get_proto_info */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->protocol_version;
}
@@ -2097,7 +2095,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * cons
/* {{{ mysqlnd_conn_data::charset_name */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn)
{
return conn->charset->name;
}
@@ -2106,7 +2104,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::thread_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn)
{
return conn->thread_id;
}
@@ -2115,7 +2113,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::get_server_version */
static zend_ulong
-MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn)
{
zend_long major, minor, patch;
char *p;
@@ -2137,7 +2135,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA *
/* {{{ mysqlnd_conn_data::more_results */
static zend_bool
-MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::more_results");
/* (conn->state == CONN_NEXT_RESULT_PENDING) too */
@@ -2148,7 +2146,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::next_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, next_result);
enum_func_status ret = FAIL;
@@ -2156,7 +2154,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
DBG_ENTER("mysqlnd_conn_data::next_result");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
if (CONN_GET_STATE(conn) != CONN_NEXT_RESULT_PENDING) {
break;
@@ -2168,16 +2166,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
We are sure that there is a result set, since conn->state is set accordingly
in mysqlnd_store_result() or mysqlnd_fetch_row_unbuffered()
*/
- if (FAIL == (ret = conn->m->query_read_result_set_header(conn, NULL TSRMLS_CC))) {
+ if (FAIL == (ret = conn->m->query_read_result_set_header(conn, NULL))) {
/*
There can be an error in the middle of a multi-statement, which will cancel the multi-statement.
So there are no more results and we should just return FALSE, error_no has been set
*/
if (!conn->error_info->error_no) {
DBG_ERR_FMT("Serious error. %s::%u", __FILE__, __LINE__);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error. PID=%d", getpid());
+ php_error_docref(NULL, E_WARNING, "Serious error. PID=%d", getpid());
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
} else {
DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error);
}
@@ -2187,7 +2185,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status->affected_rows);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2254,7 +2252,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
const char * db,
zend_bool silent,
size_t passwd_len
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, change_user);
enum_func_status ret = FAIL;
@@ -2263,7 +2261,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
DBG_INF_FMT("conn=%llu user=%s passwd=%s db=%s silent=%u",
conn->thread_id, user?user:"", passwd?"***":"null", db?db:"", (silent == TRUE)?1:0 );
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
@@ -2283,13 +2281,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
/* XXX: passwords that have \0 inside work during auth, but in this case won't work with change user */
ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, strlen(db),
conn->auth_plugin_data, conn->auth_plugin_data_len, conn->options->auth_protocol,
- 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/ TSRMLS_CC);
+ 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/);
/*
Here we should close all statements. Unbuffered queries should not be a
problem as we won't allow sending COM_CHANGE_USER.
*/
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
end:
DBG_INF(ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -2302,14 +2300,14 @@ static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const conn,
enum mysqlnd_option option,
const char * const value
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_client_option);
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::set_client_option");
DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
switch (option) {
@@ -2328,7 +2326,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
case MYSQL_SERVER_PUBLIC_KEY:
- ret = conn->net->data->m.set_client_option(conn->net, option, value TSRMLS_CC);
+ ret = conn->net->data->m.set_client_option(conn->net, option, value);
break;
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
case MYSQLND_OPT_INT_AND_FLOAT_NATIVE:
@@ -2456,11 +2454,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
default:
ret = FAIL;
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
DBG_RETURN(ret);
oom:
SET_OOM_ERROR(*conn->error_info);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
end:
DBG_RETURN(FAIL);
}
@@ -2473,14 +2471,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
enum mysqlnd_option option,
const char * const key,
const char * const value
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_client_option_2d);
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::set_client_option_2d");
DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
switch (option) {
@@ -2503,11 +2501,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
default:
ret = FAIL;
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
DBG_RETURN(ret);
oom:
SET_OOM_ERROR(*conn->error_info);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
end:
DBG_RETURN(FAIL);
}
@@ -2516,7 +2514,7 @@ end:
/* {{{ mysqlnd_conn_data::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, use_result);
MYSQLND_RES * result = NULL;
@@ -2524,7 +2522,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
DBG_ENTER("mysqlnd_conn_data::use_result");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
if (!conn->current_result) {
break;
@@ -2539,16 +2537,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_UNBUFFERED_SETS);
- conn->current_result->conn = conn->m->get_reference(conn TSRMLS_CC);
- result = conn->current_result->m.use_result(conn->current_result, FALSE TSRMLS_CC);
+ conn->current_result->conn = conn->m->get_reference(conn);
+ result = conn->current_result->m.use_result(conn->current_result, FALSE);
if (!result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
}
conn->current_result = NULL;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
@@ -2558,7 +2556,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
/* {{{ mysqlnd_conn_data::store_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, store_result);
MYSQLND_RES * result = NULL;
@@ -2566,7 +2564,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
DBG_ENTER("mysqlnd_conn_data::store_result");
DBG_INF_FMT("conn=%llu conn=%p", conn->thread_id, conn);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
unsigned int f = flags;
if (!conn->current_result) {
@@ -2583,7 +2581,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
/* overwrite */
- if ((conn->m->get_client_api_capabilities(conn TSRMLS_CC) & MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA)) {
+ if ((conn->m->get_client_api_capabilities(conn) & MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA)) {
if (MYSQLND_G(fetch_data_copy)) {
f &= ~MYSQLND_STORE_NO_COPY;
f |= MYSQLND_STORE_COPY;
@@ -2599,14 +2597,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
DBG_ERR("Unknown fetch mode");
break;
}
- result = conn->current_result->m.store_result(conn->current_result, conn, f TSRMLS_CC);
+ result = conn->current_result->m.store_result(conn->current_result, conn, f);
if (!result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
}
conn->current_result = NULL;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
}
@@ -2616,10 +2614,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
/* {{{ mysqlnd_conn_data::get_connection_stats */
static void
MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA * const conn,
- zval * return_value TSRMLS_DC ZEND_FILE_LINE_DC)
+ zval * return_value ZEND_FILE_LINE_DC)
{
DBG_ENTER("mysqlnd_conn_data::get_connection_stats");
- mysqlnd_fill_stats_hash(conn->stats, mysqlnd_stats_values_names, return_value TSRMLS_CC ZEND_FILE_LINE_CC);
+ mysqlnd_fill_stats_hash(conn->stats, mysqlnd_stats_values_names, return_value ZEND_FILE_LINE_CC);
DBG_VOID_RETURN;
}
/* }}} */
@@ -2627,15 +2625,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA
/* {{{ mysqlnd_conn_data::set_autocommit */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_autocommit);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::set_autocommit");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCOMMIT=1") - 1 TSRMLS_CC);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCOMMIT=1") - 1);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2645,25 +2643,25 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsi
/* {{{ mysqlnd_conn_data::tx_commit */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn)
{
- return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL TSRMLS_CC);
+ return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL);
}
/* }}} */
/* {{{ mysqlnd_conn_data::tx_rollback */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn)
{
- return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL TSRMLS_CC);
+ return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL);
}
/* }}} */
/* {{{ mysqlnd_tx_cor_options_to_string */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode)
{
if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
if (str->s && str->s->len) {
@@ -2695,7 +2693,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_D
/* {{{ mysqlnd_escape_string_for_tx_name_in_comment */
static char *
-mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
+mysqlnd_escape_string_for_tx_name_in_comment(const char * const name)
{
char * ret = NULL;
DBG_ENTER("mysqlnd_escape_string_for_tx_name_in_comment");
@@ -2722,7 +2720,7 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
{
*p_copy++ = v;
} else if (warned == FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
+ php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
warned = TRUE;
}
++p_orig;
@@ -2738,23 +2736,23 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
/* {{{ mysqlnd_conn_data::tx_commit_ex */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_commit_or_rollback);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_commit_or_rollback");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
smart_str tmp_str = {0, 0};
- conn->m->tx_cor_options_to_string(conn, &tmp_str, flags TSRMLS_CC);
+ conn->m->tx_cor_options_to_string(conn, &tmp_str, flags);
smart_str_0(&tmp_str);
{
char * query;
size_t query_len;
- char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name);
query_len = mnd_sprintf(&query, 0, (commit? "COMMIT%s %s":"ROLLBACK%s %s"),
name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
@@ -2768,11 +2766,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2782,13 +2780,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::tx_begin */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_begin);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_begin");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
smart_str tmp_str = {0, 0};
if (mode & TRANS_START_WITH_CONSISTENT_SNAPSHOT) {
@@ -2798,9 +2796,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1);
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
- zend_ulong server_version = conn->m->get_server_version(conn TSRMLS_CC);
+ zend_ulong server_version = conn->m->get_server_version(conn);
if (server_version < 50605L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
+ php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
smart_str_free(&tmp_str);
break;
} else if (mode & TRANS_START_READ_WRITE) {
@@ -2818,7 +2816,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_0(&tmp_str);
{
- char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name);
char * query;
unsigned int query_len = mnd_sprintf(&query, 0, "START TRANSACTION%s %s", name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
smart_str_free(&tmp_str);
@@ -2830,11 +2828,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2844,13 +2842,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
/* {{{ mysqlnd_conn_data::tx_savepoint */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_savepoint");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
char * query;
unsigned int query_len;
@@ -2863,10 +2861,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2876,13 +2874,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const
/* {{{ mysqlnd_conn_data::tx_savepoint_release */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint_release);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_savepoint_release");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
char * query;
unsigned int query_len;
@@ -2895,10 +2893,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2908,7 +2906,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn
/* {{{ mysqlnd_conn_data::negotiate_client_api_capabilities */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
unsigned int ret = 0;
DBG_ENTER("mysqlnd_conn_data::negotiate_client_api_capabilities");
@@ -2924,7 +2922,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CON
/* {{{ mysqlnd_conn_data::get_client_api_capabilities */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_client_api_capabilities");
DBG_RETURN(conn? conn->client_api_capabilities : 0);
@@ -2934,7 +2932,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CON
/* {{{ mysqlnd_conn_data::local_tx_start */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func)
{
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::local_tx_start");
@@ -2945,7 +2943,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size
/* {{{ mysqlnd_conn_data::local_tx_end */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status)
{
DBG_ENTER("mysqlnd_conn_data::local_tx_end");
DBG_RETURN(status);
@@ -2955,21 +2953,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t
/* {{{ mysqlnd_conn_data::init */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::init");
mysqlnd_stats_init(&conn->stats, STAT_LAST);
SET_ERROR_AFF_ROWS(conn);
- conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info TSRMLS_CC);
- conn->protocol = mysqlnd_protocol_init(conn->persistent TSRMLS_CC);
+ conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info);
+ conn->protocol = mysqlnd_protocol_init(conn->persistent);
DBG_RETURN(conn->stats && conn->net && conn->protocol? PASS:FAIL);
}
/* }}} */
-MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn);
MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data)
@@ -3069,11 +3067,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_conn::get_reference */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn)
{
MYSQLND * ret;
DBG_ENTER("mysqlnd_conn::get_reference");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).clone_connection_object(conn TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).clone_connection_object(conn);
DBG_RETURN(ret);
}
/* }}} */
@@ -3081,12 +3079,12 @@ MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn TSRMLS_DC)
/* {{{ mysqlnd_conn_data::dtor */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn)
{
DBG_ENTER("mysqlnd_conn::dtor");
DBG_INF_FMT("conn=%llu", conn->data->thread_id);
- conn->data->m->free_reference(conn->data TSRMLS_CC);
+ conn->data->m->free_reference(conn->data);
mnd_pefree(conn, conn->persistent);
@@ -3097,7 +3095,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn TSRMLS_DC)
/* {{{ mysqlnd_conn_data::close */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close_type close_type TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close_type close_type)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_methods, close);
MYSQLND_CONN_DATA * conn = conn_handle->data;
@@ -3106,7 +3104,7 @@ MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close
DBG_ENTER("mysqlnd_conn::close");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (CONN_GET_STATE(conn) >= CONN_READY) {
static enum_mysqlnd_collected_stats close_type_to_stat_map[MYSQLND_CLOSE_LAST] = {
STAT_CLOSE_EXPLICIT,
@@ -3120,12 +3118,12 @@ MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close
Close now, free_reference will try,
if we are last, but that's not a problem.
*/
- ret = conn->m->send_close(conn TSRMLS_CC);
+ ret = conn->m->send_close(conn);
/* do it after free_reference/dtor and we might crash */
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
- conn_handle->m->dtor(conn_handle TSRMLS_CC);
+ conn_handle->m->dtor(conn_handle);
}
DBG_RETURN(ret);
}
@@ -3142,13 +3140,13 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ _mysqlnd_init */
PHPAPI MYSQLND *
-_mysqlnd_init(unsigned int flags, zend_bool persistent TSRMLS_DC)
+_mysqlnd_init(unsigned int flags, zend_bool persistent)
{
MYSQLND * ret;
DBG_ENTER("mysqlnd_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_connection(persistent TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_connection(persistent);
if (ret && ret->data) {
- ret->data->m->negotiate_client_api_capabilities(ret->data, flags TSRMLS_CC);
+ ret->data->m->negotiate_client_api_capabilities(ret->data, flags);
}
DBG_RETURN(ret);
}
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index aab977d24c..e9a4b11638 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -63,20 +63,20 @@
/* Library related */
-PHPAPI void mysqlnd_library_init(TSRMLS_D);
-PHPAPI void mysqlnd_library_end(TSRMLS_D);
+PHPAPI void mysqlnd_library_init(void);
+PHPAPI void mysqlnd_library_end(void);
PHPAPI unsigned int mysqlnd_plugin_register();
-PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin TSRMLS_DC);
+PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin);
PHPAPI unsigned int mysqlnd_plugin_count();
-PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC);
-#define mysqlnd_plugin_find(name) _mysqlnd_plugin_find((name) TSRMLS_CC);
+PHPAPI void * _mysqlnd_plugin_find(const char * const name);
+#define mysqlnd_plugin_find(name) _mysqlnd_plugin_find((name));
-PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC);
-#define mysqlnd_plugin_apply_with_argument(func, argument) _mysqlnd_plugin_apply_with_argument((func), (argument) TSRMLS_CC);
+PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument);
+#define mysqlnd_plugin_apply_with_argument(func, argument) _mysqlnd_plugin_apply_with_argument((func), (argument));
-#define mysqlnd_restart_psession(conn) ((conn)->data)->m->restart_psession((conn)->data TSRMLS_CC)
-#define mysqlnd_end_psession(conn) ((conn)->data)->m->end_psession((conn)->data TSRMLS_CC)
+#define mysqlnd_restart_psession(conn) ((conn)->data)->m->restart_psession((conn)->data)
+#define mysqlnd_end_psession(conn) ((conn)->data)->m->end_psession((conn)->data)
PHPAPI void mysqlnd_minfo_print_hash(zval *values);
#define mysqlnd_thread_safe() TRUE
@@ -85,8 +85,8 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const char
/* Connect */
-#define mysqlnd_init(client_flags, persistent) _mysqlnd_init((client_flags), (persistent) TSRMLS_CC)
-PHPAPI MYSQLND * _mysqlnd_init(unsigned int client_flags, zend_bool persistent TSRMLS_DC);
+#define mysqlnd_init(client_flags, persistent) _mysqlnd_init((client_flags), (persistent))
+PHPAPI MYSQLND * _mysqlnd_init(unsigned int client_flags, zend_bool persistent);
PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn,
const char * host, const char * user,
const char * passwd, unsigned int passwd_len,
@@ -95,94 +95,94 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn,
const char * socket_or_pipe,
unsigned int mysql_flags,
unsigned int client_api_flags
- TSRMLS_DC);
+ );
-#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd)) TSRMLS_CC)
-#define mysqlnd_change_user_ex(conn, user, passwd, db, silent, passwd_len) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), (passwd_len) TSRMLS_CC)
+#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd)))
+#define mysqlnd_change_user_ex(conn, user, passwd, db, silent, passwd_len) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), (passwd_len))
-#define mysqlnd_debug(x) _mysqlnd_debug((x) TSRMLS_CC)
-PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC);
+#define mysqlnd_debug(x) _mysqlnd_debug((x))
+PHPAPI void _mysqlnd_debug(const char *mode);
/* Query */
-#define mysqlnd_fetch_into(result, flags, ret_val, ext) (result)->m.fetch_into((result), (flags), (ret_val), (ext) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_fetch_row_c(result) (result)->m.fetch_row_c((result) TSRMLS_CC)
-#define mysqlnd_fetch_all(result, flags, return_value) (result)->m.fetch_all((result), (flags), (return_value) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_result_fetch_field_data(res,offset,ret) (res)->m.fetch_field_data((res), (offset), (ret) TSRMLS_CC)
-#define mysqlnd_get_connection_stats(conn, values) ((conn)->data)->m->get_statistics((conn)->data, (values) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_get_client_stats(values) _mysqlnd_get_client_stats((values) TSRMLS_CC ZEND_FILE_LINE_CC)
-
-#define mysqlnd_close(conn,is_forced) (conn)->m->close((conn), (is_forced) TSRMLS_CC)
-#define mysqlnd_query(conn, query_str, query_len) ((conn)->data)->m->query((conn)->data, (query_str), (query_len) TSRMLS_CC)
-#define mysqlnd_async_query(conn, query_str, query_len) ((conn)->data)->m->send_query((conn)->data, (query_str), (query_len) TSRMLS_CC)
-#define mysqlnd_poll(r, err, d_pull,sec,usec,desc_num) _mysqlnd_poll((r), (err), (d_pull), (sec), (usec), (desc_num) TSRMLS_CC)
-#define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data TSRMLS_CC)
-#define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result) TSRMLS_CC)
-
-PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC);
-
-#define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data, 0 TSRMLS_CC)
-#define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_NO_COPY TSRMLS_CC)
-#define mysqlnd_store_result_ofs(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_COPY TSRMLS_CC)
-#define mysqlnd_next_result(conn) ((conn)->data)->m->next_result((conn)->data TSRMLS_CC)
-#define mysqlnd_more_results(conn) ((conn)->data)->m->more_results((conn)->data TSRMLS_CC)
-#define mysqlnd_free_result(r,e_or_i) ((MYSQLND_RES*)r)->m.free_result(((MYSQLND_RES*)(r)), (e_or_i) TSRMLS_CC)
-#define mysqlnd_data_seek(result, row) (result)->m.seek_data((result), (row) TSRMLS_CC)
+#define mysqlnd_fetch_into(result, flags, ret_val, ext) (result)->m.fetch_into((result), (flags), (ret_val), (ext) ZEND_FILE_LINE_CC)
+#define mysqlnd_fetch_row_c(result) (result)->m.fetch_row_c((result))
+#define mysqlnd_fetch_all(result, flags, return_value) (result)->m.fetch_all((result), (flags), (return_value) ZEND_FILE_LINE_CC)
+#define mysqlnd_result_fetch_field_data(res,offset,ret) (res)->m.fetch_field_data((res), (offset), (ret))
+#define mysqlnd_get_connection_stats(conn, values) ((conn)->data)->m->get_statistics((conn)->data, (values) ZEND_FILE_LINE_CC)
+#define mysqlnd_get_client_stats(values) _mysqlnd_get_client_stats((values) ZEND_FILE_LINE_CC)
+
+#define mysqlnd_close(conn,is_forced) (conn)->m->close((conn), (is_forced))
+#define mysqlnd_query(conn, query_str, query_len) ((conn)->data)->m->query((conn)->data, (query_str), (query_len))
+#define mysqlnd_async_query(conn, query_str, query_len) ((conn)->data)->m->send_query((conn)->data, (query_str), (query_len))
+#define mysqlnd_poll(r, err, d_pull,sec,usec,desc_num) _mysqlnd_poll((r), (err), (d_pull), (sec), (usec), (desc_num))
+#define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data)
+#define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result))
+
+PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num);
+
+#define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data, 0)
+#define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_NO_COPY)
+#define mysqlnd_store_result_ofs(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_COPY)
+#define mysqlnd_next_result(conn) ((conn)->data)->m->next_result((conn)->data)
+#define mysqlnd_more_results(conn) ((conn)->data)->m->more_results((conn)->data)
+#define mysqlnd_free_result(r,e_or_i) ((MYSQLND_RES*)r)->m.free_result(((MYSQLND_RES*)(r)), (e_or_i))
+#define mysqlnd_data_seek(result, row) (result)->m.seek_data((result), (row))
/* Errors */
-#define mysqlnd_errno(conn) ((conn)->data)->m->get_error_no((conn)->data TSRMLS_CC)
-#define mysqlnd_error(conn) ((conn)->data)->m->get_error_str((conn)->data TSRMLS_CC)
-#define mysqlnd_sqlstate(conn) ((conn)->data)->m->get_sqlstate((conn)->data TSRMLS_CC)
+#define mysqlnd_errno(conn) ((conn)->data)->m->get_error_no((conn)->data)
+#define mysqlnd_error(conn) ((conn)->data)->m->get_error_str((conn)->data)
+#define mysqlnd_sqlstate(conn) ((conn)->data)->m->get_sqlstate((conn)->data)
/* Charset */
-#define mysqlnd_character_set_name(conn) ((conn)->data)->m->charset_name((conn)->data TSRMLS_CC)
+#define mysqlnd_character_set_name(conn) ((conn)->data)->m->charset_name((conn)->data)
/* Simple metadata */
-#define mysqlnd_field_count(conn) ((conn)->data)->m->get_field_count((conn)->data TSRMLS_CC)
-#define mysqlnd_insert_id(conn) ((conn)->data)->m->get_last_insert_id((conn)->data TSRMLS_CC)
-#define mysqlnd_affected_rows(conn) ((conn)->data)->m->get_affected_rows((conn)->data TSRMLS_CC)
-#define mysqlnd_warning_count(conn) ((conn)->data)->m->get_warning_count((conn)->data TSRMLS_CC)
-#define mysqlnd_info(conn) ((conn)->data)->m->get_last_message((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_info(conn) ((conn)->data)->m->get_server_information((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_version(conn) ((conn)->data)->m->get_server_version((conn)->data TSRMLS_CC)
-#define mysqlnd_get_host_info(conn) ((conn)->data)->m->get_host_information((conn)->data TSRMLS_CC)
-#define mysqlnd_get_proto_info(conn) ((conn)->data)->m->get_protocol_information((conn)->data TSRMLS_CC)
-#define mysqlnd_thread_id(conn) ((conn)->data)->m->get_thread_id((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_status(conn) ((conn)->data)->m->get_server_status((conn)->data TSRMLS_CC)
-
-#define mysqlnd_num_rows(result) (result)->m.num_rows((result) TSRMLS_CC)
-#define mysqlnd_num_fields(result) (result)->m.num_fields((result) TSRMLS_CC)
-
-#define mysqlnd_fetch_lengths(result) (result)->m.fetch_lengths((result) TSRMLS_CC)
-
-#define mysqlnd_field_seek(result, ofs) (result)->m.seek_field((result), (ofs) TSRMLS_CC)
-#define mysqlnd_field_tell(result) (result)->m.field_tell((result) TSRMLS_CC)
-#define mysqlnd_fetch_field(result) (result)->m.fetch_field((result) TSRMLS_CC)
-#define mysqlnd_fetch_field_direct(result,fnr) (result)->m.fetch_field_direct((result), (fnr) TSRMLS_CC)
-#define mysqlnd_fetch_fields(result) (result)->m.fetch_fields((result) TSRMLS_CC)
+#define mysqlnd_field_count(conn) ((conn)->data)->m->get_field_count((conn)->data)
+#define mysqlnd_insert_id(conn) ((conn)->data)->m->get_last_insert_id((conn)->data)
+#define mysqlnd_affected_rows(conn) ((conn)->data)->m->get_affected_rows((conn)->data)
+#define mysqlnd_warning_count(conn) ((conn)->data)->m->get_warning_count((conn)->data)
+#define mysqlnd_info(conn) ((conn)->data)->m->get_last_message((conn)->data)
+#define mysqlnd_get_server_info(conn) ((conn)->data)->m->get_server_information((conn)->data)
+#define mysqlnd_get_server_version(conn) ((conn)->data)->m->get_server_version((conn)->data)
+#define mysqlnd_get_host_info(conn) ((conn)->data)->m->get_host_information((conn)->data)
+#define mysqlnd_get_proto_info(conn) ((conn)->data)->m->get_protocol_information((conn)->data)
+#define mysqlnd_thread_id(conn) ((conn)->data)->m->get_thread_id((conn)->data)
+#define mysqlnd_get_server_status(conn) ((conn)->data)->m->get_server_status((conn)->data)
+
+#define mysqlnd_num_rows(result) (result)->m.num_rows((result))
+#define mysqlnd_num_fields(result) (result)->m.num_fields((result))
+
+#define mysqlnd_fetch_lengths(result) (result)->m.fetch_lengths((result))
+
+#define mysqlnd_field_seek(result, ofs) (result)->m.seek_field((result), (ofs))
+#define mysqlnd_field_tell(result) (result)->m.field_tell((result))
+#define mysqlnd_fetch_field(result) (result)->m.fetch_field((result))
+#define mysqlnd_fetch_field_direct(result,fnr) (result)->m.fetch_field_direct((result), (fnr))
+#define mysqlnd_fetch_fields(result) (result)->m.fetch_fields((result))
/* mysqlnd metadata */
PHPAPI const char * mysqlnd_get_client_info();
PHPAPI unsigned int mysqlnd_get_client_version();
-#define mysqlnd_ssl_set(conn, key, cert, ca, capath, cipher) ((conn)->data)->m->ssl_set((conn)->data, (key), (cert), (ca), (capath), (cipher) TSRMLS_CC)
+#define mysqlnd_ssl_set(conn, key, cert, ca, capath, cipher) ((conn)->data)->m->ssl_set((conn)->data, (key), (cert), (ca), (capath), (cipher))
/* PS */
-#define mysqlnd_stmt_insert_id(stmt) (stmt)->m->get_last_insert_id((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_affected_rows(stmt) (stmt)->m->get_affected_rows((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_num_rows(stmt) (stmt)->m->get_num_rows((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_param_count(stmt) (stmt)->m->get_param_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_field_count(stmt) (stmt)->m->get_field_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_warning_count(stmt) (stmt)->m->get_warning_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_server_status(stmt) (stmt)->m->get_server_status((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_errno(stmt) (stmt)->m->get_error_no((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_error(stmt) (stmt)->m->get_error_str((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_sqlstate(stmt) (stmt)->m->get_sqlstate((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_insert_id(stmt) (stmt)->m->get_last_insert_id((stmt))
+#define mysqlnd_stmt_affected_rows(stmt) (stmt)->m->get_affected_rows((stmt))
+#define mysqlnd_stmt_num_rows(stmt) (stmt)->m->get_num_rows((stmt))
+#define mysqlnd_stmt_param_count(stmt) (stmt)->m->get_param_count((stmt))
+#define mysqlnd_stmt_field_count(stmt) (stmt)->m->get_field_count((stmt))
+#define mysqlnd_stmt_warning_count(stmt) (stmt)->m->get_warning_count((stmt))
+#define mysqlnd_stmt_server_status(stmt) (stmt)->m->get_server_status((stmt))
+#define mysqlnd_stmt_errno(stmt) (stmt)->m->get_error_no((stmt))
+#define mysqlnd_stmt_error(stmt) (stmt)->m->get_error_str((stmt))
+#define mysqlnd_stmt_sqlstate(stmt) (stmt)->m->get_sqlstate((stmt))
-PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC);
-PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC);
-PHPAPI void mysqlnd_free_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC);
-PHPAPI void mysqlnd_free_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC);
+PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind);
+PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind);
+PHPAPI void mysqlnd_free_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind);
+PHPAPI void mysqlnd_free_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind);
PHPAPI const char * mysqlnd_field_type_name(enum mysqlnd_field_types field_type);
@@ -191,73 +191,73 @@ PHPAPI const char * mysqlnd_field_type_name(enum mysqlnd_field_types field_type)
void mysqlnd_local_infile_default(MYSQLND_CONN_DATA * conn);
/* Simple commands */
-#define mysqlnd_autocommit(conn, mode) ((conn)->data)->m->set_autocommit((conn)->data, (mode) TSRMLS_CC)
-#define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name) TSRMLS_CC)
-#define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name) TSRMLS_CC)
-#define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name) TSRMLS_CC)
-#define mysqlnd_savepoint(conn, name) ((conn)->data)->m->tx_savepoint((conn)->data, (name) TSRMLS_CC)
-#define mysqlnd_release_savepoint(conn, name) ((conn)->data)->m->tx_savepoint_release((conn)->data, (name) TSRMLS_CC)
-#define mysqlnd_list_dbs(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW DATABASES LIKE %s":"SHOW DATABASES", (wild), NULL TSRMLS_CC)
-#define mysqlnd_list_fields(conn, tab,wild) ((conn)->data)->m->list_fields((conn)->data, (tab), (wild) TSRMLS_CC)
-#define mysqlnd_list_processes(conn) ((conn)->data)->m->list_method((conn)->data, "SHOW PROCESSLIST", NULL, NULL TSRMLS_CC)
-#define mysqlnd_list_tables(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW TABLES LIKE %s":"SHOW TABLES", (wild), NULL TSRMLS_CC)
-#define mysqlnd_dump_debug_info(conn) ((conn)->data)->m->server_dump_debug_information((conn)->data TSRMLS_CC)
-#define mysqlnd_select_db(conn, db, db_len) ((conn)->data)->m->select_db((conn)->data, (db), (db_len) TSRMLS_CC)
-#define mysqlnd_ping(conn) ((conn)->data)->m->ping((conn)->data TSRMLS_CC)
-#define mysqlnd_kill(conn, pid) ((conn)->data)->m->kill_connection((conn)->data, (pid) TSRMLS_CC)
-#define mysqlnd_refresh(conn, options) ((conn)->data)->m->refresh_server((conn)->data, (options) TSRMLS_CC)
-#define mysqlnd_shutdown(conn, level) ((conn)->data)->m->shutdown_server((conn)->data, (level) TSRMLS_CC)
-#define mysqlnd_set_character_set(conn, cs) ((conn)->data)->m->set_charset((conn)->data, (cs) TSRMLS_CC)
-#define mysqlnd_stat(conn, msg) ((conn)->data)->m->get_server_statistics(((conn)->data), (msg) TSRMLS_CC)
-#define mysqlnd_options(conn, opt, value) ((conn)->data)->m->set_client_option((conn)->data, (opt), (value) TSRMLS_CC)
-#define mysqlnd_options4(conn, opt, k, v) ((conn)->data)->m->set_client_option_2d((conn)->data, (opt), (k), (v) TSRMLS_CC)
-#define mysqlnd_set_server_option(conn, op) ((conn)->data)->m->set_server_option((conn)->data, (op) TSRMLS_CC)
+#define mysqlnd_autocommit(conn, mode) ((conn)->data)->m->set_autocommit((conn)->data, (mode))
+#define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name))
+#define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name))
+#define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name))
+#define mysqlnd_savepoint(conn, name) ((conn)->data)->m->tx_savepoint((conn)->data, (name))
+#define mysqlnd_release_savepoint(conn, name) ((conn)->data)->m->tx_savepoint_release((conn)->data, (name))
+#define mysqlnd_list_dbs(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW DATABASES LIKE %s":"SHOW DATABASES", (wild), NULL)
+#define mysqlnd_list_fields(conn, tab,wild) ((conn)->data)->m->list_fields((conn)->data, (tab), (wild))
+#define mysqlnd_list_processes(conn) ((conn)->data)->m->list_method((conn)->data, "SHOW PROCESSLIST", NULL, NULL)
+#define mysqlnd_list_tables(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW TABLES LIKE %s":"SHOW TABLES", (wild), NULL)
+#define mysqlnd_dump_debug_info(conn) ((conn)->data)->m->server_dump_debug_information((conn)->data)
+#define mysqlnd_select_db(conn, db, db_len) ((conn)->data)->m->select_db((conn)->data, (db), (db_len))
+#define mysqlnd_ping(conn) ((conn)->data)->m->ping((conn)->data)
+#define mysqlnd_kill(conn, pid) ((conn)->data)->m->kill_connection((conn)->data, (pid))
+#define mysqlnd_refresh(conn, options) ((conn)->data)->m->refresh_server((conn)->data, (options))
+#define mysqlnd_shutdown(conn, level) ((conn)->data)->m->shutdown_server((conn)->data, (level))
+#define mysqlnd_set_character_set(conn, cs) ((conn)->data)->m->set_charset((conn)->data, (cs))
+#define mysqlnd_stat(conn, msg) ((conn)->data)->m->get_server_statistics(((conn)->data), (msg))
+#define mysqlnd_options(conn, opt, value) ((conn)->data)->m->set_client_option((conn)->data, (opt), (value))
+#define mysqlnd_options4(conn, opt, k, v) ((conn)->data)->m->set_client_option_2d((conn)->data, (opt), (k), (v))
+#define mysqlnd_set_server_option(conn, op) ((conn)->data)->m->set_server_option((conn)->data, (op))
/* Escaping */
#define mysqlnd_real_escape_string(conn, newstr, escapestr, escapestr_len) \
- ((conn)->data)->m->escape_string((conn)->data, (newstr), (escapestr), (escapestr_len) TSRMLS_CC)
+ ((conn)->data)->m->escape_string((conn)->data, (newstr), (escapestr), (escapestr_len))
#define mysqlnd_escape_string(newstr, escapestr, escapestr_len) \
- mysqlnd_old_escape_string((newstr), (escapestr), (escapestr_len) TSRMLS_CC)
+ mysqlnd_old_escape_string((newstr), (escapestr), (escapestr_len))
-PHPAPI zend_ulong mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
+PHPAPI zend_ulong mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len);
/* PS */
-#define mysqlnd_stmt_init(conn) ((conn)->data)->m->stmt_init(((conn)->data) TSRMLS_CC)
-#define mysqlnd_stmt_store_result(stmt) (!mysqlnd_stmt_field_count((stmt)) ? PASS:((stmt)->m->store_result((stmt) TSRMLS_CC)? PASS:FAIL))
-#define mysqlnd_stmt_get_result(stmt) (stmt)->m->get_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_more_results(stmt) (stmt)->m->more_results((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_next_result(stmt) (stmt)->m->next_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_data_seek(stmt, row) (stmt)->m->seek_data((stmt), (row) TSRMLS_CC)
-#define mysqlnd_stmt_prepare(stmt, q, qlen) (stmt)->m->prepare((stmt), (q), (qlen) TSRMLS_CC)
-#define mysqlnd_stmt_execute(stmt) (stmt)->m->execute((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_send_long_data(stmt,p,d,l) (stmt)->m->send_long_data((stmt), (p), (d), (l) TSRMLS_CC)
-#define mysqlnd_stmt_alloc_param_bind(stmt) (stmt)->m->alloc_parameter_bind((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_free_param_bind(stmt,bind) (stmt)->m->free_parameter_bind((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_param(stmt,bind) (stmt)->m->bind_parameters((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_one_param(stmt,n,z,t) (stmt)->m->bind_one_parameter((stmt), (n), (z), (t) TSRMLS_CC)
-#define mysqlnd_stmt_refresh_bind_param(s) (s)->m->refresh_bind_param((s) TSRMLS_CC)
-#define mysqlnd_stmt_alloc_result_bind(stmt) (stmt)->m->alloc_result_bind((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_free_result_bind(stmt,bind) (stmt)->m->free_result_bind((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_result(stmt,bind) (stmt)->m->bind_result((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_one_result(s,no) (s)->m->bind_one_result((s), (no) TSRMLS_CC)
+#define mysqlnd_stmt_init(conn) ((conn)->data)->m->stmt_init(((conn)->data))
+#define mysqlnd_stmt_store_result(stmt) (!mysqlnd_stmt_field_count((stmt)) ? PASS:((stmt)->m->store_result((stmt))? PASS:FAIL))
+#define mysqlnd_stmt_get_result(stmt) (stmt)->m->get_result((stmt))
+#define mysqlnd_stmt_more_results(stmt) (stmt)->m->more_results((stmt))
+#define mysqlnd_stmt_next_result(stmt) (stmt)->m->next_result((stmt))
+#define mysqlnd_stmt_data_seek(stmt, row) (stmt)->m->seek_data((stmt), (row))
+#define mysqlnd_stmt_prepare(stmt, q, qlen) (stmt)->m->prepare((stmt), (q), (qlen))
+#define mysqlnd_stmt_execute(stmt) (stmt)->m->execute((stmt))
+#define mysqlnd_stmt_send_long_data(stmt,p,d,l) (stmt)->m->send_long_data((stmt), (p), (d), (l))
+#define mysqlnd_stmt_alloc_param_bind(stmt) (stmt)->m->alloc_parameter_bind((stmt))
+#define mysqlnd_stmt_free_param_bind(stmt,bind) (stmt)->m->free_parameter_bind((stmt), (bind))
+#define mysqlnd_stmt_bind_param(stmt,bind) (stmt)->m->bind_parameters((stmt), (bind))
+#define mysqlnd_stmt_bind_one_param(stmt,n,z,t) (stmt)->m->bind_one_parameter((stmt), (n), (z), (t))
+#define mysqlnd_stmt_refresh_bind_param(s) (s)->m->refresh_bind_param((s))
+#define mysqlnd_stmt_alloc_result_bind(stmt) (stmt)->m->alloc_result_bind((stmt))
+#define mysqlnd_stmt_free_result_bind(stmt,bind) (stmt)->m->free_result_bind((stmt), (bind))
+#define mysqlnd_stmt_bind_result(stmt,bind) (stmt)->m->bind_result((stmt), (bind))
+#define mysqlnd_stmt_bind_one_result(s,no) (s)->m->bind_one_result((s), (no))
#define mysqlnd_stmt_param_metadata(stmt) (stmt)->m->get_parameter_metadata((stmt))
-#define mysqlnd_stmt_result_metadata(stmt) (stmt)->m->get_result_metadata((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_result_metadata(stmt) (stmt)->m->get_result_metadata((stmt))
-#define mysqlnd_stmt_free_result(stmt) (stmt)->m->free_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_close(stmt, implicit) (stmt)->m->dtor((stmt), (implicit) TSRMLS_CC)
-#define mysqlnd_stmt_reset(stmt) (stmt)->m->reset((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_flush(stmt) (stmt)->m->flush((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_free_result(stmt) (stmt)->m->free_result((stmt))
+#define mysqlnd_stmt_close(stmt, implicit) (stmt)->m->dtor((stmt), (implicit))
+#define mysqlnd_stmt_reset(stmt) (stmt)->m->reset((stmt))
+#define mysqlnd_stmt_flush(stmt) (stmt)->m->flush((stmt))
-#define mysqlnd_stmt_attr_get(stmt, attr, value) (stmt)->m->get_attribute((stmt), (attr), (value) TSRMLS_CC)
-#define mysqlnd_stmt_attr_set(stmt, attr, value) (stmt)->m->set_attribute((stmt), (attr), (value) TSRMLS_CC)
+#define mysqlnd_stmt_attr_get(stmt, attr, value) (stmt)->m->get_attribute((stmt), (attr), (value))
+#define mysqlnd_stmt_attr_set(stmt, attr, value) (stmt)->m->set_attribute((stmt), (attr), (value))
-#define mysqlnd_stmt_fetch(stmt, fetched) (stmt)->m->fetch((stmt), (fetched) TSRMLS_CC)
+#define mysqlnd_stmt_fetch(stmt, fetched) (stmt)->m->fetch((stmt), (fetched))
/* Performance statistics */
-PHPAPI void _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
+PHPAPI void _mysqlnd_get_client_stats(zval *return_value ZEND_FILE_LINE_DC);
/* double check the class name to avoid naming conflicts when using these: */
#define MYSQLND_METHOD(class, method) php_##class##_##method##_pub
@@ -288,7 +288,10 @@ ZEND_END_MODULE_GLOBALS(mysqlnd)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd)
#ifdef ZTS
-#define MYSQLND_G(v) TSRMG(mysqlnd_globals_id, zend_mysqlnd_globals *, v)
+#define MYSQLND_G(v) ZEND_TSRMG(mysqlnd_globals_id, zend_mysqlnd_globals *, v)
+#ifdef COMPILE_DL_MYSQLND
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define MYSQLND_G(v) (mysqlnd_globals.v)
#endif
diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c
index daa758c043..9b59d76b14 100644
--- a/ext/mysqlnd/mysqlnd_alloc.c
+++ b/ext/mysqlnd/mysqlnd_alloc.c
@@ -172,7 +172,7 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno);
}
#endif
- TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE));
#if PHP_DEBUG
/* -1 is also "true" */
@@ -186,7 +186,7 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
}
#endif
- TRACE_ALLOC_INF_FMT("after : %lu", zend_memory_usage(FALSE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("after : %lu", zend_memory_usage(FALSE));
TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret);
if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
@@ -482,7 +482,7 @@ void * _mysqlnd_realloc(void *ptr, size_t new_size MYSQLND_MEM_D)
}
#endif
TRACE_ALLOC_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
- TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE));
#if PHP_DEBUG
/* -1 is also "true" */
diff --git a/ext/mysqlnd/mysqlnd_alloc.h b/ext/mysqlnd/mysqlnd_alloc.h
index b8a14fd1ab..c8581de70c 100644
--- a/ext/mysqlnd/mysqlnd_alloc.h
+++ b/ext/mysqlnd/mysqlnd_alloc.h
@@ -26,8 +26,8 @@
PHPAPI extern const char * mysqlnd_debug_std_no_trace_funcs[];
-#define MYSQLND_MEM_D TSRMLS_DC ZEND_FILE_LINE_ORIG_DC
-#define MYSQLND_MEM_C TSRMLS_CC ZEND_FILE_LINE_CC
+#define MYSQLND_MEM_D ZEND_FILE_LINE_ORIG_DC
+#define MYSQLND_MEM_C ZEND_FILE_LINE_CC
struct st_mysqlnd_allocator_methods
{
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index 255098c4f3..616c80dfee 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -47,7 +47,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
size_t * switch_to_auth_protocol_len,
zend_uchar ** switch_to_auth_protocol_data,
size_t * switch_to_auth_protocol_data_len
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
const MYSQLND_CHARSET * charset = NULL;
@@ -57,7 +57,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_auth_handshake");
- auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE);
if (!auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
@@ -65,7 +65,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
}
if (use_full_blown_auth_packet != TRUE) {
- change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE);
if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -80,7 +80,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
goto end;
}
} else {
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
auth_packet->client_flags = mysql_flags;
auth_packet->max_packet_size = options->max_allowed_packet;
@@ -168,7 +168,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
size_t * switch_to_auth_protocol_len,
zend_uchar ** switch_to_auth_protocol_data,
size_t * switch_to_auth_protocol_data_len
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
const MYSQLND_CHARSET * old_cs = conn->charset;
@@ -178,7 +178,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
DBG_ENTER("mysqlnd_auth_change_user");
- chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE);
if (!chg_user_resp) {
SET_OOM_ERROR(*conn->error_info);
@@ -186,7 +186,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
if (use_full_blown_auth_packet != TRUE) {
- change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE);
if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -201,7 +201,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
goto end;
}
} else {
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info);
@@ -219,7 +219,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
auth_packet->auth_plugin_name = auth_protocol;
- if (conn->m->get_server_version(conn TSRMLS_CC) >= 50123) {
+ if (conn->m->get_server_version(conn) >= 50123) {
auth_packet->charset_no = conn->charset->nr;
}
@@ -259,12 +259,12 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
bug#25371 mysql_change_user() triggers "packets out of sync"
When it gets fixed, there should be one more check here
*/
- if (conn->m->get_server_version(conn TSRMLS_CC) > 50113L &&conn->m->get_server_version(conn TSRMLS_CC) < 50118L) {
- MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE TSRMLS_CC);
+ if (conn->m->get_server_version(conn) > 50113L &&conn->m->get_server_version(conn) < 50118L) {
+ MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE);
if (redundant_error_packet) {
PACKET_READ(redundant_error_packet, conn);
PACKET_FREE(redundant_error_packet);
- DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", conn->m->get_server_version(conn TSRMLS_CC));
+ DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", conn->m->get_server_version(conn));
} else {
SET_OOM_ERROR(*conn->error_info);
}
@@ -291,8 +291,8 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
memset(conn->upsert_status, 0, sizeof(*conn->upsert_status));
/* set charset for old servers */
- if (conn->m->get_server_version(conn TSRMLS_CC) < 50123) {
- ret = conn->m->set_charset(conn, old_cs->name TSRMLS_CC);
+ if (conn->m->get_server_version(conn) < 50123) {
+ ret = conn->m->set_charset(conn, old_cs->name);
}
} else if (ret == FAIL && chg_user_resp->server_asked_323_auth == TRUE) {
/* old authentication with new server !*/
@@ -362,7 +362,7 @@ mysqlnd_native_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
zend_uchar * ret = NULL;
DBG_ENTER("mysqlnd_native_auth_get_auth_data");
@@ -422,7 +422,7 @@ mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
zend_uchar * ret = NULL;
@@ -482,7 +482,7 @@ static RSA *
mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options
- TSRMLS_DC)
+ )
{
RSA * ret = NULL;
const char * fname = (net_options->sha256_server_public_key && net_options->sha256_server_public_key[0] != '\0')?
@@ -499,12 +499,12 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
do {
DBG_INF("requesting the public key from the server");
- pk_req_packet = conn->protocol->m.get_sha256_pk_request_packet(conn->protocol, FALSE TSRMLS_CC);
+ pk_req_packet = conn->protocol->m.get_sha256_pk_request_packet(conn->protocol, FALSE);
if (!pk_req_packet) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- pk_resp_packet = conn->protocol->m.get_sha256_pk_request_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ pk_resp_packet = conn->protocol->m.get_sha256_pk_request_response_packet(conn->protocol, FALSE);
if (!pk_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
PACKET_FREE(pk_req_packet);
@@ -572,7 +572,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
RSA * server_public_key;
zend_uchar * ret = NULL;
@@ -588,7 +588,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
memcpy(ret, passwd, passwd_len);
} else {
*auth_data_len = 0;
- server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options TSRMLS_CC);
+ server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options);
if (server_public_key) {
int server_public_key_len;
@@ -646,12 +646,12 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_sha256_authentication_plu
/* {{{ mysqlnd_register_builtin_authentication_plugins */
void
-mysqlnd_register_builtin_authentication_plugins(TSRMLS_D)
+mysqlnd_register_builtin_authentication_plugins(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_native_auth_plugin TSRMLS_CC);
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_pam_authentication_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_native_auth_plugin);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_pam_authentication_plugin);
#ifdef MYSQLND_HAVE_SSL
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_sha256_authentication_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_sha256_authentication_plugin);
#endif
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index 705f52ea82..25e4040c0e 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -29,7 +29,7 @@
/* {{{ mysqlnd_mempool_free_chunk */
static void
-mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC)
+mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk)
{
MYSQLND_MEMORY_POOL * pool = chunk->pool;
DBG_ENTER("mysqlnd_mempool_free_chunk");
@@ -54,7 +54,7 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC)
/* {{{ mysqlnd_mempool_resize_chunk */
static enum_func_status
-mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC)
+mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size)
{
DBG_ENTER("mysqlnd_mempool_resize_chunk");
if (chunk->from_pool) {
@@ -112,7 +112,7 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz
/* {{{ mysqlnd_mempool_get_chunk */
static
-MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size TSRMLS_DC)
+MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size)
{
MYSQLND_MEMORY_POOL_CHUNK *chunk = NULL;
DBG_ENTER("mysqlnd_mempool_get_chunk");
@@ -132,7 +132,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
chunk->from_pool = FALSE;
chunk->ptr = mnd_malloc(size);
if (!chunk->ptr) {
- chunk->free_chunk(chunk TSRMLS_CC);
+ chunk->free_chunk(chunk);
chunk = NULL;
}
} else {
@@ -150,7 +150,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
/* {{{ mysqlnd_mempool_create */
PHPAPI MYSQLND_MEMORY_POOL *
-mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
+mysqlnd_mempool_create(size_t arena_size)
{
/* We calloc, because we free(). We don't mnd_calloc() for a reason. */
MYSQLND_MEMORY_POOL * ret = mnd_calloc(1, sizeof(MYSQLND_MEMORY_POOL));
@@ -162,7 +162,7 @@ mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
/* OOM ? */
ret->arena = mnd_malloc(ret->arena_size);
if (!ret->arena) {
- mysqlnd_mempool_destroy(ret TSRMLS_CC);
+ mysqlnd_mempool_destroy(ret);
ret = NULL;
}
}
@@ -173,7 +173,7 @@ mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
/* {{{ mysqlnd_mempool_destroy */
PHPAPI void
-mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
+mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool)
{
DBG_ENTER("mysqlnd_mempool_destroy");
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h
index c0232d4286..acaae44eef 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.h
+++ b/ext/mysqlnd/mysqlnd_block_alloc.h
@@ -23,8 +23,8 @@
#ifndef MYSQLND_BLOCK_ALLOC_H
#define MYSQLND_BLOCK_ALLOC_H
-PHPAPI MYSQLND_MEMORY_POOL * mysqlnd_mempool_create(size_t arena_size TSRMLS_DC);
-PHPAPI void mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC);
+PHPAPI MYSQLND_MEMORY_POOL * mysqlnd_mempool_create(size_t arena_size);
+PHPAPI void mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool);
#endif /* MYSQLND_BLOCK_ALLOC_H */
diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c
index 97a49e1054..3a6c5f5fd2 100644
--- a/ext/mysqlnd/mysqlnd_charset.c
+++ b/ext/mysqlnd/mysqlnd_charset.c
@@ -727,7 +727,7 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const name
/* {{{ mysqlnd_cset_escape_quotes */
PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char * escapestr, size_t escapestr_len TSRMLS_DC)
+ const char * escapestr, size_t escapestr_len)
{
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
@@ -781,7 +781,7 @@ PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const cset,
/* {{{ mysqlnd_cset_escape_slashes */
PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char * escapestr, size_t escapestr_len TSRMLS_DC)
+ const char * escapestr, size_t escapestr_len)
{
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
@@ -887,9 +887,9 @@ static struct st_mysqlnd_plugin_charsets mysqlnd_plugin_charsets_plugin =
/* {{{ mysqlnd_charsets_plugin_register */
void
-mysqlnd_charsets_plugin_register(TSRMLS_D)
+mysqlnd_charsets_plugin_register(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_charsets_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_charsets_plugin);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h
index ef77b2fb74..884dcb0e77 100644
--- a/ext/mysqlnd/mysqlnd_charset.h
+++ b/ext/mysqlnd/mysqlnd_charset.h
@@ -22,10 +22,10 @@
#define MYSQLND_CHARSET_H
PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const charset, char *newstr,
- const char *escapestr, size_t escapestr_len TSRMLS_DC);
+ const char *escapestr, size_t escapestr_len);
PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char *escapestr, size_t escapestr_len TSRMLS_DC);
+ const char *escapestr, size_t escapestr_len);
struct st_mysqlnd_plugin_charsets
{
@@ -34,12 +34,12 @@ struct st_mysqlnd_plugin_charsets
{
const MYSQLND_CHARSET * (*const find_charset_by_nr)(unsigned int charsetnr);
const MYSQLND_CHARSET * (*const find_charset_by_name)(const char * const name);
- zend_ulong (*const escape_quotes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
- zend_ulong (*const escape_slashes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
+ zend_ulong (*const escape_quotes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len);
+ zend_ulong (*const escape_slashes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len);
} methods;
};
-void mysqlnd_charsets_plugin_register(TSRMLS_D);
+void mysqlnd_charsets_plugin_register(void);
#endif /* MYSQLND_CHARSET_H */
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index f1fde4efbb..d374b8853b 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -28,19 +28,11 @@
static const char * const mysqlnd_debug_default_trace_file = "/tmp/mysqlnd.trace";
static const char * const mysqlnd_debug_empty_string = "";
-#ifdef ZTS
-#define MYSQLND_ZTS(self) TSRMLS_D = (self)->TSRMLS_C
-#else
-#define MYSQLND_ZTS(self)
-#endif
-
/* {{{ mysqlnd_debug::open */
static enum_func_status
MYSQLND_METHOD(mysqlnd_debug, open)(MYSQLND_DEBUG * self, zend_bool reopen)
{
- MYSQLND_ZTS(self);
-
if (!self->file_name) {
return FAIL;
}
@@ -67,7 +59,6 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self,
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
line_buffer[6], level_buffer[7];
- MYSQLND_ZTS(self);
if (!self->stream && FAIL == self->m->open(self, FALSE)) {
return FAIL;
@@ -165,7 +156,6 @@ MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self,
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
line_buffer[6], level_buffer[7];
- MYSQLND_ZTS(self);
if (!self->stream && FAIL == self->m->open(self, FALSE)) {
return FAIL;
@@ -436,7 +426,6 @@ MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int lin
static enum_func_status
MYSQLND_METHOD(mysqlnd_debug, close)(MYSQLND_DEBUG * self)
{
- MYSQLND_ZTS(self);
if (self->stream) {
#ifndef MYSQLND_PROFILING_DISABLED
if (!(self->flags & MYSQLND_DEBUG_FLUSH) && (self->flags & MYSQLND_DEBUG_PROFILE_CALLS)) {
@@ -561,7 +550,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
case ':':
#if 0
if (state != PARSER_WAIT_COLON) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Consecutive semicolons at position %u", i);
+ php_error_docref(NULL, E_WARNING, "Consecutive semicolons at position %u", i);
}
#endif
state = PARSER_WAIT_MODIFIER;
@@ -598,7 +587,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
i = j;
} else {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected list of functions for '%c' found none", mode[i]);
#endif
}
@@ -678,7 +667,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
default:
if (state == PARSER_WAIT_MODIFIER) {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized format '%c'", mode[i]);
+ php_error_docref(NULL, E_WARNING, "Unrecognized format '%c'", mode[i]);
#endif
if (i+1 < mode_len && mode[i+1] == ',') {
i+= 2;
@@ -692,7 +681,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
state = PARSER_WAIT_COLON;
} else if (state == PARSER_WAIT_COLON) {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Colon expected, '%c' found", mode[i]);
+ php_error_docref(NULL, E_WARNING, "Colon expected, '%c' found", mode[i]);
#endif
}
break;
@@ -715,12 +704,10 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_debug_init */
PHPAPI MYSQLND_DEBUG *
-mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
+mysqlnd_debug_init(const char * skip_functions[])
{
MYSQLND_DEBUG *ret = calloc(1, sizeof(MYSQLND_DEBUG));
-#ifdef ZTS
- ret->TSRMLS_C = TSRMLS_C;
-#endif
+
ret->nest_level_limit = 0;
ret->pid = getpid();
zend_stack_init(&ret->call_stack, sizeof(char *));
@@ -737,14 +724,14 @@ mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
/* {{{ _mysqlnd_debug */
-PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
+PHPAPI void _mysqlnd_debug(const char * mode)
{
#if PHP_DEBUG
MYSQLND_DEBUG * dbg = MYSQLND_G(dbg);
if (!dbg) {
struct st_mysqlnd_plugin_trace_log * trace_log_plugin = mysqlnd_plugin_find("debug_trace");
if (trace_log_plugin) {
- dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
+ dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs);
if (!dbg) {
return;
}
@@ -791,9 +778,9 @@ static struct st_mysqlnd_plugin_trace_log mysqlnd_plugin_trace_log_plugin =
/* {{{ mysqlnd_debug_trace_plugin_register */
void
-mysqlnd_debug_trace_plugin_register(TSRMLS_D)
+mysqlnd_debug_trace_plugin_register(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_trace_log_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_trace_log_plugin);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index bb4ff3e895..636172882d 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -45,9 +45,6 @@ struct st_mysqlnd_debug_methods
struct st_mysqlnd_debug
{
php_stream *stream;
-#ifdef ZTS
- TSRMLS_D;
-#endif
unsigned int flags;
unsigned int nest_level_limit;
int pid;
@@ -65,13 +62,13 @@ struct st_mysqlnd_plugin_trace_log
struct st_mysqlnd_plugin_header plugin_header;
struct
{
- MYSQLND_DEBUG * (*trace_instance_init)(const char * skip_functions[] TSRMLS_DC);
+ MYSQLND_DEBUG * (*trace_instance_init)(const char * skip_functions[]);
} methods;
};
-void mysqlnd_debug_trace_plugin_register(TSRMLS_D);
+void mysqlnd_debug_trace_plugin_register(void);
-PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC);
+PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[]);
#if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400))
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index e67d023edb..58a974d75f 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -53,21 +53,21 @@ static struct st_mysqlnd_plugin_core mysqlnd_plugin_core =
/* {{{ mysqlnd_library_end */
-PHPAPI void mysqlnd_library_end(TSRMLS_D)
+PHPAPI void mysqlnd_library_end(void)
{
if (mysqlnd_library_initted == TRUE) {
- mysqlnd_plugin_subsystem_end(TSRMLS_C);
+ mysqlnd_plugin_subsystem_end();
mysqlnd_stats_end(mysqlnd_global_stats);
mysqlnd_global_stats = NULL;
mysqlnd_library_initted = FALSE;
- mysqlnd_reverse_api_end(TSRMLS_C);
+ mysqlnd_reverse_api_end();
}
}
/* }}} */
/* {{{ mysqlnd_library_init */
-PHPAPI void mysqlnd_library_init(TSRMLS_D)
+PHPAPI void mysqlnd_library_init(void)
{
if (mysqlnd_library_initted == FALSE) {
mysqlnd_library_initted = TRUE;
@@ -76,18 +76,18 @@ PHPAPI void mysqlnd_library_init(TSRMLS_D)
_mysqlnd_init_ps_subsystem();
/* Should be calloc, as mnd_calloc will reference LOCK_access*/
mysqlnd_stats_init(&mysqlnd_global_stats, STAT_LAST);
- mysqlnd_plugin_subsystem_init(TSRMLS_C);
+ mysqlnd_plugin_subsystem_init();
{
mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats;
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core);
}
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
- mysqlnd_example_plugin_register(TSRMLS_C);
+ mysqlnd_example_plugin_register();
#endif
- mysqlnd_debug_trace_plugin_register(TSRMLS_C);
- mysqlnd_register_builtin_authentication_plugins(TSRMLS_C);
+ mysqlnd_debug_trace_plugin_register();
+ mysqlnd_register_builtin_authentication_plugins();
- mysqlnd_reverse_api_init(TSRMLS_C);
+ mysqlnd_reverse_api_init();
}
}
/* }}} */
@@ -99,9 +99,7 @@ static void
mysqlnd_error_list_pdtor(void * pDest)
{
MYSQLND_ERROR_LIST_ELEMENT * element = (MYSQLND_ERROR_LIST_ELEMENT *) pDest;
-#ifdef ZTS
- TSRMLS_FETCH();
-#endif
+
DBG_ENTER("mysqlnd_error_list_pdtor");
if (element->error) {
mnd_pefree(element->error, TRUE);
@@ -113,7 +111,7 @@ mysqlnd_error_list_pdtor(void * pDest)
/* {{{ mysqlnd_object_factory::get_connection */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent)
{
size_t alloc_size_ret = sizeof(MYSQLND) + mysqlnd_plugin_count() * sizeof(void *);
size_t alloc_size_ret_data = sizeof(MYSQLND_CONN_DATA) + mysqlnd_plugin_count() * sizeof(void *);
@@ -142,16 +140,16 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRM
data->persistent = persistent;
data->m = mysqlnd_conn_data_get_methods();
CONN_SET_STATE(data, CONN_ALLOCED);
- data->m->get_reference(data TSRMLS_CC);
+ data->m->get_reference(data);
- if (PASS != data->m->init(data TSRMLS_CC)) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ if (PASS != data->m->init(data)) {
+ new_object->m->dtor(new_object);
DBG_RETURN(NULL);
}
data->error_info->error_list = mnd_pecalloc(1, sizeof(zend_llist), persistent);
if (!data->error_info->error_list) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ new_object->m->dtor(new_object);
DBG_RETURN(NULL);
} else {
zend_llist_init(data->error_info->error_list, sizeof(MYSQLND_ERROR_LIST_ELEMENT), (llist_dtor_func_t)mysqlnd_error_list_pdtor, persistent);
@@ -164,7 +162,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRM
/* {{{ mysqlnd_object_factory::clone_connection_object */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_cloned TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_cloned)
{
size_t alloc_size_ret = sizeof(MYSQLND) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND * new_object;
@@ -181,9 +179,9 @@ MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_
new_object->persistent = to_be_cloned->persistent;
new_object->m = to_be_cloned->m;
- new_object->data = to_be_cloned->data->m->get_reference(to_be_cloned->data TSRMLS_CC);
+ new_object->data = to_be_cloned->data->m->get_reference(to_be_cloned->data);
if (!new_object->data) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ new_object->m->dtor(new_object);
new_object = NULL;
}
DBG_RETURN(new_object);
@@ -193,7 +191,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_
/* {{{ mysqlnd_object_factory::get_prepared_statement */
static MYSQLND_STMT *
-MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA * const conn)
{
size_t alloc_size = sizeof(MYSQLND_STMT) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_STMT * ret = mnd_pecalloc(1, alloc_size, conn->persistent);
@@ -228,7 +226,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
be destructed till there is open statements. The last statement
or normal query result will close it then.
*/
- stmt->conn = conn->m->get_reference(conn TSRMLS_CC);
+ stmt->conn = conn->m->get_reference(conn);
stmt->error_info->error_list = mnd_pecalloc(1, sizeof(zend_llist), ret->persistent);
if (!stmt->error_info->error_list) {
break;
@@ -241,7 +239,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
SET_OOM_ERROR(*conn->error_info);
if (ret) {
- ret->m->dtor(ret, TRUE TSRMLS_CC);
+ ret->m->dtor(ret, TRUE);
ret = NULL;
}
DBG_RETURN(NULL);
@@ -251,7 +249,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
/* {{{ mysqlnd_object_factory::get_io_channel */
PHPAPI MYSQLND_NET *
-MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
size_t net_alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
size_t net_data_alloc_size = sizeof(MYSQLND_NET_DATA) + mysqlnd_plugin_count() * sizeof(void *);
@@ -265,8 +263,8 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYS
net->persistent = net->data->persistent = persistent;
net->data->m = *mysqlnd_net_get_methods();
- if (PASS != net->data->m.init(net, stats, error_info TSRMLS_CC)) {
- net->data->m.dtor(net, stats, error_info TSRMLS_CC);
+ if (PASS != net->data->m.init(net, stats, error_info)) {
+ net->data->m.dtor(net, stats, error_info);
net = NULL;
}
} else {
@@ -286,7 +284,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYS
/* {{{ mysqlnd_object_factory::get_protocol_decoder */
static MYSQLND_PROTOCOL *
-MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_PROTOCOL) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_PROTOCOL *ret = mnd_pecalloc(1, alloc_size, persistent);
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c
index 43f1318caa..b2b7833db1 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.c
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.c
@@ -31,7 +31,7 @@ static struct st_mysqlnd_stmt_methods * mysqlnd_stmt_methods;
/* {{{ _mysqlnd_plugin_get_plugin_connection_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -45,7 +45,7 @@ _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int pl
/* {{{ _mysqlnd_plugin_get_plugin_connection_data_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -58,7 +58,7 @@ _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn,
/* {{{ _mysqlnd_plugin_get_plugin_result_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -71,7 +71,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result
/* {{{ _mysqlnd_plugin_get_plugin_result_unbuffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -84,7 +84,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_R
/* {{{ _mysqlnd_plugin_get_plugin_result_buffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -96,7 +96,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLN
/* }}} */
/* {{{ _mysqlnd_plugin_get_plugin_result_buffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -110,7 +110,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_R
/* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -123,7 +123,7 @@ _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsi
/* {{{ _mysqlnd_plugin_get_plugin_stmt_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_stmt_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -136,7 +136,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, u
/* {{{ _mysqlnd_plugin_get_plugin_net_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_net_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h
index c66043da83..82a02d5c50 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.h
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.h
@@ -22,32 +22,32 @@
#ifndef MYSQLND_EXT_PLUGIN_H
#define MYSQLND_EXT_PLUGIN_H
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_connection_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data((c), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_connection_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data((c), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_connection_data_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data_data((c), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_connection_data_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data_data((c), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_data(r, p_id) _mysqlnd_plugin_get_plugin_result_data((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_data(r, p_id) _mysqlnd_plugin_get_plugin_result_data((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_unbuffered_data(r, p_id) _mysqlnd_plugin_get_plugin_result_unbuffered_data((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_unbuffered_data(r, p_id) _mysqlnd_plugin_get_plugin_result_unbuffered_data((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_buffered_data_zval(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_zval((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_buffered_data_zval(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_zval((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_buffered_data_c(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_c((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_buffered_data_c(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_c((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_net_data(n, p_id) _mysqlnd_plugin_get_plugin_net_data((n), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_net_data(n, p_id) _mysqlnd_plugin_get_plugin_net_data((n), (p_id))
PHPAPI struct st_mysqlnd_conn_methods * mysqlnd_conn_get_methods();
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index a29a5a186d..f188abee6b 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -27,7 +27,7 @@
/* {{{ mysqlnd_local_infile_init */
static
-int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC)
+int mysqlnd_local_infile_init(void ** ptr, const char * const filename)
{
MYSQLND_INFILE_INFO *info;
php_stream_context *context = NULL;
@@ -43,7 +43,7 @@ int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC
/* check open_basedir */
if (PG(open_basedir)) {
- if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC) == -1) {
+ if (php_check_open_basedir_ex(filename, 0) == -1) {
strcpy(info->error_msg, "open_basedir restriction in effect. Unable to open file");
info->error_no = CR_UNKNOWN_ERROR;
DBG_RETURN(1);
@@ -66,7 +66,7 @@ int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC
/* {{{ mysqlnd_local_infile_read */
static
-int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len TSRMLS_DC)
+int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
int count;
@@ -87,7 +87,7 @@ int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len
/* {{{ mysqlnd_local_infile_error */
static
-int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_buf_len TSRMLS_DC)
+int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_buf_len)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
@@ -108,7 +108,7 @@ int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_b
/* {{{ mysqlnd_local_infile_end */
static
-void mysqlnd_local_infile_end(void * ptr TSRMLS_DC)
+void mysqlnd_local_infile_end(void * ptr)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
@@ -141,7 +141,7 @@ static const char *lost_conn = "Lost connection to MySQL server during LOAD DATA
/* {{{ mysqlnd_handle_local_infile */
enum_func_status
-mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning TSRMLS_DC)
+mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning)
{
zend_uchar *buf = NULL;
zend_uchar empty_packet[MYSQLND_HEADER_SIZE];
@@ -156,9 +156,9 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
DBG_ENTER("mysqlnd_handle_local_infile");
if (!(conn->options->flags & CLIENT_LOCAL_FILES)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
+ php_error_docref(NULL, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
/* write empty packet to server */
- ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+ ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info);
*is_warning = TRUE;
goto infile_error;
}
@@ -170,21 +170,21 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
*is_warning = FALSE;
/* init handler: allocate read buffer and open file */
- if (infile.local_infile_init(&info, (char *)filename TSRMLS_CC)) {
+ if (infile.local_infile_init(&info, (char *)filename)) {
char tmp_buf[sizeof(conn->error_info->error)];
int tmp_error_no;
*is_warning = TRUE;
/* error occurred */
- tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
+ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf));
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
/* write empty packet to server */
- ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+ ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info);
goto infile_error;
}
/* read data */
- while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE TSRMLS_CC)) > 0) {
- if ((ret = net->data->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+ while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE)) > 0) {
+ if ((ret = net->data->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info)) == 0) {
DBG_ERR_FMT("Error during read : %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
goto infile_error;
@@ -192,7 +192,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
}
/* send empty packet for eof */
- if ((ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+ if ((ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info)) == 0) {
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
goto infile_error;
}
@@ -203,7 +203,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
int tmp_error_no;
*is_warning = TRUE;
DBG_ERR_FMT("Bufsize < 0, warning, %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
- tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
+ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf));
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
goto infile_error;
}
@@ -212,11 +212,11 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
infile_error:
/* get response from server and update upsert values */
- if (FAIL == conn->m->simple_command_handle_response(conn, PROT_OK_PACKET, FALSE, COM_QUERY, FALSE TSRMLS_CC)) {
+ if (FAIL == conn->m->simple_command_handle_response(conn, PROT_OK_PACKET, FALSE, COM_QUERY, FALSE)) {
result = FAIL;
}
- (*conn->infile.local_infile_end)(info TSRMLS_CC);
+ (*conn->infile.local_infile_end)(info);
if (buf) {
mnd_efree(buf);
}
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index da92acfbff..a05c287807 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -42,7 +42,7 @@
/* {{{ mysqlnd_set_sock_no_delay */
static int
-mysqlnd_set_sock_no_delay(php_stream * stream TSRMLS_DC)
+mysqlnd_set_sock_no_delay(php_stream * stream)
{
int socketd = ((php_netstream_data_t*)stream->abstract)->socket;
@@ -64,10 +64,10 @@ mysqlnd_set_sock_no_delay(php_stream * stream TSRMLS_DC)
/* {{{ mysqlnd_net::network_read_ex */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
enum_func_status return_value = PASS;
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
size_t old_chunk_size = net_stream->chunk_size;
size_t to_read = count, ret;
zend_uchar * p = buffer;
@@ -95,12 +95,12 @@ MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar
/* {{{ mysqlnd_net::network_write_ex */
static size_t
MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
size_t ret;
DBG_ENTER("mysqlnd_net::network_write_ex");
DBG_INF_FMT("sending %u bytes", count);
- ret = php_stream_write(net->data->m.get_stream(net TSRMLS_CC), (char *)buffer, count);
+ ret = php_stream_write(net->data->m.get_stream(net), (char *)buffer, count);
DBG_RETURN(ret);
}
/* }}} */
@@ -110,7 +110,7 @@ MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zen
static php_stream *
MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
#if PHP_API_VERSION < 20100412
unsigned int streams_options = ENFORCE_SAFE_MODE;
@@ -150,7 +150,7 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
static php_stream *
MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
#if PHP_API_VERSION < 20100412
unsigned int streams_options = ENFORCE_SAFE_MODE;
@@ -244,9 +244,9 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
static void
MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
const char * const scheme, const size_t scheme_len,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
DBG_ENTER("mysqlnd_net::post_connect_set_opt");
if (net_stream) {
if (net->data->options.timeout_read) {
@@ -259,7 +259,7 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) {
/* TCP -> Set TCP_NODELAY */
- mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC);
+ mysqlnd_set_sock_no_delay(net_stream);
}
}
@@ -271,7 +271,7 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
/* {{{ mysqlnd_net::get_open_stream */
static func_mysqlnd_net__open_stream
MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
- MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_ERROR_INFO * const error_info)
{
func_mysqlnd_net__open_stream ret = NULL;
DBG_ENTER("mysqlnd_net::get_open_stream");
@@ -297,7 +297,7 @@ MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
enum_func_status ret = FAIL;
func_mysqlnd_net__open_stream open_stream = NULL;
@@ -305,14 +305,14 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
net->packet_no = net->compressed_envelope_packet_no = 0;
- net->data->m.close_stream(net, conn_stats, error_info TSRMLS_CC);
+ net->data->m.close_stream(net, conn_stats, error_info);
- open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info TSRMLS_CC);
+ open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info);
if (open_stream) {
- php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC);
+ php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info);
if (net_stream) {
- (void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
- net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC);
+ (void) net->data->m.set_stream(net, net_stream);
+ net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info);
ret = PASS;
}
}
@@ -345,7 +345,7 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
*/
static size_t
MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
zend_uchar safe_buf[((MYSQLND_HEADER_SIZE) + (sizeof(zend_uchar)) - 1) / (sizeof(zend_uchar))];
zend_uchar * safe_storage = safe_buf;
@@ -381,7 +381,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
int3store(uncompressed_payload, to_be_sent);
int1store(uncompressed_payload + 3, net->packet_no);
if (PASS == net->data->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen,
- uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE TSRMLS_CC))
+ uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE))
{
int3store(compress_buf + MYSQLND_HEADER_SIZE, to_be_sent + MYSQLND_HEADER_SIZE);
payload_size = tmp_complen;
@@ -396,7 +396,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
int1store(compress_buf + 3, net->packet_no);
DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
bytes_sent = net->data->m.network_write_ex(net, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE,
- conn_stats, error_info TSRMLS_CC);
+ conn_stats, error_info);
net->compressed_envelope_packet_no++;
#if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
if (res == Z_OK) {
@@ -427,7 +427,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
STORE_HEADER_SIZE(safe_storage, p);
int3store(p, to_be_sent);
int1store(p + 3, net->packet_no);
- bytes_sent = net->data->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC);
+ bytes_sent = net->data->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info);
RESTORE_HEADER_SIZE(p, safe_storage);
net->compressed_envelope_packet_no++;
}
@@ -500,7 +500,7 @@ php_mysqlnd_read_buffer_bytes_left(MYSQLND_READ_BUFFER * buffer)
/* {{{ php_mysqlnd_read_buffer_free */
static void
-php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer TSRMLS_DC)
+php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer)
{
DBG_ENTER("php_mysqlnd_read_buffer_free");
if (*buffer) {
@@ -515,7 +515,7 @@ php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer TSRMLS_DC)
/* {{{ php_mysqlnd_create_read_buffer */
static MYSQLND_READ_BUFFER *
-mysqlnd_create_read_buffer(size_t count TSRMLS_DC)
+mysqlnd_create_read_buffer(size_t count)
{
MYSQLND_READ_BUFFER * ret = mnd_emalloc(sizeof(MYSQLND_READ_BUFFER));
DBG_ENTER("mysqlnd_create_read_buffer");
@@ -534,7 +534,7 @@ mysqlnd_create_read_buffer(size_t count TSRMLS_DC)
/* {{{ mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffer */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buffer)
- (MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+ (MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info)
{
size_t decompressed_size;
enum_func_status retval = PASS;
@@ -543,7 +543,7 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffer");
/* Read the compressed header */
- if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
decompressed_size = uint3korr(comp_header);
@@ -553,19 +553,19 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
if (decompressed_size) {
compressed_data = mnd_emalloc(net_payload_size);
- if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info)) {
retval = FAIL;
goto end;
}
- net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size TSRMLS_CC);
- retval = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
+ net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size);
+ retval = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size);
if (FAIL == retval) {
goto end;
}
} else {
DBG_INF_FMT("The server decided not to compress the data. Our job is easy. Copying %u bytes", net_payload_size);
- net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size TSRMLS_CC);
- if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+ net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size);
+ if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info)) {
retval = FAIL;
goto end;
}
@@ -583,7 +583,7 @@ end:
/* {{{ mysqlnd_net::decode */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len,
- const zend_uchar * const compressed_data, const size_t compressed_data_len TSRMLS_DC)
+ const zend_uchar * const compressed_data, const size_t compressed_data_len)
{
#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
@@ -607,7 +607,7 @@ MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, const size_t
/* {{{ mysqlnd_net::encode */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len,
- const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len TSRMLS_DC)
+ const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len)
{
#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
@@ -634,7 +634,7 @@ MYSQLND_METHOD(mysqlnd_net, encode)(zend_uchar * compress_buffer, size_t * compr
/* {{{ mysqlnd_net::receive_ex */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
size_t to_read = count;
zend_uchar * p = buffer;
@@ -653,7 +653,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
DBG_INF_FMT("left "MYSQLND_SZ_T_SPEC" to read", to_read);
if (TRUE == net->uncompressed_data->is_empty(net->uncompressed_data)) {
/* Everything was consumed. This should never happen here, but for security */
- net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC);
+ net->uncompressed_data->free_buffer(&net->uncompressed_data);
}
}
if (to_read) {
@@ -661,7 +661,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
size_t net_payload_size;
zend_uchar packet_no;
- if (FAIL == net->data->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
net_payload_size = uint3korr(net_header);
@@ -679,7 +679,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
DBG_INF_FMT("HEADER: hwd_packet_no=%u size=%3u", packet_no, (zend_ulong) net_payload_size);
#endif
/* Now let's read from the wire, decompress it and fill the read buffer */
- net->data->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info TSRMLS_CC);
+ net->data->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info);
/*
Now a bit of recursion - read from the read buffer,
@@ -687,19 +687,19 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
is not enough, then the recursive call will try to
satisfy it until it is satisfied.
*/
- DBG_RETURN(net->data->m.receive_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+ DBG_RETURN(net->data->m.receive_ex(net, p, to_read, conn_stats, error_info));
}
DBG_RETURN(PASS);
}
#endif /* MYSQLND_COMPRESSION_ENABLED */
- DBG_RETURN(net->data->m.network_read_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+ DBG_RETURN(net->data->m.network_read_ex(net, p, to_read, conn_stats, error_info));
}
/* }}} */
/* {{{ mysqlnd_net::set_client_option */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mysqlnd_option option, const char * const value TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mysqlnd_option option, const char * const value)
{
DBG_ENTER("mysqlnd_net::set_client_option");
DBG_INF_FMT("option=%u", option);
@@ -812,7 +812,7 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys
/* {{{ mysqlnd_net::consume_uneaten_data */
size_t
-MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd)
{
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
/*
@@ -825,8 +825,8 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
char tmp_buf[256];
size_t skipped_bytes = 0;
int opt = PHP_STREAM_OPTION_BLOCKING;
- php_stream * net_stream = net->data->get_stream(net TSRMLS_CC);
- int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL TSRMLS_CC);
+ php_stream * net_stream = net->data->get_stream(net);
+ int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL);
DBG_ENTER("mysqlnd_net::consume_uneaten_data");
@@ -839,13 +839,13 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
} while (bytes_consumed == sizeof(tmp_buf));
if (was_blocked) {
- net_stream->ops->set_option(net_stream, opt, 1, NULL TSRMLS_CC);
+ net_stream->ops->set_option(net_stream, opt, 1, NULL);
}
if (bytes_consumed) {
DBG_ERR_FMT("Skipped %u bytes. Last command %s hasn't consumed all the output from the server",
bytes_consumed, mysqlnd_command_to_text[net->last_command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
+ php_error_docref(NULL, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
"consumed all the output from the server",
bytes_consumed, mysqlnd_command_to_text[net->last_command]);
}
@@ -864,11 +864,11 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
*/
/* {{{ mysqlnd_net::enable_ssl */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net)
{
#ifdef MYSQLND_SSL_SUPPORTED
- php_stream_context * context = php_stream_context_alloc(TSRMLS_C);
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream_context * context = php_stream_context_alloc();
+ php_stream * net_stream = net->data->m.get_stream(net);
DBG_ENTER("mysqlnd_net::enable_ssl");
if (!context) {
@@ -914,15 +914,15 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, context TSRMLS_CC);
+ php_stream_context_set(net_stream, context);
#else
php_stream_context_set(net_stream, context);
#endif
- if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
+ if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(net_stream, 1) < 0)
{
DBG_ERR("Cannot connect to MySQL by using SSL");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot connect to MySQL by using SSL");
+ php_error_docref(NULL, E_WARNING, "Cannot connect to MySQL by using SSL");
DBG_RETURN(FAIL);
}
net->data->ssl = TRUE;
@@ -934,7 +934,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
*/
#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, NULL TSRMLS_CC);
+ php_stream_context_set(net_stream, NULL);
#else
php_stream_context_set(net_stream, NULL);
#endif
@@ -959,7 +959,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::disable_ssl */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net)
{
DBG_ENTER("mysqlnd_net::disable_ssl");
DBG_RETURN(PASS);
@@ -969,14 +969,14 @@ MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::free_contents */
static void
-MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net)
{
zend_bool pers = net->persistent;
DBG_ENTER("mysqlnd_net::free_contents");
#ifdef MYSQLND_COMPRESSION_ENABLED
if (net->uncompressed_data) {
- net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC);
+ net->uncompressed_data->free_buffer(&net->uncompressed_data);
}
#endif
if (net->data->options.ssl_key) {
@@ -1011,11 +1011,11 @@ MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
/* {{{ mysqlnd_net::close_stream */
static void
-MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
php_stream * net_stream;
DBG_ENTER("mysqlnd_net::close_stream");
- if (net && (net_stream = net->data->m.get_stream(net TSRMLS_CC))) {
+ if (net && (net_stream = net->data->m.get_stream(net))) {
zend_bool pers = net->persistent;
DBG_INF_FMT("Freeing stream. abstract=%p", net_stream->abstract);
if (pers) {
@@ -1031,7 +1031,7 @@ MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS
} else {
php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE);
}
- (void) net->data->m.set_stream(net, NULL TSRMLS_CC);
+ (void) net->data->m.set_stream(net, NULL);
}
DBG_VOID_RETURN;
@@ -1041,19 +1041,19 @@ MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS
/* {{{ mysqlnd_net::init */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
unsigned int buf_size;
DBG_ENTER("mysqlnd_net::init");
buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size);
buf_size = MYSQLND_G(net_read_buffer_size); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size);
buf_size = MYSQLND_G(net_read_timeout); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size);
DBG_RETURN(PASS);
}
@@ -1062,12 +1062,12 @@ MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const
/* {{{ mysqlnd_net::dtor */
static void
-MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
DBG_ENTER("mysqlnd_net::dtor");
if (net) {
- net->data->m.free_contents(net TSRMLS_CC);
- net->data->m.close_stream(net, stats, error_info TSRMLS_CC);
+ net->data->m.free_contents(net);
+ net->data->m.close_stream(net, stats, error_info);
if (net->cmd_buffer.buffer) {
DBG_INF("Freeing cmd buffer");
@@ -1085,7 +1085,7 @@ MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const
/* {{{ mysqlnd_net::get_stream */
static php_stream *
-MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net)
{
DBG_ENTER("mysqlnd_net::get_stream");
DBG_INF_FMT("%p", net? net->data->stream:NULL);
@@ -1096,7 +1096,7 @@ MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::set_stream */
static php_stream *
-MYSQLND_METHOD(mysqlnd_net, set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, set_stream)(MYSQLND_NET * const net, php_stream * net_stream)
{
php_stream * ret = NULL;
DBG_ENTER("mysqlnd_net::set_stream");
@@ -1146,11 +1146,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_net_init */
PHPAPI MYSQLND_NET *
-mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
MYSQLND_NET * net;
DBG_ENTER("mysqlnd_net_init");
- net = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_io_channel(persistent, stats, error_info TSRMLS_CC);
+ net = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_io_channel(persistent, stats, error_info);
DBG_RETURN(net);
}
/* }}} */
@@ -1158,11 +1158,11 @@ mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO
/* {{{ mysqlnd_net_free */
PHPAPI void
-mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
DBG_ENTER("mysqlnd_net_free");
if (net) {
- net->data->m.dtor(net, stats, error_info TSRMLS_CC);
+ net->data->m.dtor(net, stats, error_info);
}
DBG_VOID_RETURN;
}
diff --git a/ext/mysqlnd/mysqlnd_net.h b/ext/mysqlnd/mysqlnd_net.h
index 699dd7f7d5..4f67697d51 100644
--- a/ext/mysqlnd/mysqlnd_net.h
+++ b/ext/mysqlnd/mysqlnd_net.h
@@ -23,8 +23,8 @@
#ifndef MYSQLND_NET_H
#define MYSQLND_NET_H
-PHPAPI MYSQLND_NET * mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
-PHPAPI void mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
+PHPAPI MYSQLND_NET * mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+PHPAPI void mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
#endif /* MYSQLND_NET_H */
diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c
index 3bb3c05147..f6c78ca0bc 100644
--- a/ext/mysqlnd/mysqlnd_plugin.c
+++ b/ext/mysqlnd/mysqlnd_plugin.c
@@ -27,7 +27,7 @@
/*--------------------------------------------------------------------*/
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
-static enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC);
+static enum_func_status mysqlnd_example_plugin_end(void * p);
static MYSQLND_STATS * mysqlnd_plugin_example_stats = NULL;
@@ -67,7 +67,7 @@ static struct st_mysqlnd_typeii_plugin_example mysqlnd_example_plugin =
/* {{{ mysqlnd_example_plugin_end */
static
-enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
+enum_func_status mysqlnd_example_plugin_end(void * p)
{
struct st_mysqlnd_typeii_plugin_example * plugin = (struct st_mysqlnd_typeii_plugin_example *) p;
DBG_ENTER("mysqlnd_example_plugin_end");
@@ -80,11 +80,11 @@ enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
/* {{{ mysqlnd_example_plugin_register */
void
-mysqlnd_example_plugin_register(TSRMLS_D)
+mysqlnd_example_plugin_register(void)
{
mysqlnd_stats_init(&mysqlnd_plugin_example_stats, EXAMPLE_STAT_LAST);
mysqlnd_example_plugin.plugin_header.plugin_stats.values = mysqlnd_plugin_example_stats;
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin);
}
/* }}} */
#endif /* defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 */
@@ -97,7 +97,7 @@ static unsigned int mysqlnd_plugins_counter = 0;
/* {{{ mysqlnd_plugin_subsystem_init */
void
-mysqlnd_plugin_subsystem_init(TSRMLS_D)
+mysqlnd_plugin_subsystem_init(void)
{
zend_hash_init(&mysqlnd_registered_plugins, 4 /* initial hash size */, NULL /* hash_func */, NULL /* dtor */, TRUE /* pers */);
}
@@ -106,11 +106,11 @@ mysqlnd_plugin_subsystem_init(TSRMLS_D)
/* {{{ mysqlnd_plugin_end_apply_func */
int
-mysqlnd_plugin_end_apply_func(zval *el TSRMLS_DC)
+mysqlnd_plugin_end_apply_func(zval *el)
{
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
if (plugin_header->m.plugin_shutdown) {
- plugin_header->m.plugin_shutdown(plugin_header TSRMLS_CC);
+ plugin_header->m.plugin_shutdown(plugin_header);
}
return ZEND_HASH_APPLY_REMOVE;
}
@@ -119,9 +119,9 @@ mysqlnd_plugin_end_apply_func(zval *el TSRMLS_DC)
/* {{{ mysqlnd_plugin_subsystem_end */
void
-mysqlnd_plugin_subsystem_end(TSRMLS_D)
+mysqlnd_plugin_subsystem_end(void)
{
- zend_hash_apply(&mysqlnd_registered_plugins, mysqlnd_plugin_end_apply_func TSRMLS_CC);
+ zend_hash_apply(&mysqlnd_registered_plugins, mysqlnd_plugin_end_apply_func);
zend_hash_destroy(&mysqlnd_registered_plugins);
}
/* }}} */
@@ -130,20 +130,19 @@ mysqlnd_plugin_subsystem_end(TSRMLS_D)
/* {{{ mysqlnd_plugin_register */
PHPAPI unsigned int mysqlnd_plugin_register()
{
- TSRMLS_FETCH();
- return mysqlnd_plugin_register_ex(NULL TSRMLS_CC);
+ return mysqlnd_plugin_register_ex(NULL);
}
/* }}} */
/* {{{ mysqlnd_plugin_register_ex */
-PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin TSRMLS_DC)
+PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin)
{
if (plugin) {
if (plugin->plugin_api_version == MYSQLND_PLUGIN_API_VERSION) {
zend_hash_str_update_ptr(&mysqlnd_registered_plugins, plugin->plugin_name, strlen(plugin->plugin_name), plugin);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Plugin API version mismatch while loading plugin %s. Expected %d, got %d",
+ php_error_docref(NULL, E_WARNING, "Plugin API version mismatch while loading plugin %s. Expected %d, got %d",
plugin->plugin_name, MYSQLND_PLUGIN_API_VERSION, plugin->plugin_api_version);
return 0xCAFE;
}
@@ -154,7 +153,7 @@ PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header *
/* {{{ mysqlnd_plugin_find */
-PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC)
+PHPAPI void * _mysqlnd_plugin_find(const char * const name)
{
void * plugin;
if ((plugin = zend_hash_str_find_ptr(&mysqlnd_registered_plugins, name, strlen(name))) != NULL) {
@@ -167,7 +166,7 @@ PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC)
/* {{{ _mysqlnd_plugin_apply_with_argument */
-PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC)
+PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument)
{
/* Note: We want to be thread-safe (read-only), so we can use neither
* zend_hash_apply_with_argument nor zend_hash_internal_pointer_reset and
@@ -177,9 +176,9 @@ PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, voi
int result;
ZEND_HASH_FOREACH_VAL(&mysqlnd_registered_plugins, val) {
- result = apply_func(val, argument TSRMLS_CC);
+ result = apply_func(val, argument);
if (result & ZEND_HASH_APPLY_REMOVE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mysqlnd_plugin_apply_with_argument must not remove table entries");
+ php_error_docref(NULL, E_WARNING, "mysqlnd_plugin_apply_with_argument must not remove table entries");
}
if (result & ZEND_HASH_APPLY_STOP) {
break;
diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h
index f05e352baa..290c7b14b9 100644
--- a/ext/mysqlnd/mysqlnd_priv.h
+++ b/ext/mysqlnd/mysqlnd_priv.h
@@ -148,11 +148,11 @@
#define SET_STMT_ERROR(stmt, a, b, c) SET_CLIENT_ERROR(*(stmt)->error_info, a, b, c)
-#define CONN_GET_STATE(c) (c)->m->get_state((c) TSRMLS_CC)
-#define CONN_SET_STATE(c, s) (c)->m->set_state((c), (s) TSRMLS_CC)
+#define CONN_GET_STATE(c) (c)->m->get_state((c))
+#define CONN_SET_STATE(c, s) (c)->m->set_state((c), (s))
/* PS stuff */
-typedef void (*ps_field_fetch_func)(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC);
+typedef void (*ps_field_fetch_func)(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row);
struct st_mysqlnd_perm_bind {
ps_field_fetch_func func;
/* should be signed int */
@@ -164,8 +164,8 @@ struct st_mysqlnd_perm_bind {
extern struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
-enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC);
-enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC);
+enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything);
+enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything);
PHPAPI extern const char * const mysqlnd_old_passwd;
@@ -182,21 +182,21 @@ PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);
-enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning TSRMLS_DC);
+enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning);
void _mysqlnd_init_ps_subsystem();/* This one is private, mysqlnd_library_init() will call it */
void _mysqlnd_init_ps_fetch_subsystem();
-void ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row, unsigned int byte_count TSRMLS_DC);
+void ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row, unsigned int byte_count);
-void mysqlnd_plugin_subsystem_init(TSRMLS_D);
-void mysqlnd_plugin_subsystem_end(TSRMLS_D);
+void mysqlnd_plugin_subsystem_init(void);
+void mysqlnd_plugin_subsystem_end(void);
-void mysqlnd_register_builtin_authentication_plugins(TSRMLS_D);
+void mysqlnd_register_builtin_authentication_plugins(void);
-void mysqlnd_example_plugin_register(TSRMLS_D);
+void mysqlnd_example_plugin_register(void);
struct st_mysqlnd_packet_greet;
struct st_mysqlnd_authentication_plugin;
@@ -219,7 +219,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
size_t * switch_to_auth_protocol_len,
zend_uchar ** switch_to_auth_protocol_data,
size_t * switch_to_auth_protocol_data_len
- TSRMLS_DC);
+ );
enum_func_status
mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
@@ -238,7 +238,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
size_t * switch_to_auth_protocol_len,
zend_uchar ** switch_to_auth_protocol_data,
size_t * switch_to_auth_protocol_data_len
- TSRMLS_DC);
+ );
#endif /* MYSQLND_PRIV_H */
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 1b2602e6b6..08e5776e7b 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -37,15 +37,15 @@ const char * const mysqlnd_not_bound_as_blob = "Can't send long data for non-str
const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
-enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
+enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
-static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
-static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
+static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt);
+static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no);
/* {{{ mysqlnd_stmt::store_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -67,7 +67,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->cursor_exists) {
/* Silently convert buffered to unbuffered, for now */
- DBG_RETURN(s->m->use_result(s TSRMLS_CC));
+ DBG_RETURN(s->m->use_result(s));
}
/* Nothing to store for UPSERT/LOAD DATA*/
@@ -89,13 +89,13 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
result->type = MYSQLND_RES_PS_BUF;
/* result->m.row_decoder = php_mysqlnd_rowp_read_binary_protocol; */
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, TRUE, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, TRUE, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
- ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buffers, TRUE TSRMLS_CC);
+ ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buffers, TRUE);
result->stored_data->m.fetch_row = mysqlnd_stmt_fetch_row_buffered;
@@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED;
} else {
COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info);
- stmt->result->m.free_result_contents(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
@@ -142,7 +142,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::get_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -163,7 +163,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->cursor_exists) {
/* Silently convert buffered to unbuffered, for now */
- DBG_RETURN(s->m->use_result(s TSRMLS_CC));
+ DBG_RETURN(s->m->use_result(s));
}
/* Nothing to store for UPSERT/LOAD DATA*/
@@ -178,19 +178,19 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
do {
- result = conn->m->result_init(stmt->result->field_count, stmt->persistent TSRMLS_CC);
+ result = conn->m->result_init(stmt->result->field_count, stmt->persistent);
if (!result) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE TSRMLS_CC);
+ result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE);
if (!result->meta) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- if ((result = result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY TSRMLS_CC))) {
+ if ((result = result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY))) {
stmt->upsert_status->affected_rows = result->stored_data->row_count;
stmt->state = MYSQLND_STMT_PREPARED;
result->type = MYSQLND_RES_PS_BUF;
@@ -203,7 +203,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
} while (0);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
DBG_RETURN(NULL);
}
@@ -212,12 +212,12 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::more_results */
static zend_bool
-MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::more_results");
/* (conn->state == CONN_NEXT_RESULT_PENDING) too */
- DBG_RETURN((stmt && stmt->conn && (stmt->conn->m->get_server_status(stmt->conn TSRMLS_CC) & SERVER_MORE_RESULTS_EXISTS))?
+ DBG_RETURN((stmt && stmt->conn && (stmt->conn->m->get_server_status(stmt->conn) & SERVER_MORE_RESULTS_EXISTS))?
TRUE:
FALSE);
}
@@ -226,7 +226,7 @@ MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt::next_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -245,9 +245,9 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
/* Free space for next result */
- s->m->free_stmt_result(s TSRMLS_CC);
+ s->m->free_stmt_result(s);
{
- enum_func_status ret = s->m->parse_execute_response(s TSRMLS_CC);
+ enum_func_status ret = s->m->parse_execute_response(s);
DBG_RETURN(ret);
}
}
@@ -256,7 +256,7 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt_skip_metadata */
static enum_func_status
-mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
/* Follows parameter metadata, we have just to skip it, as libmysql does */
@@ -270,7 +270,7 @@ mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE);
if (!field_packet) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
@@ -293,7 +293,7 @@ mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt_read_prepare_response */
static enum_func_status
-mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_PACKET_PREPARE_RESPONSE * prepare_resp;
@@ -305,7 +305,7 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE);
if (!prepare_resp) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
@@ -337,7 +337,7 @@ done:
/* {{{ mysqlnd_stmt_prepare_read_eof */
static enum_func_status
-mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_PACKET_EOF * fields_eof;
@@ -349,14 +349,14 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE);
if (!fields_eof) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
} else {
if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) {
if (stmt->result) {
- stmt->result->m.free_result_contents(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
memset(stmt, 0, sizeof(MYSQLND_STMT_DATA));
stmt->state = MYSQLND_STMT_INITTED;
@@ -376,7 +376,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt::prepare */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const query, unsigned int query_len)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_STMT * s_to_prepare = s;
@@ -400,32 +400,32 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
/* Do implicit use_result and then flush the result */
stmt->default_rset_handler = s->m->use_result;
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
/* No 'else' here please :) */
if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE && stmt->result) {
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
/*
Create a new test statement, which we will prepare, but if anything
fails, we will scrap it.
*/
- s_to_prepare = stmt->conn->m->stmt_init(stmt->conn TSRMLS_CC);
+ s_to_prepare = stmt->conn->m->stmt_init(stmt->conn);
if (!s_to_prepare) {
goto fail;
}
stmt_to_prepare = s_to_prepare->data;
}
- if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (const zend_uchar *) query, query_len, PROT_LAST, FALSE, TRUE TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_read_prepare_response(s_to_prepare TSRMLS_CC))
+ if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (const zend_uchar *) query, query_len, PROT_LAST, FALSE, TRUE) ||
+ FAIL == mysqlnd_stmt_read_prepare_response(s_to_prepare))
{
goto fail;
}
if (stmt_to_prepare->param_count) {
- if (FAIL == mysqlnd_stmt_skip_metadata(s_to_prepare TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC))
+ if (FAIL == mysqlnd_stmt_skip_metadata(s_to_prepare) ||
+ FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare))
{
goto fail;
}
@@ -437,7 +437,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
no metadata at prepare.
*/
if (stmt_to_prepare->field_count) {
- MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->persistent TSRMLS_CC);
+ MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->persistent);
if (!result) {
SET_OOM_ERROR(*stmt->conn->error_info);
goto fail;
@@ -445,12 +445,12 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
/* Allocate the result now as it is needed for the reading of metadata */
stmt_to_prepare->result = result;
- result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn TSRMLS_CC);
+ result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn);
result->type = MYSQLND_RES_PS_BUF;
- if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC))
+ if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn) ||
+ FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare))
{
goto fail;
}
@@ -469,7 +469,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
stmt_to_prepare = stmt;
stmt = tmp_swap_data;
}
- s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
+ s_to_prepare->m->dtor(s_to_prepare, TRUE);
}
stmt->state = MYSQLND_STMT_PREPARED;
DBG_INF("PASS");
@@ -477,7 +477,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
fail:
if (stmt_to_prepare != stmt && s_to_prepare) {
- s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
+ s_to_prepare->m->dtor(s_to_prepare, TRUE);
}
stmt->state = MYSQLND_STMT_INITTED;
@@ -489,7 +489,7 @@ fail:
/* {{{ mysqlnd_stmt_execute_parse_response */
static enum_func_status
-mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
+mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -502,7 +502,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
conn = stmt->conn;
CONN_SET_STATE(conn, CONN_QUERY_SENT);
- ret = mysqlnd_query_read_result_set_header(stmt->conn, s TSRMLS_CC);
+ ret = mysqlnd_query_read_result_set_header(stmt->conn, s);
if (ret == FAIL) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
memset(stmt->upsert_status, 0, sizeof(*stmt->upsert_status));
@@ -535,7 +535,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
For SHOW we don't create (bypasses PS in server)
a result set at prepare and thus a connection was missing
*/
- stmt->result->conn = stmt->conn->m->get_reference(stmt->conn TSRMLS_CC);
+ stmt->result->conn = stmt->conn->m->get_reference(stmt->conn);
}
/* Update stmt->field_count as SHOW sets it to 0 at prepare */
@@ -587,10 +587,10 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
}
#ifndef MYSQLND_DONT_SKIP_OUT_PARAMS_RESULTSET
if (stmt->upsert_status->server_status & SERVER_PS_OUT_PARAMS) {
- s->m->free_stmt_content(s TSRMLS_CC);
+ s->m->free_stmt_content(s);
DBG_INF("PS OUT Variable RSet, skipping");
/* OUT params result set. Skip for now to retain compatibility */
- ret = mysqlnd_stmt_execute_parse_response(s TSRMLS_CC);
+ ret = mysqlnd_stmt_execute_parse_response(s);
}
#endif
@@ -602,7 +602,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::execute */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -655,14 +655,14 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
}
#endif
- s->m->flush(s TSRMLS_CC);
+ s->m->flush(s);
/*
Executed, but the user hasn't started to fetch
This will clean also the metadata, but after the EXECUTE call we will
have it again.
*/
- stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_buffers(stmt->result);
stmt->state = MYSQLND_STMT_PREPARED;
} else if (stmt->state < MYSQLND_STMT_PREPARED) {
@@ -699,12 +699,12 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
DBG_RETURN(FAIL);
}
}
- ret = s->m->generate_execute_request(s, &request, &request_len, &free_request TSRMLS_CC);
+ ret = s->m->generate_execute_request(s, &request, &request_len, &free_request);
if (ret == PASS) {
/* support for buffer types should be added here ! */
ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, request, request_len,
PROT_LAST /* we will handle the response packet*/,
- FALSE, FALSE TSRMLS_CC);
+ FALSE, FALSE);
} else {
SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Couldn't generate the request. Possibly OOM.");
}
@@ -720,7 +720,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
}
stmt->execute_count++;
- ret = s->m->parse_execute_response(s TSRMLS_CC);
+ ret = s->m->parse_execute_response(s);
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
@@ -734,7 +734,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_fetch_row_buffered */
enum_func_status
-mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
@@ -763,7 +763,7 @@ mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int
meta->field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -835,7 +835,7 @@ mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int
/* {{{ mysqlnd_stmt_fetch_row_unbuffered */
enum_func_status
-mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
@@ -873,7 +873,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
unsigned int i, field_count = result->field_count;
if (!row_packet->skip_extraction) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -885,7 +885,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
row_packet->field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC))
+ result->conn->stats))
{
DBG_RETURN(FAIL);
}
@@ -923,7 +923,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
the bound variables. Thus we need to do part of what it does or Zend will
report leaks.
*/
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
@@ -962,7 +962,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
/* {{{ mysqlnd_stmt::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_RES * result;
@@ -992,7 +992,7 @@ MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS);
result = stmt->result;
- result->m.use_result(stmt->result, TRUE TSRMLS_CC);
+ result->m.use_result(stmt->result, TRUE);
result->unbuf->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor:
mysqlnd_stmt_fetch_row_unbuffered;
stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED;
@@ -1007,7 +1007,7 @@ MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_fetch_row_cursor */
enum_func_status
-mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
@@ -1043,7 +1043,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
if (FAIL == stmt->conn->m->simple_command(stmt->conn, COM_STMT_FETCH, buf, sizeof(buf),
PROT_LAST /* we will handle the response packet*/,
- FALSE, TRUE TSRMLS_CC)) {
+ FALSE, TRUE)) {
COPY_CLIENT_ERROR(*stmt->error_info, *stmt->conn->error_info);
DBG_RETURN(FAIL);
}
@@ -1056,7 +1056,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
unsigned int i, field_count = result->field_count;
if (!row_packet->skip_extraction) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -1068,7 +1068,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
row_packet->field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC))
+ result->conn->stats))
{
DBG_RETURN(FAIL);
}
@@ -1110,13 +1110,13 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
the bound variables. Thus we need to do part of what it does or Zend will
report leaks.
*/
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
/* We asked for one row, the next one should be EOF, eat it */
ret = PACKET_READ(row_packet, result->conn);
if (row_packet->row_buffer) {
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR);
@@ -1154,7 +1154,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
/* {{{ mysqlnd_stmt::fetch */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fetched_anything)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -1173,7 +1173,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
} else if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
/* Execute only once. We have to free the previous contents of user's bound vars */
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
stmt->state = MYSQLND_STMT_USER_FETCHING;
@@ -1202,7 +1202,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
stmt->result_zvals_separated_once = TRUE;
}
- ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything TSRMLS_CC);
+ ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything);
DBG_RETURN(ret);
}
/* }}} */
@@ -1210,7 +1210,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
/* {{{ mysqlnd_stmt::reset */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = PASS;
@@ -1238,7 +1238,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
}
}
- s->m->flush(s TSRMLS_CC);
+ s->m->flush(s);
/*
Don't free now, let the result be usable. When the stmt will again be
@@ -1250,7 +1250,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
if (CONN_GET_STATE(conn) == CONN_READY &&
FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf,
sizeof(cmd_buf), PROT_OK_PACKET,
- FALSE, TRUE TSRMLS_CC))) {
+ FALSE, TRUE))) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
}
*stmt->upsert_status = *conn->upsert_status;
@@ -1263,7 +1263,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::flush */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = PASS;
@@ -1283,13 +1283,13 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
do {
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("fetching result set header");
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
stmt->state = MYSQLND_STMT_USER_FETCHING;
}
if (stmt->result) {
DBG_INF("skipping result");
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
}
@@ -1302,7 +1302,7 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::send_long_data */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned int param_no,
- const char * const data, zend_ulong length TSRMLS_DC)
+ const char * const data, zend_ulong length)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = FAIL;
@@ -1363,7 +1363,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);
/* COM_STMT_SEND_LONG_DATA doesn't send an OK packet*/
- ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE);
mnd_efree(cmd_buf);
if (FAIL == ret) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
@@ -1393,8 +1393,8 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
#if HAVE_USLEEP && !defined(PHP_WIN32)
usleep(120000);
#endif
- if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error "
+ if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd))) {
+ php_error_docref(NULL, E_WARNING, "There was an error "
"while sending long data. Probably max_allowed_packet_size "
"is smaller than the data. You have to increase it or send "
"smaller chunks of data. Answer was "MYSQLND_SZ_T_SPEC" bytes long.", packet_len);
@@ -1413,7 +1413,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
/* {{{ mysqlnd_stmt::bind_parameters */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * const param_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_param");
@@ -1426,7 +1426,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared);
DBG_ERR("not prepared");
if (param_bind) {
- s->m->free_parameter_bind(s, param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, param_bind);
}
DBG_RETURN(FAIL);
}
@@ -1455,7 +1455,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
zval_ptr_dtor(&stmt->param_bind[i].zv);
}
if (stmt->param_bind != param_bind) {
- s->m->free_parameter_bind(s, stmt->param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, stmt->param_bind);
}
}
@@ -1482,7 +1482,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
/* {{{ mysqlnd_stmt::bind_one_parameter */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigned int param_no,
- zval * const zv, zend_uchar type TSRMLS_DC)
+ zval * const zv, zend_uchar type)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_one_parameter");
@@ -1536,7 +1536,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
/* {{{ mysqlnd_stmt::refresh_bind_param */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::refresh_bind_param");
@@ -1565,7 +1565,7 @@ MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s TSRMLS_D
/* {{{ mysqlnd_stmt::bind_result */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
- MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC)
+ MYSQLND_RESULT_BIND * const result_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_result");
@@ -1577,7 +1577,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
if (stmt->state < MYSQLND_STMT_PREPARED) {
SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared);
if (result_bind) {
- s->m->free_result_bind(s, result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, result_bind);
}
DBG_ERR("not prepared");
DBG_RETURN(FAIL);
@@ -1594,7 +1594,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
DBG_RETURN(FAIL);
}
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
stmt->result_zvals_separated_once = FALSE;
stmt->result_bind = result_bind;
for (i = 0; i < stmt->field_count; i++) {
@@ -1611,7 +1611,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
stmt->result_bind[i].bound = TRUE;
}
} else if (result_bind) {
- s->m->free_result_bind(s, result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, result_bind);
}
DBG_INF("PASS");
DBG_RETURN(PASS);
@@ -1621,7 +1621,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
/* {{{ mysqlnd_stmt::bind_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned int param_no TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned int param_no)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_result");
@@ -1646,7 +1646,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned i
SET_EMPTY_ERROR(*stmt->conn->error_info);
if (stmt->field_count) {
- mysqlnd_stmt_separate_one_result_bind(s, param_no TSRMLS_CC);
+ mysqlnd_stmt_separate_one_result_bind(s, param_no);
/* Guaranteed is that stmt->result_bind is NULL */
if (!stmt->result_bind) {
stmt->result_bind = mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent);
@@ -1672,7 +1672,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned i
/* {{{ mysqlnd_stmt::insert_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->last_insert_id : 0;
@@ -1682,7 +1682,7 @@ MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::affected_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->affected_rows : 0;
@@ -1692,7 +1692,7 @@ MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt && stmt->result? mysqlnd_num_rows(stmt->result):0;
@@ -1702,7 +1702,7 @@ MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::warning_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->warning_count : 0;
@@ -1712,7 +1712,7 @@ MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::server_status */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->server_status : 0;
@@ -1722,7 +1722,7 @@ MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::field_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->field_count : 0;
@@ -1732,7 +1732,7 @@ MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::param_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->param_count : 0;
@@ -1742,7 +1742,7 @@ MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::errno */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->error_info->error_no : 0;
@@ -1752,7 +1752,7 @@ MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::error */
static const char *
-MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->error_info->error : 0;
@@ -1762,7 +1762,7 @@ MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::sqlstate */
static const char *
-MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt && stmt->error_info->sqlstate[0] ? stmt->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
@@ -1772,17 +1772,17 @@ MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const s, uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const s, uint64_t row)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
- return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row TSRMLS_CC) : FAIL;
+ return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row) : FAIL;
}
/* }}} */
/* {{{ mysqlnd_stmt::param_metadata */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (!stmt || !stmt->param_count) {
@@ -1795,7 +1795,7 @@ MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::result_metadata */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_RES *result;
@@ -1814,7 +1814,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->update_max_length && stmt->result->stored_data) {
/* stored result, we have to update the max_length before we clone the meta data :( */
stmt->result->stored_data->m.initialize_result_set_rest(stmt->result->stored_data, stmt->result->meta, stmt->conn->stats,
- stmt->conn->options->int_and_float_native TSRMLS_CC);
+ stmt->conn->options->int_and_float_native);
}
/*
TODO: This implementation is kind of a hack,
@@ -1826,17 +1826,17 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
result set, so we don't get one.
*/
do {
- result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent TSRMLS_CC);
+ result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent);
if (!result) {
break;
}
result->type = MYSQLND_RES_NORMAL;
- result->unbuf = mysqlnd_result_unbuffered_init(stmt->field_count, TRUE, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(stmt->field_count, TRUE, result->persistent);
if (!result->unbuf) {
break;
}
result->unbuf->eof_reached = TRUE;
- result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE TSRMLS_CC);
+ result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE);
if (!result->meta) {
break;
}
@@ -1847,7 +1847,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
SET_OOM_ERROR(*stmt->conn->error_info);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
DBG_RETURN(NULL);
}
@@ -1858,7 +1858,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
enum mysqlnd_stmt_attr attr_type,
- const void * const value TSRMLS_DC)
+ const void * const value)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::attr_set");
@@ -1913,7 +1913,7 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, attr_get)(const MYSQLND_STMT * const s,
enum mysqlnd_stmt_attr attr_type,
- void * const value TSRMLS_DC)
+ void * const value)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::attr_set");
@@ -1944,7 +1944,7 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_get)(const MYSQLND_STMT * const s,
/* free_result() doesn't actually free stmt->result but only the buffers */
/* {{{ mysqlnd_stmt::free_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_result");
@@ -1966,21 +1966,21 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
DBG_INF("fetching result set header");
/* Do implicit use_result and then flush the result */
stmt->default_rset_handler = s->m->use_result;
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("skipping result");
/* Flush if anything is left and unbuffered set */
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
/*
Separate the bound variables, which point to the result set, then
destroy the set.
*/
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
/* Now we can destroy the result set */
- stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_buffers(stmt->result);
}
if (stmt->state > MYSQLND_STMT_PREPARED) {
@@ -1998,7 +1998,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_separate_result_bind */
static void
-mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
+mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
unsigned int i;
@@ -2027,7 +2027,7 @@ mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
}
}
- s->m->free_result_bind(s, stmt->result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, stmt->result_bind);
stmt->result_bind = NULL;
DBG_VOID_RETURN;
@@ -2037,7 +2037,7 @@ mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_separate_one_result_bind */
static void
-mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param_no TSRMLS_DC)
+mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param_no)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt_separate_one_result_bind");
@@ -2070,7 +2070,7 @@ mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param
/* {{{ mysqlnd_stmt::free_stmt_result */
static void
-MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_stmt_result");
@@ -2082,10 +2082,10 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
First separate the bound variables, which point to the result set, then
destroy the set.
*/
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
/* Not every statement has a result set attached */
if (stmt->result) {
- stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_internal(stmt->result);
stmt->result = NULL;
}
if (stmt->error_info->error_list) {
@@ -2101,7 +2101,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::free_stmt_content */
static void
-MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_stmt_content");
@@ -2125,11 +2125,11 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
*/
zval_ptr_dtor(&stmt->param_bind[i].zv);
}
- s->m->free_parameter_bind(s, stmt->param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, stmt->param_bind);
stmt->param_bind = NULL;
}
- s->m->free_stmt_result(s TSRMLS_CC);
+ s->m->free_stmt_result(s);
DBG_VOID_RETURN;
}
/* }}} */
@@ -2137,7 +2137,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::net_close */
static enum_func_status
-MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_bool implicit)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -2163,14 +2163,14 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
do {
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("fetching result set header");
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
stmt->state = MYSQLND_STMT_USER_FETCHING;
}
/* unbuffered set not fetched to the end ? Clean the line */
if (stmt->result) {
DBG_INF("skipping result");
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
/*
@@ -2185,7 +2185,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
if (CONN_GET_STATE(conn) == CONN_READY &&
FAIL == conn->m->simple_command(conn, COM_STMT_CLOSE, cmd_buf, sizeof(cmd_buf),
PROT_LAST /* COM_STMT_CLOSE doesn't send an OK packet*/,
- FALSE, TRUE TSRMLS_CC)) {
+ FALSE, TRUE)) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
DBG_RETURN(FAIL);
}
@@ -2209,10 +2209,10 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
stmt->execute_cmd_buffer.buffer = NULL;
}
- s->m->free_stmt_content(s TSRMLS_CC);
+ s->m->free_stmt_content(s);
if (stmt->conn) {
- stmt->conn->m->free_reference(stmt->conn TSRMLS_CC);
+ stmt->conn->m->free_reference(stmt->conn);
stmt->conn = NULL;
}
@@ -2222,7 +2222,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
/* {{{ mysqlnd_stmt::dtor */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit)
{
MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL;
enum_func_status ret = FAIL;
@@ -2235,7 +2235,7 @@ MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TS
MYSQLND_INC_GLOBAL_STATISTIC(implicit == TRUE? STAT_STMT_CLOSE_IMPLICIT:
STAT_STMT_CLOSE_EXPLICIT);
- ret = s->m->net_close(s, implicit TSRMLS_CC);
+ ret = s->m->net_close(s, implicit);
mnd_pefree(stmt, persistent);
}
mnd_pefree(s, persistent);
@@ -2248,7 +2248,7 @@ MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TS
/* {{{ mysqlnd_stmt::alloc_param_bind */
static MYSQLND_PARAM_BIND *
-MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::alloc_param_bind");
@@ -2262,7 +2262,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::alloc_result_bind */
static MYSQLND_RESULT_BIND *
-MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::alloc_result_bind");
@@ -2276,7 +2276,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s TSRMLS_DC
/* {{{ param_bind::free_parameter_bind */
PHPAPI void
-MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * param_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * param_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (stmt) {
@@ -2288,7 +2288,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLN
/* {{{ mysqlnd_stmt::free_result_bind */
PHPAPI void
-MYSQLND_METHOD(mysqlnd_stmt, free_result_bind)(MYSQLND_STMT * const s, MYSQLND_RESULT_BIND * result_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_result_bind)(MYSQLND_STMT * const s, MYSQLND_RESULT_BIND * result_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (stmt) {
@@ -2355,11 +2355,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ _mysqlnd_stmt_init */
MYSQLND_STMT *
-_mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+_mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn)
{
MYSQLND_STMT * ret;
DBG_ENTER("_mysqlnd_stmt_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn);
DBG_RETURN(ret);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index e98d1c3a52..4a68970d50 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -55,7 +55,7 @@ struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
/* {{{ ps_fetch_from_1_to_8_bytes */
void
ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len,
- zend_uchar ** row, unsigned int byte_count TSRMLS_DC)
+ zend_uchar ** row, unsigned int byte_count)
{
char tmp[22];
size_t tmp_len = 0;
@@ -127,7 +127,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne
/* {{{ ps_fetch_null */
static void
-ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
ZVAL_NULL(zv);
}
@@ -136,43 +136,43 @@ ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len
/* {{{ ps_fetch_int8 */
static void
-ps_fetch_int8(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int8(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 1 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 1);
}
/* }}} */
/* {{{ ps_fetch_int16 */
static void
-ps_fetch_int16(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int16(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 2 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 2);
}
/* }}} */
/* {{{ ps_fetch_int32 */
static void
-ps_fetch_int32(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int32(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 4 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 4);
}
/* }}} */
/* {{{ ps_fetch_int64 */
static void
-ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 8 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 8);
}
/* }}} */
/* {{{ ps_fetch_float */
static void
-ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
float fval;
double dval;
@@ -238,7 +238,7 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
/* {{{ ps_fetch_double */
static void
-ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
double value;
DBG_ENTER("ps_fetch_double");
@@ -253,7 +253,7 @@ ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_
/* {{{ ps_fetch_time */
static void
-ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t;
zend_ulong length; /* First byte encodes the length*/
@@ -296,7 +296,7 @@ ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_le
/* {{{ ps_fetch_date */
static void
-ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t = {0};
zend_ulong length; /* First byte encodes the length*/
@@ -333,7 +333,7 @@ ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_le
/* {{{ ps_fetch_datetime */
static void
-ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t;
zend_ulong length; /* First byte encodes the length*/
@@ -377,7 +377,7 @@ ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pac
/* {{{ ps_fetch_string */
static void
-ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
/*
For now just copy, before we make it possible
@@ -397,10 +397,10 @@ ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_
/* {{{ ps_fetch_bit */
static void
-ps_fetch_bit(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_bit(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
zend_ulong length = php_mysqlnd_net_field_length(row);
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, length TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, length);
}
/* }}} */
@@ -550,7 +550,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
/* {{{ mysqlnd_stmt_copy_it */
static enum_func_status
-mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count, unsigned int current TSRMLS_DC)
+mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count, unsigned int current)
{
if (!*copies) {
*copies = mnd_ecalloc(param_count, sizeof(zval));
@@ -566,7 +566,7 @@ mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count,
/* {{{ mysqlnd_stmt_free_copies */
static void
-mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies TSRMLS_DC)
+mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies)
{
if (copies) {
unsigned int i;
@@ -581,7 +581,7 @@ mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies TSRMLS_DC)
/* {{{ mysqlnd_stmt_execute_check_n_enlarge_buffer */
static enum_func_status
-mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, size_t * buf_len, zend_uchar * const provided_buffer, size_t needed_bytes TSRMLS_DC)
+mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, size_t * buf_len, zend_uchar * const provided_buffer, size_t needed_bytes)
{
const size_t overalloc = 5;
size_t left = (*buf_len - (*p - *buf));
@@ -609,7 +609,7 @@ mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, si
/* {{{ mysqlnd_stmt_execute_prepare_param_types */
static enum_func_status
-mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copies_param, int * resend_types_next_time TSRMLS_DC)
+mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copies_param, int * resend_types_next_time)
{
unsigned int i;
DBG_ENTER("mysqlnd_stmt_execute_prepare_param_types");
@@ -621,7 +621,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) {
/* always copy the var, because we do many conversions */
if (Z_TYPE_P(parameter) != IS_LONG &&
- PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i TSRMLS_CC))
+ PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i))
{
SET_OOM_ERROR(*stmt->error_info);
goto end;
@@ -710,7 +710,7 @@ mysqlnd_stmt_execute_store_types(MYSQLND_STMT_DATA * stmt, zval * copies, zend_u
/* {{{ mysqlnd_stmt_execute_calculate_param_values_size */
static enum_func_status
-mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval ** copies_param, size_t * data_size TSRMLS_DC)
+mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval ** copies_param, size_t * data_size)
{
unsigned int i;
DBG_ENTER("mysqlnd_stmt_execute_calculate_param_values_size");
@@ -730,7 +730,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval
if (Z_ISREF(stmt->param_bind[j].zv) && Z_REFVAL(stmt->param_bind[j].zv) == the_var) {
/* Double binding of the same zval, make a copy */
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -745,7 +745,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval
*data_size += 8;
if (Z_TYPE_P(the_var) != IS_DOUBLE) {
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -780,7 +780,7 @@ use_string:
*data_size += 8; /* max 8 bytes for size */
if (Z_TYPE_P(the_var) != IS_STRING) {
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -866,7 +866,7 @@ send_string:
/* {{{ mysqlnd_stmt_execute_store_params */
static enum_func_status
-mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar **p, size_t *buf_len TSRMLS_DC)
+mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar **p, size_t *buf_len )
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar * provided_buffer = *buf;
@@ -880,7 +880,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
{
unsigned int null_count = (stmt->param_count + 7) / 8;
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, null_count TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, null_count)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -898,7 +898,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values
occur, and force resend for the next execution.
*/
- if (FAIL == mysqlnd_stmt_execute_prepare_param_types(stmt, &copies, &resend_types_next_time TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_prepare_param_types(stmt, &copies, &resend_types_next_time)) {
goto end;
}
@@ -906,7 +906,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
(*p)++;
if (stmt->send_types_to_server) {
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, stmt->param_count * 2 TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, stmt->param_count * 2)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -917,12 +917,12 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
/* 2. Store data */
/* 2.1 Calculate how much space we need */
- if (FAIL == mysqlnd_stmt_execute_calculate_param_values_size(stmt, &copies, &data_size TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_calculate_param_values_size(stmt, &copies, &data_size)) {
goto end;
}
/* 2.2 Enlarge the buffer, if needed */
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, data_size TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, data_size)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -932,7 +932,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
ret = PASS;
end:
- mysqlnd_stmt_free_copies(stmt, copies TSRMLS_CC);
+ mysqlnd_stmt_free_copies(stmt, copies);
DBG_INF_FMT("ret=%s", ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -942,7 +942,7 @@ end:
/* {{{ mysqlnd_stmt_execute_generate_request */
enum_func_status
-mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC)
+mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer)
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar *p = stmt->execute_cmd_buffer.buffer,
@@ -965,7 +965,7 @@ mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** requ
int1store(p, 1); /* and send 1 for iteration count */
p+= 4;
- ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length TSRMLS_CC);
+ ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length);
*free_buffer = (cmd_buffer != stmt->execute_cmd_buffer.buffer);
*request_len = (p - cmd_buffer);
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index 610642d8de..8e82b22715 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -35,7 +35,7 @@
/* {{{ mysqlnd_result_buffered_zval::initialize_result_set_rest */
static enum_func_status
MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC)
+ MYSQLND_STATS * stats, zend_bool int_and_float_native)
{
unsigned int i;
enum_func_status ret = PASS;
@@ -58,7 +58,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND
field_count,
meta->fields,
int_and_float_native,
- stats TSRMLS_CC);
+ stats);
if (rc != PASS) {
ret = FAIL;
break;
@@ -88,7 +88,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND
/* {{{ mysqlnd_result_buffered_c::initialize_result_set_rest */
static enum_func_status
MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC)
+ MYSQLND_STATS * stats, zend_bool int_and_float_native)
{
unsigned int i;
enum_func_status ret = PASS;
@@ -111,7 +111,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RE
continue;
}
- rc = result->m.row_decoder(result->row_buffers[i], current_row, field_count, meta->fields, int_and_float_native, stats TSRMLS_CC);
+ rc = result->m.row_decoder(result->row_buffers[i], current_row, field_count, meta->fields, int_and_float_native, stats);
if (rc != PASS) {
ret = FAIL;
@@ -143,7 +143,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RE
/* {{{ mysqlnd_result_unbuffered::free_last_data */
static void
-MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED * unbuf, MYSQLND_STATS * const global_stats TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED * unbuf, MYSQLND_STATS * const global_stats)
{
DBG_ENTER("mysqlnd_res::unbuffered_free_last_data");
@@ -165,7 +165,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED
if (unbuf->last_row_buffer) {
DBG_INF("Freeing last row buffer");
/* Nothing points to this buffer now, free it */
- unbuf->last_row_buffer->free_chunk(unbuf->last_row_buffer TSRMLS_CC);
+ unbuf->last_row_buffer->free_chunk(unbuf->last_row_buffer);
unbuf->last_row_buffer = NULL;
}
@@ -176,10 +176,10 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_result_unbuffered::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats)
{
DBG_ENTER("mysqlnd_result_unbuffered, free_result");
- result->m.free_last_data(result, global_stats TSRMLS_CC);
+ result->m.free_last_data(result, global_stats);
if (result->lengths) {
mnd_pefree(result->lengths, result->persistent);
@@ -193,7 +193,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED *
}
if (result->result_set_memory_pool) {
- mysqlnd_mempool_destroy(result->result_set_memory_pool TSRMLS_CC);
+ mysqlnd_mempool_destroy(result->result_set_memory_pool);
result->result_set_memory_pool = NULL;
}
@@ -206,7 +206,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED *
/* {{{ mysqlnd_result_buffered_zval::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_ZVAL * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_ZVAL * const set)
{
zval * data = set->data;
@@ -237,7 +237,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_Z
/* {{{ mysqlnd_result_buffered_c::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C * const set)
{
DBG_ENTER("mysqlnd_result_buffered_c::free_result");
mnd_pefree(set->initialized, set->persistent);
@@ -249,7 +249,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C *
/* {{{ mysqlnd_result_buffered::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * const set)
{
int64_t row;
@@ -257,14 +257,14 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);
if (set->type == MYSQLND_BUFFERED_TYPE_ZVAL) {
- MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)((MYSQLND_RES_BUFFERED_ZVAL *) set TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)((MYSQLND_RES_BUFFERED_ZVAL *) set);
} if (set->type == MYSQLND_BUFFERED_TYPE_C) {
- MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)((MYSQLND_RES_BUFFERED_C *) set TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)((MYSQLND_RES_BUFFERED_C *) set);
}
for (row = set->row_count - 1; row >= 0; row--) {
MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row];
- current_buffer->free_chunk(current_buffer TSRMLS_CC);
+ current_buffer->free_chunk(current_buffer);
}
if (set->lengths) {
@@ -278,7 +278,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
}
if (set->result_set_memory_pool) {
- mysqlnd_mempool_destroy(set->result_set_memory_pool TSRMLS_CC);
+ mysqlnd_mempool_destroy(set->result_set_memory_pool);
set->result_set_memory_pool = NULL;
}
@@ -294,16 +294,16 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
/* {{{ mysqlnd_res::free_result_buffers */
static void
-MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_buffers");
DBG_INF_FMT("%s", result->unbuf? "unbuffered":(result->stored_data? "buffered":"unknown"));
if (result->unbuf) {
- result->unbuf->m.free_result(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_result(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf = NULL;
} else if (result->stored_data) {
- result->stored_data->m.free_result(result->stored_data TSRMLS_CC);
+ result->stored_data->m.free_result(result->stored_data);
result->stored_data = NULL;
}
@@ -315,14 +315,14 @@ MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result TSRMLS_DC)
/* {{{ mysqlnd_res::free_result_contents_internal */
static
-void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * result TSRMLS_DC)
+void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_contents_internal");
- result->m.free_result_buffers(result TSRMLS_CC);
+ result->m.free_result_buffers(result);
if (result->meta) {
- result->meta->m->free_metadata(result->meta TSRMLS_CC);
+ result->meta->m->free_metadata(result->meta);
result->meta = NULL;
}
@@ -333,15 +333,15 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * re
/* {{{ mysqlnd_res::free_result_internal */
static
-void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result TSRMLS_DC)
+void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_internal");
- result->m.skip_result(result TSRMLS_CC);
+ result->m.skip_result(result);
- result->m.free_result_contents(result TSRMLS_CC);
+ result->m.free_result_contents(result);
if (result->conn) {
- result->conn->m->free_reference(result->conn TSRMLS_CC);
+ result->conn->m->free_reference(result->conn);
result->conn = NULL;
}
@@ -354,7 +354,7 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result TSRM
/* {{{ mysqlnd_res::read_result_metadata */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_res::read_result_metadata");
@@ -365,11 +365,11 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
infrastructure!
*/
if (result->meta) {
- result->meta->m->free_metadata(result->meta TSRMLS_CC);
+ result->meta->m->free_metadata(result->meta);
result->meta = NULL;
}
- result->meta = result->m.result_meta_init(result->field_count, result->persistent TSRMLS_CC);
+ result->meta = result->m.result_meta_init(result->field_count, result->persistent);
if (!result->meta) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -378,8 +378,8 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
/* 1. Read all fields metadata */
/* It's safe to reread without freeing */
- if (FAIL == result->meta->m->read_metadata(result->meta, conn TSRMLS_CC)) {
- result->m.free_result_contents(result TSRMLS_CC);
+ if (FAIL == result->meta->m->read_metadata(result->meta, conn)) {
+ result->m.free_result_contents(result);
DBG_RETURN(FAIL);
}
/* COM_FIELD_LIST is broken and has premature EOF, thus we need to hack here and in mysqlnd_res_meta.c */
@@ -399,7 +399,7 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
/* {{{ mysqlnd_query_read_result_set_header */
enum_func_status
-mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s ? s->data:NULL;
enum_func_status ret;
@@ -411,7 +411,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
ret = FAIL;
do {
- rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE TSRMLS_CC);
+ rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE);
if (!rset_header) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -421,7 +421,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
SET_ERROR_AFF_ROWS(conn);
if (FAIL == (ret = PACKET_READ(rset_header, conn))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading result set's header");
+ php_error_docref(NULL, E_WARNING, "Error reading result set's header");
break;
}
@@ -456,7 +456,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
conn->last_query_type = QUERY_LOAD_LOCAL;
conn->field_count = 0; /* overwrite previous value, or the last value could be used and lead to bug#53503 */
CONN_SET_STATE(conn, CONN_SENDING_LOAD_DATA);
- ret = mysqlnd_handle_local_infile(conn, rset_header->info_or_local_file, &is_warning TSRMLS_CC);
+ ret = mysqlnd_handle_local_infile(conn, rset_header->info_or_local_file, &is_warning);
CONN_SET_STATE(conn, (ret == PASS || is_warning == TRUE)? CONN_READY:CONN_QUIT_SENT);
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_NON_RSET_QUERY);
break;
@@ -499,7 +499,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
/* PS has already allocated it */
conn->field_count = rset_header->field_count;
if (!stmt) {
- result = conn->current_result = conn->m->result_init(rset_header->field_count, conn->persistent TSRMLS_CC);
+ result = conn->current_result = conn->m->result_init(rset_header->field_count, conn->persistent);
} else {
if (!stmt->result) {
DBG_INF("This is 'SHOW'/'EXPLAIN'-like query.");
@@ -508,7 +508,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
- result = stmt->result = conn->m->result_init(rset_header->field_count, stmt->persistent TSRMLS_CC);
+ result = stmt->result = conn->m->result_init(rset_header->field_count, stmt->persistent);
} else {
/*
Update result set metadata if it for some reason changed between
@@ -531,7 +531,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
break;
}
- if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
+ if (FAIL == (ret = result->m.read_result_metadata(result, conn))) {
/* For PS, we leave them in Prepared state */
if (!stmt && conn->current_result) {
mnd_efree(conn->current_result);
@@ -542,7 +542,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
}
/* Check for SERVER_STATUS_MORE_RESULTS if needed */
- fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
+ fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE);
if (!fields_eof) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -550,7 +550,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
}
if (FAIL == (ret = PACKET_READ(fields_eof, conn))) {
DBG_ERR("Error occurred while reading the EOF packet");
- result->m.free_result_contents(result TSRMLS_CC);
+ result->m.free_result_contents(result);
mnd_efree(result);
if (!stmt) {
conn->current_result = NULL;
@@ -600,7 +600,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
completeness.
*/
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED * const result)
{
const MYSQLND_RES_BUFFERED_ZVAL * set = (MYSQLND_RES_BUFFERED_ZVAL *) result;
/*
@@ -632,7 +632,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED
completeness.
*/
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED * const result)
{
const MYSQLND_RES_BUFFERED_C * set = (MYSQLND_RES_BUFFERED_C *) result;
DBG_ENTER("mysqlnd_result_buffered_c::fetch_lengths");
@@ -649,7 +649,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED *
/* {{{ mysqlnd_result_unbuffered::fetch_lengths */
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result)
{
/* simulate output of libmysql */
return (result->last_row_data || result->eof_reached)? result->lengths : NULL;
@@ -659,14 +659,14 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_res::fetch_lengths */
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result)
{
zend_ulong * ret;
DBG_ENTER("mysqlnd_res::fetch_lengths");
ret = result->stored_data && result->stored_data->m.fetch_lengths ?
- result->stored_data->m.fetch_lengths(result->stored_data TSRMLS_CC) :
+ result->stored_data->m.fetch_lengths(result->stored_data) :
(result->unbuf && result->unbuf->m.fetch_lengths ?
- result->unbuf->m.fetch_lengths(result->unbuf TSRMLS_CC) :
+ result->unbuf->m.fetch_lengths(result->unbuf) :
NULL
);
DBG_RETURN(ret);
@@ -676,7 +676,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_result_unbuffered::fetch_row_c */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_ROW_C *row = (MYSQLND_ROW_C *) param;
@@ -706,7 +706,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
result->m.unbuffered_free_last_data() before it. The function returns always true.
*/
if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -723,7 +723,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -784,7 +784,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
} else {
CONN_SET_STATE(result->conn, CONN_READY);
}
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
}
DBG_INF_FMT("ret=%s fetched=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
@@ -795,7 +795,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
/* {{{ mysqlnd_result_unbuffered::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
zval *row = (zval *) param;
@@ -825,7 +825,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
result->m.unbuffered_free_last_data() before it. The function returns always true.
*/
if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -842,7 +842,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -910,7 +910,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
} else {
CONN_SET_STATE(result->conn, CONN_READY);
}
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
}
DBG_INF_FMT("ret=%s fetched=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
@@ -921,7 +921,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
/* {{{ mysqlnd_res::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps)
{
DBG_ENTER("mysqlnd_res::use_result");
@@ -933,7 +933,7 @@ MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps
result->type = MYSQLND_RES_PS_UNBUF;
}
- result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, ps, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, ps, result->persistent);
if (!result->unbuf) {
goto oom;
}
@@ -944,7 +944,7 @@ MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps
this to be not NULL.
*/
/* FALSE = non-persistent */
- result->unbuf->row_packet = result->conn->protocol->m.get_row_packet(result->conn->protocol, FALSE TSRMLS_CC);
+ result->unbuf->row_packet = result->conn->protocol->m.get_row_packet(result->conn->protocol, FALSE);
if (!result->unbuf->row_packet) {
goto oom;
}
@@ -965,7 +965,7 @@ oom:
/* {{{ mysqlnd_result_buffered::fetch_row_c */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
MYSQLND_ROW_C * row = (MYSQLND_ROW_C *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -990,7 +990,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1057,7 +1057,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void
/* {{{ mysqlnd_result_buffered_zval::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
zval * row = (zval *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -1081,7 +1081,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, vo
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1144,7 +1144,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, vo
/* {{{ mysqlnd_result_buffered_c::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
zval * row = (zval *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -1172,7 +1172,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1250,11 +1250,11 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void
/* {{{ mysqlnd_res::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool *fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool *fetched_anything)
{
const mysqlnd_fetch_row_func f = result->stored_data? result->stored_data->m.fetch_row:(result->unbuf? result->unbuf->m.fetch_row:NULL);
if (f) {
- return f(result, param, flags, fetched_anything TSRMLS_CC);
+ return f(result, param, flags, fetched_anything);
}
*fetched_anything = FALSE;
return PASS;
@@ -1269,7 +1269,7 @@ enum_func_status
MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result,
MYSQLND_RES_METADATA * meta,
MYSQLND_MEMORY_POOL_CHUNK ***row_buffers,
- zend_bool binary_protocol TSRMLS_DC)
+ zend_bool binary_protocol)
{
enum_func_status ret;
MYSQLND_PACKET_ROW * row_packet = NULL;
@@ -1295,7 +1295,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
set->references = 1;
/* non-persistent */
- row_packet = conn->protocol->m.get_row_packet(conn->protocol, FALSE TSRMLS_CC);
+ row_packet = conn->protocol->m.get_row_packet(conn->protocol, FALSE);
if (!row_packet) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -1395,7 +1395,7 @@ end:
static MYSQLND_RES *
MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
MYSQLND_CONN_DATA * const conn,
- const unsigned int flags TSRMLS_DC)
+ const unsigned int flags)
{
enum_func_status ret;
MYSQLND_MEMORY_POOL_CHUNK ***row_buffers = NULL;
@@ -1404,27 +1404,27 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
/* We need the conn because we are doing lazy zval initialization in buffered_fetch_row */
/* In case of error the reference will be released in free_result_internal() called indirectly by our caller */
- result->conn = conn->m->get_reference(conn TSRMLS_CC);
+ result->conn = conn->m->get_reference(conn);
result->type = MYSQLND_RES_NORMAL;
CONN_SET_STATE(conn, CONN_FETCHING_DATA);
if (flags & MYSQLND_STORE_NO_COPY) {
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
row_buffers = &result->stored_data->row_buffers;
} else if (flags & MYSQLND_STORE_COPY) {
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_c_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_c_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
row_buffers = &result->stored_data->row_buffers;
}
- ret = result->m.store_result_fetch_data(conn, result, result->meta, row_buffers, flags & MYSQLND_STORE_PS TSRMLS_CC);
+ ret = result->m.store_result_fetch_data(conn, result, result->meta, row_buffers, flags & MYSQLND_STORE_PS);
if (FAIL == ret) {
if (result->stored_data) {
@@ -1471,7 +1471,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
/* {{{ mysqlnd_res::skip_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result)
{
zend_bool fetched_anything;
@@ -1488,7 +1488,7 @@ MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
result->type == MYSQLND_RES_NORMAL? STAT_FLUSHED_NORMAL_SETS:
STAT_FLUSHED_PS_SETS);
- while ((PASS == result->m.fetch_row(result, NULL, 0, &fetched_anything TSRMLS_CC)) && fetched_anything == TRUE) {
+ while ((PASS == result->m.fetch_row(result, NULL, 0, &fetched_anything)) && fetched_anything == TRUE) {
/* do nothing */;
}
}
@@ -1499,7 +1499,7 @@ MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::free_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implicit)
{
DBG_ENTER("mysqlnd_res::free_result");
@@ -1507,7 +1507,7 @@ MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implici
implicit == TRUE? STAT_FREE_RESULT_IMPLICIT:
STAT_FREE_RESULT_EXPLICIT);
- result->m.free_result_internal(result TSRMLS_CC);
+ result->m.free_result_internal(result);
DBG_RETURN(PASS);
}
/* }}} */
@@ -1515,19 +1515,19 @@ MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implici
/* {{{ mysqlnd_res::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * const result, const uint64_t row)
{
DBG_ENTER("mysqlnd_res::data_seek");
DBG_INF_FMT("row=%lu", row);
- DBG_RETURN(result->stored_data? result->stored_data->m.data_seek(result->stored_data, row TSRMLS_CC) : FAIL);
+ DBG_RETURN(result->stored_data? result->stored_data->m.data_seek(result->stored_data, row) : FAIL);
}
/* }}} */
/* {{{ mysqlnd_result_buffered_zval::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row)
{
MYSQLND_RES_BUFFERED_ZVAL * set = (MYSQLND_RES_BUFFERED_ZVAL *) result;
DBG_ENTER("mysqlnd_result_buffered_zval::data_seek");
@@ -1545,7 +1545,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * c
/* {{{ mysqlnd_result_buffered_c::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row)
{
MYSQLND_RES_BUFFERED_C * set = (MYSQLND_RES_BUFFERED_C *) result;
DBG_ENTER("mysqlnd_result_buffered_c::data_seek");
@@ -1563,7 +1563,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * cons
/* {{{ mysqlnd_result_unbuffered::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED * const result)
{
/* Be compatible with libmysql. We count row_count, but will return 0 */
return result->eof_reached? result->row_count:0;
@@ -1573,7 +1573,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_result_buffered::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * const result)
{
return result->row_count;
}
@@ -1582,18 +1582,18 @@ MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * c
/* {{{ mysqlnd_res::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result)
{
return result->stored_data?
- result->stored_data->m.num_rows(result->stored_data TSRMLS_CC) :
- (result->unbuf? result->unbuf->m.num_rows(result->unbuf TSRMLS_CC) : 0);
+ result->stored_data->m.num_rows(result->stored_data) :
+ (result->unbuf? result->unbuf->m.num_rows(result->unbuf) : 0);
}
/* }}} */
/* {{{ mysqlnd_res::num_fields */
static unsigned int
-MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result)
{
return result->field_count;
}
@@ -1602,7 +1602,7 @@ MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result TSRMLS_
/* {{{ mysqlnd_res::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result)
{
DBG_ENTER("mysqlnd_res::fetch_field");
do {
@@ -1621,12 +1621,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request");
/* we have to initialize the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_field(result->meta TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_field(result->meta));
}
} while (0);
DBG_RETURN(NULL);
@@ -1636,7 +1636,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::fetch_field_direct */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr)
{
DBG_ENTER("mysqlnd_res::fetch_field_direct");
do {
@@ -1655,12 +1655,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, cons
DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request");
/* we have to initialized the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_field_direct(result->meta, fieldnr TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_field_direct(result->meta, fieldnr));
}
} while (0);
@@ -1671,7 +1671,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, cons
/* {{{ mysqlnd_res::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result)
{
DBG_ENTER("mysqlnd_res::fetch_fields");
do {
@@ -1679,12 +1679,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) {
/* we have to initialize the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_fields(result->meta TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_fields(result->meta));
}
} while (0);
DBG_RETURN(NULL);
@@ -1694,18 +1694,18 @@ MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::field_seek */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res, field_seek)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, field_seek)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset)
{
- return result->meta? result->meta->m->field_seek(result->meta, field_offset TSRMLS_CC) : 0;
+ return result->meta? result->meta->m->field_seek(result->meta, field_offset) : 0;
}
/* }}} */
/* {{{ mysqlnd_res::field_tell */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result)
{
- return result->meta? result->meta->m->field_tell(result->meta TSRMLS_CC) : 0;
+ return result->meta? result->meta->m->field_tell(result->meta) : 0;
}
/* }}} */
@@ -1714,7 +1714,7 @@ MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result TSRMLS_
static void
MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int flags,
zval *return_value,
- enum_mysqlnd_extension extension TSRMLS_DC ZEND_FILE_LINE_DC)
+ enum_mysqlnd_extension extension ZEND_FILE_LINE_DC)
{
zend_bool fetched_anything;
@@ -1725,8 +1725,8 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
extend and rehash the hash constantly.
*/
array_init_size(return_value, mysqlnd_num_fields(result) * 2);
- if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading a row");
+ if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything)) {
+ php_error_docref(NULL, E_WARNING, "Error while reading a row");
zval_dtor(return_value);
RETVAL_FALSE;
} else if (fetched_anything == FALSE) {
@@ -1752,19 +1752,19 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
/* {{{ mysqlnd_res::fetch_row_c */
static MYSQLND_ROW_C
-MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result)
{
zend_bool fetched_anything;
MYSQLND_ROW_C ret = NULL;
DBG_ENTER("mysqlnd_res::fetch_row_c");
if (result->stored_data && result->stored_data->m.fetch_row == MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)) {
- MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything);
} else if (result->unbuf && result->unbuf->m.fetch_row == MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)) {
- MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything);
} else {
ret = NULL;
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "result->m.fetch_row has invalid value. Report to the developers");
+ php_error_docref(NULL, E_ERROR, "result->m.fetch_row has invalid value. Report to the developers");
}
DBG_RETURN(ret);
}
@@ -1773,7 +1773,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result TSRMLS_DC)
/* {{{ mysqlnd_res::fetch_all */
static void
-MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int flags, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int flags, zval *return_value ZEND_FILE_LINE_DC)
{
zval row;
zend_ulong i = 0;
@@ -1782,7 +1782,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int
DBG_ENTER("mysqlnd_res::fetch_all");
if ((!result->unbuf && !set)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fetch_all can be used only with buffered sets");
+ php_error_docref(NULL, E_WARNING, "fetch_all can be used only with buffered sets");
if (result->conn) {
SET_CLIENT_ERROR(*result->conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "fetch_all can be used only with buffered sets");
}
@@ -1809,7 +1809,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int
/* {{{ mysqlnd_res::fetch_field_data */
static void
-MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int offset, zval *return_value TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int offset, zval *return_value)
{
zval row;
zval *entry;
@@ -1894,7 +1894,7 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_result_init */
PHPAPI MYSQLND_RES *
-mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_init(unsigned int field_count, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1916,7 +1916,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
/* {{{ mysqlnd_result_unbuffered_init */
PHPAPI MYSQLND_RES_UNBUFFERED *
-mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_UNBUFFERED) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_UNBUFFERED * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1931,7 +1931,7 @@ mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
@@ -1957,7 +1957,7 @@ mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool
/* {{{ mysqlnd_result_buffered_zval_init */
PHPAPI MYSQLND_RES_BUFFERED_ZVAL *
-mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_BUFFERED_ZVAL) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_BUFFERED_ZVAL * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1971,7 +1971,7 @@ mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_b
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
@@ -2000,7 +2000,7 @@ mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_b
/* {{{ mysqlnd_result_buffered_c_init */
PHPAPI MYSQLND_RES_BUFFERED_C *
-mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_BUFFERED_C) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_BUFFERED_C * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -2014,7 +2014,7 @@ mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h
index 700efed83e..d8ae4db0f7 100644
--- a/ext/mysqlnd/mysqlnd_result.h
+++ b/ext/mysqlnd/mysqlnd_result.h
@@ -23,12 +23,12 @@
#ifndef MYSQLND_RESULT_H
#define MYSQLND_RESULT_H
-PHPAPI MYSQLND_RES * mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_UNBUFFERED * mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_BUFFERED_ZVAL * mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_BUFFERED_C * mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
+PHPAPI MYSQLND_RES * mysqlnd_result_init(unsigned int field_count, zend_bool persistent);
+PHPAPI MYSQLND_RES_UNBUFFERED * mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
+PHPAPI MYSQLND_RES_BUFFERED_ZVAL * mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
+PHPAPI MYSQLND_RES_BUFFERED_C * mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
-enum_func_status mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt TSRMLS_DC);
+enum_func_status mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt);
#endif /* MYSQLND_RESULT_H */
diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c
index 447de33ac9..9cdde04504 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.c
+++ b/ext/mysqlnd/mysqlnd_result_meta.c
@@ -30,7 +30,7 @@
/* {{{ php_mysqlnd_free_field_metadata */
static void
-php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent TSRMLS_DC)
+php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent)
{
if (meta) {
if (meta->root) {
@@ -50,14 +50,14 @@ php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent TSRMLS
/* {{{ mysqlnd_res_meta::read_metadata */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn)
{
unsigned int i = 0;
MYSQLND_PACKET_RES_FIELD * field_packet;
DBG_ENTER("mysqlnd_res_meta::read_metadata");
- field_packet = conn->protocol->m.get_result_field_packet(conn->protocol, FALSE TSRMLS_CC);
+ field_packet = conn->protocol->m.get_result_field_packet(conn->protocol, FALSE);
if (!field_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -92,7 +92,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
if (mysqlnd_ps_fetch_functions[meta->fields[i].type].func == NULL) {
DBG_ERR_FMT("Unknown type %u sent by the server. Please send a report to the developers",
meta->fields[i].type);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unknown type %u sent by the server. "
"Please send a report to the developers",
meta->fields[i].type);
@@ -148,7 +148,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
/* {{{ mysqlnd_res_meta::free */
static void
-MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta)
{
int i;
MYSQLND_FIELD *fields;
@@ -159,7 +159,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
DBG_INF("Freeing fields metadata");
i = meta->field_count;
while (i--) {
- php_mysqlnd_free_field_metadata(fields++, meta->persistent TSRMLS_CC);
+ php_mysqlnd_free_field_metadata(fields++, meta->persistent);
}
mnd_pefree(meta->fields, meta->persistent);
meta->fields = NULL;
@@ -180,7 +180,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
/* {{{ mysqlnd_res::clone_metadata */
static MYSQLND_RES_METADATA *
-MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent)
{
unsigned int i;
/* +1 is to have empty marker at the end */
@@ -267,7 +267,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * co
DBG_RETURN(new_meta);
oom:
if (new_meta) {
- new_meta->m->free_metadata(new_meta TSRMLS_CC);
+ new_meta->m->free_metadata(new_meta);
new_meta = NULL;
}
DBG_RETURN(NULL);
@@ -277,7 +277,7 @@ oom:
/* {{{ mysqlnd_res_meta::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field");
if (meta->current_field >= meta->field_count) {
@@ -294,7 +294,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta
/* {{{ mysqlnd_res_meta::fetch_field_direct */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field_direct");
DBG_INF_FMT("fieldnr=%u", fieldnr);
@@ -308,7 +308,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA
/* {{{ mysqlnd_res_meta::fetch_fields */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta)
{
DBG_ENTER("mysqlnd_res_meta::fetch_fields");
DBG_RETURN(meta->fields);
@@ -318,7 +318,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta
/* {{{ mysqlnd_res_meta::field_tell */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const meta)
{
return meta->current_field;
}
@@ -327,7 +327,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const
/* {{{ mysqlnd_res_meta::field_seek */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res_meta, field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset)
{
MYSQLND_FIELD_OFFSET return_value = 0;
DBG_ENTER("mysqlnd_res_meta::fetch_fields");
@@ -352,7 +352,7 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_result_meta_init */
PHPAPI MYSQLND_RES_METADATA *
-mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_METADATA) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -377,7 +377,7 @@ mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_D
DBG_RETURN(ret);
} while (0);
if (ret) {
- ret->m->free_metadata(ret TSRMLS_CC);
+ ret->m->free_metadata(ret);
}
DBG_RETURN(NULL);
}
@@ -395,7 +395,7 @@ mysqlnd_result_metadata_get_methods()
/* {{{ _mysqlnd_plugin_get_plugin_result_metadata_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_metadata_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h
index 91388b65a5..b1165a184a 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.h
+++ b/ext/mysqlnd/mysqlnd_result_meta.h
@@ -23,9 +23,9 @@
#ifndef MYSQLND_RESULT_META_H
#define MYSQLND_RESULT_META_H
-PHPAPI MYSQLND_RES_METADATA * mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_DC);
+PHPAPI MYSQLND_RES_METADATA * mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent);
PHPAPI struct st_mysqlnd_res_meta_methods * mysqlnd_result_metadata_get_methods();
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id TSRMLS_DC);
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id);
#endif /* MYSQLND_RESULT_META_H */
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c
index 553a507818..b358b6d2f2 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.c
+++ b/ext/mysqlnd/mysqlnd_reverse_api.c
@@ -31,7 +31,7 @@ static HashTable mysqlnd_api_ext_ht;
/* {{{ mysqlnd_reverse_api_init */
PHPAPI void
-mysqlnd_reverse_api_init(TSRMLS_D)
+mysqlnd_reverse_api_init(void)
{
zend_hash_init(&mysqlnd_api_ext_ht, 3, NULL, NULL, 1);
}
@@ -40,7 +40,7 @@ mysqlnd_reverse_api_init(TSRMLS_D)
/* {{{ mysqlnd_reverse_api_end */
PHPAPI void
-mysqlnd_reverse_api_end(TSRMLS_D)
+mysqlnd_reverse_api_end(void)
{
zend_hash_destroy(&mysqlnd_api_ext_ht);
}
@@ -49,7 +49,7 @@ mysqlnd_reverse_api_end(TSRMLS_D)
/* {{{ myslqnd_get_api_extensions */
PHPAPI HashTable *
-mysqlnd_reverse_api_get_api_list(TSRMLS_D)
+mysqlnd_reverse_api_get_api_list(void)
{
return &mysqlnd_api_ext_ht;
}
@@ -58,7 +58,7 @@ mysqlnd_reverse_api_get_api_list(TSRMLS_D)
/* {{{ mysqlnd_reverse_api_register_api */
PHPAPI void
-mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
+mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext)
{
zend_hash_str_add_ptr(&mysqlnd_api_ext_ht, apiext->module->name, strlen(apiext->module->name), apiext);
}
@@ -67,17 +67,17 @@ mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
/* {{{ zval_to_mysqlnd */
PHPAPI MYSQLND *
-zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities TSRMLS_DC)
+zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities)
{
MYSQLND * retval;
#ifdef OLD_CODE
MYSQLND_REVERSE_API * elem;
ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, elem) {
if (elem->conversion_cb) {
- retval = elem->conversion_cb(zv TSRMLS_CC);
+ retval = elem->conversion_cb(zv);
if (retval) {
if (retval->data) {
- *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
+ *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
}
return retval;
}
@@ -87,10 +87,10 @@ zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned
MYSQLND_REVERSE_API * api;
ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, api) {
if (api && api->conversion_cb) {
- retval = api->conversion_cb(zv TSRMLS_CC);
+ retval = api->conversion_cb(zv);
if (retval) {
if (retval->data) {
- *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
+ *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
}
return retval;
}
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h
index 58a1ddd087..2ea0cfd33d 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.h
+++ b/ext/mysqlnd/mysqlnd_reverse_api.h
@@ -24,17 +24,17 @@
typedef struct st_mysqlnd_reverse_api
{
zend_module_entry * module;
- MYSQLND *(*conversion_cb)(zval * zv TSRMLS_DC);
+ MYSQLND *(*conversion_cb)(zval * zv);
} MYSQLND_REVERSE_API;
-PHPAPI void mysqlnd_reverse_api_init(TSRMLS_D);
-PHPAPI void mysqlnd_reverse_api_end(TSRMLS_D);
+PHPAPI void mysqlnd_reverse_api_init(void);
+PHPAPI void mysqlnd_reverse_api_end(void);
-PHPAPI HashTable * mysqlnd_reverse_api_get_api_list(TSRMLS_D);
+PHPAPI HashTable * mysqlnd_reverse_api_get_api_list(void);
-PHPAPI void mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC);
-PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities TSRMLS_DC);
+PHPAPI void mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext);
+PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities);
#endif /* MYSQLND_REVERSE_API_H */
diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c
index e25befbc15..de8014ccea 100644
--- a/ext/mysqlnd/mysqlnd_statistics.c
+++ b/ext/mysqlnd/mysqlnd_statistics.c
@@ -197,7 +197,7 @@ const MYSQLND_STRING mysqlnd_stats_values_names[STAT_LAST] =
/* {{{ mysqlnd_fill_stats_hash */
PHPAPI void
-mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC)
+mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value ZEND_FILE_LINE_DC)
{
unsigned int i;
@@ -214,7 +214,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING
/* {{{ _mysqlnd_get_client_stats */
PHPAPI void
-_mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC)
+_mysqlnd_get_client_stats(zval *return_value ZEND_FILE_LINE_DC)
{
MYSQLND_STATS stats, *stats_ptr = mysqlnd_global_stats;
DBG_ENTER("_mysqlnd_get_client_stats");
@@ -222,7 +222,7 @@ _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC)
memset(&stats, 0, sizeof(stats));
stats_ptr = &stats;
}
- mysqlnd_fill_stats_hash(stats_ptr, mysqlnd_stats_values_names, return_value TSRMLS_CC ZEND_FILE_LINE_CC);
+ mysqlnd_fill_stats_hash(stats_ptr, mysqlnd_stats_values_names, return_value ZEND_FILE_LINE_CC);
DBG_VOID_RETURN;
}
/* }}} */
@@ -264,7 +264,7 @@ mysqlnd_stats_end(MYSQLND_STATS * stats)
/* {{{ mysqlnd_stats_set_trigger */
PHPAPI mysqlnd_stat_trigger
-mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats statistic, mysqlnd_stat_trigger trigger TSRMLS_DC)
+mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats statistic, mysqlnd_stat_trigger trigger)
{
mysqlnd_stat_trigger ret = NULL;
DBG_ENTER("mysqlnd_stats_set_trigger");
@@ -281,7 +281,7 @@ mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_st
/* {{{ mysqlnd_stats_set_handler */
PHPAPI mysqlnd_stat_trigger
-mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats TSRMLS_DC)
+mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats)
{
mysqlnd_stat_trigger ret = NULL;
DBG_ENTER("mysqlnd_stats_reset_trigger");
diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h
index bfc316ec59..e151148396 100644
--- a/ext/mysqlnd/mysqlnd_statistics.h
+++ b/ext/mysqlnd/mysqlnd_statistics.h
@@ -42,7 +42,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
(s_array)->in_trigger = TRUE; \
MYSQLND_STATS_UNLOCK((s_array)); \
\
- (s_array)->triggers[(statistic)]((s_array), (statistic), (val) TSRMLS_CC); \
+ (s_array)->triggers[(statistic)]((s_array), (statistic), (val)); \
\
MYSQLND_STATS_LOCK((s_array)); \
(s_array)->in_trigger = FALSE; \
@@ -157,13 +157,13 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
#endif /* MYSQLND_CORE_STATISTICS_DISABLED */
-PHPAPI void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
+PHPAPI void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value ZEND_FILE_LINE_DC);
PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, size_t statistic_count);
PHPAPI void mysqlnd_stats_end(MYSQLND_STATS * stats);
-PHPAPI mysqlnd_stat_trigger mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats stat, mysqlnd_stat_trigger trigger TSRMLS_DC);
-PHPAPI mysqlnd_stat_trigger mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats TSRMLS_DC);
+PHPAPI mysqlnd_stat_trigger mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats stat, mysqlnd_stat_trigger trigger);
+PHPAPI mysqlnd_stat_trigger mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats);
#endif /* MYSQLND_STATISTICS_H */
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 6be8b68034..ca5a269961 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -48,7 +48,7 @@ struct st_mysqlnd_memory_pool
unsigned int arena_size;
unsigned int free_size;
- MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL * pool, unsigned int size TSRMLS_DC);
+ MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL * pool, unsigned int size);
};
struct st_mysqlnd_memory_pool_chunk
@@ -56,8 +56,8 @@ struct st_mysqlnd_memory_pool_chunk
size_t app;
MYSQLND_MEMORY_POOL *pool;
zend_uchar *ptr;
- enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
- void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC);
+ enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size);
+ void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk);
unsigned int size;
zend_bool from_pool;
};
@@ -150,10 +150,10 @@ typedef struct st_mysqlnd_charset
/* local infile handler */
typedef struct st_mysqlnd_infile
{
- int (*local_infile_init)(void **ptr, const char * const filename TSRMLS_DC);
- int (*local_infile_read)(void *ptr, zend_uchar * buf, unsigned int buf_len TSRMLS_DC);
- int (*local_infile_error)(void *ptr, char * error_msg, unsigned int error_msg_len TSRMLS_DC);
- void (*local_infile_end)(void *ptr TSRMLS_DC);
+ int (*local_infile_init)(void **ptr, const char * const filename);
+ int (*local_infile_read)(void *ptr, zend_uchar * buf, unsigned int buf_len);
+ int (*local_infile_error)(void *ptr, char * error_msg, unsigned int error_msg_len);
+ void (*local_infile_end)(void *ptr);
} MYSQLND_INFILE;
typedef struct st_mysqlnd_options
@@ -242,17 +242,17 @@ typedef struct st_mysqlnd_unbuffered_result MYSQLND_RES_UNBUFFERED;
typedef struct st_mysqlnd_debug MYSQLND_DEBUG;
-typedef MYSQLND_RES* (*mysqlnd_stmt_use_or_store_func)(MYSQLND_STMT * const TSRMLS_DC);
+typedef MYSQLND_RES* (*mysqlnd_stmt_use_or_store_func)(MYSQLND_STMT * const);
typedef enum_func_status (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
void * param,
const unsigned int flags,
zend_bool * fetched_anything
- TSRMLS_DC);
+ );
typedef struct st_mysqlnd_stats MYSQLND_STATS;
-typedef void (*mysqlnd_stat_trigger)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change TSRMLS_DC);
+typedef void (*mysqlnd_stat_trigger)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change);
struct st_mysqlnd_stats
{
@@ -274,32 +274,32 @@ typedef struct st_mysqlnd_read_buffer {
zend_bool (*is_empty)(struct st_mysqlnd_read_buffer *);
void (*read)(struct st_mysqlnd_read_buffer *, size_t count, zend_uchar * dest);
size_t (*bytes_left)(struct st_mysqlnd_read_buffer *);
- void (*free_buffer)(struct st_mysqlnd_read_buffer ** TSRMLS_DC);
+ void (*free_buffer)(struct st_mysqlnd_read_buffer **);
} MYSQLND_READ_BUFFER;
-typedef enum_func_status (*func_mysqlnd_net__set_client_option)(MYSQLND_NET * const net, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len, const zend_uchar * const compressed_data, const size_t compressed_data_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd TSRMLS_DC);
-typedef void (*func_mysqlnd_net__free_contents)(MYSQLND_NET * net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__enable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__disable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buf, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC);
-typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_net__set_client_option)(MYSQLND_NET * const net, enum_mysqlnd_option option, const char * const value);
+typedef enum_func_status (*func_mysqlnd_net__decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len, const zend_uchar * const compressed_data, const size_t compressed_data_len);
+typedef enum_func_status (*func_mysqlnd_net__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len);
+typedef size_t (*func_mysqlnd_net__consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd);
+typedef void (*func_mysqlnd_net__free_contents)(MYSQLND_NET * net);
+typedef enum_func_status (*func_mysqlnd_net__enable_ssl)(MYSQLND_NET * const net);
+typedef enum_func_status (*func_mysqlnd_net__disable_ssl)(MYSQLND_NET * const net);
+typedef enum_func_status (*func_mysqlnd_net__network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef size_t (*func_mysqlnd_net__network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buf, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef size_t (*func_mysqlnd_net__send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef php_stream * (*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef php_stream * (*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net);
+typedef php_stream * (*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream);
+typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info);
struct st_mysqlnd_net_methods
{
@@ -355,21 +355,21 @@ struct st_mysqlnd_packet_auth_pam;
struct st_mysqlnd_packet_sha256_pk_request;
struct st_mysqlnd_packet_sha256_pk_request_response;
-typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol__get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol__get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
+typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol__get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol__get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
struct st_mysqlnd_protocol_methods
{
@@ -395,11 +395,11 @@ struct st_mysqlnd_protocol_methods
};
-typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(zend_bool persistent TSRMLS_DC);
-typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn TSRMLS_DC);
-typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
-typedef MYSQLND_PROTOCOL * (*func_mysqlnd_object_factory__get_protocol_decoder)(zend_bool persistent TSRMLS_DC);
+typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(zend_bool persistent);
+typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn);
+typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+typedef MYSQLND_PROTOCOL * (*func_mysqlnd_object_factory__get_protocol_decoder)(zend_bool persistent);
struct st_mysqlnd_object_factory_methods
@@ -412,98 +412,98 @@ struct st_mysqlnd_object_factory_methods
};
-typedef enum_func_status (*func_mysqlnd_conn_data__init)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__connect)(MYSQLND_CONN_DATA * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
-typedef zend_ulong (*func_mysqlnd_conn_data__escape_string)(MYSQLND_CONN_DATA * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_charset)(MYSQLND_CONN_DATA * const conn, const char * const charset TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_query)(MYSQLND_CONN_DATA * conn, const char *query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__next_result)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef zend_bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef MYSQLND_STMT * (*func_mysqlnd_conn_data__stmt_init)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__shutdown_server)(MYSQLND_CONN_DATA * const conn, uint8_t level TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__refresh_server)(MYSQLND_CONN_DATA * const conn, uint8_t options TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__kill_connection)(MYSQLND_CONN_DATA * conn, unsigned int pid TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__server_dump_debug_information)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, zend_bool silent, size_t passwd_len TSRMLS_DC);
-
-typedef unsigned int (*func_mysqlnd_conn_data__get_error_no)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_error_str)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_sqlstate)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_conn_data__get_thread_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__get_statistics)(const MYSQLND_CONN_DATA * const conn, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
-
-typedef zend_ulong (*func_mysqlnd_conn_data__get_server_version)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_server_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__get_server_statistics)(MYSQLND_CONN_DATA * conn, zend_string **message TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_host_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_protocol_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_last_message)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__charset_name)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_fields)(MYSQLND_CONN_DATA * conn, const char * table, const char * achtung_wild TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char * achtung_wild, char *par1 TSRMLS_DC);
-
-typedef uint64_t (*func_mysqlnd_conn_data__get_last_insert_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_conn_data__get_affected_rows)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_warning_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef unsigned int (*func_mysqlnd_conn_data__get_field_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef unsigned int (*func_mysqlnd_conn_data__get_server_status)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__free_contents)(MYSQLND_CONN_DATA * conn TSRMLS_DC);/* private */
-typedef void (*func_mysqlnd_conn_data__free_options)(MYSQLND_CONN_DATA * conn TSRMLS_DC); /* private */
-typedef void (*func_mysqlnd_conn_data__dtor)(MYSQLND_CONN_DATA * conn TSRMLS_DC); /* private */
-
-typedef enum_func_status (*func_mysqlnd_conn_data__query_read_result_set_header)(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt TSRMLS_DC);
-
-typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet, zend_bool silent, enum php_mysqlnd_server_command command, zend_bool ignore_upsert_status TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__restart_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_close)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher TSRMLS_DC);
-
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__result_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * tmp_str, const unsigned int mode TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
-typedef struct st_mysqlnd_authentication_plugin * (*func_mysqlnd_conn_data__fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option_2d)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_option option, const char * const key, const char * const value TSRMLS_DC);
-
-
-typedef unsigned int (*func_mysqlnd_conn_data__negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__init)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__connect)(MYSQLND_CONN_DATA * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags);
+typedef zend_ulong (*func_mysqlnd_conn_data__escape_string)(MYSQLND_CONN_DATA * const conn, char *newstr, const char *escapestr, size_t escapestr_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_charset)(MYSQLND_CONN_DATA * const conn, const char * const charset);
+typedef enum_func_status (*func_mysqlnd_conn_data__query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_query)(MYSQLND_CONN_DATA * conn, const char *query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__reap_query)(MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__next_result)(MYSQLND_CONN_DATA * const conn);
+typedef zend_bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn);
+
+typedef MYSQLND_STMT * (*func_mysqlnd_conn_data__stmt_init)(MYSQLND_CONN_DATA * const conn);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__shutdown_server)(MYSQLND_CONN_DATA * const conn, uint8_t level);
+typedef enum_func_status (*func_mysqlnd_conn_data__refresh_server)(MYSQLND_CONN_DATA * const conn, uint8_t options);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__ping)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__kill_connection)(MYSQLND_CONN_DATA * conn, unsigned int pid);
+typedef enum_func_status (*func_mysqlnd_conn_data__select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__server_dump_debug_information)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, zend_bool silent, size_t passwd_len);
+
+typedef unsigned int (*func_mysqlnd_conn_data__get_error_no)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_error_str)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_sqlstate)(const MYSQLND_CONN_DATA * const conn);
+typedef uint64_t (*func_mysqlnd_conn_data__get_thread_id)(const MYSQLND_CONN_DATA * const conn);
+typedef void (*func_mysqlnd_conn_data__get_statistics)(const MYSQLND_CONN_DATA * const conn, zval *return_value ZEND_FILE_LINE_DC);
+
+typedef zend_ulong (*func_mysqlnd_conn_data__get_server_version)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_server_information)(const MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__get_server_statistics)(MYSQLND_CONN_DATA * conn, zend_string **message);
+typedef const char * (*func_mysqlnd_conn_data__get_host_information)(const MYSQLND_CONN_DATA * const conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_protocol_information)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_last_message)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__charset_name)(const MYSQLND_CONN_DATA * const conn);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_fields)(MYSQLND_CONN_DATA * conn, const char * table, const char * achtung_wild);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char * achtung_wild, char *par1);
+
+typedef uint64_t (*func_mysqlnd_conn_data__get_last_insert_id)(const MYSQLND_CONN_DATA * const conn);
+typedef uint64_t (*func_mysqlnd_conn_data__get_affected_rows)(const MYSQLND_CONN_DATA * const conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_warning_count)(const MYSQLND_CONN_DATA * const conn);
+
+typedef unsigned int (*func_mysqlnd_conn_data__get_field_count)(const MYSQLND_CONN_DATA * const conn);
+
+typedef unsigned int (*func_mysqlnd_conn_data__get_server_status)(const MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_option option, const char * const value);
+typedef void (*func_mysqlnd_conn_data__free_contents)(MYSQLND_CONN_DATA * conn);/* private */
+typedef void (*func_mysqlnd_conn_data__free_options)(MYSQLND_CONN_DATA * conn); /* private */
+typedef void (*func_mysqlnd_conn_data__dtor)(MYSQLND_CONN_DATA * conn); /* private */
+
+typedef enum_func_status (*func_mysqlnd_conn_data__query_read_result_set_header)(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt);
+
+typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn);
+typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(const MYSQLND_CONN_DATA * const conn);
+typedef void (*func_mysqlnd_conn_data__set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status);
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet, zend_bool silent, enum php_mysqlnd_server_command command, zend_bool ignore_upsert_status);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__restart_psession)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__end_psession)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_close)(MYSQLND_CONN_DATA * conn);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher);
+
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__result_init)(unsigned int field_count, zend_bool persistent);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name);
+typedef void (*func_mysqlnd_conn_data__tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * tmp_str, const unsigned int mode);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func);
+typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status);
+typedef enum_func_status (*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status);
+typedef struct st_mysqlnd_authentication_plugin * (*func_mysqlnd_conn_data__fetch_auth_plugin_by_name)(const char * const requested_protocol);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option_2d)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_option option, const char * const key, const char * const value);
+
+
+typedef unsigned int (*func_mysqlnd_conn_data__negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef unsigned int (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn);
struct st_mysqlnd_conn_data_methods
@@ -603,10 +603,10 @@ struct st_mysqlnd_conn_data_methods
};
-typedef enum_func_status (*func_mysqlnd_data__connect)(MYSQLND * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
-typedef MYSQLND * (*func_mysqlnd_conn__clone_object)(MYSQLND * const conn TSRMLS_DC);
-typedef void (*func_mysqlnd_conn__dtor)(MYSQLND * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn__close)(MYSQLND * conn, enum_connection_close_type close_type TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_data__connect)(MYSQLND * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags);
+typedef MYSQLND * (*func_mysqlnd_conn__clone_object)(MYSQLND * const conn);
+typedef void (*func_mysqlnd_conn__dtor)(MYSQLND * conn);
+typedef enum_func_status (*func_mysqlnd_conn__close)(MYSQLND * conn, enum_connection_close_type close_type);
struct st_mysqlnd_conn_methods
{
@@ -619,38 +619,38 @@ struct st_mysqlnd_conn_methods
/* for decoding - binary or text protocol */
typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
-
-
-typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, zend_bool ps_protocol TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef void (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int flags, zval *return_value, enum_mysqlnd_extension ext TSRMLS_DC ZEND_FILE_LINE_DC);
-typedef MYSQLND_ROW_C (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, const unsigned int flags, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
-typedef void (*func_mysqlnd_res__fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_res__num_fields)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__skip_result)(MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__seek_data)(MYSQLND_RES * const result, const uint64_t row TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__seek_field)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__field_tell)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field)(MYSQLND_RES * const result TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_fields)(MYSQLND_RES * const result TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_res__fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_MEMORY_POOL_CHUNK *** row_buffers, zend_bool binary_protocol TSRMLS_DC);
-
-typedef void (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result TSRMLS_DC); /* private */
-typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_result_internal)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *result TSRMLS_DC);
-
-
-typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
+
+
+typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, zend_bool ps_protocol);
+typedef MYSQLND_RES * (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef void (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int flags, zval *return_value, enum_mysqlnd_extension ext ZEND_FILE_LINE_DC);
+typedef MYSQLND_ROW_C (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, const unsigned int flags, zval *return_value ZEND_FILE_LINE_DC);
+typedef void (*func_mysqlnd_res__fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value);
+typedef uint64_t (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result);
+typedef unsigned int (*func_mysqlnd_res__num_fields)(const MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__skip_result)(MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__seek_data)(MYSQLND_RES * const result, const uint64_t row);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__seek_field)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__field_tell)(const MYSQLND_RES * const result);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field)(MYSQLND_RES * const result);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_fields)(MYSQLND_RES * const result);
+
+typedef enum_func_status (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn);
+typedef zend_ulong * (*func_mysqlnd_res__fetch_lengths)(MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_MEMORY_POOL_CHUNK *** row_buffers, zend_bool binary_protocol);
+
+typedef void (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result); /* private */
+typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, zend_bool implicit);
+typedef void (*func_mysqlnd_res__free_result_internal)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *result);
+
+
+typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent);
struct st_mysqlnd_res_methods
{
@@ -689,10 +689,10 @@ struct st_mysqlnd_res_methods
};
-typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC);
-typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats TSRMLS_DC);
-typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC);
+typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result);
+typedef zend_ulong * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result);
+typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats);
+typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats);
struct st_mysqlnd_result_unbuffered_methods
{
@@ -704,12 +704,12 @@ struct st_mysqlnd_result_unbuffered_methods
func_mysqlnd_result_unbuffered__free_result free_result;
};
-typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
+typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result);
typedef enum_func_status (*func_mysqlnd_result_buffered__initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC);
-typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
+ MYSQLND_STATS * stats, zend_bool int_and_float_native);
+typedef zend_ulong * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result);
+typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row);
+typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result);
struct st_mysqlnd_result_buffered_methods
{
@@ -723,14 +723,14 @@ struct st_mysqlnd_result_buffered_methods
};
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_fields)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_tell)(const MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent TSRMLS_DC);
-typedef void (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta TSRMLS_DC);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field)(MYSQLND_RES_METADATA * const meta);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_fields)(MYSQLND_RES_METADATA * const meta);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_tell)(const MYSQLND_RES_METADATA * const meta);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset);
+typedef enum_func_status (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent);
+typedef void (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta);
struct st_mysqlnd_res_meta_methods
{
@@ -745,48 +745,48 @@ struct st_mysqlnd_res_meta_methods
};
-typedef enum_func_status (*func_mysqlnd_stmt__prepare)(MYSQLND_STMT * const stmt, const char * const query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__execute)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef zend_bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__net_close)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* private */
-typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* use this for mysqlnd_stmt_close */
-typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, zend_ulong length TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_parameter_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_last_insert_id)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_affected_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_num_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_param_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_field_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_warning_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_error_no)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef const char * (*func_mysqlnd_stmt__get_error_str)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef const char * (*func_mysqlnd_stmt__get_sqlstate)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__get_attribute)(const MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, void * const value TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__set_attribute)(MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, const void * const value TSRMLS_DC);
-typedef MYSQLND_PARAM_BIND *(*func_mysqlnd_stmt__alloc_param_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_stmt__prepare)(MYSQLND_STMT * const stmt, const char * const query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_stmt__execute)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt);
+typedef zend_bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row);
+typedef enum_func_status (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__net_close)(MYSQLND_STMT * const stmt, zend_bool implicit); /* private */
+typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit); /* use this for mysqlnd_stmt_close */
+typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type);
+typedef enum_func_status (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no);
+typedef enum_func_status (*func_mysqlnd_stmt__send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, zend_ulong length);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_parameter_metadata)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result_metadata)(MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_last_insert_id)(const MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_affected_rows)(const MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_num_rows)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_param_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_field_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_warning_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_error_no)(const MYSQLND_STMT * const stmt);
+typedef const char * (*func_mysqlnd_stmt__get_error_str)(const MYSQLND_STMT * const stmt);
+typedef const char * (*func_mysqlnd_stmt__get_sqlstate)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__get_attribute)(const MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, void * const value);
+typedef enum_func_status (*func_mysqlnd_stmt__set_attribute)(MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, const void * const value);
+typedef MYSQLND_PARAM_BIND *(*func_mysqlnd_stmt__alloc_param_bind)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT * const stmt);
+typedef void (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND *);
+typedef void (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND *);
+typedef unsigned int (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+typedef enum_func_status (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s);
+typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s);
+typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt);
+typedef void (*func_mysqlnd_stmt__free_stmt_result)(MYSQLND_STMT * const s);
struct st_mysqlnd_stmt_methods
{
@@ -1182,7 +1182,7 @@ struct st_mysqlnd_plugin_header
struct
{
- enum_func_status (*plugin_shutdown)(void * plugin TSRMLS_DC);
+ enum_func_status (*plugin_shutdown)(void * plugin);
} m;
};
@@ -1208,7 +1208,7 @@ typedef zend_uchar * (*func_auth_plugin__get_auth_data)(struct st_mysqlnd_authen
const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options, zend_ulong mysql_flags
- TSRMLS_DC);
+ );
struct st_mysqlnd_authentication_plugin
{
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 1d86df7859..9f6463b9f9 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -35,10 +35,10 @@
#define PACKET_READ_HEADER_AND_BODY(packet, conn, buf, buf_size, packet_type_as_text, packet_type) \
{ \
DBG_INF_FMT("buf=%p size=%u", (buf), (buf_size)); \
- if (FAIL == mysqlnd_read_header((conn)->net, &((packet)->header), (conn)->stats, ((conn)->error_info) TSRMLS_CC)) {\
+ if (FAIL == mysqlnd_read_header((conn)->net, &((packet)->header), (conn)->stats, ((conn)->error_info))) {\
CONN_SET_STATE(conn, CONN_QUIT_SENT); \
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysqlnd_server_gone); \
+ php_error_docref(NULL, E_WARNING, "%s", mysqlnd_server_gone); \
DBG_ERR_FMT("Can't read %s's header", (packet_type_as_text)); \
DBG_RETURN(FAIL);\
}\
@@ -47,10 +47,10 @@
(buf_size), (packet)->header.size, (packet)->header.size - (buf_size)); \
DBG_RETURN(FAIL); \
}\
- if (FAIL == conn->net->data->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info) TSRMLS_CC)) { \
+ if (FAIL == conn->net->data->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info))) { \
CONN_SET_STATE(conn, CONN_QUIT_SENT); \
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysqlnd_server_gone); \
+ php_error_docref(NULL, E_WARNING, "%s", mysqlnd_server_gone); \
DBG_ERR_FMT("Empty '%s' packet body", (packet_type_as_text)); \
DBG_RETURN(FAIL);\
} \
@@ -63,7 +63,7 @@
#define BAIL_IF_NO_MORE_DATA \
if ((size_t)(p - begin) > packet->header.size) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%u)", __LINE__); \
+ php_error_docref(NULL, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%u)", __LINE__); \
goto premature_end; \
} \
@@ -233,7 +233,7 @@ php_mysqlnd_net_store_length_size(uint64_t length)
static enum_func_status
php_mysqlnd_read_error_from_line(zend_uchar *buf, size_t buf_len,
char *error, int error_buf_len,
- unsigned int *error_no, char *sqlstate TSRMLS_DC)
+ unsigned int *error_no, char *sqlstate)
{
zend_uchar *p = buf;
int error_msg_len= 0;
@@ -276,13 +276,13 @@ end:
/* {{{ mysqlnd_read_header */
static enum_func_status
mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
- MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+ MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info)
{
zend_uchar buffer[MYSQLND_HEADER_SIZE];
DBG_ENTER(mysqlnd_read_header_name);
DBG_INF_FMT("compressed=%u", net->data->compressed);
- if (FAIL == net->data->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
@@ -318,7 +318,7 @@ mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
/* {{{ php_mysqlnd_greet_read */
static enum_func_status
-php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buf[2048];
zend_uchar *p = buf;
@@ -350,7 +350,7 @@ php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
/*
The server doesn't send sqlstate in the greet packet.
It's a bug#26426 , so we have to set it correctly ourselves.
@@ -445,7 +445,7 @@ php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -454,7 +454,7 @@ premature_end:
/* {{{ php_mysqlnd_greet_free_mem */
static
-void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet;
if (p->server_version) {
@@ -480,7 +480,7 @@ void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation TSRML
/* {{{ php_mysqlnd_auth_write */
static
-size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buffer[AUTH_WRITE_BUFFER_LEN];
zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */
@@ -517,7 +517,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
const char * const msg = "Authentication data too long. "
"Won't fit into the buffer and will be truncated. Authentication will thus fail";
SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, msg);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", msg);
+ php_error_docref(NULL, E_WARNING, "%s", msg);
DBG_RETURN(0);
}
@@ -647,12 +647,12 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
if (packet->is_change_user_packet) {
if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer + MYSQLND_HEADER_SIZE, p - buffer - MYSQLND_HEADER_SIZE,
PROT_LAST /* the caller will handle the OK packet */,
- packet->silent, TRUE TSRMLS_CC)) {
+ packet->silent, TRUE)) {
DBG_RETURN(0);
}
DBG_RETURN(p - buffer - MYSQLND_HEADER_SIZE);
} else {
- size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (!sent) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
}
@@ -664,7 +664,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
/* {{{ php_mysqlnd_auth_free_mem */
static
-void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_AUTH * p = (MYSQLND_PACKET_AUTH *) _packet;
@@ -678,7 +678,7 @@ void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation TSRMLS
/* {{{ php_mysqlnd_auth_response_read */
static enum_func_status
-php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar local_buf[AUTH_RESP_BUFFER_SIZE];
size_t buf_len = conn->net->cmd_buffer.buffer? conn->net->cmd_buffer.length: AUTH_RESP_BUFFER_SIZE;
@@ -710,7 +710,7 @@ php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_D
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
if (0xFE == packet->response_code) {
@@ -761,7 +761,7 @@ php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_D
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "AUTH_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "AUTH_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -770,7 +770,7 @@ premature_end:
/* {{{ php_mysqlnd_auth_response_free_mem */
static void
-php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet;
if (p->message) {
@@ -798,7 +798,7 @@ php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation TS
/* {{{ php_mysqlnd_change_auth_response_write */
static size_t
-php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *packet= (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet;
zend_uchar * buffer = conn->net->cmd_buffer.length >= packet->auth_data_len? conn->net->cmd_buffer.buffer : mnd_emalloc(packet->auth_data_len);
@@ -812,7 +812,7 @@ php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn
}
{
- size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (buffer != conn->net->cmd_buffer.buffer) {
mnd_efree(buffer);
}
@@ -827,7 +827,7 @@ php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn
/* {{{ php_mysqlnd_change_auth_response_free_mem */
static void
-php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_CHANGE_AUTH_RESPONSE * p = (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet;
@@ -841,7 +841,7 @@ php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_alloca
/* {{{ php_mysqlnd_ok_read */
static enum_func_status
-php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar local_buf[OK_BUFFER_SIZE];
size_t buf_len = conn->net->cmd_buffer.buffer? conn->net->cmd_buffer.length : OK_BUFFER_SIZE;
@@ -865,7 +865,7 @@ php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(PASS);
}
@@ -902,7 +902,7 @@ php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -911,7 +911,7 @@ premature_end:
/* {{{ php_mysqlnd_ok_free_mem */
static void
-php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet;
if (p->message) {
@@ -927,7 +927,7 @@ php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
/* {{{ php_mysqlnd_eof_read */
static enum_func_status
-php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/*
EOF packet is since 4.1 five bytes long,
@@ -955,7 +955,7 @@ php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
@@ -985,7 +985,7 @@ php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -994,7 +994,7 @@ premature_end:
/* {{{ php_mysqlnd_eof_free_mem */
static
-void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
mnd_pefree(_packet, ((MYSQLND_PACKET_EOF *)_packet)->header.persistent);
@@ -1004,7 +1004,7 @@ void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_cmd_write */
-size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* Let's have some space, which we can use, if not enough, we will allocate new buffer */
MYSQLND_PACKET_COMMAND * packet= (MYSQLND_PACKET_COMMAND *) _packet;
@@ -1027,14 +1027,14 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PACKETS_SENT_CMD);
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
- net->data->m.consume_uneaten_data(net, packet->command TSRMLS_CC);
+ net->data->m.consume_uneaten_data(net, packet->command);
#endif
if (!packet->argument || !packet->arg_len) {
zend_uchar buffer[MYSQLND_HEADER_SIZE + 1];
int1store(buffer + MYSQLND_HEADER_SIZE, packet->command);
- sent = net->data->m.send_ex(net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
+ sent = net->data->m.send_ex(net, buffer, 1, conn->stats, conn->error_info);
} else {
size_t tmp_len = packet->arg_len + 1 + MYSQLND_HEADER_SIZE;
zend_uchar *tmp, *p;
@@ -1049,7 +1049,7 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
memcpy(p, packet->argument, packet->arg_len);
- sent = net->data->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ sent = net->data->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (tmp != net->cmd_buffer.buffer) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CMD_BUFFER_TOO_SMALL);
mnd_efree(tmp);
@@ -1070,7 +1070,7 @@ end:
/* {{{ php_mysqlnd_cmd_free_mem */
static
-void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_COMMAND * p = (MYSQLND_PACKET_COMMAND *) _packet;
@@ -1082,7 +1082,7 @@ void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_rset_header_read */
static enum_func_status
-php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
enum_func_status ret = PASS;
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1108,7 +1108,7 @@ php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error_info.error, sizeof(packet->error_info.error),
&packet->error_info.error_no, packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(PASS);
}
@@ -1178,7 +1178,7 @@ php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(ret);
premature_end:
DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -1187,7 +1187,7 @@ premature_end:
/* {{{ php_mysqlnd_rset_header_free_mem */
static
-void php_mysqlnd_rset_header_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_rset_header_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet;
DBG_ENTER("php_mysqlnd_rset_header_free_mem");
@@ -1221,7 +1221,7 @@ static size_t rset_field_offsets[] =
/* {{{ php_mysqlnd_rset_field_read */
static enum_func_status
-php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* Should be enough for the metadata of a single row */
MYSQLND_PACKET_RES_FIELD *packet = (MYSQLND_PACKET_RES_FIELD *) _packet;
@@ -1250,7 +1250,7 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error_info.error, sizeof(packet->error_info.error),
&packet->error_info.error_no, packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_ERR_FMT("Server error : (%u) %s", packet->error_info.error_no, packet->error_info.error);
DBG_RETURN(PASS);
} else if (EODATA_MARKER == *p && packet->header.size < 8) {
@@ -1285,7 +1285,7 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
/* 1 byte length */
if (12 != *p) {
DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol error. Server sent false length. Expected 12");
+ php_error_docref(NULL, E_WARNING, "Protocol error. Server sent false length. Expected 12");
}
p++;
@@ -1408,12 +1408,12 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
faulty_or_fake:
DBG_ERR_FMT("Protocol error. Server sent NULL_LENGTH. The server is faulty");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol error. Server sent NULL_LENGTH."
+ php_error_docref(NULL, E_WARNING, "Protocol error. Server sent NULL_LENGTH."
" The server is faulty");
DBG_RETURN(FAIL);
premature_end:
DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
+ php_error_docref(NULL, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
"shorter than expected", p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -1422,7 +1422,7 @@ premature_end:
/* {{{ php_mysqlnd_rset_field_free_mem */
static
-void php_mysqlnd_rset_field_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_rset_field_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_RES_FIELD *p = (MYSQLND_PACKET_RES_FIELD *) _packet;
/* p->metadata was passed to us as temporal buffer */
@@ -1438,7 +1438,7 @@ static enum_func_status
php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_set_memory_pool,
MYSQLND_MEMORY_POOL_CHUNK ** buffer,
size_t * data_size, zend_bool persistent_alloc,
- unsigned int prealloc_more_bytes TSRMLS_DC)
+ unsigned int prealloc_more_bytes)
{
enum_func_status ret = PASS;
MYSQLND_PACKET_HEADER header;
@@ -1457,7 +1457,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
*data_size = prealloc_more_bytes;
while (1) {
- if (FAIL == mysqlnd_read_header(conn->net, &header, conn->stats, conn->error_info TSRMLS_CC)) {
+ if (FAIL == mysqlnd_read_header(conn->net, &header, conn->stats, conn->error_info)) {
ret = FAIL;
break;
}
@@ -1466,7 +1466,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
if (first_iteration) {
first_iteration = FALSE;
- *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size TSRMLS_CC);
+ *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size);
if (!*buffer) {
ret = FAIL;
break;
@@ -1481,7 +1481,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
/*
We have to realloc the buffer.
*/
- if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size TSRMLS_CC)) {
+ if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size)) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
break;
@@ -1490,7 +1490,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
p = (*buffer)->ptr + (*data_size - header.size);
}
- if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info TSRMLS_CC))) {
+ if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info))) {
DBG_ERR("Empty row packet body");
php_error(E_WARNING, "Empty row packet body");
break;
@@ -1501,7 +1501,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
}
}
if (ret == FAIL && *buffer) {
- (*buffer)->free_chunk((*buffer) TSRMLS_CC);
+ (*buffer)->free_chunk((*buffer));
*buffer = NULL;
}
*data_size -= prealloc_more_bytes;
@@ -1514,7 +1514,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
enum_func_status
php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
unsigned int i;
zend_uchar *p = row_buffer->ptr;
@@ -1549,7 +1549,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
statistic = STAT_BINARY_TYPE_FETCHED_NULL;
} else {
enum_mysqlnd_field_types type = fields_metadata[i].type;
- mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p TSRMLS_CC);
+ mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p);
if (MYSQLND_G(collect_statistics)) {
switch (fields_metadata[i].type) {
@@ -1604,7 +1604,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
enum_func_status
php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
unsigned int i;
zval *current_field, *end_field, *start_field;
@@ -1724,7 +1724,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
Definitely not nice, _hackish_ :(, but works.
*/
zend_uchar *start = bit_area;
- ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, &p, len TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, &p, len);
/*
We have advanced in ps_fetch_from_1_to_8_bytes. We should go back because
later in this function there will be an advancement.
@@ -1756,11 +1756,11 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
enum_func_status
php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
enum_func_status ret;
DBG_ENTER("php_mysqlnd_rowp_read_text_protocol_zval");
- ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats TSRMLS_CC);
+ ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats);
DBG_RETURN(ret);
}
/* }}} */
@@ -1770,11 +1770,11 @@ php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
enum_func_status
php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
enum_func_status ret;
DBG_ENTER("php_mysqlnd_rowp_read_text_protocol_c");
- ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats TSRMLS_CC);
+ ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats);
DBG_RETURN(ret);
}
/* }}} */
@@ -1786,7 +1786,7 @@ php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
if PS => packet->fields is passed from outside
*/
static enum_func_status
-php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar *p;
enum_func_status ret = PASS;
@@ -1803,7 +1803,7 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
ret = php_mysqlnd_read_row_ex(conn, packet->result_set_memory_pool, &packet->row_buffer, &data_size,
packet->persistent_alloc, post_alloc_for_bit_fields
- TSRMLS_CC);
+ );
if (FAIL == ret) {
goto end;
}
@@ -1828,7 +1828,7 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
} else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */
packet->eof = TRUE;
p++;
@@ -1878,14 +1878,14 @@ end:
/* {{{ php_mysqlnd_rowp_free_mem */
static void
-php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_ROW *p;
DBG_ENTER("php_mysqlnd_rowp_free_mem");
p = (MYSQLND_PACKET_ROW *) _packet;
if (p->row_buffer) {
- p->row_buffer->free_chunk(p->row_buffer TSRMLS_CC);
+ p->row_buffer->free_chunk(p->row_buffer);
p->row_buffer = NULL;
}
DBG_INF_FMT("stack_allocation=%u persistent=%u", (int)stack_allocation, (int)p->header.persistent);
@@ -1906,7 +1906,7 @@ php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
/* {{{ php_mysqlnd_stats_read */
static enum_func_status
-php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
MYSQLND_PACKET_STATS *packet= (MYSQLND_PACKET_STATS *) _packet;
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1928,7 +1928,7 @@ php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
/* {{{ php_mysqlnd_stats_free_mem */
static
-void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet;
if (p->message) {
@@ -1948,7 +1948,7 @@ void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation TSRML
/* {{{ php_mysqlnd_prepare_read */
static enum_func_status
-php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* In case of an error, we should have place to put it */
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1974,7 +1974,7 @@ php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
@@ -2015,7 +2015,7 @@ php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2024,7 +2024,7 @@ premature_end:
/* {{{ php_mysqlnd_prepare_free_mem */
static void
-php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_PREPARE_RESPONSE *p= (MYSQLND_PACKET_PREPARE_RESPONSE *) _packet;
if (!stack_allocation) {
@@ -2036,7 +2036,7 @@ php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_D
/* {{{ php_mysqlnd_chg_user_read */
static enum_func_status
-php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* There could be an error message */
size_t buf_len = conn->net->cmd_buffer.length;
@@ -2071,7 +2071,7 @@ php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
}
BAIL_IF_NO_MORE_DATA;
if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) {
@@ -2090,7 +2090,7 @@ php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2099,7 +2099,7 @@ premature_end:
/* {{{ php_mysqlnd_chg_user_free_mem */
static void
-php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet;
@@ -2124,7 +2124,7 @@ php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_sha256_pk_request_write */
static
-size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buffer[MYSQLND_HEADER_SIZE + 1];
size_t sent;
@@ -2132,7 +2132,7 @@ size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * c
DBG_ENTER("php_mysqlnd_sha256_pk_request_write");
int1store(buffer + MYSQLND_HEADER_SIZE, '\1');
- sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
+ sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info);
DBG_RETURN(sent);
}
@@ -2141,7 +2141,7 @@ size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * c
/* {{{ php_mysqlnd_sha256_pk_request_free_mem */
static
-void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_SHA256_PK_REQUEST * p = (MYSQLND_PACKET_SHA256_PK_REQUEST *) _packet;
@@ -2155,7 +2155,7 @@ void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allo
/* {{{ php_mysqlnd_sha256_pk_request_response_read */
static enum_func_status
-php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buf[SHA256_PK_REQUEST_RESP_BUFFER_SIZE];
zend_uchar *p = buf;
@@ -2180,7 +2180,7 @@ php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA *
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SHA256_PK_REQUEST_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "SHA256_PK_REQUEST_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2189,7 +2189,7 @@ premature_end:
/* {{{ php_mysqlnd_sha256_pk_request_response_free_mem */
static void
-php_mysqlnd_sha256_pk_request_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_sha256_pk_request_response_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _packet;
if (p->public_key) {
@@ -2305,7 +2305,7 @@ mysqlnd_packet_methods packet_methods[PROT_LAST] =
/* {{{ mysqlnd_protocol::get_greet_packet */
static struct st_mysqlnd_packet_greet *
-MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_greet * packet = mnd_pecalloc(1, packet_methods[PROT_GREET_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_greet_packet");
@@ -2320,7 +2320,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_auth_packet */
static struct st_mysqlnd_packet_auth *
-MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_auth * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_packet");
@@ -2335,7 +2335,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const proto
/* {{{ mysqlnd_protocol::get_auth_response_packet */
static struct st_mysqlnd_packet_auth_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_response_packet");
@@ -2350,7 +2350,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * co
/* {{{ mysqlnd_protocol::get_change_auth_response_packet */
static struct st_mysqlnd_packet_change_auth_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_change_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_CHANGE_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_auth_response_packet");
@@ -2365,7 +2365,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_ok_packet */
static struct st_mysqlnd_packet_ok *
-MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_ok * packet = mnd_pecalloc(1, packet_methods[PROT_OK_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_ok_packet");
@@ -2380,7 +2380,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protoco
/* {{{ mysqlnd_protocol::get_eof_packet */
static struct st_mysqlnd_packet_eof *
-MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_eof * packet = mnd_pecalloc(1, packet_methods[PROT_EOF_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_eof_packet");
@@ -2395,7 +2395,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_command_packet */
static struct st_mysqlnd_packet_command *
-MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_command * packet = mnd_pecalloc(1, packet_methods[PROT_CMD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_command_packet");
@@ -2410,7 +2410,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const pr
/* {{{ mysqlnd_protocol::get_rset_packet */
static struct st_mysqlnd_packet_rset_header *
-MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_rset_header * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_HEADER_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_rset_header_packet");
@@ -2425,7 +2425,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * cons
/* {{{ mysqlnd_protocol::get_result_field_packet */
static struct st_mysqlnd_packet_res_field *
-MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_res_field * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_FLD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_result_field_packet");
@@ -2440,7 +2440,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * con
/* {{{ mysqlnd_protocol::get_row_packet */
static struct st_mysqlnd_packet_row *
-MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_row * packet = mnd_pecalloc(1, packet_methods[PROT_ROW_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_row_packet");
@@ -2455,7 +2455,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_stats_packet */
static struct st_mysqlnd_packet_stats *
-MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_stats * packet = mnd_pecalloc(1, packet_methods[PROT_STATS_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_stats_packet");
@@ -2470,7 +2470,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_prepare_response_packet */
static struct st_mysqlnd_packet_prepare_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_prepare_response * packet = mnd_pecalloc(1, packet_methods[PROT_PREPARE_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_prepare_response_packet");
@@ -2485,7 +2485,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL *
/* {{{ mysqlnd_protocol::get_change_user_response_packet */
static struct st_mysqlnd_packet_chg_user_resp*
-MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_chg_user_resp * packet = mnd_pecalloc(1, packet_methods[PROT_CHG_USER_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_user_response_packet");
@@ -2500,7 +2500,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_sha256_pk_request_packet */
static struct st_mysqlnd_packet_sha256_pk_request *
-MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_sha256_pk_request * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_packet");
@@ -2515,7 +2515,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL
/* {{{ mysqlnd_protocol::get_sha256_pk_request_response_packet */
static struct st_mysqlnd_packet_sha256_pk_request_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_sha256_pk_request_response * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_RESPONSE_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_response_packet");
@@ -2550,11 +2550,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_protocol_init */
PHPAPI MYSQLND_PROTOCOL *
-mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC)
+mysqlnd_protocol_init(zend_bool persistent)
{
MYSQLND_PROTOCOL * ret;
DBG_ENTER("mysqlnd_protocol_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_decoder(persistent TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_decoder(persistent);
DBG_RETURN(ret);
}
/* }}} */
@@ -2562,7 +2562,7 @@ mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC)
/* {{{ mysqlnd_protocol_free */
PHPAPI void
-mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol TSRMLS_DC)
+mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol)
{
DBG_ENTER("mysqlnd_protocol_free");
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h
index 5238715987..c15d3c4a47 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.h
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.h
@@ -36,13 +36,13 @@ PHPAPI extern const char mysqlnd_read_body_name[];
/* Packet handling */
-#define PACKET_WRITE(packet, conn) ((packet)->header.m->write_to_net((packet), (conn) TSRMLS_CC))
-#define PACKET_READ(packet, conn) ((packet)->header.m->read_from_net((packet), (conn) TSRMLS_CC))
+#define PACKET_WRITE(packet, conn) ((packet)->header.m->write_to_net((packet), (conn)))
+#define PACKET_READ(packet, conn) ((packet)->header.m->read_from_net((packet), (conn)))
#define PACKET_FREE(packet) \
do { \
DBG_INF_FMT("PACKET_FREE(%p)", packet); \
if ((packet)) { \
- ((packet)->header.m->free_mem((packet), FALSE TSRMLS_CC)); \
+ ((packet)->header.m->free_mem((packet), FALSE)); \
} \
} while (0);
@@ -51,9 +51,9 @@ PHPAPI extern const char * const mysqlnd_command_to_text[COM_END];
/* Low-level extraction functionality */
typedef struct st_mysqlnd_packet_methods {
size_t struct_size;
- enum_func_status (*read_from_net)(void * packet, MYSQLND_CONN_DATA * conn TSRMLS_DC);
- size_t (*write_to_net)(void * packet, MYSQLND_CONN_DATA * conn TSRMLS_DC);
- void (*free_mem)(void *packet, zend_bool stack_allocation TSRMLS_DC);
+ enum_func_status (*read_from_net)(void * packet, MYSQLND_CONN_DATA * conn);
+ size_t (*write_to_net)(void * packet, MYSQLND_CONN_DATA * conn);
+ void (*free_mem)(void *packet, zend_bool stack_allocation);
} mysqlnd_packet_methods;
@@ -308,20 +308,20 @@ PHPAPI const extern char * const mysqlnd_empty_string;
enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
enum_func_status php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
enum_func_status php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
-PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC);
-PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol TSRMLS_DC);
+PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent);
+PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol);
#endif /* MYSQLND_WIREPROTOCOL_H */
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index a16018f6ba..92128d7715 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -56,7 +56,7 @@ mysqlnd_minfo_print_hash(zval *values)
/* {{{ mysqlnd_minfo_dump_plugin_stats */
static int
-mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument TSRMLS_DC)
+mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument)
{
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
if (plugin_header->plugin_stats.values) {
@@ -64,7 +64,7 @@ mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument TSRMLS_DC)
zval values;
snprintf(buf, sizeof(buf), "%s statistics", plugin_header->plugin_name);
- mysqlnd_fill_stats_hash(plugin_header->plugin_stats.values, plugin_header->plugin_stats.names, &values TSRMLS_CC ZEND_FILE_LINE_CC);
+ mysqlnd_fill_stats_hash(plugin_header->plugin_stats.values, plugin_header->plugin_stats.names, &values ZEND_FILE_LINE_CC);
php_info_print_table_start();
php_info_print_table_header(2, buf, "");
@@ -79,7 +79,7 @@ mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument TSRMLS_DC)
/* {{{ mysqlnd_minfo_dump_loaded_plugins */
static int
-mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf TSRMLS_DC)
+mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf)
{
smart_str * buffer = (smart_str *) buf;
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
@@ -96,9 +96,9 @@ mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf TSRMLS_DC)
/* {{{ mysqlnd_minfo_dump_api_plugins */
static void
-mysqlnd_minfo_dump_api_plugins(smart_str * buffer TSRMLS_DC)
+mysqlnd_minfo_dump_api_plugins(smart_str * buffer)
{
- HashTable *ht = mysqlnd_reverse_api_get_api_list(TSRMLS_C);
+ HashTable *ht = mysqlnd_reverse_api_get_api_list();
MYSQLND_REVERSE_API *ext;
ZEND_HASH_FOREACH_PTR(ht, ext) {
@@ -157,7 +157,7 @@ PHP_MINFO_FUNCTION(mysqlnd)
php_info_print_table_row(2, "Loaded plugins", tmp_str.s? tmp_str.s->val : "");
smart_str_free(&tmp_str);
- mysqlnd_minfo_dump_api_plugins(&tmp_str TSRMLS_CC);
+ mysqlnd_minfo_dump_api_plugins(&tmp_str);
smart_str_0(&tmp_str);
php_info_print_table_row(2, "API Extensions", tmp_str.s? tmp_str.s->val : "");
smart_str_free(&tmp_str);
@@ -179,6 +179,9 @@ PHPAPI ZEND_DECLARE_MODULE_GLOBALS(mysqlnd)
*/
static PHP_GINIT_FUNCTION(mysqlnd)
{
+#if defined(COMPILE_DL_MYSQLND) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysqlnd_globals->collect_statistics = TRUE;
mysqlnd_globals->collect_memory_statistics = FALSE;
mysqlnd_globals->debug = NULL; /* The actual string */
@@ -252,7 +255,7 @@ static PHP_MINIT_FUNCTION(mysqlnd)
{
REGISTER_INI_ENTRIES();
- mysqlnd_library_init(TSRMLS_C);
+ mysqlnd_library_init();
return SUCCESS;
}
/* }}} */
@@ -262,7 +265,7 @@ static PHP_MINIT_FUNCTION(mysqlnd)
*/
static PHP_MSHUTDOWN_FUNCTION(mysqlnd)
{
- mysqlnd_library_end(TSRMLS_C);
+ mysqlnd_library_end();
UNREGISTER_INI_ENTRIES();
return SUCCESS;
@@ -279,8 +282,8 @@ static PHP_RINIT_FUNCTION(mysqlnd)
struct st_mysqlnd_plugin_trace_log * trace_log_plugin = mysqlnd_plugin_find("debug_trace");
MYSQLND_G(dbg) = NULL;
if (trace_log_plugin) {
- MYSQLND_DEBUG * dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
- MYSQLND_DEBUG * trace_alloc = trace_log_plugin->methods.trace_instance_init(NULL TSRMLS_CC);
+ MYSQLND_DEBUG * dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs);
+ MYSQLND_DEBUG * trace_alloc = trace_log_plugin->methods.trace_instance_init(NULL);
if (!dbg || !trace_alloc) {
return FAILURE;
}
@@ -357,6 +360,9 @@ zend_module_entry mysqlnd_module_entry = {
/* {{{ COMPILE_DL_MYSQLND */
#ifdef COMPILE_DL_MYSQLND
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysqlnd)
#endif
/* }}} */
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index f9a945a8b4..7f7c30c9e1 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -120,26 +120,26 @@ zend_class_entry *oci_coll_class_entry_ptr;
#endif
/* {{{ static protos */
-static void php_oci_connection_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_pconnection_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_pconnection_list_np_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_statement_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_descriptor_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC);
-static void php_oci_collection_list_dtor (zend_resource * TSRMLS_DC);
-
-static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC);
-static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
-static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
-static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
-static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC);
-
-static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC);
-static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC);
-static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC);
-static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid TSRMLS_DC);
-static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid TSRMLS_DC);
-static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TSRMLS_DC);
+static void php_oci_connection_list_dtor (zend_resource *);
+static void php_oci_pconnection_list_dtor (zend_resource *);
+static void php_oci_pconnection_list_np_dtor (zend_resource *);
+static void php_oci_statement_list_dtor (zend_resource *);
+static void php_oci_descriptor_list_dtor (zend_resource *);
+static void php_oci_spool_list_dtor(zend_resource *entry);
+static void php_oci_collection_list_dtor (zend_resource *);
+
+static int php_oci_persistent_helper(zend_resource *le);
+static int php_oci_connection_ping(php_oci_connection *);
+static int php_oci_connection_status(php_oci_connection *);
+static int php_oci_connection_close(php_oci_connection *);
+static void php_oci_spool_close(php_oci_spool *session_pool);
+
+static OCIEnv *php_oci_create_env(ub2 charsetid);
+static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode);
+static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode);
+static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid);
+static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid);
+static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh);
/* }}} */
/* {{{ dynamically loadable module stuff */
@@ -1080,7 +1080,7 @@ PHP_INI_END()
*
* Initialize global handles only when they are needed
*/
-static void php_oci_init_global_handles(TSRMLS_D)
+static void php_oci_init_global_handles(void)
{
sword errstatus;
sb4 ora_error_code = 0;
@@ -1090,14 +1090,14 @@ static void php_oci_init_global_handles(TSRMLS_D)
if (errstatus == OCI_ERROR) {
#ifdef HAVE_OCI_INSTANT_CLIENT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
#endif
if (OCI_G(env)
&& OCIErrorGet(OCI_G(env), (ub4)1, NULL, &ora_error_code, tmp_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
&& *tmp_buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_buf);
}
OCI_G(env) = NULL;
@@ -1134,9 +1134,9 @@ static void php_oci_init_global_handles(TSRMLS_D)
}
if (errstatus == OCI_SUCCESS_WITH_INFO) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Initialization error: OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "Initialization error: OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Initialization error: OCI_ERROR: %s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "Initialization error: OCI_ERROR: %s", tmp_buf);
OCIHandleFree((dvoid *) OCI_G(env), OCI_HTYPE_ENV);
@@ -1152,7 +1152,7 @@ static void php_oci_init_global_handles(TSRMLS_D)
*
* Free global handles (if they were initialized before)
*/
-static void php_oci_cleanup_global_handles(TSRMLS_D)
+static void php_oci_cleanup_global_handles(void)
{
if (OCI_G(err)) {
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) OCI_G(err), OCI_HTYPE_ERROR));
@@ -1182,7 +1182,7 @@ static PHP_GINIT_FUNCTION(oci)
*/
static PHP_GSHUTDOWN_FUNCTION(oci)
{
- php_oci_cleanup_global_handles(TSRMLS_C);
+ php_oci_cleanup_global_handles();
}
/* }}} */
@@ -1203,8 +1203,8 @@ PHP_MINIT_FUNCTION(oci)
INIT_CLASS_ENTRY(oci_lob_class_entry, "OCI-Lob", php_oci_lob_class_functions);
INIT_CLASS_ENTRY(oci_coll_class_entry, "OCI-Collection", php_oci_coll_class_functions);
- oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry TSRMLS_CC);
- oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry TSRMLS_CC);
+ oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry);
+ oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry);
/* thies@thieso.net 990203 i do not think that we will need all of them - just in here for completeness for now! */
REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT);
@@ -1321,7 +1321,7 @@ PHP_RSHUTDOWN_FUNCTION(oci)
* unable to process a pconnection because of a refcount, the processing would happen from
* np-destructor which is called when refcount goes to zero - php_oci_pconnection_list_np_dtor
*/
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper);
if (OCI_G(edition)) {
efree(OCI_G(edition));
@@ -1348,7 +1348,7 @@ PHP_MINFO_FUNCTION(oci)
php_info_print_table_row(2, "Revision", "$Id$");
#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))
- php_oci_client_get_version(&ver TSRMLS_CC);
+ php_oci_client_get_version(&ver);
php_info_print_table_row(2, "Oracle Run-time Client Library Version", ver);
efree(ver);
#else
@@ -1397,12 +1397,12 @@ PHP_MINFO_FUNCTION(oci)
*
* Non-persistent connection destructor
*/
-static void php_oci_connection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_connection_list_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
if (connection) {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_links)--;
}
}
@@ -1412,12 +1412,12 @@ static void php_oci_connection_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Persistent connection destructor
*/
-static void php_oci_pconnection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_pconnection_list_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
if (connection) {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_persistent)--;
OCI_G(num_links)--;
}
@@ -1429,7 +1429,7 @@ static void php_oci_pconnection_list_dtor(zend_resource *entry TSRMLS_DC)
* Non-Persistent destructor for persistent connection - This gets invoked when
* the refcount of this goes to zero in the regular list
*/
-static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_pconnection_list_np_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
zval *zvp;
@@ -1459,7 +1459,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
zend_hash_del(&EG(persistent_list), connection->hash_key);
}
else {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_persistent)--;
}
@@ -1478,7 +1478,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
* If oci_old_close_semantics is set, we artificially bump up the refcount and decremented
* only at request shutdown.
*/
- php_oci_connection_release(connection TSRMLS_CC);
+ php_oci_connection_release(connection);
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECT_P_DTOR_RELEASE_ENABLED()) {
@@ -1493,10 +1493,10 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
*
* Statement destructor
*/
-static void php_oci_statement_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_statement_list_dtor(zend_resource *entry)
{
php_oci_statement *statement = (php_oci_statement *)entry->ptr;
- php_oci_statement_free(statement TSRMLS_CC);
+ php_oci_statement_free(statement);
}
/* }}} */
@@ -1504,10 +1504,10 @@ static void php_oci_statement_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Descriptor destructor
*/
-static void php_oci_descriptor_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_descriptor_list_dtor(zend_resource *entry)
{
php_oci_descriptor *descriptor = (php_oci_descriptor *)entry->ptr;
- php_oci_lob_free(descriptor TSRMLS_CC);
+ php_oci_lob_free(descriptor);
}
/* }}} */
@@ -1515,10 +1515,10 @@ static void php_oci_descriptor_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Collection destructor
*/
-static void php_oci_collection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_collection_list_dtor(zend_resource *entry)
{
php_oci_collection *collection = (php_oci_collection *)entry->ptr;
- php_oci_collection_close(collection TSRMLS_CC);
+ php_oci_collection_close(collection);
}
/* }}} */
@@ -1574,7 +1574,6 @@ void php_oci_bind_hash_dtor(void *data)
void php_oci_column_hash_dtor(void *data)
{
php_oci_out_column *column = (php_oci_out_column *) data;
- TSRMLS_FETCH();
/* if (column->stmtid) { */ /* PHPNG TODO */
zend_list_close(column->stmtid);
@@ -1601,10 +1600,9 @@ void php_oci_column_hash_dtor(void *data)
void php_oci_descriptor_flush_hash_dtor(void *data)
{
php_oci_descriptor *descriptor = *(php_oci_descriptor **)data;
- TSRMLS_FETCH();
if (descriptor && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED && (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE)) {
- php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
+ php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE);
descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED;
}
data = NULL;
@@ -1617,7 +1615,7 @@ void php_oci_descriptor_flush_hash_dtor(void *data)
*
* Free descriptors for a connection
*/
-void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_DC)
+void php_oci_connection_descriptors_free(php_oci_connection *connection)
{
zend_hash_destroy(connection->descriptors);
efree(connection->descriptors);
@@ -1631,7 +1629,7 @@ void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_D
* Fetch & print out error message if we get an error
* Returns an Oracle error number
*/
-sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
+sb4 php_oci_error(OCIError *err_p, sword errstatus)
{
text *errbuf = (text *)NULL;
sb4 errcode = 0; /* Oracle error number */
@@ -1640,46 +1638,46 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
case OCI_SUCCESS:
break;
case OCI_SUCCESS_WITH_INFO:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf);
+ php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
}
break;
case OCI_NEED_DATA:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NEED_DATA");
+ php_error_docref(NULL, E_WARNING, "OCI_NEED_DATA");
break;
case OCI_NO_DATA:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NO_DATA: failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "OCI_NO_DATA: failed to fetch error message");
}
break;
case OCI_ERROR:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "failed to fetch error message");
}
break;
case OCI_INVALID_HANDLE:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_INVALID_HANDLE");
+ php_error_docref(NULL, E_WARNING, "OCI_INVALID_HANDLE");
break;
case OCI_STILL_EXECUTING:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_STILL_EXECUTING");
+ php_error_docref(NULL, E_WARNING, "OCI_STILL_EXECUTING");
break;
case OCI_CONTINUE:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CONTINUE");
+ php_error_docref(NULL, E_WARNING, "OCI_CONTINUE");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", errstatus);
+ php_error_docref(NULL, E_WARNING, "Unknown OCI error code: %d", errstatus);
break;
}
@@ -1697,7 +1695,7 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
*
* Fetch error message into the buffer from the error handle provided
*/
-sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
+sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf)
{
sb4 error_code = 0;
text err_buf[PHP_OCI_ERRBUF_LEN];
@@ -1724,7 +1722,7 @@ sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
*
* Compute offset in the SQL statement
*/
-int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC)
+int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset)
{
sword errstatus;
@@ -1733,7 +1731,7 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1741,7 +1739,7 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, OCI_ATTR_PARSE_ERROR_OFFSET, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1763,7 +1761,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
zend_long session_mode = OCI_DEFAULT;
/* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) {
return;
}
@@ -1777,7 +1775,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
charset = NULL;
}
- connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC);
+ connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive);
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECT_RETURN_ENABLED()) {
@@ -1799,7 +1797,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
* The real connect function. Allocates all the resources needed, establishes the connection and
* returns the result handle (or NULL)
*/
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC)
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive)
{
zval *zvp;
zend_resource *le;
@@ -1815,12 +1813,12 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
ub2 charsetid_nls_lang = 0;
if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
+ php_error_docref(NULL, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
return NULL;
}
if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
if ((session_mode & OCI_SYSOPER) && (session_mode & OCI_SYSDBA)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together");
+ php_error_docref(NULL, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together");
return NULL;
}
if (session_mode & PHP_OCI_CRED_EXT) {
@@ -1828,11 +1826,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* Disable external authentication on Windows as Impersonation is not yet handled.
* TODO: Re-enable this once OCI provides capability.
*/
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "External Authentication is not supported on Windows");
+ php_error_docref(NULL, E_WARNING, "External Authentication is not supported on Windows");
return NULL;
#endif
if (username_len != 1 || username[0] != '/' || password_len != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password");
+ php_error_docref(NULL, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password");
return NULL;
}
}
@@ -1842,13 +1840,13 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
*/
persistent = 0;
if (!OCI_G(privileged_connect)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
+ php_error_docref(NULL, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
return NULL;
}
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* Safe mode has been removed in PHP 5.4 */
if (PG(safe_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled in Safe Mode");
+ php_error_docref(NULL, E_WARNING, "Privileged connect is disabled in Safe Mode");
return NULL;
}
#endif
@@ -1857,7 +1855,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* Initialize global handles if they weren't initialized before */
if (OCI_G(env) == NULL) {
- php_oci_init_global_handles(TSRMLS_C);
+ php_oci_init_global_handles();
if (OCI_G(env) == NULL) {
return NULL;
}
@@ -1903,7 +1901,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if (charset && *charset) {
PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), (CONST oratext *)charset));
if (!charsetid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset);
+ php_error_docref(NULL, E_WARNING, "Invalid character set name: %s", charset);
} else {
smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
}
@@ -1970,7 +1968,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* TODO: put in negative code for non-persistent stubs
*/
if (connection && connection->is_persistent && connection->is_stub) {
- if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
+ if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
smart_str_free(&hashed_details);
zend_hash_del(&EG(persistent_list), connection->hash_key);
@@ -1991,7 +1989,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* 2) see if it's time to ping it
* 3) ping it if needed
*/
- if (php_oci_connection_status(connection TSRMLS_CC)) {
+ if (php_oci_connection_status(connection)) {
/* Only ping if:
*
* 1) next_ping > 0, which means that ping_interval is not -1 (aka "Off")
@@ -1999,7 +1997,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* 2) current_timestamp > next_ping, which means "it's time to check if it's
* still alive"
*/
- if (!ping_done && (*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp)) && !php_oci_connection_ping(connection TSRMLS_CC)) {
+ if (!ping_done && (*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp)) && !php_oci_connection_ping(connection)) {
/* server died */
} else {
php_oci_connection *tmp;
@@ -2078,11 +2076,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* try to find an idle connection and kill it */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper);
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* all persistent connactions are in use, fallback to non-persistent connection creation */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
+ php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}
@@ -2127,9 +2125,9 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* TODO: Unconditionally do this once OCI provides extended OCISessionGet capability
*/
if (use_spool && !connection->is_persistent) {
- if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang TSRMLS_CC))==NULL)
+ if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang))==NULL)
{
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
smart_str_free(&hashed_details);
return NULL;
}
@@ -2153,14 +2151,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* connect/password change
*/
if (!use_spool) {
- if (php_oci_old_create_session(connection, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
- php_oci_connection_close(connection TSRMLS_CC);
+ if (php_oci_old_create_session(connection, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
+ php_oci_connection_close(connection);
return NULL;
}
} else {
/* create using the client-side session pool */
- if (php_oci_create_session(connection, session_pool, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
- php_oci_connection_close(connection TSRMLS_CC);
+ if (php_oci_create_session(connection, session_pool, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
+ php_oci_connection_close(connection);
return NULL;
}
}
@@ -2210,7 +2208,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
*
* Ping connection. Uses OCIPing() or OCIServerVersion() depending on the Oracle Client version
*/
-static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_ping(php_oci_connection *connection)
{
sword errstatus;
#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))))
@@ -2253,7 +2251,7 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
*
* Check connection status (pre-ping check)
*/
-static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_status(php_oci_connection *connection)
{
ub4 ss = OCI_SERVER_NOT_CONNECTED;
sword errstatus;
@@ -2274,7 +2272,7 @@ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC)
*
* Rollback connection
*/
-int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_rollback(php_oci_connection *connection)
{
sword errstatus;
@@ -2282,7 +2280,7 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
connection->rb_on_disconnect = 0;
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2295,7 +2293,7 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
*
* Commit connection
*/
-int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_commit(php_oci_connection *connection)
{
sword errstatus;
@@ -2303,7 +2301,7 @@ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
connection->rb_on_disconnect = 0;
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2316,7 +2314,7 @@ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
*
* Close the connection and free all its resources
*/
-static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_close(php_oci_connection *connection)
{
int result = 0;
zend_bool in_call_save = OCI_G(in_call);
@@ -2329,7 +2327,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
if (!connection->is_stub) {
/* Release resources associated with connection */
- php_oci_connection_release(connection TSRMLS_CC);
+ php_oci_connection_release(connection);
}
if (!connection->using_spool && connection->svc) {
@@ -2368,7 +2366,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
/* Keep this as the last member to be freed, as there are dependencies
* (like env) on the session pool
*/
- php_oci_spool_close(connection->private_spool TSRMLS_CC);
+ php_oci_spool_close(connection->private_spool);
}
if (connection->hash_key) {
@@ -2392,7 +2390,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
* transactions, setting timeout-related parameters etc. For session-pool using connections, the
* underlying connection is released to its session pool.
*/
-int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_release(php_oci_connection *connection)
{
int result = 0;
zend_bool in_call_save = OCI_G(in_call);
@@ -2403,13 +2401,13 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
}
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
if (connection->svc) {
/* rollback outstanding transactions */
if (connection->rb_on_disconnect) {
- if (php_oci_connection_rollback(connection TSRMLS_CC)) {
+ if (php_oci_connection_rollback(connection)) {
/* rollback failed */
result = 1;
}
@@ -2483,14 +2481,14 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
*
* Change password for the user with the username given
*/
-int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC)
+int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len)
{
sword errstatus;
PHP_OCI_CALL_RETURN(errstatus, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2504,7 +2502,7 @@ int php_oci_password_change(php_oci_connection *connection, char *user, int user
*
* Get Oracle client library version
*/
-void php_oci_client_get_version(char **version TSRMLS_DC)
+void php_oci_client_get_version(char **version)
{
char version_buff[256];
#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIClientVersion only available 10.2 onwards */
@@ -2527,7 +2525,7 @@ void php_oci_client_get_version(char **version TSRMLS_DC)
*
* Get Oracle server version
*/
-int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC)
+int php_oci_server_get_version(php_oci_connection *connection, char **version)
{
sword errstatus;
char version_buff[256];
@@ -2535,7 +2533,7 @@ int php_oci_server_get_version(php_oci_connection *connection, char **version TS
PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2549,7 +2547,7 @@ int php_oci_server_get_version(php_oci_connection *connection, char **version TS
*
* Convert php_oci_out_column struct into zval
*/
-int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC)
+int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
{
php_oci_descriptor *descriptor;
ub4 lob_length;
@@ -2563,7 +2561,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
}
if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */
- zend_register_resource(value, column->stmtid, 0 TSRMLS_CC); /* XXX type correct? */
+ zend_register_resource(value, column->stmtid, 0); /* XXX type correct? */
++GC_REFCOUNT(column->stmtid);
} else if (column->is_descr) {
@@ -2574,7 +2572,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
descriptor = (php_oci_descriptor *) column->descid->ptr;
if (!descriptor || rsrc_type != le_descriptor) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find LOB descriptor #%d", column->descid);
+ php_error_docref(NULL, E_WARNING, "Unable to find LOB descriptor #%d", column->descid);
return 1;
}
@@ -2588,10 +2586,10 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
if (column->chunk_size)
descriptor->chunk_size = column->chunk_size;
- lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length TSRMLS_CC);
+ lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length);
if (descriptor->chunk_size) /* Cache the chunk_size to avoid recalling OCILobGetChunkSize */
column->chunk_size = descriptor->chunk_size;
- php_oci_temp_lob_close(descriptor TSRMLS_CC);
+ php_oci_temp_lob_close(descriptor);
if (lob_fetch_status) {
ZVAL_FALSE(value);
return 1;
@@ -2652,7 +2650,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (expected_args > 2) {
/* only for ocifetchinto BC */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|l", &z_statement, &array, &fetch_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz|l", &z_statement, &array, &fetch_mode) == FAILURE) {
return;
}
@@ -2662,7 +2660,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else if (expected_args == 2) {
/* only for oci_fetch_array() */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &fetch_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_statement, &fetch_mode) == FAILURE) {
return;
}
@@ -2672,7 +2670,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else {
/* for all oci_fetch_*() */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -2692,7 +2690,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
#if (OCI_MAJOR_VERSION < 12)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_FALSE; /* end of fetch */
}
#else /* OCI_MAJOR_VERSION */
@@ -2716,8 +2714,8 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
}
if (invokedstatement->impres_count > 0) {
/* Make it so the fetch occurs on the first Implicit Result Set */
- statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC);
- if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ statement = php_oci_get_implicit_resultset(invokedstatement);
+ if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
invokedstatement->impres_count--;
invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement;
@@ -2728,16 +2726,16 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
}
}
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
/* End of fetch */
if (invokedstatement->impres_count > 0) {
/* Check next Implicit Result Set */
- statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC);
- if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ statement = php_oci_get_implicit_resultset(invokedstatement);
+ if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
invokedstatement->impres_count--;
invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement;
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
/* End of all fetches */
RETURN_FALSE;
}
@@ -2751,7 +2749,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
@@ -2763,7 +2761,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (!(column->indicator == -1)) {
zval element;
- php_oci_column_to_zval(column, &element, fetch_mode TSRMLS_CC);
+ php_oci_column_to_zval(column, &element, fetch_mode);
if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) {
add_index_zval(return_value, i, &element);
@@ -2799,7 +2797,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
* Helper function to close/rollback persistent connections at the end of request. A return value of
* 1 indicates that the connection is to be destroyed
*/
-static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC)
+static int php_oci_persistent_helper(zend_resource *le)
{
time_t timestamp;
php_oci_connection *connection;
@@ -2830,7 +2828,7 @@ static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC)
*
* Create(alloc + Init) Session pool for the given dbname and charsetid
*/
-static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid TSRMLS_DC)
+static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid)
{
php_oci_spool *session_pool = NULL;
zend_bool iserror = 0;
@@ -2855,7 +2853,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
}
/* Create the session pool's env */
- if (!(session_pool->env = php_oci_create_env(charsetid TSRMLS_CC))) {
+ if (!(session_pool->env = php_oci_create_env(charsetid))) {
iserror = 1;
goto exit_create_spool;
}
@@ -2864,7 +2862,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2876,7 +2874,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2893,7 +2891,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2904,7 +2902,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2915,7 +2913,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2925,7 +2923,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2938,13 +2936,13 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
}
exit_create_spool:
if (iserror && session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
session_pool = NULL;
}
@@ -2967,7 +2965,7 @@ exit_create_spool:
* Get Session pool for the given dbname and charsetid from the persistent list. Function called for
* non-persistent connections.
*/
-static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid TSRMLS_DC)
+static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid)
{
smart_str spool_hashed_details = {0};
php_oci_spool *session_pool = NULL;
@@ -3013,7 +3011,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
if (spool_out_le == NULL) {
- session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid TSRMLS_CC);
+ session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid);
if (session_pool == NULL) {
iserror = 1;
@@ -3033,7 +3031,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
exit_get_spool:
smart_str_free(&spool_hashed_details);
if (iserror && session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
session_pool = NULL;
}
@@ -3046,7 +3044,7 @@ exit_get_spool:
*
* Create the OCI environment choosing the correct function for the OCI version
*/
-static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
+static OCIEnv *php_oci_create_env(ub2 charsetid)
{
OCIEnv *retenv = NULL;
@@ -3058,14 +3056,14 @@ static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
text ora_msg_buf[OCI_ERROR_MAXMSG_SIZE]; /* Use traditional smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */
#ifdef HAVE_OCI_INSTANT_CLIENT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
#endif
if (retenv
&& OCIErrorGet(retenv, (ub4)1, NULL, &ora_error_code, ora_msg_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
&& *ora_msg_buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_msg_buf);
+ php_error_docref(NULL, E_WARNING, "%s", ora_msg_buf);
}
return NULL;
@@ -3079,12 +3077,12 @@ static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
* This function is to be deprecated in future in favour of OCISessionGet which is used in
* php_oci_do_connect_ex
*/
-static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC)
+static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode)
{
ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ? OCI_G(statement_cache_size) : 0;
/* Create the OCI environment separate for each connection */
- if (!(connection->env = php_oci_create_env(connection->charset TSRMLS_CC))) {
+ if (!(connection->env = php_oci_create_env(connection->charset))) {
return 1;
}
@@ -3092,7 +3090,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3101,7 +3099,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text *)dbname, dbname_len, (ub4) OCI_DEFAULT));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3111,7 +3109,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3120,7 +3118,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3129,7 +3127,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3139,7 +3137,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3150,7 +3148,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3162,7 +3160,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(edition), (ub4) (strlen(OCI_G(edition))), (ub4) OCI_ATTR_EDITION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3174,7 +3172,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
#endif
@@ -3184,7 +3182,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3193,7 +3191,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3203,14 +3201,14 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3229,7 +3227,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) cred_type, (ub4) session_mode));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
/* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when
* user's password has expired, but is still usable.
*/
@@ -3241,15 +3239,15 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
}
/* Brand new connection: Init and update the next_ping in the connection */
- if (php_oci_ping_init(connection, OCI_G(err) TSRMLS_CC) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) {
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3262,7 +3260,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
*
* Create session using client-side session pool - new norm
*/
-static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC)
+static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode)
{
php_oci_spool *actual_spool = NULL;
#if (OCI_MAJOR_VERSION > 10)
@@ -3273,7 +3271,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
/* Persistent connections have private session pools */
if (connection->is_persistent && !connection->private_spool &&
- !(connection->private_spool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, NULL, connection->charset TSRMLS_CC))) {
+ !(connection->private_spool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, NULL, connection->charset))) {
return 1;
}
actual_spool = (connection->is_persistent) ? (connection->private_spool) : (session_pool);
@@ -3301,7 +3299,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3311,7 +3309,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->authinfo), OCI_HTYPE_AUTHINFO, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3320,7 +3318,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)(strlen(OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3332,7 +3330,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_AUTHINFO, (dvoid *) &purity, (ub4)0, (ub4)OCI_ATTR_PURITY, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
#endif
@@ -3362,7 +3360,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode),OCISessionGet, (connection->env, OCI_G(err), &(connection->svc), (OCIAuthInfo *)connection->authinfo, (OraText *)actual_spool->poolname, (ub4)actual_spool->poolname_len, NULL, 0, NULL, NULL, NULL, OCI_SESSGET_SPOOL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
/* Session creation returns OCI_SUCCESS_WITH_INFO when user's password has expired, but
* is still usable.
@@ -3381,18 +3379,18 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextGetValue, (connection->session, OCI_G(err), (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), (void **)&(connection->next_pingp)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
if (!(connection->next_pingp)){
/* This is a brand new connection, we need not ping, but have to initialize ping */
- if (php_oci_ping_init(connection, OCI_G(err) TSRMLS_CC) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) {
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
} else if ((*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp))) {
- if (php_oci_connection_ping(connection TSRMLS_CC)) {
+ if (php_oci_connection_ping(connection)) {
/* Got a good connection - update next_ping and get out of ping loop */
*(connection->next_pingp) = timestamp + OCI_G(ping_interval);
} else {
@@ -3408,7 +3406,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3424,12 +3422,12 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
*
* Session pool destructor function
*/
-static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_spool_list_dtor(zend_resource *entry)
{
php_oci_spool *session_pool = (php_oci_spool *)entry->ptr;
if (session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
}
return;
@@ -3440,7 +3438,7 @@ static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Destroys the OCI Session Pool
*/
-static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC)
+static void php_oci_spool_close(php_oci_spool *session_pool)
{
if (session_pool->poolname_len) {
PHP_OCI_CALL(OCISessionPoolDestroy, ((dvoid *) session_pool->poolh,
@@ -3473,7 +3471,7 @@ static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC)
* OCIContext{Get,Set}Value to store the next_ping because we need to support ping for
* non-persistent DRCP connections
*/
-static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TSRMLS_DC)
+static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh)
{
time_t *next_pingp = NULL;
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index 341a983ef5..f722e6b782 100644
--- a/ext/oci8/oci8_collection.c
+++ b/ext/oci8/oci8_collection.c
@@ -44,7 +44,7 @@
/* {{{ php_oci_collection_create()
Create and return connection handle */
-php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC)
+php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len)
{
dvoid *dschp1 = NULL;
dvoid *parmp1;
@@ -197,7 +197,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch
break;
/* we only support VARRAYs and TABLEs */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown collection type %d", collection->coll_typecode);
+ php_error_docref(NULL, E_WARNING, "unknown collection type %d", collection->coll_typecode);
break;
}
@@ -232,16 +232,16 @@ CLEANUP:
/* free the describe handle (Bug #44113) */
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE));
}
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- php_oci_collection_close(collection TSRMLS_CC);
+ php_oci_collection_close(collection);
return NULL;
}
/* }}} */
/* {{{ php_oci_collection_size()
Return size of the collection */
-int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
+int php_oci_collection_size(php_oci_collection *collection, sb4 *size)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -249,7 +249,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -260,7 +260,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
/* {{{ php_oci_collection_max()
Return max number of elements in the collection */
-int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC)
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max)
{
php_oci_connection *connection = collection->connection;
@@ -273,7 +273,7 @@ int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS
/* {{{ php_oci_collection_trim()
Trim collection to the given number of elements */
-int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC)
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -281,7 +281,7 @@ int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size
PHP_OCI_CALL_RETURN(errstatus, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection));
if (errstatus != OCI_SUCCESS) {
- errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ errstatus = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -292,7 +292,7 @@ int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size
/* {{{ php_oci_collection_append_null()
Append NULL element to the end of the collection */
-int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
+int php_oci_collection_append_null(php_oci_collection *collection)
{
OCIInd null_index = OCI_IND_NULL;
php_oci_connection *connection = collection->connection;
@@ -302,7 +302,7 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection));
if (errstatus != OCI_SUCCESS) {
- errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ errstatus = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -313,7 +313,7 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
/* {{{ php_oci_collection_append_date()
Append DATE element to the end of the collection (use "DD-MON-YY" format) */
-int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC)
+int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIDate oci_date;
@@ -325,7 +325,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
if (errstatus != OCI_SUCCESS) {
/* failed to convert string to date */
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -341,7 +341,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -353,7 +353,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
/* {{{ php_oci_collection_append_number()
Append NUMBER to the end of the collection */
-int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC)
+int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
double element_double;
@@ -366,7 +366,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -382,7 +382,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -394,7 +394,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
/* {{{ php_oci_collection_append_string()
Append STRING to the end of the collection */
-int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIString *ocistr = (OCIString *)0;
@@ -404,7 +404,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -420,7 +420,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -432,19 +432,19 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
/* {{{ php_oci_collection_append()
Append wrapper. Appends any supported element to the end of the collection */
-int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len)
{
if (element_len == 0) {
- return php_oci_collection_append_null(collection TSRMLS_CC);
+ return php_oci_collection_append_null(collection);
}
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
- return php_oci_collection_append_date(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_date(collection, element, element_len);
break;
case OCI_TYPECODE_VARCHAR2 :
- return php_oci_collection_append_string(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_string(collection, element, element_len);
break;
case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */
@@ -458,11 +458,11 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
case OCI_TYPECODE_FLOAT : /* FLOAT */
case OCI_TYPECODE_NUMBER : /* NUMBER */
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
- return php_oci_collection_append_number(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_number(collection, element, element_len);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -473,7 +473,7 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
/* {{{ php_oci_collection_element_get()
Get the element with the given index */
-int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC)
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element)
{
php_oci_connection *connection = collection->connection;
dvoid *element;
@@ -500,7 +500,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -520,7 +520,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -562,7 +562,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -573,7 +573,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -584,7 +584,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
/* {{{ php_oci_collection_element_set_null()
Set the element with the given index to NULL */
-int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC)
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index)
{
OCIInd null_index = OCI_IND_NULL;
php_oci_connection *connection = collection->connection;
@@ -594,7 +594,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon
PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -605,7 +605,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon
/* {{{ php_oci_collection_element_set_date()
Change element's value to the given DATE */
-int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC)
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIDate oci_date;
@@ -617,7 +617,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
if (errstatus != OCI_SUCCESS) {
/* failed to convert string to date */
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -634,7 +634,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -646,7 +646,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
/* {{{ php_oci_collection_element_set_number()
Change element's value to the given NUMBER */
-int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC)
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
double element_double;
@@ -659,7 +659,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -676,7 +676,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -688,7 +688,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
/* {{{ php_oci_collection_element_set_string()
Change element's value to the given string */
-int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIString *ocistr = (OCIString *)0;
@@ -698,7 +698,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -715,7 +715,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -727,19 +727,19 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
/* {{{ php_oci_collection_element_set()
Collection element setter */
-int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC)
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len)
{
if (value_len == 0) {
- return php_oci_collection_element_set_null(collection, index TSRMLS_CC);
+ return php_oci_collection_element_set_null(collection, index);
}
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
- return php_oci_collection_element_set_date(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_date(collection, index, value, value_len);
break;
case OCI_TYPECODE_VARCHAR2 :
- return php_oci_collection_element_set_string(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_string(collection, index, value, value_len);
break;
case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */
@@ -753,11 +753,11 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind
case OCI_TYPECODE_FLOAT : /* FLOAT */
case OCI_TYPECODE_NUMBER : /* NUMBER */
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
- return php_oci_collection_element_set_number(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_number(collection, index, value, value_len);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -768,7 +768,7 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind
/* {{{ php_oci_collection_assign()
Assigns a value to the collection from another collection */
-int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC)
+int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from)
{
php_oci_connection *connection = collection_dest->connection;
sword errstatus;
@@ -776,7 +776,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -787,7 +787,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
/* {{{ php_oci_collection_close()
Destroy collection and all associated resources */
-void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC)
+void php_oci_collection_close(php_oci_collection *collection)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -796,7 +796,7 @@ void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 6c73ad0a32..a8a5662855 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -56,12 +56,12 @@ PHP_FUNCTION(oci_define_by_name)
php_oci_statement *statement;
php_oci_define *define, *tmp_define;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
return;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Column name cannot be empty");
RETURN_FALSE;
}
@@ -106,7 +106,7 @@ PHP_FUNCTION(oci_bind_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
return;
}
@@ -116,7 +116,7 @@ PHP_FUNCTION(oci_bind_by_name)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type TSRMLS_CC)) {
+ if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -136,7 +136,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
return;
}
@@ -147,11 +147,11 @@ PHP_FUNCTION(oci_bind_array_by_name)
}
if (max_array_len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum array length must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Maximum array length must be greater than zero");
RETURN_FALSE;
}
- if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type TSRMLS_CC)) {
+ if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -166,13 +166,13 @@ PHP_FUNCTION(oci_free_descriptor)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -195,29 +195,29 @@ PHP_FUNCTION(oci_lob_save)
ub4 bytes_written;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &offset) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset parameter must be greater than or equal to 0");
RETURN_FALSE;
}
- if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written TSRMLS_CC)) {
+ if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -235,18 +235,18 @@ PHP_FUNCTION(oci_lob_import)
if (getThis()) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
#endif
return;
}
}
else {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
#endif
return;
}
@@ -255,19 +255,19 @@ PHP_FUNCTION(oci_lob_import)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* The "p" parsing parameter handles this case in PHP 5.4+ */
if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
RETURN_FALSE;
}
#endif
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) {
+ if (php_oci_lob_import(descriptor, filename)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -284,19 +284,19 @@ PHP_FUNCTION(oci_lob_load)
ub4 buffer_len;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
@@ -319,29 +319,29 @@ PHP_FUNCTION(oci_lob_read)
ub4 buffer_len;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
- if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
@@ -362,19 +362,19 @@ PHP_FUNCTION(oci_lob_eof)
ub4 lob_length;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) {
+ if (!php_oci_lob_get_length(descriptor, &lob_length) && lob_length >= 0) {
if (lob_length == descriptor->lob_current_position) {
RETURN_TRUE;
}
@@ -391,13 +391,13 @@ PHP_FUNCTION(oci_lob_tell)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -415,13 +415,13 @@ PHP_FUNCTION(oci_lob_rewind)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -443,24 +443,24 @@ PHP_FUNCTION(oci_lob_seek)
ub4 lob_length;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &offset, &whence) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
@@ -494,19 +494,19 @@ PHP_FUNCTION(oci_lob_size)
ub4 lob_length;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
RETURN_LONG(lob_length);
@@ -525,7 +525,7 @@ PHP_FUNCTION(oci_lob_write)
char *data;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &write_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &write_len) == FAILURE) {
return;
}
@@ -534,7 +534,7 @@ PHP_FUNCTION(oci_lob_write)
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
return;
}
@@ -544,7 +544,7 @@ PHP_FUNCTION(oci_lob_write)
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -554,7 +554,7 @@ PHP_FUNCTION(oci_lob_write)
RETURN_LONG(0);
}
- if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written TSRMLS_CC)) {
+ if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written)) {
RETURN_FALSE;
}
RETURN_LONG(bytes_written);
@@ -569,30 +569,30 @@ PHP_FUNCTION(oci_lob_append)
php_oci_descriptor *descriptor_dest, *descriptor_from;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
- if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) {
+ if (php_oci_lob_append(descriptor_dest, descriptor_from)) {
RETURN_FALSE;
}
/* XXX should we increase lob_size here ? */
@@ -610,30 +610,30 @@ PHP_FUNCTION(oci_lob_truncate)
ub4 ub_trim_length;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &trim_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &trim_length) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
if (trim_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to zero");
RETURN_FALSE;
}
ub_trim_length = (ub4) trim_length;
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_truncate(descriptor, ub_trim_length TSRMLS_CC)) {
+ if (php_oci_lob_truncate(descriptor, ub_trim_length)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -650,44 +650,44 @@ PHP_FUNCTION(oci_lob_erase)
zend_long offset = -1, length = -1;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &offset, &length) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 0 && offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 1 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
RETURN_FALSE;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 1 && offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
RETURN_FALSE;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) {
+ if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased)) {
RETURN_FALSE;
}
RETURN_LONG(bytes_erased);
@@ -703,18 +703,18 @@ PHP_FUNCTION(oci_lob_flush)
zend_long flush_flag = 0;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flush_flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flush_flag) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -725,7 +725,7 @@ PHP_FUNCTION(oci_lob_flush)
RETURN_FALSE;
}
- if (php_oci_lob_flush(descriptor, flush_flag TSRMLS_CC)) {
+ if (php_oci_lob_flush(descriptor, flush_flag)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -741,24 +741,24 @@ PHP_FUNCTION(ocisetbufferinglob)
zend_bool flag;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &flag) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) {
+ if (php_oci_lob_set_buffering(descriptor, flag)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -773,13 +773,13 @@ PHP_FUNCTION(ocigetbufferinglob)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -800,17 +800,17 @@ PHP_FUNCTION(oci_lob_copy)
php_oci_descriptor *descriptor_dest, *descriptor_from;
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) {
return;
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
@@ -818,7 +818,7 @@ PHP_FUNCTION(oci_lob_copy)
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (ZEND_NUM_ARGS() == 3 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -827,7 +827,7 @@ PHP_FUNCTION(oci_lob_copy)
length = -1;
}
- if (php_oci_lob_copy(descriptor_dest, descriptor_from, length TSRMLS_CC)) {
+ if (php_oci_lob_copy(descriptor_dest, descriptor_from, length)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -842,24 +842,24 @@ PHP_FUNCTION(oci_lob_is_equal)
php_oci_descriptor *descriptor_first, *descriptor_second;
boolean is_equal;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first);
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second);
- if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) {
+ if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal)) {
RETURN_FALSE;
}
@@ -885,37 +885,37 @@ PHP_FUNCTION(oci_lob_export)
if (getThis()) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
#endif
return;
}
if (ZEND_NUM_ARGS() > 1 && start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than or equal to 0");
RETURN_FALSE;
}
}
else {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
#endif
return;
}
if (ZEND_NUM_ARGS() > 2 && start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 3 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than or equal to 0");
RETURN_FALSE;
}
}
@@ -923,19 +923,19 @@ PHP_FUNCTION(oci_lob_export)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* The "p" parsing parameter handles this case in PHP 5.4+ */
if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
RETURN_FALSE;
}
#endif
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
@@ -959,7 +959,7 @@ PHP_FUNCTION(oci_lob_export)
}
#endif
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -976,7 +976,7 @@ PHP_FUNCTION(oci_lob_export)
while(length > 0) {
ub4 tmp_bytes_read = 0;
- if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read)) {
php_stream_close(stream);
RETURN_FALSE;
}
@@ -1014,24 +1014,24 @@ PHP_FUNCTION(oci_lob_write_temporary)
zend_long type = OCI_TEMP_CLOB;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &type) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) {
+ if (php_oci_lob_write_tmp(descriptor, type, data, data_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1046,19 +1046,19 @@ PHP_FUNCTION(oci_lob_close)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_close(descriptor TSRMLS_CC)) {
+ if (php_oci_lob_close(descriptor)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1074,14 +1074,14 @@ PHP_FUNCTION(oci_new_descriptor)
php_oci_descriptor *descriptor;
zend_long type = OCI_DTYPE_LOB;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_connection, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_connection, &type) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
/* php_oci_lob_create() checks type */
- descriptor = php_oci_lob_create(connection, type TSRMLS_CC);
+ descriptor = php_oci_lob_create(connection, type);
if (!descriptor) {
RETURN_NULL();
@@ -1099,17 +1099,17 @@ PHP_FUNCTION(oci_rollback)
zval *z_connection;
php_oci_connection *connection;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
- if (php_oci_connection_rollback(connection TSRMLS_CC)) {
+ if (php_oci_connection_rollback(connection)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1123,17 +1123,17 @@ PHP_FUNCTION(oci_commit)
zval *z_connection;
php_oci_connection *connection;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
- if (php_oci_connection_commit(connection TSRMLS_CC)) {
+ if (php_oci_connection_commit(connection)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1321,13 +1321,13 @@ PHP_FUNCTION(oci_execute)
php_oci_statement *statement;
zend_long mode = OCI_COMMIT_ON_SUCCESS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_statement, &mode) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_execute(statement, mode TSRMLS_CC)) {
+ if (php_oci_statement_execute(statement, mode)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1341,13 +1341,13 @@ PHP_FUNCTION(oci_cancel)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_cancel(statement TSRMLS_CC)) {
+ if (php_oci_statement_cancel(statement)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1362,13 +1362,13 @@ PHP_FUNCTION(oci_fetch)
php_oci_statement *statement;
ub4 nrows = 1; /* only one row at a time is supported for now */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1396,7 +1396,7 @@ PHP_FUNCTION(oci_fetch_all)
int i;
zend_long rows = 0, flags = 0, skip = 0, maxrows = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) {
return;
}
@@ -1406,7 +1406,7 @@ PHP_FUNCTION(oci_fetch_all)
array_init(array);
while (skip--) {
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_LONG(0);
}
}
@@ -1415,16 +1415,16 @@ PHP_FUNCTION(oci_fetch_all)
columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0);
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
}
- while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ while (!php_oci_statement_fetch(statement, nrows)) {
zval row;
array_init(&row);
for (i = 0; i < statement->ncolumns; i++) {
- php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS);
if (flags & PHP_OCI_NUM) {
zend_hash_next_index_insert(Z_ARRVAL(row), &element);
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(oci_fetch_all)
rows++;
if (maxrows != -1 && rows == maxrows) {
- php_oci_statement_cancel(statement TSRMLS_CC);
+ php_oci_statement_cancel(statement);
break;
}
}
@@ -1449,30 +1449,30 @@ PHP_FUNCTION(oci_fetch_all)
if (flags & PHP_OCI_NUM) {
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
array_init(&tmp);
outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp);
}
} else { /* default to ASSOC */
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
array_init(&tmp);
outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &tmp);
}
}
- while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ while (!php_oci_statement_fetch(statement, nrows)) {
for (i = 0; i < statement->ncolumns; i++) {
- php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS);
zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element);
}
rows++;
if (maxrows != -1 && rows == maxrows) {
- php_oci_statement_cancel(statement TSRMLS_CC);
+ php_oci_statement_cancel(statement);
break;
}
}
@@ -1528,7 +1528,7 @@ PHP_FUNCTION(oci_free_statement)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -1558,7 +1558,7 @@ PHP_FUNCTION(oci_close)
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
@@ -1608,30 +1608,30 @@ PHP_FUNCTION(oci_error)
ub2 error_offset = 0;
text *sqltext = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 0) {
- statement = (php_oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_statement);
if (statement) {
errh = statement->err;
errcode = statement->errcode;
- if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) {
+ if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset)) {
RETURN_FALSE;
}
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_connection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_pconnection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
@@ -1648,11 +1648,11 @@ go_out:
}
if (!errh) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oci_error: unable to find error handle");
+ php_error_docref(NULL, E_WARNING, "Oci_error: unable to find error handle");
RETURN_FALSE;
}
- errcode = php_oci_fetch_errmsg(errh, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(errh, &errbuf);
if (errcode) {
array_init(return_value);
@@ -1675,7 +1675,7 @@ PHP_FUNCTION(oci_num_fields)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -1695,13 +1695,13 @@ PHP_FUNCTION(oci_parse)
char *query;
size_t query_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &query, &query_len) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC);
+ statement = php_oci_statement_create(connection, query, query_len);
if (statement) {
RETURN_RES(statement->id);
@@ -1718,18 +1718,18 @@ PHP_FUNCTION(oci_set_prefetch)
php_oci_statement *statement;
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_statement, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &z_statement, &size) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
if (size < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0");
return;
}
- if (php_oci_statement_set_prefetch(statement, (ub4)size TSRMLS_CC)) {
+ if (php_oci_statement_set_prefetch(statement, (ub4)size)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1746,7 +1746,7 @@ PHP_FUNCTION(oci_set_client_identifier)
size_t client_id_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &client_id, &client_id_len) == FAILURE) {
return;
}
@@ -1755,7 +1755,7 @@ PHP_FUNCTION(oci_set_client_identifier)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
@@ -1795,7 +1795,7 @@ PHP_FUNCTION(oci_set_edition)
char *edition;
size_t edition_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &edition, &edition_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &edition, &edition_len) == FAILURE) {
return;
}
@@ -1813,7 +1813,7 @@ PHP_FUNCTION(oci_set_edition)
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1830,7 +1830,7 @@ PHP_FUNCTION(oci_set_module_name)
size_t module_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &module, &module_len) == FAILURE) {
return;
}
@@ -1839,13 +1839,13 @@ PHP_FUNCTION(oci_set_module_name)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1862,7 +1862,7 @@ PHP_FUNCTION(oci_set_action)
size_t action_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &action, &action_len) == FAILURE) {
return;
}
@@ -1871,13 +1871,13 @@ PHP_FUNCTION(oci_set_action)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1894,7 +1894,7 @@ PHP_FUNCTION(oci_set_client_info)
size_t client_info_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &client_info, &client_info_len) == FAILURE) {
return;
}
@@ -1903,13 +1903,13 @@ PHP_FUNCTION(oci_set_client_info)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1926,7 +1926,7 @@ PHP_FUNCTION(oci_set_db_operation)
char *dbop_name;
size_t dbop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) {
return;
}
@@ -1935,12 +1935,12 @@ PHP_FUNCTION(oci_set_db_operation)
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1959,47 +1959,47 @@ PHP_FUNCTION(oci_password_change)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* Safe mode has been removed in PHP 5.4 */
if (PG(safe_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "is disabled in Safe Mode");
+ php_error_docref(NULL, E_WARNING, "is disabled in Safe Mode");
RETURN_FALSE;
}
#endif
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (!user_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ php_error_docref(NULL, E_WARNING, "username cannot be empty");
RETURN_FALSE;
}
if (!pass_old_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "old password cannot be empty");
RETURN_FALSE;
}
if (!pass_new_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "new password cannot be empty");
RETURN_FALSE;
}
- if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) {
+ if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
if (!user_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ php_error_docref(NULL, E_WARNING, "username cannot be empty");
RETURN_FALSE;
}
if (!pass_old_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "old password cannot be empty");
RETURN_FALSE;
}
if (!pass_new_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "new password cannot be empty");
RETURN_FALSE;
}
- connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 0 TSRMLS_CC);
+ connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 0);
if (!connection) {
RETURN_FALSE;
}
@@ -2017,13 +2017,13 @@ PHP_FUNCTION(oci_new_cursor)
php_oci_connection *connection;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);
+ statement = php_oci_statement_create(connection, NULL, 0);
if (statement) {
RETURN_RES(statement->id);
@@ -2040,7 +2040,7 @@ PHP_FUNCTION(oci_result)
column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
if(column) {
- php_oci_column_to_zval(column, return_value, 0 TSRMLS_CC);
+ php_oci_column_to_zval(column, return_value, 0);
}
else {
RETURN_FALSE;
@@ -2054,7 +2054,7 @@ PHP_FUNCTION(oci_client_version)
{
char *version = NULL;
- php_oci_client_get_version(&version TSRMLS_CC);
+ php_oci_client_get_version(&version);
RETURN_STRING(version);
}
/* }}} */
@@ -2067,13 +2067,13 @@ PHP_FUNCTION(oci_server_version)
php_oci_connection *connection;
char *version = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- if (php_oci_server_get_version(connection, &version TSRMLS_CC)) {
+ if (php_oci_server_get_version(connection, &version)) {
RETURN_FALSE;
}
@@ -2089,13 +2089,13 @@ PHP_FUNCTION(oci_statement_type)
php_oci_statement *statement;
ub2 type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_get_type(statement, &type TSRMLS_CC)) {
+ if (php_oci_statement_get_type(statement, &type)) {
RETURN_FALSE;
}
@@ -2144,13 +2144,13 @@ PHP_FUNCTION(oci_num_rows)
php_oci_statement *statement;
ub4 rowcount;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_get_numrows(statement, &rowcount TSRMLS_CC)) {
+ if (php_oci_statement_get_numrows(statement, &rowcount)) {
RETURN_FALSE;
}
RETURN_LONG(rowcount);
@@ -2165,13 +2165,13 @@ PHP_FUNCTION(oci_free_collection)
php_oci_collection *collection;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
@@ -2192,24 +2192,24 @@ PHP_FUNCTION(oci_collection_append)
size_t value_len;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) {
+ if (php_oci_collection_append(collection, value, value_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2226,24 +2226,24 @@ PHP_FUNCTION(oci_collection_element_get)
zval value;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &element_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &element_index) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) {
+ if (php_oci_collection_element_get(collection, element_index, &value)) {
RETURN_FALSE;
}
@@ -2259,30 +2259,30 @@ PHP_FUNCTION(oci_collection_assign)
php_oci_collection *collection_dest, *collection_from;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_collection_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest);
PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from);
- if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) {
+ if (php_oci_collection_assign(collection_dest, collection_from)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2300,24 +2300,24 @@ PHP_FUNCTION(oci_collection_element_assign)
char *value;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element_index, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element_index, &value, &value_len) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) {
+ if (php_oci_collection_element_set(collection, element_index, value, value_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2333,19 +2333,19 @@ PHP_FUNCTION(oci_collection_size)
sb4 size = 0;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_size(collection, &size TSRMLS_CC)) {
+ if (php_oci_collection_size(collection, &size)) {
RETURN_FALSE;
}
RETURN_LONG(size);
@@ -2361,19 +2361,19 @@ PHP_FUNCTION(oci_collection_max)
zend_long max;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_max(collection, &max TSRMLS_CC)) {
+ if (php_oci_collection_max(collection, &max)) {
RETURN_FALSE;
}
RETURN_LONG(max);
@@ -2389,24 +2389,24 @@ PHP_FUNCTION(oci_collection_trim)
zend_long trim_size;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &trim_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &trim_size) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) {
+ if (php_oci_collection_trim(collection, trim_size)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2423,13 +2423,13 @@ PHP_FUNCTION(oci_new_collection)
char *tdo, *schema = NULL;
size_t tdo_len, schema_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len TSRMLS_CC)) ) {
+ if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len)) ) {
object_init_ex(return_value, oci_coll_class_entry_ptr);
add_property_resource(return_value, "collection", collection->id);
}
@@ -2447,16 +2447,16 @@ PHP_FUNCTION(oci_get_implicit_resultset)
php_oci_statement *statement;
php_oci_statement *imp_statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- imp_statement = php_oci_get_implicit_resultset(statement TSRMLS_CC);
+ imp_statement = php_oci_get_implicit_resultset(statement);
if (imp_statement) {
- if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
RETURN_RES(imp_statement->id);
}
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 12986a8d3a..11e8a27ab5 100644
--- a/ext/oci8/oci8_lob.c
+++ b/ext/oci8/oci8_lob.c
@@ -51,7 +51,7 @@
/* {{{ php_oci_lob_create()
Create LOB descriptor and allocate all the resources needed */
-php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type TSRMLS_DC)
+php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type)
{
php_oci_descriptor *descriptor;
sword errstatus;
@@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
/* these three are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unknown descriptor type %pd", type);
return NULL;
break;
}
@@ -76,7 +76,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
PHP_OCI_HANDLE_ERROR(connection, OCI_G(errcode));
efree(descriptor);
return NULL;
@@ -104,8 +104,8 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
descriptor->index = (connection->descriptor_count)++;
if (connection->descriptor_count == LONG_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal descriptor counter has reached limit");
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_error_docref(NULL, E_WARNING, "Internal descriptor counter has reached limit");
+ php_oci_connection_descriptors_free(connection);
return NULL;
}
@@ -118,7 +118,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
/* {{{ php_oci_lob_get_length()
Get length of the LOB. The length is cached so we don't need to ask Oracle every time */
-int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC)
+int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -132,7 +132,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
if (descriptor->type == OCI_DTYPE_FILE) {
PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -141,7 +141,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -152,7 +152,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -198,8 +198,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece
return OCI_CONTINUE;
default: {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece);
+ php_error_docref(NULL, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece);
*(ctx->lob_data) = NULL;
*(ctx->lob_len) = 0;
return OCI_ERROR;
@@ -210,7 +209,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece
/* {{{ php_oci_lob_calculate_buffer()
Work out the size for LOB buffering */
-static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length TSRMLS_DC)
+static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length)
{
php_oci_connection *connection = descriptor->connection;
ub4 chunk_size;
@@ -224,7 +223,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, z
PHP_OCI_CALL_RETURN(errstatus, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return read_length; /* we have to return original length here */
}
@@ -241,7 +240,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, z
/* {{{ php_oci_lob_read()
Read specified portion of the LOB into the buffer */
-int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len TSRMLS_DC)
+int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len)
{
php_oci_connection *connection = descriptor->connection;
ub4 length = 0;
@@ -262,7 +261,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
ctx.lob_data = data;
ctx.alloc_len = 0;
- if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &length)) {
return 1;
}
@@ -271,7 +270,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
if (initial_offset > length) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be less than size of the LOB");
+ php_error_docref(NULL, E_WARNING, "Offset must be less than size of the LOB");
return 1;
}
@@ -293,7 +292,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -303,7 +302,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -317,7 +316,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -337,7 +336,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */
- buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */
+ buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size); /* use chunk size */
bufp = (ub1 *) ecalloc(1, buffer_size);
PHP_OCI_CALL_RETURN(errstatus, OCILobRead2,
@@ -367,7 +366,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (*data) {
efree(*data);
@@ -383,7 +382,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (*data) {
efree(*data);
@@ -401,7 +400,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
/* {{{ php_oci_lob_write()
Write data to the LOB */
-int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC)
+int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written)
{
OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor;
php_oci_connection *connection = (php_oci_connection *) descriptor->connection;
@@ -409,7 +408,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
sword errstatus;
*bytes_written = 0;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -443,7 +442,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
);
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
*bytes_written = 0;
return 1;
@@ -467,7 +466,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
/* {{{ php_oci_lob_set_buffering()
Turn buffering off/onn for this particular LOB */
-int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS_DC)
+int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -489,7 +488,7 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS
}
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -513,17 +512,17 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor)
/* {{{ php_oci_lob_copy()
Copy one LOB (or its part) to another one */
-int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC)
+int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length)
{
php_oci_connection *connection = descriptor_dest->connection;
ub4 length_dest, length_from, copy_len;
sword errstatus;
- if (php_oci_lob_get_length(descriptor_dest, &length_dest TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_dest, &length_dest)) {
return 1;
}
- if (php_oci_lob_get_length(descriptor_from, &length_from TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_from, &length_from)) {
return 1;
}
@@ -551,7 +550,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -563,7 +562,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
/* {{{ php_oci_lob_close()
Close LOB */
-int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_lob_close (php_oci_descriptor *descriptor)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -572,14 +571,14 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
}
- if (php_oci_temp_lob_close(descriptor TSRMLS_CC)) {
+ if (php_oci_temp_lob_close(descriptor)) {
return 1;
}
@@ -589,7 +588,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_temp_lob_close()
Close Temporary LOB */
-int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_temp_lob_close (php_oci_descriptor *descriptor)
{
php_oci_connection *connection = descriptor->connection;
int is_temporary;
@@ -598,7 +597,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -607,7 +606,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -619,7 +618,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_lob_flush()
Flush buffers for the LOB (only if they have been used) */
-int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC)
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag)
{
OCILobLocator *lob = descriptor->descriptor;
php_oci_connection *connection = descriptor->connection;
@@ -635,7 +634,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %pd", flush_flag);
+ php_error_docref(NULL, E_WARNING, "Invalid flag value: %pd", flush_flag);
return 1;
break;
}
@@ -650,7 +649,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
PHP_OCI_CALL_RETURN(errstatus, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -664,7 +663,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
/* {{{ php_oci_lob_free()
Close LOB descriptor and free associated resources */
-void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
+void php_oci_lob_free (php_oci_descriptor *descriptor)
{
if (!descriptor || !descriptor->connection) {
return;
@@ -695,11 +694,11 @@ void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
/* flushing Lobs & Files with buffering enabled */
if ((descriptor->type == OCI_DTYPE_FILE || descriptor->type == OCI_DTYPE_LOB) && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED) {
- php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
+ php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE);
}
if (descriptor->type == OCI_DTYPE_LOB) {
- php_oci_temp_lob_close(descriptor TSRMLS_CC);
+ php_oci_temp_lob_close(descriptor);
}
PHP_OCI_CALL(OCIDescriptorFree, (descriptor->descriptor, descriptor->type));
@@ -711,7 +710,7 @@ void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_lob_import()
Import LOB contents from the given file */
-int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC)
+int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename)
{
int fp;
ub4 loblen;
@@ -723,15 +722,15 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
/* Safe mode has been removed in PHP 5.4 */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
#else
- if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)) {
#endif
return 1;
}
if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open file %s", filename);
+ php_error_docref(NULL, E_WARNING, "Can't open file %s", filename);
return 1;
}
@@ -755,7 +754,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
close(fp);
return 1;
@@ -772,7 +771,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
/* {{{ php_oci_lob_append()
Append data to the end of the LOB */
-int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC)
+int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from)
{
php_oci_connection *connection = descriptor_dest->connection;
OCILobLocator *lob_dest = descriptor_dest->descriptor;
@@ -780,11 +779,11 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
ub4 dest_len, from_len;
sword errstatus;
- if (php_oci_lob_get_length(descriptor_dest, &dest_len TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_dest, &dest_len)) {
return 1;
}
- if (php_oci_lob_get_length(descriptor_from, &from_len TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_from, &from_len)) {
return 1;
}
@@ -795,7 +794,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
PHP_OCI_CALL_RETURN(errstatus, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -806,14 +805,14 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
/* {{{ php_oci_lob_truncate()
Truncate LOB to the given length */
-int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC)
+int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
ub4 lob_length;
sword errstatus;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -822,19 +821,19 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng
}
if (new_lob_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Size must be greater than or equal to 0");
return 1;
}
if (new_lob_length > lob_length) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be less than or equal to the current LOB size");
+ php_error_docref(NULL, E_WARNING, "Size must be less than or equal to the current LOB size");
return 1;
}
PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -848,7 +847,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng
/* {{{ php_oci_lob_erase()
Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */
-int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC)
+int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -857,7 +856,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
*bytes_erased = 0;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -872,7 +871,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -885,7 +884,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
/* {{{ php_oci_lob_is_equal()
Compare two LOB descriptors and figure out if they are pointing to the same LOB */
-int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC)
+int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result)
{
php_oci_connection *connection = descriptor_first->connection;
OCILobLocator *first_lob = descriptor_first->descriptor;
@@ -895,7 +894,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
PHP_OCI_CALL_RETURN(errstatus, OCILobIsEqual, (connection->env, first_lob, second_lob, result));
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -906,7 +905,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
/* {{{ php_oci_lob_write_tmp()
Create temporary LOB and write data to it */
-int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC)
+int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -919,7 +918,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %pd", type);
+ php_error_docref(NULL, E_WARNING, "Invalid temporary lob type: %pd", type);
return 1;
break;
}
@@ -942,7 +941,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
);
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -950,7 +949,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
PHP_OCI_CALL_RETURN(errstatus, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE));
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -958,7 +957,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
descriptor->is_open = 1;
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
- return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC);
+ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written);
}
/* }}} */
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 7dc0d5ee66..f651925170 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -43,7 +43,7 @@
/* {{{ php_oci_statement_create()
Create statemend handle and allocate necessary resources */
-php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC)
+php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len)
{
php_oci_statement *statement;
sword errstatus;
@@ -80,7 +80,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
#endif /* HAVE_OCI8_DTRACE */
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE));
PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR));
@@ -109,9 +109,9 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
++GC_REFCOUNT(statement->connection->id);
if (OCI_G(default_prefetch) >= 0) {
- php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC);
+ php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch));
} else {
- php_oci_statement_set_prefetch(statement, (ub4)100 TSRMLS_CC); /* semi-arbitrary, "sensible default" */
+ php_oci_statement_set_prefetch(statement, (ub4)100); /* semi-arbitrary, "sensible default" */
}
PHP_OCI_REGISTER_RESOURCE(statement, le_statement);
@@ -124,10 +124,10 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
/* {{{ php_oci_get_implicit_resultset()
Fetch implicit result set statement resource */
-php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC)
+php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement)
{
#if (OCI_MAJOR_VERSION < 12)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Implicit results are available in Oracle Database 12c onwards");
+ php_error_docref(NULL, E_WARNING, "Implicit results are available in Oracle Database 12c onwards");
return NULL;
#else
void *result;
@@ -142,7 +142,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
if (rtype != OCI_RESULT_TYPE_SELECT) {
/* Only OCI_RESULT_TYPE_SELECT is supported by Oracle DB 12cR1 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected implicit result type returned from Oracle Database");
+ php_error_docref(NULL, E_WARNING, "Unexpected implicit result type returned from Oracle Database");
return NULL;
} else {
statement2 = ecalloc(1,sizeof(php_oci_statement));
@@ -169,7 +169,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
Z_ADDREF_P(statement->id);
Z_ADDREF_P(statement2->connection->id);
- php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC);
+ php_oci_statement_set_prefetch(statement2, statement->prefetch_count);
PHP_OCI_REGISTER_RESOURCE(statement2, le_statement);
@@ -183,7 +183,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
/* {{{ php_oci_statement_set_prefetch()
Set prefetch buffer size for the statement */
-int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC)
+int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch )
{
sword errstatus;
@@ -194,7 +194,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
statement->prefetch_count = 0;
return 1;
@@ -207,7 +207,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T
/* {{{ php_oci_cleanup_pre_fetch()
Helper function to cleanup ref-cursors and descriptors from the previous row */
-int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC)
+int php_oci_cleanup_pre_fetch(void *data)
{
php_oci_out_column *outcol = data;
@@ -241,7 +241,7 @@ int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC)
/* {{{ php_oci_statement_fetch()
Fetch a row from the statement */
-int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
+int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
{
int i;
void *handlepp;
@@ -254,7 +254,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
if (statement->has_descr && statement->columns) {
- zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch TSRMLS_CC);
+ zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch);
}
PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
@@ -282,7 +282,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* reset length for all piecewise columns */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise) {
column->retlen4 = 0;
piecewisecols = 1;
@@ -307,7 +307,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* scan through our columns for a piecewise column with a matching handle */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise && handlepp == column->oci_define) {
if (!column->data) {
column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1);
@@ -337,7 +337,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
if (piecewisecols) {
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise && handlepp == column->oci_define) {
column->retlen4 += column->cb_retlen;
}
@@ -350,7 +350,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* do the stuff needed for OCIDefineByName */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
}
@@ -360,13 +360,13 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
}
zval_dtor(&column->define->zval);
- php_oci_column_to_zval(column, &column->define->zval, 0 TSRMLS_CC);
+ php_oci_column_to_zval(column, &column->define->zval, 0);
}
return 0;
}
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
statement->has_data = 0;
@@ -377,7 +377,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* {{{ php_oci_statement_get_column()
Get column from the result set */
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC)
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len)
{
php_oci_out_column *column = NULL;
int i;
@@ -388,7 +388,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z
if (column_name) {
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
} else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) {
@@ -410,11 +410,10 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z
sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp)
{
php_oci_out_column *outcol = (php_oci_out_column *)ctx;
- TSRMLS_FETCH();
if (!outcol) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid context pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid context pointer value");
return OCI_ERROR;
}
@@ -422,7 +421,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
case SQLT_RSET: {
php_oci_statement *nested_stmt;
- nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0 TSRMLS_CC);
+ nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0);
if (!nested_stmt) {
return OCI_ERROR;
}
@@ -454,7 +453,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
dtype = OCI_DTYPE_LOB;
}
- descr = php_oci_lob_create(outcol->statement->connection, dtype TSRMLS_CC);
+ descr = php_oci_lob_create(outcol->statement->connection, dtype);
if (!descr) {
return OCI_ERROR;
}
@@ -477,7 +476,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
/* {{{ php_oci_statement_execute()
Execute statement */
-int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
+int php_oci_statement_execute(php_oci_statement *statement, ub4 mode)
{
php_oci_out_column *outcol;
php_oci_out_column column;
@@ -503,7 +502,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
#endif /* HAVE_OCI8_DTRACE */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode);
+ php_error_docref(NULL, E_WARNING, "Invalid execute mode given: %d", mode);
return 1;
break;
}
@@ -513,7 +512,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
} else {
@@ -531,7 +530,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (statement->binds) {
int result = 0;
- zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result TSRMLS_CC);
+ zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result);
if (result) {
return 1;
}
@@ -541,13 +540,13 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
if (statement->binds) {
- zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec TSRMLS_CC);
+ zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec);
}
if (mode & OCI_COMMIT_ON_SUCCESS) {
@@ -580,7 +579,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -600,7 +599,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)&param, counter));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -610,7 +609,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -620,7 +619,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -630,7 +629,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -640,7 +639,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -653,7 +652,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -663,7 +662,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -673,7 +672,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -808,7 +807,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -831,7 +830,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -847,15 +846,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
/* {{{ php_oci_statement_cancel()
Cancel statement */
-int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC)
+int php_oci_statement_cancel(php_oci_statement *statement)
{
- return php_oci_statement_fetch(statement, 0 TSRMLS_CC);
+ return php_oci_statement_fetch(statement, 0);
}
/* }}} */
/* {{{ php_oci_statement_free()
Destroy statement handle and free associated resources */
-void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
+void php_oci_statement_free(php_oci_statement *statement)
{
if (statement->stmt) {
if (statement->last_query_len) { /* FIXME: magical */
@@ -903,7 +902,7 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
/* {{{ php_oci_bind_pre_exec()
Helper function */
-int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
+int php_oci_bind_pre_exec(void *data, void *result)
{
php_oci_bind *bind = (php_oci_bind *) data;
@@ -924,7 +923,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE(bind->zval) != IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
@@ -940,14 +939,14 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_BIN:
case SQLT_LNG:
if (Z_TYPE(bind->zval) == IS_RESOURCE || Z_TYPE(bind->zval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
if (Z_TYPE(bind->zval) != IS_RESOURCE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
@@ -962,7 +961,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
/* {{{ php_oci_bind_post_exec()
Helper function */
-int php_oci_bind_post_exec(void *data TSRMLS_DC)
+int php_oci_bind_post_exec(void *data)
{
php_oci_bind *bind = (php_oci_bind *) data;
php_oci_connection *connection = bind->parent_statement->connection;
@@ -1030,7 +1029,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
zval_dtor(entry);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
ZVAL_NULL(entry);
} else {
@@ -1041,7 +1040,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
} else {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(&bind->zval);
} else {
@@ -1079,7 +1078,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
/* {{{ php_oci_bind_by_name()
Bind zval to the given placeholder */
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC)
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type)
{
php_oci_collection *bind_collection = NULL;
php_oci_descriptor *bind_descriptor = NULL;
@@ -1099,7 +1098,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
return 1;
}
@@ -1121,7 +1120,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
return 1;
}
@@ -1140,7 +1139,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_INT:
case SQLT_NUM:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_long(var);
@@ -1155,7 +1154,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_AFC:
case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
if (Z_TYPE_P(var) != IS_NULL) {
@@ -1170,7 +1169,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_RSET:
if (Z_TYPE_P(var) != IS_RESOURCE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
PHP_OCI_ZVAL_TO_STATEMENT_EX(var, bind_statement);
@@ -1186,7 +1185,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12
case SQLT_BOL:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_boolean(var);
@@ -1198,7 +1197,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type);
+ php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type);
return 1;
break;
}
@@ -1248,7 +1247,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1266,7 +1265,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1287,7 +1286,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1312,10 +1311,9 @@ sb4 php_oci_bind_in_callback(
{
php_oci_bind *phpbind;
zval *val;
- TSRMLS_FETCH();
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = &phpbind->zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
@@ -1366,10 +1364,9 @@ sb4 php_oci_bind_out_callback(
php_oci_bind *phpbind;
zval *val;
sb4 retval = OCI_ERROR;
- TSRMLS_FETCH();
if (!(phpbind=(php_oci_bind *)octxp) || !(val = &phpbind->zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
@@ -1396,7 +1393,7 @@ sb4 php_oci_bind_out_callback(
* binds (Bug #46994).
*/
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find object outbind descriptor property");
return OCI_ERROR;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc);
@@ -1438,11 +1435,11 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
php_oci_statement *statement;
php_oci_out_column *column;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_statement, &column_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &z_statement, &column_index) == FAILURE) {
return NULL;
}
- statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(z_statement, -1, "oci8 statement", NULL, 1, le_statement);
if (!statement) {
return NULL;
@@ -1453,9 +1450,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
}
if (Z_TYPE_P(column_index) == IS_STRING) {
- column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index));
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
+ php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
return NULL;
}
} else {
@@ -1464,9 +1461,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
tmp = *column_index;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
- column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
zval_dtor(&tmp);
return NULL;
}
@@ -1478,7 +1475,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
/* {{{ php_oci_statement_get_type()
Return type of the statement */
-int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC)
+int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type)
{
ub2 statement_type;
sword errstatus;
@@ -1488,7 +1485,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1501,7 +1498,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC
/* {{{ php_oci_statement_get_numrows()
Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */
-int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC)
+int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
{
ub4 statement_numrows;
sword errstatus;
@@ -1511,7 +1508,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1524,7 +1521,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
/* {{{ php_oci_bind_array_by_name()
Bind arrays to PL/SQL types */
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC)
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
{
php_oci_bind *bind, *bindp;
sword errstatus;
@@ -1532,7 +1529,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
convert_to_array(var);
if (maxlength < -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pd)", maxlength);
+ php_error_docref(NULL, E_WARNING, "Invalid max length value (%pd)", maxlength);
return 1;
}
@@ -1540,11 +1537,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
case SQLT_NUM:
case SQLT_INT:
case SQLT_LNG:
- bind = php_oci_bind_array_helper_number(var, max_table_length TSRMLS_CC);
+ bind = php_oci_bind_array_helper_number(var, max_table_length);
break;
case SQLT_FLT:
- bind = php_oci_bind_array_helper_double(var, max_table_length TSRMLS_CC);
+ bind = php_oci_bind_array_helper_double(var, max_table_length);
break;
case SQLT_AFC:
@@ -1554,16 +1551,16 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
case SQLT_STR:
case SQLT_LVC:
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must provide max length value for empty arrays");
+ php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
return 1;
}
- bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength TSRMLS_CC);
+ bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
break;
case SQLT_ODT:
- bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC);
+ bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
return 1;
break;
}
@@ -1614,7 +1611,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
if (errstatus != OCI_SUCCESS) {
efree(bind);
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1626,7 +1623,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
/* {{{ php_oci_bind_array_helper_string()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength)
{
php_oci_bind *bind;
ub4 i;
@@ -1696,7 +1693,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_number()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length)
{
php_oci_bind *bind;
ub4 i;
@@ -1735,7 +1732,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_double()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length)
{
php_oci_bind *bind;
ub4 i;
@@ -1774,7 +1771,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_date()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection)
{
php_oci_bind *bind;
ub4 i;
@@ -1809,7 +1806,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return NULL;
}
@@ -1824,7 +1821,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return NULL;
}
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 852fe986f3..e5ba737715 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -374,7 +374,7 @@ typedef struct {
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
do { \
- var = (type) zend_fetch_resource(zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
+ var = (type) zend_fetch_resource(zval, -1, name, NULL, 1, resource_type); \
if (!var) { \
return 1; \
} \
@@ -402,93 +402,93 @@ void php_oci_column_hash_dtor(void *data);
void php_oci_define_hash_dtor(void *data);
void php_oci_bind_hash_dtor(void *data);
void php_oci_descriptor_flush_hash_dtor(void *data);
-void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_DC);
-sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC);
-sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC);
-int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC);
+void php_oci_connection_descriptors_free(php_oci_connection *connection);
+sb4 php_oci_error(OCIError *err_p, sword status);
+sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf);
+int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset);
void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive);
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC);
-int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC);
-int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC);
-int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC);
-int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC);
-void php_oci_client_get_version(char **version TSRMLS_DC);
-int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC);
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive);
+int php_oci_connection_rollback(php_oci_connection *connection);
+int php_oci_connection_commit(php_oci_connection *connection);
+int php_oci_connection_release(php_oci_connection *connection);
+int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len);
+void php_oci_client_get_version(char **version);
+int php_oci_server_get_version(php_oci_connection *connection, char **version);
void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args);
-int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC);
+int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode);
void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus);
/* }}} */
/* {{{ lob related prototypes */
-php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type TSRMLS_DC);
-int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC);
-int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len TSRMLS_DC);
-int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC);
-int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC);
-int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off TSRMLS_DC);
+php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type);
+int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length);
+int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len);
+int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written);
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag);
+int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off);
int php_oci_lob_get_buffering(php_oci_descriptor *descriptor);
-int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC);
-int php_oci_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_temp_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC);
-void php_oci_lob_free(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename TSRMLS_DC);
-int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC);
-int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC);
-int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC);
-int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC);
+int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length);
+int php_oci_lob_close(php_oci_descriptor *descriptor);
+int php_oci_temp_lob_close(php_oci_descriptor *descriptor);
+int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len);
+void php_oci_lob_free(php_oci_descriptor *descriptor);
+int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename);
+int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from);
+int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length);
+int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased);
+int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result);
sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp);
/* }}} */
/* {{{ collection related prototypes */
-php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC);
-int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC);
-int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC);
-int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC);
-int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC);
-int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC);
-int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC);
-int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC);
-int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC);
-int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC);
-int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC);
-int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC);
-void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC);
-int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC);
-int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC);
-int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC);
-int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC);
+php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len);
+int php_oci_collection_size(php_oci_collection *collection, sb4 *size);
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max);
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size);
+int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len);
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element);
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len);
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index);
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len);
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len);
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len);
+int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from);
+void php_oci_collection_close(php_oci_collection *collection);
+int php_oci_collection_append_null(php_oci_collection *collection);
+int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len);
+int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len);
+int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len);
/* }}} */
/* {{{ statement related prototypes */
-php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC);
-php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC);
-int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC);
-int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC);
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC);
-int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC);
-int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC);
-void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC);
-int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC);
-int php_oci_bind_post_exec(void *data TSRMLS_DC);
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC);
+php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len);
+php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement);
+int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch);
+int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows);
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len);
+int php_oci_statement_execute(php_oci_statement *statement, ub4 mode);
+int php_oci_statement_cancel(php_oci_statement *statement);
+void php_oci_statement_free(php_oci_statement *statement);
+int php_oci_bind_pre_exec(void *data, void *result);
+int php_oci_bind_post_exec(void *data);
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type);
sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp);
sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp);
php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data);
-int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC);
-int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC);
-int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC);
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC);
+int php_oci_cleanup_pre_fetch(void *data);
+int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type);
+int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows);
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type);
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length);
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length);
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength);
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection);
/* }}} */
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index 3857c6955c..42d6f44fd4 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -159,11 +159,11 @@ ZEND_GET_MODULE(birdstep)
THREAD_LS birdstep_module php_birdstep_module;
THREAD_LS static HENV henv;
-#define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not result index (%ld)", id); RETURN_FALSE; }
-#define PHP_BIRDSTEP_CHK_LNK(id) if (!(conn = birdstep_find_conn(list, id))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not connection index (%ld)", id); RETURN_FALSE; }
+#define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not result index (%ld)", id); RETURN_FALSE; }
+#define PHP_BIRDSTEP_CHK_LNK(id) if (!(conn = birdstep_find_conn(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not connection index (%ld)", id); RETURN_FALSE; }
-static void _close_birdstep_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_birdstep_link(zend_rsrc_list_entry *rsrc)
{
VConn *conn = (VConn *)rsrc->ptr;
@@ -172,7 +172,7 @@ static void _close_birdstep_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}
-static void _free_birdstep_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_birdstep_result(zend_rsrc_list_entry *rsrc)
{
Vresult *res = (Vresult *)rsrc->ptr;
@@ -224,11 +224,11 @@ PHP_MSHUTDOWN_FUNCTION(birdstep)
/* Some internal functions. Connections and result manupulate */
-static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc TSRMLS_DC)
+static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc)
{
int ind;
- ind = zend_list_insert(conn,php_birdstep_module.le_link TSRMLS_CC);
+ ind = zend_list_insert(conn,php_birdstep_module.le_link);
conn->hdbc = hdbc;
conn->index = ind;
@@ -293,28 +293,28 @@ PHP_FUNCTION(birdstep_connect)
VConn *new;
zend_long ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &serv, &serv_len, &user, &user_len, &pass, &pass_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &serv, &serv_len, &user, &user_len, &pass, &pass_len) == FAILURE) {
return;
}
if ( php_birdstep_module.max_links != -1 && php_birdstep_module.num_links == php_birdstep_module.max_links ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links);
RETURN_FALSE;
}
stat = SQLAllocConnect(henv,&hdbc);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not allocate connection handle");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Could not allocate connection handle");
RETURN_FALSE;
}
stat = SQLConnect(hdbc, serv, SQL_NTS, user, SQL_NTS, pass, SQL_NTS);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s", serv, user);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s", serv, user);
SQLFreeConnect(hdbc);
RETURN_FALSE;
}
new = (VConn *)emalloc(sizeof(VConn));
- ind = birdstep_add_conn(list,new,hdbc TSRMLS_CC);
+ ind = birdstep_add_conn(list,new,hdbc);
php_birdstep_module.num_links++;
RETURN_LONG(ind);
}
@@ -327,7 +327,7 @@ PHP_FUNCTION(birdstep_close)
zend_long id;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -354,7 +354,7 @@ PHP_FUNCTION(birdstep_exec)
SWORD cols,i,colnamelen;
SDWORD rows,coldesc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &ind, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &ind, &query, &query_len) == FAILURE) {
return;
}
@@ -363,13 +363,13 @@ PHP_FUNCTION(birdstep_exec)
res = (Vresult *)emalloc(sizeof(Vresult));
stat = SQLAllocStmt(conn->hdbc,&res->hstmt);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat);
efree(res);
RETURN_FALSE;
}
stat = SQLExecDirect(res->hstmt,query,SQL_NTS);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Cannot execute \"%s\" query",query);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Cannot execute \"%s\" query",query);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -377,7 +377,7 @@ PHP_FUNCTION(birdstep_exec)
/* Success query */
stat = SQLNumResultCols(res->hstmt,&cols);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -385,7 +385,7 @@ PHP_FUNCTION(birdstep_exec)
if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */
stat = SQLRowCount(res->hstmt,&rows);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -432,7 +432,7 @@ PHP_FUNCTION(birdstep_fetch)
UDWORD row;
UWORD RowStat[1];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
@@ -445,7 +445,7 @@ PHP_FUNCTION(birdstep_fetch)
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -469,7 +469,7 @@ PHP_FUNCTION(birdstep_result)
SWORD indx = -1;
char *field = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lZ", &ind, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lZ", &ind, &col) == FAILURE) {
return;
}
@@ -489,12 +489,12 @@ PHP_FUNCTION(birdstep_result)
}
}
if ( indx < 0 ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found",field);
+ php_error_docref(NULL, E_WARNING, "Field %s not found",field);
RETURN_FALSE;
}
} else {
if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
RETURN_FALSE;
}
}
@@ -506,7 +506,7 @@ PHP_FUNCTION(birdstep_result)
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -531,7 +531,7 @@ l1:
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLGetData return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLGetData return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -556,7 +556,7 @@ PHP_FUNCTION(birdstep_freeresult)
zend_long ind;
Vresult *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
@@ -576,7 +576,7 @@ PHP_FUNCTION(birdstep_autocommit)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -584,7 +584,7 @@ PHP_FUNCTION(birdstep_autocommit)
stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_on option failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_on option failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -599,7 +599,7 @@ PHP_FUNCTION(birdstep_off_autocommit)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -607,7 +607,7 @@ PHP_FUNCTION(birdstep_off_autocommit)
stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_off option failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_off option failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -622,7 +622,7 @@ zend_long
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -630,7 +630,7 @@ zend_long
stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Commit failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Commit failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -645,7 +645,7 @@ PHP_FUNCTION(birdstep_rollback)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -653,7 +653,7 @@ PHP_FUNCTION(birdstep_rollback)
stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Rollback failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Rollback failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -668,7 +668,7 @@ PHP_FUNCTION(birdstep_fieldname)
Vresult *res;
SWORD indx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &ind, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &ind, &col) == FAILURE) {
return;
}
@@ -676,7 +676,7 @@ PHP_FUNCTION(birdstep_fieldname)
indx = col;
if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
RETURN_FALSE;
}
RETURN_STRING(res->values[indx].name,TRUE);
@@ -690,7 +690,7 @@ PHP_FUNCTION(birdstep_fieldnum)
zend_long ind;
Vresult *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 594a37383e..238f89233e 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -416,7 +416,7 @@ ZEND_GET_MODULE(odbc)
/* {{{ _free_odbc_result
*/
-static void _free_odbc_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_odbc_result(zend_resource *rsrc)
{
odbc_result *res = (odbc_result *)rsrc->ptr;
int i;
@@ -465,7 +465,7 @@ static void safe_odbc_disconnect( void *handle )
/* {{{ _close_odbc_conn
*/
-static void _close_odbc_conn(zend_resource *rsrc TSRMLS_DC)
+static void _close_odbc_conn(zend_resource *rsrc)
{
zend_resource *p;
odbc_result *res;
@@ -491,7 +491,7 @@ static void _close_odbc_conn(zend_resource *rsrc TSRMLS_DC)
/* {{{ void _close_odbc_pconn
*/
-static void _close_odbc_pconn(zend_resource *rsrc TSRMLS_DC)
+static void _close_odbc_pconn(zend_resource *rsrc)
{
zend_resource *p;
odbc_result *res;
@@ -521,7 +521,6 @@ static void _close_odbc_pconn(zend_resource *rsrc TSRMLS_DC)
static PHP_INI_DISP(display_link_nums)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -546,7 +545,6 @@ static PHP_INI_DISP(display_link_nums)
static PHP_INI_DISP(display_defPW)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -577,7 +575,6 @@ static PHP_INI_DISP(display_defPW)
static PHP_INI_DISP(display_binmode)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -608,7 +605,6 @@ static PHP_INI_DISP(display_binmode)
static PHP_INI_DISP(display_lrl)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -634,7 +630,6 @@ static PHP_INI_DISP(display_lrl)
static PHP_INI_DISP(display_cursortype)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -868,7 +863,6 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
RETCODE rc;
ODBC_SQL_ENV_T henv;
ODBC_SQL_CONN_T conn;
- TSRMLS_FETCH();
if (conn_resource) {
henv = conn_resource->henv;
@@ -895,9 +889,9 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
memcpy(ODBCG(laststate), state, sizeof(state));
memcpy(ODBCG(lasterrormsg), errormsg, sizeof(errormsg));
if (func) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
}
/*
} while (SQL_SUCCEEDED(rc));
@@ -913,7 +907,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
zval *pv_res;
zend_long flag;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &flag) == FAILURE) {
return;
}
@@ -936,7 +930,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
/* }}} */
/* {{{ odbc_bindcols */
-int odbc_bindcols(odbc_result *result TSRMLS_DC)
+int odbc_bindcols(odbc_result *result)
{
RETCODE rc;
int i;
@@ -1019,7 +1013,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
RETCODE rc;
zval *pv_conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_conn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_conn) == FAILURE) {
return;
}
@@ -1036,7 +1030,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
/* }}} */
/* {{{ _close_pconn_with_res */
-static int _close_pconn_with_res(zend_resource *le, zend_resource *res TSRMLS_DC)
+static int _close_pconn_with_res(zend_resource *le, zend_resource *res)
{
if (le->type == le_pconn && (((odbc_connection *)(le->ptr))->res == res)){
return 1;
@@ -1064,24 +1058,24 @@ void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -1119,7 +1113,7 @@ PHP_FUNCTION(odbc_close_all)
zend_list_close(p);
/* Delete the persistent connection */
zend_hash_apply_with_argument(&EG(persistent_list),
- (apply_func_arg_t) _close_pconn_with_res, (void *)p TSRMLS_CC);
+ (apply_func_arg_t) _close_pconn_with_res, (void *)p);
}
}
} ZEND_HASH_FOREACH_END();
@@ -1156,7 +1150,7 @@ PHP_FUNCTION(odbc_prepare)
SQLUINTEGER scrollopts;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pv_conn, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pv_conn, &query, &query_len) == FAILURE) {
return;
}
@@ -1169,7 +1163,7 @@ PHP_FUNCTION(odbc_prepare)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -1211,7 +1205,7 @@ PHP_FUNCTION(odbc_prepare)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -1250,7 +1244,7 @@ PHP_FUNCTION(odbc_execute)
numArgs = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|a", &pv_res, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|a", &pv_res, &pv_param_arr) == FAILURE) {
return;
}
@@ -1258,13 +1252,13 @@ PHP_FUNCTION(odbc_execute)
/* XXX check for already bound parameters*/
if (result->numparams > 0 && numArgs == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No parameters to SQL statement given");
+ php_error_docref(NULL, E_WARNING, "No parameters to SQL statement given");
RETURN_FALSE;
}
if (result->numparams > 0) {
if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams);
+ php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams);
RETURN_FALSE;
}
@@ -1276,7 +1270,7 @@ PHP_FUNCTION(odbc_execute)
for(i = 1; i <= result->numparams; i++) {
if ((tmp = zend_hash_get_current_data(Z_ARRVAL_P(pv_param_arr))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ php_error_docref(NULL, E_WARNING,"Error getting parameter");
SQLFreeStmt(result->stmt,SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1290,7 +1284,7 @@ PHP_FUNCTION(odbc_execute)
otype = Z_TYPE_P(tmp);
convert_to_string_ex(tmp);
if (Z_TYPE_P(tmp) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1333,7 +1327,7 @@ PHP_FUNCTION(odbc_execute)
filename[strlen(filename)] = '\0';
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
efree(filename);
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
@@ -1346,7 +1340,7 @@ PHP_FUNCTION(odbc_execute)
}
if ((params[i-1].fp = open(filename,O_RDONLY)) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't open file %s", filename);
+ php_error_docref(NULL, E_WARNING,"Can't open file %s", filename);
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1446,7 +1440,7 @@ PHP_FUNCTION(odbc_execute)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
@@ -1468,7 +1462,7 @@ PHP_FUNCTION(odbc_cursor)
odbc_result *result;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
@@ -1500,7 +1494,7 @@ PHP_FUNCTION(odbc_cursor)
RETVAL_STRING(cursorname);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
RETVAL_FALSE;
}
} else {
@@ -1525,14 +1519,14 @@ PHP_FUNCTION(odbc_data_source)
UCHAR server_name[100], desc[200];
SQLSMALLINT len1=0, len2=0, fetch_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zv_conn, &zv_fetch_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zv_conn, &zv_fetch_type) == FAILURE) {
return;
}
fetch_type = (SQLSMALLINT) zv_fetch_type;
if (!(fetch_type == SQL_FETCH_FIRST || fetch_type == SQL_FETCH_NEXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fetch type (%d)", fetch_type);
+ php_error_docref(NULL, E_WARNING, "Invalid fetch type (%d)", fetch_type);
RETURN_FALSE;
}
@@ -1586,7 +1580,7 @@ PHP_FUNCTION(odbc_exec)
numArgs = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pv_conn, &query, &query_len, &pv_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &pv_conn, &query, &query_len, &pv_flags) == FAILURE) {
return;
}
@@ -1596,7 +1590,7 @@ PHP_FUNCTION(odbc_exec)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
efree(result);
RETURN_FALSE;
}
@@ -1638,7 +1632,7 @@ PHP_FUNCTION(odbc_exec)
/* For insert, update etc. cols == 0 */
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -1671,7 +1665,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
zval *pv_res, tmp;
zend_long pv_row = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_res, &pv_row) == FAILURE) {
return;
}
@@ -1679,7 +1673,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
#else
zval *pv_res, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
#endif
@@ -1687,7 +1681,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -1823,13 +1817,13 @@ PHP_FUNCTION(odbc_fetch_into)
#endif /* HAVE_SQL_EXTENDED_FETCH */
#ifdef HAVE_SQL_EXTENDED_FETCH
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|l", &pv_res, &pv_res_arr, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|l", &pv_res, &pv_res_arr, &pv_row) == FAILURE) {
return;
}
rownum = pv_row;
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/", &pv_res, &pv_res_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/", &pv_res, &pv_res_arr) == FAILURE) {
return;
}
#endif /* HAVE_SQL_EXTENDED_FETCH */
@@ -1837,7 +1831,7 @@ PHP_FUNCTION(odbc_fetch_into)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -1933,13 +1927,13 @@ PHP_FUNCTION(solid_fetch_prev)
RETCODE rc;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
rc = SQLFetchPrev(result->stmt);
@@ -1971,7 +1965,7 @@ PHP_FUNCTION(odbc_fetch_row)
SQLUSMALLINT RowStatus[1];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_res, &pv_row) == FAILURE) {
return;
}
@@ -1980,7 +1974,7 @@ PHP_FUNCTION(odbc_fetch_row)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -2029,7 +2023,7 @@ PHP_FUNCTION(odbc_result)
field_ind = -1;
field = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pv_res, &pv_field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pv_res, &pv_field) == FAILURE) {
return;
}
@@ -2043,14 +2037,14 @@ PHP_FUNCTION(odbc_result)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if ((result->numcols == 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
/* get field index if the field parameter was a string */
if (field != NULL) {
if (result->values == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set contains no data");
+ php_error_docref(NULL, E_WARNING, "Result set contains no data");
RETURN_FALSE;
}
@@ -2062,13 +2056,13 @@ PHP_FUNCTION(odbc_result)
}
if (field_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found", field);
+ php_error_docref(NULL, E_WARNING, "Field %s not found", field);
RETURN_FALSE;
}
} else {
/* check for limits of field_ind if the field parameter was an int */
if (field_ind >= result->numcols || field_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index is larger than the number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index is larger than the number of fields");
RETURN_FALSE;
}
}
@@ -2213,14 +2207,14 @@ PHP_FUNCTION(odbc_result_all)
SQLUSMALLINT RowStatus[1];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s", &pv_res, &pv_format, &pv_format_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s", &pv_res, &pv_format, &pv_format_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
#ifdef HAVE_SQL_EXTENDED_FETCH
@@ -2328,7 +2322,7 @@ PHP_FUNCTION(odbc_free_result)
odbc_result *result;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
@@ -2366,7 +2360,7 @@ PHP_FUNCTION(odbc_pconnect)
/* }}} */
/* {{{ odbc_sqlconnect */
-int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int cur_opt, int persistent TSRMLS_DC)
+int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int cur_opt, int persistent)
{
RETCODE rc;
@@ -2510,7 +2504,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* Now an optional 4th parameter specifying the cursor type
* defaulting to the cursors default
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &db, &db_len, &uid, &uid_len, &pwd, &pwd_len, &pv_opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|l", &db, &db_len, &uid, &uid_len, &pwd, &pwd_len, &pv_opt) == FAILURE) {
return;
}
@@ -2522,7 +2516,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
cur_opt == SQL_CUR_USE_ODBC ||
cur_opt == SQL_CUR_USE_DRIVER ||
cur_opt == SQL_CUR_DEFAULT) ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Cursor type (%d)", cur_opt);
+ php_error_docref(NULL, E_WARNING, "Invalid Cursor type (%d)", cur_opt);
RETURN_FALSE;
}
}
@@ -2550,17 +2544,17 @@ try_and_get_another_connection:
zend_resource new_le;
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (ODBCG(max_persistent) != -1 && ODBCG(num_persistent) >= ODBCG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open persistent links (%ld)", ODBCG(num_persistent));
+ php_error_docref(NULL, E_WARNING,"Too many open persistent links (%ld)", ODBCG(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
- if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 1 TSRMLS_CC)) {
+ if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 1)) {
efree(hashed_details);
RETURN_FALSE;
}
@@ -2635,12 +2629,12 @@ try_and_get_another_connection:
}
}
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links));
+ php_error_docref(NULL, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
- if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0 TSRMLS_CC)) {
+ if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0)) {
efree(hashed_details);
RETURN_FALSE;
}
@@ -2671,11 +2665,11 @@ PHP_FUNCTION(odbc_close)
int is_pconn = 0;
int found_resource_type = le_conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_conn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_conn) == FAILURE) {
return;
}
- conn = (odbc_connection *) zend_fetch_resource(pv_conn TSRMLS_CC, -1, "ODBC-Link", &found_resource_type, 2, le_conn, le_pconn);
+ conn = (odbc_connection *) zend_fetch_resource(pv_conn, -1, "ODBC-Link", &found_resource_type, 2, le_conn, le_pconn);
if (found_resource_type==le_pconn) {
is_pconn = 1;
}
@@ -2692,7 +2686,7 @@ PHP_FUNCTION(odbc_close)
zend_list_close(Z_RES_P(pv_conn));
if(is_pconn){
- zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _close_pconn_with_res, (void *) Z_RES_P(pv_conn) TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _close_pconn_with_res, (void *) Z_RES_P(pv_conn));
}
}
/* }}} */
@@ -2705,7 +2699,7 @@ PHP_FUNCTION(odbc_num_rows)
SQLLEN rows;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2723,7 +2717,7 @@ PHP_FUNCTION(odbc_next_result)
zval *pv_res;
int rc, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2746,7 +2740,7 @@ PHP_FUNCTION(odbc_next_result)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
@@ -2771,7 +2765,7 @@ PHP_FUNCTION(odbc_num_fields)
odbc_result *result;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2787,24 +2781,24 @@ PHP_FUNCTION(odbc_field_name)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -2822,24 +2816,24 @@ PHP_FUNCTION(odbc_field_type)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -2873,14 +2867,14 @@ PHP_FUNCTION(odbc_field_num)
odbc_result *result;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pv_res, &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pv_res, &fname, &fname_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -2908,7 +2902,7 @@ PHP_FUNCTION(odbc_autocommit)
zval *pv_conn;
zend_long pv_onoff = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, &pv_onoff) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_conn, &pv_onoff) == FAILURE) {
return;
}
@@ -2958,7 +2952,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_string *ptr;
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &pv_handle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pv_handle) == FAILURE) {
return;
}
@@ -3020,7 +3014,7 @@ PHP_FUNCTION(odbc_setoption)
zval *pv_handle;
zend_long pv_which, pv_opt, pv_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &pv_handle, &pv_which, &pv_opt, &pv_val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &pv_handle, &pv_which, &pv_opt, &pv_val) == FAILURE) {
return;
}
@@ -3029,7 +3023,7 @@ PHP_FUNCTION(odbc_setoption)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn);
if (conn->persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set option for persistent connection");
+ php_error_docref(NULL, E_WARNING, "Unable to set option for persistent connection");
RETURN_FALSE;
}
rc = SQLSetConnectOption(conn->hdbc, (unsigned short) pv_opt, pv_val);
@@ -3049,7 +3043,7 @@ PHP_FUNCTION(odbc_setoption)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option type");
+ php_error_docref(NULL, E_WARNING, "Unknown option type");
RETURN_FALSE;
break;
}
@@ -3073,7 +3067,7 @@ PHP_FUNCTION(odbc_tables)
size_t cat_len = 0, schema_len = 0, table_len = 0, type_len = 0;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &type, &type_len) == FAILURE) {
return;
}
@@ -3085,7 +3079,7 @@ PHP_FUNCTION(odbc_tables)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3116,7 +3110,7 @@ PHP_FUNCTION(odbc_tables)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3140,7 +3134,7 @@ PHP_FUNCTION(odbc_columns)
int cat_len = 0, schema_len = 0, table_len = 0, column_len = 0;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &column, &column_len) == FAILURE) {
return;
}
@@ -3152,7 +3146,7 @@ PHP_FUNCTION(odbc_columns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3185,7 +3179,7 @@ PHP_FUNCTION(odbc_columns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3210,7 +3204,7 @@ PHP_FUNCTION(odbc_columnprivileges)
int cat_len = 0, schema_len, table_len, column_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &column, &column_len) == FAILURE) {
return;
}
@@ -3222,7 +3216,7 @@ PHP_FUNCTION(odbc_columnprivileges)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3248,7 +3242,7 @@ PHP_FUNCTION(odbc_columnprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3274,7 +3268,7 @@ PHP_FUNCTION(odbc_foreignkeys)
size_t pcat_len = 0, pschema_len, ptable_len, fcat_len, fschema_len, ftable_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sssss", &pv_conn, &pcat, &pcat_len, &pschema, &pschema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!sssss", &pv_conn, &pcat, &pcat_len, &pschema, &pschema_len,
&ptable, &ptable_len, &fcat, &fcat_len, &fschema, &fschema_len, &ftable, &ftable_len) == FAILURE) {
return;
}
@@ -3298,7 +3292,7 @@ PHP_FUNCTION(odbc_foreignkeys)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3326,7 +3320,7 @@ PHP_FUNCTION(odbc_foreignkeys)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3351,7 +3345,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
RETCODE rc;
SQLSMALLINT data_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, &pv_data_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_conn, &pv_data_type) == FAILURE) {
return;
}
@@ -3364,7 +3358,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3386,7 +3380,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3410,7 +3404,7 @@ PHP_FUNCTION(odbc_primarykeys)
int cat_len = 0, schema_len, table_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
return;
}
@@ -3421,7 +3415,7 @@ PHP_FUNCTION(odbc_primarykeys)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3446,7 +3440,7 @@ PHP_FUNCTION(odbc_primarykeys)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3475,7 +3469,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&proc, &proc_len, &col, &col_len) == FAILURE) {
return;
}
@@ -3487,7 +3481,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3513,7 +3507,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3543,7 +3537,7 @@ PHP_FUNCTION(odbc_procedures)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) {
return;
}
@@ -3554,7 +3548,7 @@ PHP_FUNCTION(odbc_procedures)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3579,7 +3573,7 @@ PHP_FUNCTION(odbc_procedures)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3606,7 +3600,7 @@ PHP_FUNCTION(odbc_specialcolumns)
SQLUSMALLINT type, scope, nullable;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len,
&name, &name_len, &vscope, &vnullable) == FAILURE) {
return;
}
@@ -3622,7 +3616,7 @@ PHP_FUNCTION(odbc_specialcolumns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3650,7 +3644,7 @@ PHP_FUNCTION(odbc_specialcolumns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3676,7 +3670,7 @@ PHP_FUNCTION(odbc_statistics)
SQLUSMALLINT unique, reserved;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ssll", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ssll", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&name, &name_len, &vunique, &vreserved) == FAILURE) {
return;
}
@@ -3691,7 +3685,7 @@ PHP_FUNCTION(odbc_statistics)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3718,7 +3712,7 @@ PHP_FUNCTION(odbc_statistics)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3743,7 +3737,7 @@ PHP_FUNCTION(odbc_tableprivileges)
int cat_len = 0, schema_len, table_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
return;
}
@@ -3754,7 +3748,7 @@ PHP_FUNCTION(odbc_tableprivileges)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3779,7 +3773,7 @@ PHP_FUNCTION(odbc_tableprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 6a7e5c3756..e5c55fec71 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -279,7 +279,7 @@ void odbc_del_result(HashTable *list, int count);
int odbc_add_conn(HashTable *list, HDBC conn);
odbc_connection *odbc_get_conn(HashTable *list, int count);
void odbc_del_conn(HashTable *list, int ind);
-int odbc_bindcols(odbc_result *result TSRMLS_DC);
+int odbc_bindcols(odbc_result *result);
#define ODBC_SQL_ERROR_PARAMS odbc_connection *conn_resource, ODBC_SQL_STMT_T stmt, char *func
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 6f3f1310a0..49ca397316 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -30,7 +30,7 @@
#define DEBUG_BLOCKPASS 0
/* Checks if a constant (like "true") may be replaced by its value */
-int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy TSRMLS_DC)
+int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy)
{
zend_constant *c;
char *lookup_name;
@@ -585,7 +585,7 @@ static void strip_nop(zend_code_block *block, zend_optimizer_ctx *ctx)
block->len = new_end - block->start_opline;
}
-static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, char *used_ext, zend_cfg *cfg, zend_optimizer_ctx *ctx TSRMLS_DC)
+static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, char *used_ext, zend_cfg *cfg, zend_optimizer_ctx *ctx)
{
zend_op *opline = block->start_opline;
zend_op *end, *last_op = NULL;
@@ -626,7 +626,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval c = ZEND_OP1_LITERAL(src);
VAR_UNSET(opline->op1);
zval_copy_ctor(&c);
- zend_optimizer_update_op1_const(op_array, opline, &c TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &c);
literal_dtor(&ZEND_OP1_LITERAL(src));
MAKE_NOP(src);
}
@@ -640,7 +640,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval c = ZEND_OP1_LITERAL(src);
VAR_UNSET(opline->op2);
zval_copy_ctor(&c);
- zend_optimizer_update_op2_const(op_array, opline, &c TSRMLS_CC);
+ zend_optimizer_update_op2_const(op_array, opline, &c);
literal_dtor(&ZEND_OP1_LITERAL(src));
MAKE_NOP(src);
}
@@ -720,7 +720,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
int flen = FUNCTION_CACHE->funcs[Z_LVAL(ZEND_OP1_LITERAL(fcall))].name_len;
if(flen == sizeof("defined")-1 && zend_binary_strcasecmp(fname, flen, "defined", sizeof("defined")-1) == 0) {
zval c;
- if(zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, 0 TSRMLS_CC ELS_CC) != 0) {
+ if(zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, 0 ELS_CC) != 0) {
literal_dtor(arg);
MAKE_NOP(sv);
MAKE_NOP(fcall);
@@ -740,11 +740,11 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
}
} else if(flen == sizeof("constant")-1 && zend_binary_strcasecmp(fname, flen, "constant", sizeof("constant")-1) == 0) {
zval c;
- if(zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, 1 TSRMLS_CC ELS_CC) != 0) {
+ if(zend_optimizer_get_persistent_constant(Z_STR_P(arg), &c, 1 ELS_CC) != 0) {
literal_dtor(arg);
MAKE_NOP(sv);
MAKE_NOP(fcall);
- ZEND_OP1_LITERAL(opline) = zend_optimizer_add_literal(op_array, &c TSRMLS_CC);
+ ZEND_OP1_LITERAL(opline) = zend_optimizer_add_literal(op_array, &c);
/* no copy ctor - get already copied it */
ZEND_OP1_TYPE(opline) = IS_CONST;
}
@@ -923,7 +923,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
memcpy(Z_STRVAL(ZEND_OP1_LITERAL(last_op)) + old_len, Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)));
Z_STRVAL(ZEND_OP1_LITERAL(last_op))[l] = '\0';
zval_dtor(&ZEND_OP1_LITERAL(opline));
- Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)) TSRMLS_CC);
+ Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)));
if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP1_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
@@ -967,7 +967,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
memcpy(Z_STRVAL(ZEND_OP2_LITERAL(src)) + old_len, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)));
Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0';
zend_string_release(Z_STR(ZEND_OP2_LITERAL(opline)));
- Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)) TSRMLS_CC);
+ Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)));
if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP2_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
@@ -1004,7 +1004,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
ZEND_OP1_TYPE(opline)==IS_CONST &&
ZEND_OP2_TYPE(opline)==IS_CONST) {
/* evaluate constant expressions */
- int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode);
+ int (*binary_op)(zval *result, zval *op1, zval *op2) = get_binary_op(opline->opcode);
zval result;
int er;
@@ -1021,12 +1021,12 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
}
er = EG(error_reporting);
EG(error_reporting) = 0;
- if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline) TSRMLS_CC) == SUCCESS) {
+ if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline)) == SUCCESS) {
literal_dtor(&ZEND_OP1_LITERAL(opline));
literal_dtor(&ZEND_OP2_LITERAL(opline));
opline->opcode = ZEND_QM_ASSIGN;
SET_UNUSED(opline->op2);
- zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &result);
}
EG(error_reporting) = er;
} else if ((opline->opcode == ZEND_BOOL ||
@@ -1037,7 +1037,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval result;
if (unary_op) {
- unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ unary_op(&result, &ZEND_OP1_LITERAL(opline));
literal_dtor(&ZEND_OP1_LITERAL(opline));
} else {
/* BOOL */
@@ -1046,7 +1046,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
ZVAL_NULL(&ZEND_OP1_LITERAL(opline));
}
opline->opcode = ZEND_QM_ASSIGN;
- zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &result);
} else if ((opline->opcode == ZEND_RETURN || opline->opcode == ZEND_EXIT) &&
(ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op1) &&
@@ -1251,7 +1251,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
}
}
-static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_array, zend_code_block *blocks, zend_cfg *cfg, zend_optimizer_ctx *ctx TSRMLS_DC)
+static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_array, zend_code_block *blocks, zend_cfg *cfg, zend_optimizer_ctx *ctx)
{
/* last_op is the last opcode of the current block */
zend_op *last_op = (block->start_opline + block->len - 1);
@@ -1293,7 +1293,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
zval zv = ZEND_OP1_LITERAL(last_op);
zval_copy_ctor(&zv);
- last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv TSRMLS_CC);
+ last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv);
}
del_source(block, block->op1_to);
if (block->op1_to->op2_to) {
@@ -1319,7 +1319,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
zval zv = ZEND_OP1_LITERAL(last_op);
zval_copy_ctor(&zv);
- last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv TSRMLS_CC);
+ last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv);
}
del_source(block, block->op1_to);
block->op1_to = NULL;
@@ -1384,7 +1384,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
case ZEND_JMPNZ:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
if (last_op->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -1528,7 +1528,7 @@ next_target:
case ZEND_JMPZ_EX:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
if (last_op->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
@@ -1641,7 +1641,7 @@ next_target_ex:
}
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) {
+ if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) {
/* JMPZNZ(false,L1,L2) -> JMP(L1) */
zend_code_block *todel;
@@ -1908,7 +1908,7 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, char *
#define PASSES 3
-void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_cfg cfg;
zend_code_block *cur_block;
@@ -1953,7 +1953,7 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
if (!cur_block->access) {
continue;
}
- zend_optimize_block(cur_block, op_array, usage, &cfg, ctx TSRMLS_CC);
+ zend_optimize_block(cur_block, op_array, usage, &cfg, ctx);
}
/* Jump optimization for each block */
@@ -1961,7 +1961,7 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
if (!cur_block->access) {
continue;
}
- zend_jmp_optimization(cur_block, op_array, cfg.blocks, &cfg, ctx TSRMLS_CC);
+ zend_jmp_optimization(cur_block, op_array, cfg.blocks, &cfg, ctx);
}
/* Eliminate unreachable basic blocks */
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 8fb5a9b0c9..0dee9d6146 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -114,7 +114,7 @@ static void optimizer_literal_class_info(literal_info *info,
}
}
-void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_op *opline, *end;
int i, j, n, *map, cache_slots;
@@ -309,7 +309,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
for (i = 0; i < op_array->last_literal; i++) {
zval zv = op_array->literals[i].constant;
- use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv);
fprintf(stderr, "Literal %d, val (%d):%s\n", i, Z_STRLEN(zv), Z_STRVAL(zv));
if (use_copy) {
zval_dtor(&zv);
@@ -490,7 +490,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
for (i = 0; i < op_array->last_literal; i++) {
zval zv = op_array->literals[i].constant;
- use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv);
fprintf(stderr, "Literal %d, val (%d):%s\n", i, Z_STRLEN(zv), Z_STRVAL(zv));
if (use_copy) {
zval_dtor(&zv);
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c
index 5c765cef4e..0fa08b7d32 100644
--- a/ext/opcache/Optimizer/optimize_func_calls.c
+++ b/ext/opcache/Optimizer/optimize_func_calls.c
@@ -38,7 +38,7 @@ typedef struct _optimizer_call_info {
zend_op *opline;
} optimizer_call_info;
-void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_op *opline = op_array->opcodes;
zend_op *end = opline + op_array->last;
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 6eb6a4ce02..819a093600 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -37,7 +37,7 @@
#define ZEND_IS_CONSTANT_TYPE(t) ((t) == IS_CONSTANT)
-void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
int i = 0;
zend_op *opline = op_array->opcodes;
@@ -68,7 +68,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
if (ZEND_OP1_TYPE(opline) == IS_CONST &&
ZEND_OP2_TYPE(opline) == IS_CONST) {
/* binary operation with constant operands */
- int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode);
+ int (*binary_op)(zval *result, zval *op1, zval *op2) = get_binary_op(opline->opcode);
uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */
zval result;
int er;
@@ -82,7 +82,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
er = EG(error_reporting);
EG(error_reporting) = 0;
/* evaluate constant expression */
- if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline) TSRMLS_CC) != SUCCESS) {
+ if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline)) != SUCCESS) {
EG(error_reporting) = er;
break;
}
@@ -91,7 +91,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result);
}
break;
@@ -127,7 +127,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res);
} else if (opline->extended_value == _IS_BOOL) {
/* T = CAST(X, IS_BOOL) => T = BOOL(X) */
opline->opcode = ZEND_BOOL;
@@ -146,7 +146,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
er = EG(error_reporting);
EG(error_reporting) = 0;
- if (unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC) != SUCCESS) {
+ if (unary_op(&result, &ZEND_OP1_LITERAL(opline)) != SUCCESS) {
EG(error_reporting) = er;
break;
}
@@ -154,7 +154,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result);
}
break;
@@ -243,12 +243,12 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
memset(&fake_execute_data, 0, sizeof(zend_execute_data));
fake_execute_data.func = (zend_function*)op_array;
EG(current_execute_data) = &fake_execute_data;
- if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) {
+ if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
uint32_t tv = ZEND_RESULT(opline).var;
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset);
}
EG(current_execute_data) = orig_execute_data;
break;
@@ -261,7 +261,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
uint32_t tv = ZEND_RESULT(opline).var;
zval c;
- if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1 TSRMLS_CC)) {
+ if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1)) {
if (!ctx->constants || !zend_optimizer_get_collected_constant(ctx->constants, &ZEND_OP2_LITERAL(opline), &c)) {
break;
}
@@ -271,7 +271,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c);
}
/* class constant */
@@ -319,7 +319,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
break;
}
if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_P(c))) {
- if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1 TSRMLS_CC) ||
+ if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1) ||
ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {
break;
}
@@ -335,7 +335,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t);
}
}
}
@@ -436,7 +436,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
func->module->type == MODULE_PERSISTENT) {
zval t;
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -471,7 +471,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
}
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -484,10 +484,10 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
"defined", sizeof("defined")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0 TSRMLS_CC)) {
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0)) {
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -501,8 +501,8 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
"constant", sizeof("constant")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1 TSRMLS_CC)) {
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -518,7 +518,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -537,7 +537,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_STR(&t, dirname);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -560,7 +560,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline)));
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t);
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
}
@@ -569,11 +569,11 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
{
zval c;
uint32_t tv = ZEND_RESULT(opline).var;
- if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0 TSRMLS_CC)) {
+ if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0)) {
break;
}
ZVAL_TRUE(&c);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c);
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
}
diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c
index 859bc2f3bc..4c839edf5a 100644
--- a/ext/opcache/Optimizer/pass2.c
+++ b/ext/opcache/Optimizer/pass2.c
@@ -33,7 +33,7 @@
#include "zend_execute.h"
#include "zend_vm.h"
-void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
+void zend_optimizer_pass2(zend_op_array *op_array)
{
zend_op *opline;
zend_op *end = op_array->opcodes + op_array->last;
@@ -47,7 +47,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_DIV:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
- convert_scalar_to_number(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ convert_scalar_to_number(&ZEND_OP1_LITERAL(opline));
}
}
/* break missing *intentionally* - the assign_op's may only optimize op2 */
@@ -61,7 +61,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
}
if (ZEND_OP2_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
- convert_scalar_to_number(&ZEND_OP2_LITERAL(opline) TSRMLS_CC);
+ convert_scalar_to_number(&ZEND_OP2_LITERAL(opline));
}
}
break;
@@ -119,7 +119,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
/* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C)
in case we know it wouldn't jump */
} else if (ZEND_OP1_TYPE(opline) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
if (opline->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -133,7 +133,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMPZ:
case ZEND_JMPNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
if (opline->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -169,7 +169,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMPZNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
int opline_num;
- if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) {
+ if (zend_is_true(&ZEND_OP1_LITERAL(opline))) {
opline_num = opline->extended_value; /* JMPNZ */
} else {
opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */
diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c
index 8d8cb50580..8a4646a595 100644
--- a/ext/opcache/Optimizer/pass3.c
+++ b/ext/opcache/Optimizer/pass3.c
@@ -53,7 +53,7 @@
} \
jmp_hitlist[jmp_hitlist_count++] = ZEND_OP2(&op_array->opcodes[target]).opline_num;
-void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC)
+void zend_optimizer_pass3(zend_op_array *op_array)
{
zend_op *opline;
zend_op *end = op_array->opcodes + op_array->last;
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index a36b6584b3..229831231e 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -99,7 +99,7 @@ int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name)
return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
-int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC)
+int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv)
{
int i = op_array->last_literal;
op_array->last_literal++;
@@ -113,7 +113,7 @@ int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC)
void zend_optimizer_update_op1_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC)
+ zval *val)
{
if (opline->opcode == ZEND_FREE) {
MAKE_NOP(opline);
@@ -127,37 +127,37 @@ void zend_optimizer_update_op1_const(zend_op_array *op_array,
case ZEND_FETCH_CONSTANT:
case ZEND_DEFINED:
case ZEND_NEW:
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline)));
Z_CACHE_SLOT(op_array->literals[opline->op1.constant]) = op_array->last_cache_slot++;
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op1.constant+1]));
break;
default:
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline)));
break;
}
} else {
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
}
}
}
void zend_optimizer_update_op2_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC)
+ zval *val)
{
ZEND_OP2_TYPE(opline) = IS_CONST;
if (opline->opcode == ZEND_INIT_FCALL) {
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- opline->op2.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op2.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline)));
Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = op_array->last_cache_slot++;
return;
}
- opline->op2.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op2.constant = zend_optimizer_add_literal(op_array, val);
if (Z_TYPE_P(val) == IS_STRING) {
zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline)));
switch (opline->opcode) {
@@ -177,13 +177,13 @@ void zend_optimizer_update_op2_const(zend_op_array *op_array,
case ZEND_INSTANCEOF:
Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = op_array->last_cache_slot++;
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op2.constant+1]));
break;
case ZEND_INIT_METHOD_CALL:
case ZEND_INIT_STATIC_METHOD_CALL:
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op2.constant+1]));
/* break missing intentionally */
/*case ZEND_FETCH_CONSTANT:*/
@@ -268,7 +268,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
zend_op *opline,
zend_uchar type,
uint32_t var,
- zval *val TSRMLS_DC)
+ zval *val)
{
zend_op *end = op_array->opcodes + op_array->last;
@@ -313,7 +313,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
zval old_val;
ZVAL_COPY_VALUE(&old_val, val);
zval_copy_ctor(val);
- zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, val);
ZVAL_COPY_VALUE(val, &old_val);
opline++;
continue;
@@ -325,7 +325,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
default:
break;
}
- zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, val);
break;
}
@@ -337,7 +337,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
default:
break;
}
- zend_optimizer_update_op2_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op2_const(op_array, opline, val);
break;
}
opline++;
@@ -347,7 +347,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
}
static void zend_optimize(zend_op_array *op_array,
- zend_optimizer_ctx *ctx TSRMLS_DC)
+ zend_optimizer_ctx *ctx)
{
if (op_array->type == ZEND_EVAL_CODE) {
return;
@@ -360,7 +360,7 @@ static void zend_optimize(zend_op_array *op_array,
* - convert CAST(IS_BOOL,x) into BOOL(x)
*/
if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass1(op_array, ctx TSRMLS_CC);
+ zend_optimizer_pass1(op_array, ctx);
}
/* pass 2:
@@ -370,7 +370,7 @@ static void zend_optimize(zend_op_array *op_array,
* - pre-evaluate constant function calls
*/
if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass2(op_array TSRMLS_CC);
+ zend_optimizer_pass2(op_array);
}
/* pass 3:
@@ -379,21 +379,21 @@ static void zend_optimize(zend_op_array *op_array,
* - change $i++ to ++$i where possible
*/
if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass3(op_array TSRMLS_CC);
+ zend_optimizer_pass3(op_array);
}
/* pass 4:
* - INIT_FCALL_BY_NAME -> DO_FCALL
*/
if (ZEND_OPTIMIZER_PASS_4 & OPTIMIZATION_LEVEL) {
- optimize_func_calls(op_array, ctx TSRMLS_CC);
+ optimize_func_calls(op_array, ctx);
}
/* pass 5:
* - CFG optimization
*/
if (ZEND_OPTIMIZER_PASS_5 & OPTIMIZATION_LEVEL) {
- optimize_cfg(op_array, ctx TSRMLS_CC);
+ optimize_cfg(op_array, ctx);
}
/* pass 9:
@@ -414,12 +414,12 @@ static void zend_optimize(zend_op_array *op_array,
* - Compact literals table
*/
if (ZEND_OPTIMIZER_PASS_11 & OPTIMIZATION_LEVEL) {
- zend_optimizer_compact_literals(op_array, ctx TSRMLS_CC);
+ zend_optimizer_compact_literals(op_array, ctx);
}
}
static void zend_accel_optimize(zend_op_array *op_array,
- zend_optimizer_ctx *ctx TSRMLS_DC)
+ zend_optimizer_ctx *ctx)
{
zend_op *opline, *end;
@@ -459,7 +459,7 @@ static void zend_accel_optimize(zend_op_array *op_array,
}
/* Do actual optimizations */
- zend_optimize(op_array, ctx TSRMLS_CC);
+ zend_optimize(op_array, ctx);
/* Redo pass_two() */
opline = op_array->opcodes;
@@ -498,7 +498,7 @@ static void zend_accel_optimize(zend_op_array *op_array,
}
}
-int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
+int zend_accel_script_optimize(zend_persistent_script *script)
{
uint idx, j;
Bucket *p, *q;
@@ -510,13 +510,13 @@ int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
ctx.script = script;
ctx.constants = NULL;
- zend_accel_optimize(&script->main_op_array, &ctx TSRMLS_CC);
+ 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 TSRMLS_CC);
+ zend_accel_optimize(op_array, &ctx);
}
for (idx = 0; idx < script->class_table.nNumUsed; idx++) {
@@ -528,7 +528,7 @@ int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
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 TSRMLS_CC);
+ 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) {
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index ee44bf671c..5e86ab84e6 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -82,13 +82,13 @@ struct _zend_block_source {
#define LITERAL_LONG(op, val) do { \
zval _c; \
ZVAL_LONG(&_c, val); \
- op.constant = zend_optimizer_add_literal(op_array, &_c TSRMLS_CC); \
+ op.constant = zend_optimizer_add_literal(op_array, &_c); \
} while (0)
#define LITERAL_BOOL(op, val) do { \
zval _c; \
ZVAL_BOOL(&_c, val); \
- op.constant = zend_optimizer_add_literal(op_array, &_c TSRMLS_CC); \
+ op.constant = zend_optimizer_add_literal(op_array, &_c); \
} while (0)
#define literal_dtor(zv) do { \
@@ -101,30 +101,30 @@ struct _zend_block_source {
target = src; \
} while (0)
-int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
-int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy TSRMLS_DC);
+int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv);
+int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy);
void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value);
int zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value);
int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name);
void zend_optimizer_update_op1_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC);
+ zval *val);
void zend_optimizer_update_op2_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC);
+ zval *val);
int zend_optimizer_replace_by_const(zend_op_array *op_array,
zend_op *opline,
zend_uchar type,
uint32_t var,
- zval *val TSRMLS_DC);
+ zval *val);
-void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
-void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC);
-void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC);
-void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
-void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
+void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx);
+void zend_optimizer_pass2(zend_op_array *op_array);
+void zend_optimizer_pass3(zend_op_array *op_array);
+void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx);
+void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx);
void optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_ctx *ctx);
void zend_optimizer_nop_removal(zend_op_array *op_array);
-void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
+void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx);
#endif
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 34b5b47808..5faa9c61c3 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -74,13 +74,13 @@ typedef int gid_t;
#define SHM_PROTECT() \
do { \
if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(1 TSRMLS_CC); \
+ zend_accel_shared_protect(1); \
} \
} while (0)
#define SHM_UNPROTECT() \
do { \
if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(0 TSRMLS_CC); \
+ zend_accel_shared_protect(0); \
} \
} while (0)
@@ -90,6 +90,9 @@ ZEND_EXTENSION();
zend_accel_globals accel_globals;
#else
int accel_globals_id;
+#if defined(COMPILE_DL_OPCACHE)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
#endif
/* Points to the structure shared across all PHP processes */
@@ -100,9 +103,9 @@ zend_bool accel_startup_ok = 0;
static char *zps_failure_reason = NULL;
char *zps_api_failure_reason = NULL;
-static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
-static char *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type);
+static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle );
+static char *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len);
static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
@@ -161,7 +164,7 @@ static ZEND_FUNCTION(accel_chdir)
}
}
-static inline char* accel_getcwd(int *cwd_len TSRMLS_DC)
+static inline char* accel_getcwd(int *cwd_len)
{
if (ZCG(cwd)) {
*cwd_len = ZCG(cwd_len);
@@ -178,10 +181,10 @@ static inline char* accel_getcwd(int *cwd_len TSRMLS_DC)
}
}
-void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC)
+void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason)
{
if ((((double) ZSMMG(wasted_shared_memory)) / ZCG(accel_directives).memory_consumption) >= ZCG(accel_directives).max_wasted_percentage) {
- zend_accel_schedule_restart(reason TSRMLS_CC);
+ zend_accel_schedule_restart(reason);
}
}
@@ -192,7 +195,7 @@ void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason T
*/
static ZEND_INI_MH(accel_include_path_on_modify)
{
- int ret = orig_include_path_on_modify(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ int ret = orig_include_path_on_modify(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
ZCG(include_path_key) = NULL;
if (ret == SUCCESS) {
@@ -207,7 +210,7 @@ static ZEND_INI_MH(accel_include_path_on_modify)
if (!ZCG(include_path_key) &&
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len));
if (!ZCG(include_path_key) &&
@@ -221,11 +224,11 @@ static ZEND_INI_MH(accel_include_path_on_modify)
ZCG(include_path_key) = key + ZCG(include_path_len) + 1;
zend_accel_hash_update(&ZCSG(include_paths), key, ZCG(include_path_len), 0, ZCG(include_path_key));
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
} else {
@@ -240,29 +243,29 @@ static ZEND_INI_MH(accel_include_path_on_modify)
}
/* Interned strings support */
-static zend_string *(*orig_new_interned_string)(zend_string *str TSRMLS_DC);
-static void (*orig_interned_strings_snapshot)(TSRMLS_D);
-static void (*orig_interned_strings_restore)(TSRMLS_D);
+static zend_string *(*orig_new_interned_string)(zend_string *str);
+static void (*orig_interned_strings_snapshot)(void);
+static void (*orig_interned_strings_restore)(void);
/* O+ disables creation of interned strings by regular PHP compiler, instead,
* it creates interned strings in shared memory when saves a script.
* Such interned strings are shared across all PHP processes
*/
-static zend_string *accel_new_interned_string_for_php(zend_string *str TSRMLS_DC)
+static zend_string *accel_new_interned_string_for_php(zend_string *str)
{
return str;
}
-static void accel_interned_strings_snapshot_for_php(TSRMLS_D)
+static void accel_interned_strings_snapshot_for_php(void)
{
}
-static void accel_interned_strings_restore_for_php(TSRMLS_D)
+static void accel_interned_strings_restore_for_php(void)
{
}
#ifndef ZTS
-static void accel_interned_strings_restore_state(TSRMLS_D)
+static void accel_interned_strings_restore_state(void)
{
uint idx = ZCSG(interned_strings).nNumUsed;
uint nIndex;
@@ -289,13 +292,13 @@ static void accel_interned_strings_restore_state(TSRMLS_D)
}
}
-static void accel_interned_strings_save_state(TSRMLS_D)
+static void accel_interned_strings_save_state(void)
{
ZCSG(interned_strings_saved_top) = ZCSG(interned_strings_top);
}
#endif
-zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC)
+zend_string *accel_new_interned_string(zend_string *str)
{
/* for now interned strings are supported only for non-ZTS build */
#ifndef ZTS
@@ -363,18 +366,18 @@ zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC)
#ifndef ZTS
/* Copy PHP interned strings from PHP process memory into the shared memory */
-static void accel_use_shm_interned_strings(TSRMLS_D)
+static void accel_use_shm_interned_strings(void)
{
uint idx, j;
Bucket *p, *q;
/* empty string */
- CG(empty_string) = accel_new_interned_string(CG(empty_string) TSRMLS_CC);
+ CG(empty_string) = accel_new_interned_string(CG(empty_string));
for (j = 0; j < 256; j++) {
char s[2];
s[0] = j;
s[1] = 0;
- CG(one_char_string)[j] = accel_new_interned_string(zend_string_init(s, 1, 0) TSRMLS_CC);
+ CG(one_char_string)[j] = accel_new_interned_string(zend_string_init(s, 1, 0));
}
/* function table hash keys */
@@ -382,10 +385,10 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
p = CG(function_table)->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
if (Z_FUNC(p->val)->common.function_name) {
- Z_FUNC(p->val)->common.function_name = accel_new_interned_string(Z_FUNC(p->val)->common.function_name TSRMLS_CC);
+ Z_FUNC(p->val)->common.function_name = accel_new_interned_string(Z_FUNC(p->val)->common.function_name);
}
}
@@ -398,11 +401,11 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
ce = (zend_class_entry*)Z_PTR(p->val);
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
if (ce->name) {
- ce->name = accel_new_interned_string(ce->name TSRMLS_CC);
+ ce->name = accel_new_interned_string(ce->name);
}
for (j = 0; j < ce->properties_info.nNumUsed; j++) {
@@ -414,11 +417,11 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
info = (zend_property_info*)Z_PTR(q->val);
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
if (info->name) {
- info->name = accel_new_interned_string(info->name TSRMLS_CC);
+ info->name = accel_new_interned_string(info->name);
}
}
@@ -426,10 +429,10 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
q = ce->function_table.arData + j;
if (Z_TYPE(q->val) == IS_UNDEF) continue;
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
if (Z_FUNC(q->val)->common.function_name) {
- Z_FUNC(q->val)->common.function_name = accel_new_interned_string(Z_FUNC(q->val)->common.function_name TSRMLS_CC);
+ Z_FUNC(q->val)->common.function_name = accel_new_interned_string(Z_FUNC(q->val)->common.function_name);
}
}
@@ -437,7 +440,7 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
q = ce->constants_table.arData + j;
if (!Z_TYPE(q->val) == IS_UNDEF) continue;
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
}
}
@@ -447,7 +450,7 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
p = EG(zend_constants)->arData + idx;
if (!Z_TYPE(p->val) == IS_UNDEF) continue;
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
}
@@ -460,15 +463,15 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
auto_global = (zend_auto_global*)Z_PTR(p->val);;
- auto_global->name = accel_new_interned_string(auto_global->name TSRMLS_CC);
+ auto_global->name = accel_new_interned_string(auto_global->name);
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
}
}
#endif
-static inline void accel_restart_enter(TSRMLS_D)
+static inline void accel_restart_enter(void)
{
#ifdef ZEND_WIN32
INCREMENT(restart_in);
@@ -482,7 +485,7 @@ static inline void accel_restart_enter(TSRMLS_D)
ZCSG(restart_in_progress) = 1;
}
-static inline void accel_restart_leave(TSRMLS_D)
+static inline void accel_restart_leave(void)
{
#ifdef ZEND_WIN32
ZCSG(restart_in_progress) = 0;
@@ -497,7 +500,7 @@ static inline void accel_restart_leave(TSRMLS_D)
#endif
}
-static inline int accel_restart_is_active(TSRMLS_D)
+static inline int accel_restart_is_active(void)
{
if (ZCSG(restart_in_progress)) {
#ifndef ZEND_WIN32
@@ -521,7 +524,7 @@ static inline int accel_restart_is_active(TSRMLS_D)
}
/* Creates a read lock for SHM access */
-static inline void accel_activate_add(TSRMLS_D)
+static inline void accel_activate_add(void)
{
#ifdef ZEND_WIN32
INCREMENT(mem_usage);
@@ -535,7 +538,7 @@ static inline void accel_activate_add(TSRMLS_D)
}
/* Releases a lock for SHM access */
-static inline void accel_deactivate_sub(TSRMLS_D)
+static inline void accel_deactivate_sub(void)
{
#ifdef ZEND_WIN32
if (ZCG(counted)) {
@@ -551,10 +554,10 @@ static inline void accel_deactivate_sub(TSRMLS_D)
#endif
}
-static inline void accel_unlock_all(TSRMLS_D)
+static inline void accel_unlock_all(void)
{
#ifdef ZEND_WIN32
- accel_deactivate_sub(TSRMLS_C);
+ accel_deactivate_sub();
#else
static const FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
@@ -607,7 +610,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
}
#endif
-static inline int accel_is_inactive(TSRMLS_D)
+static inline int accel_is_inactive(void)
{
#ifdef ZEND_WIN32
if (LOCKVAL(mem_usage) == 0) {
@@ -638,7 +641,7 @@ static inline int accel_is_inactive(TSRMLS_D)
return FAILURE;
}
-static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf TSRMLS_DC)
+static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf)
{
php_stream_wrapper *wrapper;
php_stream_statbuf stream_statbuf;
@@ -648,7 +651,7 @@ static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf
return FAILURE;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY);
if (!wrapper) {
return FAILURE;
}
@@ -660,7 +663,7 @@ static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf
er = EG(error_reporting);
EG(error_reporting) = 0;
zend_try {
- ret = wrapper->wops->url_stat(wrapper, (char*)filename, PHP_STREAM_URL_STAT_QUIET, &stream_statbuf, NULL TSRMLS_CC);
+ ret = wrapper->wops->url_stat(wrapper, (char*)filename, PHP_STREAM_URL_STAT_QUIET, &stream_statbuf, NULL);
} zend_catch {
ret = -1;
} zend_end_try();
@@ -719,7 +722,7 @@ static accel_time_t zend_get_file_handle_timestamp_win(zend_file_handle *file_ha
}
#endif
-static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size TSRMLS_DC)
+static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size)
{
zend_stat_t statbuf;
#ifdef ZEND_WIN32
@@ -730,7 +733,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
!EG(current_execute_data) &&
file_handle->filename == SG(request_info).path_translated) {
- zend_stat_t *tmpbuf = sapi_module.get_stat(TSRMLS_C);
+ zend_stat_t *tmpbuf = sapi_module.get_stat();
if (tmpbuf) {
if (size) {
@@ -755,7 +758,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
break;
case ZEND_HANDLE_FP:
if (zend_fstat(fileno(file_handle->handle.fp), &statbuf) == -1) {
- if (zend_get_stream_timestamp(file_handle->filename, &statbuf TSRMLS_CC) != SUCCESS) {
+ if (zend_get_stream_timestamp(file_handle->filename, &statbuf) != SUCCESS) {
return 0;
}
}
@@ -767,7 +770,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
if (file_path) {
if (is_stream_path(file_path)) {
- if (zend_get_stream_timestamp(file_path, &statbuf TSRMLS_CC) == SUCCESS) {
+ if (zend_get_stream_timestamp(file_path, &statbuf) == SUCCESS) {
break;
}
}
@@ -776,7 +779,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
}
}
- if (zend_get_stream_timestamp(file_handle->filename, &statbuf TSRMLS_CC) != SUCCESS) {
+ if (zend_get_stream_timestamp(file_handle->filename, &statbuf) != SUCCESS) {
return 0;
}
break;
@@ -796,7 +799,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
er = EG(error_reporting);
EG(error_reporting) = 0;
zend_try {
- ret = stream->ops->stat(stream, &sb TSRMLS_CC);
+ ret = stream->ops->stat(stream, &sb);
} zend_catch {
ret = -1;
} zend_end_try();
@@ -819,7 +822,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
return statbuf.st_mtime;
}
-static inline int do_validate_timestamps(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
+static inline int do_validate_timestamps(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
{
zend_file_handle ps_handle;
char *full_path_ptr = NULL;
@@ -833,7 +836,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
return FAILURE;
}
} else {
- full_path_ptr = accelerator_orig_zend_resolve_path(file_handle->filename, strlen(file_handle->filename) TSRMLS_CC);
+ full_path_ptr = accelerator_orig_zend_resolve_path(file_handle->filename, strlen(file_handle->filename));
if (full_path_ptr && strcmp(persistent_script->full_path->val, full_path_ptr) != 0) {
efree(full_path_ptr);
return FAILURE;
@@ -849,7 +852,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
return FAILURE;
}
- if (zend_get_file_handle_timestamp(file_handle, NULL TSRMLS_CC) == persistent_script->timestamp) {
+ if (zend_get_file_handle_timestamp(file_handle, NULL) == persistent_script->timestamp) {
if (full_path_ptr) {
efree(full_path_ptr);
file_handle->opened_path = NULL;
@@ -865,19 +868,19 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
ps_handle.filename = persistent_script->full_path->val;
ps_handle.opened_path = persistent_script->full_path->val;
- if (zend_get_file_handle_timestamp(&ps_handle, NULL TSRMLS_CC) == persistent_script->timestamp) {
+ if (zend_get_file_handle_timestamp(&ps_handle, NULL) == persistent_script->timestamp) {
return SUCCESS;
}
return FAILURE;
}
-int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
{
if (ZCG(accel_directives).revalidate_freq &&
persistent_script->dynamic_members.revalidate >= ZCG(request_time)) {
return SUCCESS;
- } else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
+ } else if (do_validate_timestamps(persistent_script, file_handle) == FAILURE) {
return FAILURE;
} else {
persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq;
@@ -911,7 +914,7 @@ static unsigned int zend_accel_script_checksum(zend_persistent_script *persisten
/* Instead of resolving full real path name each time we need to identify file,
* we create a key that consist from requested file name, current working
* directory, current include_path, etc */
-char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len TSRMLS_DC)
+char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len)
{
int key_length;
@@ -927,7 +930,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
int cwd_len;
char *cwd;
- if ((cwd = accel_getcwd(&cwd_len TSRMLS_CC)) == NULL) {
+ if ((cwd = accel_getcwd(&cwd_len)) == NULL) {
/* we don't handle this well for now. */
zend_accel_error(ACCEL_LOG_INFO, "getcwd() failed for '%s' (%d), please try to set opcache.use_cwd to 0 in ini file", file_handle->filename, errno);
if (file_handle->opened_path) {
@@ -952,7 +955,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len));
if (ZCG(include_path_key)) {
@@ -970,11 +973,11 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
include_path = ZCG(include_path_key);
include_path_len = 1;
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
@@ -984,7 +987,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
in include path too.
*/
if (EG(current_execute_data) &&
- (parent_script = zend_get_executed_filename(TSRMLS_C)) != NULL &&
+ (parent_script = zend_get_executed_filename()) != NULL &&
parent_script[0] != '[') {
parent_script_len = strlen(parent_script);
@@ -1037,21 +1040,21 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
return ZCG(key);
}
-static inline char *accel_make_persistent_key(zend_file_handle *file_handle, int *key_len TSRMLS_DC)
+static inline char *accel_make_persistent_key(zend_file_handle *file_handle, int *key_len)
{
- return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len TSRMLS_CC);
+ return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len);
}
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC)
+int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force)
{
char *realpath;
zend_persistent_script *persistent_script;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return FAILURE;
}
- realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ realpath = accelerator_orig_zend_resolve_path(filename, filename_len);
if (!realpath) {
return FAILURE;
@@ -1067,9 +1070,9 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
if (force ||
!ZCG(accel_directives).validate_timestamps ||
- do_validate_timestamps(persistent_script, &file_handle TSRMLS_CC) == FAILURE) {
+ do_validate_timestamps(persistent_script, &file_handle) == FAILURE) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1077,28 +1080,28 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
- accelerator_shm_read_unlock(TSRMLS_C);
+ accelerator_shm_read_unlock();
efree(realpath);
return SUCCESS;
}
/* Adds another key for existing cached script */
-static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_hash_entry *bucket TSRMLS_DC)
+static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_hash_entry *bucket)
{
if (!zend_accel_hash_find(&ZCSG(hash), key, key_length)) {
if (zend_accel_hash_is_full(&ZCSG(hash))) {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
} else {
char *new_key = zend_shared_alloc(key_length + 1);
if (new_key) {
@@ -1107,13 +1110,13 @@ static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_ha
zend_accel_error(ACCEL_LOG_INFO, "Added key '%s'", new_key);
}
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
}
}
-static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory TSRMLS_DC)
+static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory)
{
zend_accel_hash_entry *bucket;
uint memory_used;
@@ -1123,18 +1126,18 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
return new_persistent_script;
}
- if (!zend_accel_script_optimize(new_persistent_script TSRMLS_CC)) {
+ if (!zend_accel_script_optimize(new_persistent_script)) {
return new_persistent_script;
}
/* exclusive lock */
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (zend_accel_hash_is_full(&ZCSG(hash))) {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
@@ -1149,26 +1152,26 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
if (!ZCG(accel_directives).revalidate_path &&
(!ZCG(accel_directives).validate_timestamps ||
(new_persistent_script->timestamp == existing_persistent_script->timestamp))) {
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
+ zend_accel_add_key(key, key_length, bucket);
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
}
/* Calculate the required memory size */
- memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length TSRMLS_CC);
+ memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length);
/* Allocate shared memory */
ZCG(mem) = zend_shared_alloc(memory_used);
if (!ZCG(mem)) {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
/* Copy into shared memory */
- new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length TSRMLS_CC);
+ new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length);
/* Consistency check */
if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
@@ -1198,14 +1201,14 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
} else {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
}
}
}
new_persistent_script->dynamic_members.memory_consumption = ZEND_ALIGNED_SIZE(new_persistent_script->size);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
*from_shared_memory = 1;
return new_persistent_script;
@@ -1224,7 +1227,7 @@ static const struct jit_auto_global_info
static zend_string *jit_auto_globals_str[4];
-static int zend_accel_get_auto_globals(TSRMLS_D)
+static int zend_accel_get_auto_globals(void)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
int n = 1;
@@ -1239,7 +1242,7 @@ static int zend_accel_get_auto_globals(TSRMLS_D)
return mask;
}
-static int zend_accel_get_auto_globals_no_jit(TSRMLS_D)
+static int zend_accel_get_auto_globals_no_jit(void)
{
if (zend_hash_exists(&EG(symbol_table).ht, jit_auto_globals_str[3])) {
return 8;
@@ -1247,7 +1250,7 @@ static int zend_accel_get_auto_globals_no_jit(TSRMLS_D)
return 0;
}
-static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
+static void zend_accel_set_auto_globals(int mask)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
int n = 1;
@@ -1255,24 +1258,24 @@ static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
for (i = 0; i < ag_size ; i++) {
if ((mask & n) && !(ZCG(auto_globals_mask) & n)) {
ZCG(auto_globals_mask) |= n;
- zend_is_auto_global(jit_auto_globals_str[i] TSRMLS_CC);
+ zend_is_auto_global(jit_auto_globals_str[i]);
}
n += n;
}
}
-static void zend_accel_init_auto_globals(TSRMLS_D)
+static void zend_accel_init_auto_globals(void)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
for (i = 0; i < ag_size ; i++) {
jit_auto_globals_str[i] = zend_string_init(jit_auto_globals_info[i].name, jit_auto_globals_info[i].len, 1);
zend_string_hash_val(jit_auto_globals_str[i]);
- jit_auto_globals_str[i] = accel_new_interned_string(jit_auto_globals_str[i] TSRMLS_CC);
+ jit_auto_globals_str[i] = accel_new_interned_string(jit_auto_globals_str[i]);
}
}
-static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, unsigned int key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC)
+static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, unsigned int key_length, zend_op_array **op_array_p, int *from_shared_memory)
{
zend_persistent_script *new_persistent_script;
zend_op_array *orig_active_op_array;
@@ -1285,7 +1288,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Try to open file */
if (file_handle->type == ZEND_HANDLE_FILENAME) {
- if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle TSRMLS_CC) == SUCCESS) {
+ if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) == SUCCESS) {
/* key may be changed by zend_stream_open_function() */
if (key == ZCG(key)) {
key_length = ZCG(key_len);
@@ -1293,10 +1296,10 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
} else {
*op_array_p = NULL;
if (type == ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
return NULL;
}
@@ -1305,7 +1308,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* check blacklist right after ensuring that file was opened */
if (file_handle->opened_path && zend_accel_blacklist_is_blacklisted(&accel_blacklist, file_handle->opened_path)) {
ZCSG(blacklist_misses)++;
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
@@ -1318,7 +1321,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Stream callbacks needs to be called in context of original
* function and class tables (see: https://bugs.php.net/bug.php?id=64353)
*/
- if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(file_handle, &buf, &size) == FAILURE) {
*op_array_p = NULL;
return NULL;
}
@@ -1332,26 +1335,26 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Obtain the file timestamps, *before* actually compiling them,
* otherwise we have a race-condition.
*/
- timestamp = zend_get_file_handle_timestamp(file_handle, ZCG(accel_directives).max_file_size > 0 ? &size : NULL TSRMLS_CC);
+ timestamp = zend_get_file_handle_timestamp(file_handle, ZCG(accel_directives).max_file_size > 0 ? &size : NULL);
/* If we can't obtain a timestamp (that means file is possibly socket)
* we won't cache it
*/
if (timestamp == 0) {
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
/* check if file is too new (may be it's not written completely yet) */
if (ZCG(accel_directives).file_update_protection &&
(ZCG(request_time) - ZCG(accel_directives).file_update_protection < timestamp)) {
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
if (ZCG(accel_directives).max_file_size > 0 && size > (size_t)ZCG(accel_directives).max_file_size) {
ZCSG(blacklist_misses)++;
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
}
@@ -1375,7 +1378,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES;
CG(compiler_options) |= ZEND_COMPILE_DELAYED_BINDING;
CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION;
- op_array = *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ op_array = *op_array_p = accelerator_orig_compile_file(file_handle, type);
CG(compiler_options) = orig_compiler_options;
} zend_catch {
op_array = NULL;
@@ -1392,7 +1395,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
if (!op_array) {
/* compilation failed */
free_persistent_script(new_persistent_script, 1);
- zend_accel_free_user_functions(&ZCG(function_table) TSRMLS_CC);
+ zend_accel_free_user_functions(&ZCG(function_table));
if (do_bailout) {
zend_bailout();
}
@@ -1403,7 +1406,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
Here we aren't sure we would store it, but we will need it
further anyway.
*/
- zend_accel_move_user_functions(&ZCG(function_table), &new_persistent_script->function_table TSRMLS_CC);
+ zend_accel_move_user_functions(&ZCG(function_table), &new_persistent_script->function_table);
new_persistent_script->main_op_array = *op_array;
efree(op_array); /* we have valid persistent_script, so it's safe to free op_array */
@@ -1411,9 +1414,9 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Fill in the ping_auto_globals_mask for the new script. If jit for auto globals is enabled we
will have to ping the used auto global variables before execution */
if (PG(auto_globals_jit)) {
- new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals(TSRMLS_C);
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals();
} else {
- new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit(TSRMLS_C);
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit();
}
if (ZCG(accel_directives).validate_timestamps) {
@@ -1432,11 +1435,11 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
zend_string_hash_val(new_persistent_script->full_path);
/* Now persistent_script structure is ready in process memory */
- return cache_script_in_shared_memory(new_persistent_script, key, key_length, from_shared_memory TSRMLS_CC);
+ return cache_script_in_shared_memory(new_persistent_script, key, key_length, from_shared_memory);
}
/* zend_compile() replacement */
-zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
{
zend_persistent_script *persistent_script = NULL;
char *key = NULL;
@@ -1446,11 +1449,11 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (!file_handle->filename ||
!ZCG(enabled) || !accel_startup_ok ||
(!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
- (ZCSG(restart_in_progress) && accel_restart_is_active(TSRMLS_C)) ||
+ (ZCSG(restart_in_progress) && accel_restart_is_active()) ||
(is_stream_path(file_handle->filename) &&
!is_cacheable_stream_path(file_handle->filename))) {
/* The Accelerator is disabled, act as if without the Accelerator */
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* Make sure we only increase the currently running processes semaphore
@@ -1459,7 +1462,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
*/
if (!ZCG(counted)) {
ZCG(counted) = 1;
- accel_activate_add(TSRMLS_C);
+ accel_activate_add();
}
/* In case this callback is called from include_once, require_once or it's
@@ -1477,7 +1480,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
(EG(current_execute_data)->opline->extended_value == ZEND_INCLUDE_ONCE ||
EG(current_execute_data)->opline->extended_value == ZEND_REQUIRE_ONCE))) {
if (!ZCG(key_len)) {
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* persistent script was already found by overridden open() or
* resolve_path() callbacks */
@@ -1486,8 +1489,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
key_length = ZCG(key_len);
} else {
/* try to find cached script by key */
- if ((key = accel_make_persistent_key(file_handle, &key_length TSRMLS_CC)) == NULL) {
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ if ((key = accel_make_persistent_key(file_handle, &key_length)) == NULL) {
+ return accelerator_orig_compile_file(file_handle, type);
}
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length);
if (!persistent_script) {
@@ -1496,12 +1499,12 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* open file to resolve the path */
if (file_handle->type == ZEND_HANDLE_FILENAME &&
- accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle TSRMLS_CC) == FAILURE) {
+ accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) == FAILURE) {
if (type == ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
return NULL;
}
@@ -1513,9 +1516,9 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (!ZCG(accel_directives).revalidate_path &&
!persistent_script->corrupted) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_lock();
+ zend_accel_add_key(key, key_length, bucket);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
@@ -1534,8 +1537,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* If script is found then validate_timestamps if option is enabled */
if (persistent_script && ZCG(accel_directives).validate_timestamps) {
- if (validate_timestamp_and_record(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
- zend_shared_alloc_lock(TSRMLS_C);
+ if (validate_timestamp_and_record(persistent_script, file_handle) == FAILURE) {
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1543,10 +1546,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
persistent_script = NULL;
}
}
@@ -1560,7 +1563,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* The checksum is wrong */
zend_accel_error(ACCEL_LOG_INFO, "Checksum failed for '%s': expected=0x%0.8X, found=0x%0.8X",
persistent_script->full_path, persistent_script->dynamic_members.checksum, checksum);
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1568,10 +1571,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
persistent_script = NULL;
}
}
@@ -1587,14 +1590,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* No memory left. Behave like without the Accelerator */
if (ZSMMG(memory_exhausted) || ZCSG(restart_pending)) {
SHM_PROTECT();
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* Try and cache the script and assume that it is returned from_shared_memory.
* If it isn't compile_and_cache_file() changes the flag to 0
*/
from_shared_memory = 0;
- persistent_script = compile_and_cache_file(file_handle, type, key, key_length, &op_array, &from_shared_memory TSRMLS_CC);
+ persistent_script = compile_and_cache_file(file_handle, type, key, key_length, &op_array, &from_shared_memory);
/* Caching is disabled, returning op_array;
* or something went wrong during compilation, returning NULL
@@ -1643,7 +1646,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
}
}
}
- zend_file_handle_dtor(file_handle TSRMLS_CC);
+ zend_file_handle_dtor(file_handle);
from_shared_memory = 1;
}
@@ -1653,14 +1656,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* Fetch jit auto globals used in the script before execution */
if (persistent_script->ping_auto_globals_mask) {
- zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask TSRMLS_CC);
+ zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask);
}
- return zend_accel_load_script(persistent_script, from_shared_memory TSRMLS_CC);
+ return zend_accel_load_script(persistent_script, from_shared_memory);
}
/* zend_stream_open_function() replacement for PHP 5.3 and above */
-static int persistent_stream_open_function(const char *filename, zend_file_handle *handle TSRMLS_DC)
+static int persistent_stream_open_function(const char *filename, zend_file_handle *handle)
{
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
@@ -1715,11 +1718,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
}
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
- return accelerator_orig_zend_stream_open_function(filename, handle TSRMLS_CC);
+ return accelerator_orig_zend_stream_open_function(filename, handle);
}
/* zend_resolve_path() replacement for PHP 5.3 and above */
-static char* persistent_zend_resolve_path(const char *filename, int filename_len TSRMLS_DC)
+static char* persistent_zend_resolve_path(const char *filename, int filename_len)
{
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
@@ -1760,7 +1763,7 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
handle.filename = (char*)filename;
handle.free_filename = 0;
handle.opened_path = NULL;
- key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC);
+ key = accel_make_persistent_key_ex(&handle, filename_len, &key_length);
if (!ZCG(accel_directives).revalidate_path &&
key &&
(persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length)) != NULL &&
@@ -1773,7 +1776,7 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
}
/* find the full real path */
- resolved_path = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ resolved_path = accelerator_orig_zend_resolve_path(filename, filename_len);
/* Check if requested file already cached (by real path) */
if (resolved_path &&
@@ -1784,9 +1787,9 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
if (key && !ZCG(accel_directives).revalidate_path) {
/* add another "key" for the same bucket */
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_lock();
+ zend_accel_add_key(key, key_length, bucket);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
ZCG(cache_opline) = (EG(current_execute_data) && key) ? EG(current_execute_data)->opline : NULL;
@@ -1801,10 +1804,10 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
}
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
- return accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ return accelerator_orig_zend_resolve_path(filename, filename_len);
}
-static void zend_reset_cache_vars(TSRMLS_D)
+static void zend_reset_cache_vars(void)
{
ZSMMG(memory_exhausted) = 0;
ZCSG(hits) = 0;
@@ -1817,7 +1820,6 @@ static void zend_reset_cache_vars(TSRMLS_D)
static void accel_activate(void)
{
- TSRMLS_FETCH();
if (!ZCG(enabled) || !accel_startup_ok) {
return;
@@ -1826,7 +1828,7 @@ static void accel_activate(void)
SHM_UNPROTECT();
/* PHP-5.4 and above return "double", but we use 1 sec precision */
ZCG(auto_globals_mask) = 0;
- ZCG(request_time) = (time_t)sapi_get_request_time(TSRMLS_C);
+ ZCG(request_time) = (time_t)sapi_get_request_time();
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
ZCG(include_path_check) = !ZCG(include_path_key);
@@ -1837,14 +1839,14 @@ static void accel_activate(void)
#else
zend_accel_error(ACCEL_LOG_WARNING, "Stuck count for pid %d", getpid());
#endif
- accel_unlock_all(TSRMLS_C);
+ accel_unlock_all();
ZCG(counted) = 0;
}
if (ZCSG(restart_pending)) {
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (ZCSG(restart_pending) != 0) { /* check again, to ensure that the cache wasn't already cleaned by another process */
- if (accel_is_inactive(TSRMLS_C) == SUCCESS) {
+ if (accel_is_inactive() == SUCCESS) {
zend_accel_error(ACCEL_LOG_DEBUG, "Restarting!");
ZCSG(restart_pending) = 0;
switch ZCSG(restart_reason) {
@@ -1858,9 +1860,9 @@ static void accel_activate(void)
ZCSG(manual_restarts)++;
break;
}
- accel_restart_enter(TSRMLS_C);
+ accel_restart_enter();
- zend_reset_cache_vars(TSRMLS_C);
+ zend_reset_cache_vars();
zend_accel_hash_clean(&ZCSG(hash));
/* include_paths keeps only the first path */
@@ -1873,17 +1875,17 @@ static void accel_activate(void)
#if !defined(ZTS)
if (ZCG(accel_directives).interned_strings_buffer) {
- accel_interned_strings_restore_state(TSRMLS_C);
+ accel_interned_strings_restore_state();
}
#endif
zend_shared_alloc_restore_state();
ZCSG(accelerator_enabled) = ZCSG(cache_status_before_restart);
ZCSG(last_restart_time) = ZCG(request_time);
- accel_restart_leave(TSRMLS_C);
+ accel_restart_leave();
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
/* check if ZCG(function_table) wasn't somehow polluted on the way */
@@ -1923,8 +1925,7 @@ static void accel_fast_zval_dtor(zval *zvalue)
if (Z_REFCOUNTED_P(zvalue) && Z_DELREF_P(zvalue) == 0) {
switch (Z_TYPE_P(zvalue)) {
case IS_ARRAY: {
- TSRMLS_FETCH();
- GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue));
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue));
if (Z_ARR_P(zvalue) != &EG(symbol_table)) {
/* break possible cycles */
ZVAL_NULL(zvalue);
@@ -1934,15 +1935,13 @@ static void accel_fast_zval_dtor(zval *zvalue)
break;
case IS_OBJECT:
{
- TSRMLS_FETCH();
-
+
OBJ_RELEASE(Z_OBJ_P(zvalue));
}
break;
case IS_RESOURCE:
{
- TSRMLS_FETCH();
-
+
/* destroy resource */
zend_list_delete(Z_RES_P(zvalue));
}
@@ -1961,7 +1960,7 @@ static void accel_fast_zval_dtor(zval *zvalue)
}
}
-static int accel_clean_non_persistent_function(zval *zv TSRMLS_DC)
+static int accel_clean_non_persistent_function(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
@@ -1995,7 +1994,7 @@ static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucke
}
}
-static void zend_accel_fast_shutdown(TSRMLS_D)
+static void zend_accel_fast_shutdown(void)
{
if (EG(full_tables_cleanup)) {
EG(symbol_table).ht.pDestructor = accel_fast_zval_dtor;
@@ -2078,19 +2077,18 @@ static void accel_deactivate(void)
* In general, they're restored by persistent_compile_file(), but in case
* the script is aborted abnormally, they may become messed up.
*/
- TSRMLS_FETCH();
if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
- zend_shared_alloc_safe_unlock(TSRMLS_C); /* be sure we didn't leave cache locked */
- accel_unlock_all(TSRMLS_C);
+ zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
+ accel_unlock_all();
ZCG(counted) = 0;
#if !ZEND_DEBUG
if (ZCG(accel_directives).fast_shutdown) {
- zend_accel_fast_shutdown(TSRMLS_C);
+ zend_accel_fast_shutdown();
}
#endif
@@ -2124,7 +2122,7 @@ static int accelerator_remove_cb(zend_extension *element1, zend_extension *eleme
return 0;
}
-static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_extension *, zend_extension *) TSRMLS_DC)
+static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_extension *, zend_extension *))
{
accel_startup_ok = 0;
zps_failure_reason = reason;
@@ -2132,7 +2130,7 @@ static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_e
zend_llist_del_element(&zend_extensions, NULL, (int (*)(void *, void *))cb);
}
-static inline int accel_find_sapi(TSRMLS_D)
+static inline int accel_find_sapi(void)
{
static const char *supported_sapis[] = {
"apache",
@@ -2163,9 +2161,9 @@ static inline int accel_find_sapi(TSRMLS_D)
return FAILURE;
}
-static int zend_accel_init_shm(TSRMLS_D)
+static int zend_accel_init_shm(void)
{
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals));
if (!accel_shared_globals) {
@@ -2209,12 +2207,12 @@ static int zend_accel_init_shm(TSRMLS_D)
# ifndef ZTS
if (ZCG(accel_directives).interned_strings_buffer) {
- accel_use_shm_interned_strings(TSRMLS_C);
- accel_interned_strings_save_state(TSRMLS_C);
+ accel_use_shm_interned_strings();
+ accel_interned_strings_save_state();
}
# endif
- zend_reset_cache_vars(TSRMLS_C);
+ zend_reset_cache_vars();
ZCSG(oom_restarts) = 0;
ZCSG(hash_restarts) = 0;
@@ -2225,16 +2223,19 @@ static int zend_accel_init_shm(TSRMLS_D)
ZCSG(last_restart_time) = 0;
ZCSG(restart_in_progress) = 0;
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
return SUCCESS;
}
-static void accel_globals_ctor(zend_accel_globals *accel_globals TSRMLS_DC)
+static void accel_globals_ctor(zend_accel_globals *accel_globals)
{
+#if defined(COMPILE_DL_OPCACHE) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(accel_globals, 0, sizeof(zend_accel_globals));
zend_hash_init(&accel_globals->function_table, zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1);
- zend_accel_copy_internal_functions(TSRMLS_C);
+ zend_accel_copy_internal_functions();
}
static void accel_globals_internal_func_dtor(zval *zv)
@@ -2242,7 +2243,7 @@ static void accel_globals_internal_func_dtor(zval *zv)
free(Z_PTR_P(zv));
}
-static void accel_globals_dtor(zend_accel_globals *accel_globals TSRMLS_DC)
+static void accel_globals_dtor(zend_accel_globals *accel_globals)
{
accel_globals->function_table.pDestructor = accel_globals_internal_func_dtor;
zend_hash_destroy(&accel_globals->function_table);
@@ -2252,7 +2253,6 @@ static int accel_startup(zend_extension *extension)
{
zend_function *func;
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
#ifdef ZTS
accel_globals_id = ts_allocate_id(&accel_globals_id, sizeof(zend_accel_globals), (ts_allocate_ctor) accel_globals_ctor, (ts_allocate_dtor) accel_globals_dtor);
@@ -2264,20 +2264,20 @@ static int accel_startup(zend_extension *extension)
_setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */
#endif
- if (start_accel_module(TSRMLS_C) == FAILURE) {
+ if (start_accel_module() == FAILURE) {
accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
}
/* no supported SAPI found - disable acceleration and stop initialization */
- if (accel_find_sapi(TSRMLS_C) == FAILURE) {
+ if (accel_find_sapi() == FAILURE) {
accel_startup_ok = 0;
if (!ZCG(accel_directives).enable_cli &&
strcmp(sapi_module.name, "cli") == 0) {
- zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb TSRMLS_CC);
+ zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb);
} else {
- zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb);
}
return SUCCESS;
}
@@ -2290,7 +2290,7 @@ static int accel_startup(zend_extension *extension)
/********************************************/
switch (zend_shared_alloc_startup(ZCG(accel_directives).memory_consumption)) {
case ALLOC_SUCCESS:
- if (zend_accel_init_shm(TSRMLS_C) == FAILURE) {
+ if (zend_accel_init_shm() == FAILURE) {
accel_startup_ok = 0;
return FAILURE;
}
@@ -2301,7 +2301,7 @@ static int accel_startup(zend_extension *extension)
return SUCCESS;
case SUCCESSFULLY_REATTACHED:
accel_shared_globals = (zend_accel_shared_globals *) ZSMMG(app_shared_globals);
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
orig_new_interned_string = zend_new_interned_string;
orig_interned_strings_snapshot = zend_interned_strings_snapshot;
orig_interned_strings_restore = zend_interned_strings_restore;
@@ -2310,9 +2310,9 @@ static int accel_startup(zend_extension *extension)
zend_interned_strings_snapshot = accel_interned_strings_snapshot_for_php;
zend_interned_strings_restore = accel_interned_strings_restore_for_php;
#ifndef ZTS
- accel_use_shm_interned_strings(TSRMLS_C);
+ accel_use_shm_interned_strings();
#endif
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
break;
case FAILED_REATTACHED:
accel_startup_ok = 0;
@@ -2324,7 +2324,7 @@ static int accel_startup(zend_extension *extension)
/* from this point further, shared memory is supposed to be OK */
/* Init auto-global strings */
- zend_accel_init_auto_globals(TSRMLS_C);
+ zend_accel_init_auto_globals();
/* Override compiler */
accelerator_orig_compile_file = zend_compile_file;
@@ -2359,7 +2359,7 @@ static int accel_startup(zend_extension *extension)
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
char *key;
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
key = zend_shared_alloc(ZCG(include_path_len) + 2);
if (key) {
memcpy(key, ZCG(include_path), ZCG(include_path_len) + 1);
@@ -2367,9 +2367,9 @@ static int accel_startup(zend_extension *extension)
ZCG(include_path_key) = key + ZCG(include_path_len) + 1;
zend_accel_hash_update(&ZCSG(include_paths), key, ZCG(include_path_len), 0, ZCG(include_path_key));
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
} else {
ZCG(include_path) = "";
@@ -2379,16 +2379,16 @@ static int accel_startup(zend_extension *extension)
ini_entry->on_modify = accel_include_path_on_modify;
}
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
zend_shared_alloc_save_state();
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
accel_startup_ok = 1;
/* Override file_exists(), is_file() and is_readable() */
- zend_accel_override_file_functions(TSRMLS_C);
+ zend_accel_override_file_functions();
/* Load black list */
accel_blacklist.entries = NULL;
@@ -2401,7 +2401,7 @@ static int accel_startup(zend_extension *extension)
#if 0
/* FIXME: We probably don't need it here */
- zend_accel_copy_internal_functions(TSRMLS_C);
+ zend_accel_copy_internal_functions();
#endif
return SUCCESS;
@@ -2416,7 +2416,7 @@ static void accel_free_ts_resources()
#endif
}
-void accel_shutdown(TSRMLS_D)
+void accel_shutdown(void)
{
zend_ini_entry *ini_entry;
@@ -2449,7 +2449,7 @@ void accel_shutdown(TSRMLS_D)
}
}
-void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
+void zend_accel_schedule_restart(zend_accel_restart_reason reason)
{
if (ZCSG(restart_pending)) {
/* don't schedule twice */
@@ -2473,9 +2473,9 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
/* this is needed because on WIN32 lock is not decreased unless ZCG(counted) is set */
#ifdef ZEND_WIN32
-#define accel_deactivate_now() ZCG(counted) = 1; accel_deactivate_sub(TSRMLS_C)
+#define accel_deactivate_now() ZCG(counted) = 1; accel_deactivate_sub()
#else
-#define accel_deactivate_now() accel_deactivate_sub(TSRMLS_C)
+#define accel_deactivate_now() accel_deactivate_sub()
#endif
/* ensures it is OK to read SHM
@@ -2483,7 +2483,7 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
if OK returns SUCCESS
MUST call accelerator_shm_read_unlock after done lock operations
*/
-int accelerator_shm_read_lock(TSRMLS_D)
+int accelerator_shm_read_lock(void)
{
if (ZCG(counted)) {
/* counted means we are holding read lock for SHM, so that nothing bad can happen */
@@ -2491,7 +2491,7 @@ int accelerator_shm_read_lock(TSRMLS_D)
} else {
/* here accelerator is active but we do not hold SHM lock. This means restart was scheduled
or is in progress now */
- accel_activate_add(TSRMLS_C); /* acquire usage lock */
+ accel_activate_add(); /* acquire usage lock */
/* Now if we weren't inside restart, restart would not begin until we remove usage lock */
if (ZCSG(restart_in_progress)) {
/* we already were inside restart this means it's not safe to touch shm */
@@ -2503,7 +2503,7 @@ int accelerator_shm_read_lock(TSRMLS_D)
}
/* must be called ONLY after SUCCESSFUL accelerator_shm_read_lock */
-void accelerator_shm_read_unlock(TSRMLS_D)
+void accelerator_shm_read_unlock(void)
{
if (!ZCG(counted)) {
/* counted is 0 - meaning we had to readlock manually, release readlock now */
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 619ade025d..9b478ae158 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -284,8 +284,11 @@ extern zend_accel_shared_globals *accel_shared_globals;
#define ZCSG(element) (accel_shared_globals->element)
#ifdef ZTS
-# define ZCG(v) TSRMG(accel_globals_id, zend_accel_globals *, v)
+# define ZCG(v) ZEND_TSRMG(accel_globals_id, zend_accel_globals *, v)
extern int accel_globals_id;
+# ifdef COMPILE_DL_OPCACHE
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define ZCG(v) (accel_globals.v)
extern zend_accel_globals accel_globals;
@@ -293,17 +296,17 @@ extern zend_accel_globals accel_globals;
extern char *zps_api_failure_reason;
-void accel_shutdown(TSRMLS_D);
-void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC);
-void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC);
-int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC);
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC);
-int zend_accel_script_optimize(zend_persistent_script *persistent_script TSRMLS_DC);
-int accelerator_shm_read_lock(TSRMLS_D);
-void accelerator_shm_read_unlock(TSRMLS_D);
+void accel_shutdown(void);
+void zend_accel_schedule_restart(zend_accel_restart_reason reason);
+void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
+int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force);
+int zend_accel_script_optimize(zend_persistent_script *persistent_script);
+int accelerator_shm_read_lock(void);
+void accelerator_shm_read_unlock(void);
-char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len TSRMLS_DC);
-zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
+char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len);
+zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type);
#if !defined(ZEND_DECLARE_INHERITED_CLASS_DELAYED)
# define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145
@@ -314,7 +317,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
#define IS_ACCEL_INTERNED(str) \
((char*)(str) >= ZCSG(interned_strings_start) && (char*)(str) < ZCSG(interned_strings_end))
-zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC);
+zend_string *accel_new_interned_string(zend_string *str);
# define ZEND_RESULT_TYPE(opline) (opline)->result_type
# define ZEND_RESULT(opline) (opline)->result
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
index 793105b966..be2f0feab7 100644
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -385,7 +385,7 @@ fi
Optimizer/optimize_temp_vars_5.c \
Optimizer/nop_removal.c \
Optimizer/compact_literals.c,
- shared,,,,yes)
+ shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
fi
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index 9a0713d608..921f0ed9b4 100644
--- a/ext/opcache/config.w32
+++ b/ext/opcache/config.w32
@@ -14,7 +14,7 @@ if (PHP_OPCACHE != "no") {
zend_persist.c \
zend_persist_calc.c \
zend_shared_alloc.c \
- shared_alloc_win32.c", true);
+ shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c pass1_5.c pass2.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c", "opcache", "OptimizerObj");
diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c
index 37431fb18a..cab33b5b38 100644
--- a/ext/opcache/shared_alloc_win32.c
+++ b/ext/opcache/shared_alloc_win32.c
@@ -188,7 +188,6 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 };
#endif
void **wanted_mapping_base = default_mapping_base_set;
- TSRMLS_FETCH();
zend_shared_alloc_lock_win32();
/* Mapping retries: When Apache2 restarts, the parent process startup routine
diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c
index 7263ed3c93..cbf0ada9bb 100644
--- a/ext/opcache/zend_accelerator_blacklist.c
+++ b/ext/opcache/zend_accelerator_blacklist.c
@@ -237,7 +237,6 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename)
char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL;
FILE *fp;
int path_length, blacklist_path_length;
- TSRMLS_FETCH();
if ((fp = fopen(filename, "r")) == NULL) {
zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename);
@@ -288,9 +287,9 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename)
path_dup = zend_strndup(pbuf, path_length);
if (blacklist_path) {
- expand_filepath_ex(path_dup, real_path, blacklist_path, blacklist_path_length TSRMLS_CC);
+ expand_filepath_ex(path_dup, real_path, blacklist_path, blacklist_path_length);
} else {
- expand_filepath(path_dup, real_path TSRMLS_CC);
+ expand_filepath(path_dup, real_path);
}
path_length = strlen(real_path);
@@ -358,11 +357,11 @@ zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *v
return ret;
}
-void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument TSRMLS_DC)
+void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument)
{
int i;
for (i = 0; i < blacklist->pos; i++) {
- func(&blacklist->entries[i], argument TSRMLS_CC);
+ func(&blacklist->entries[i], argument);
}
}
diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h
index 1990e414b9..60d6cac925 100644
--- a/ext/opcache/zend_accelerator_blacklist.h
+++ b/ext/opcache/zend_accelerator_blacklist.h
@@ -37,7 +37,7 @@ typedef struct _zend_blacklist {
zend_regexp_list *regexp_list;
} zend_blacklist;
-typedef int (*blacklist_apply_func_arg_t)(zend_blacklist_entry *, zval * TSRMLS_DC);
+typedef int (*blacklist_apply_func_arg_t)(zend_blacklist_entry *, zval *);
extern zend_blacklist accel_blacklist;
@@ -46,6 +46,6 @@ void zend_accel_blacklist_shutdown(zend_blacklist *blacklist);
void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename);
zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path);
-void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument TSRMLS_DC);
+void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument);
#endif /* ZEND_ACCELERATOR_BLACKLIST_H */
diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c
index 2a386b812b..feed711bf5 100644
--- a/ext/opcache/zend_accelerator_debug.c
+++ b/ext/opcache/zend_accelerator_debug.c
@@ -34,7 +34,6 @@ void zend_accel_error(int type, const char *format, ...)
time_t timestamp;
char *time_string;
FILE * fLog = NULL;
- TSRMLS_FETCH();
if (type > ZCG(accel_directives).log_verbosity_level) {
return;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 3cde5188ca..03afd4468d 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -83,7 +83,7 @@ static zend_function_entry accel_functions[] = {
{ NULL, NULL, NULL, 0, 0 }
};
-static int validate_api_restriction(TSRMLS_D)
+static int validate_api_restriction(void)
{
if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) {
int len = strlen(ZCG(accel_directives).restrict_api);
@@ -217,7 +217,7 @@ static ZEND_INI_MH(OnEnable)
if (stage == ZEND_INI_STAGE_STARTUP ||
stage == ZEND_INI_STAGE_SHUTDOWN ||
stage == ZEND_INI_STAGE_DEACTIVATE) {
- return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
/* It may be only temporary disabled */
zend_bool *p;
@@ -278,7 +278,7 @@ ZEND_INI_BEGIN()
#endif
ZEND_INI_END()
-static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
+static int filename_is_in_cache(char *filename, int filename_len)
{
char *key;
int key_length;
@@ -292,14 +292,14 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len);
if (persistent_script) {
return !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
}
}
- if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
+ if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length)) != NULL) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length);
return persistent_script && !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
}
return 0;
@@ -315,7 +315,7 @@ static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS)
Z_STRLEN(zfilename) == 0) {
return 0;
}
- return filename_is_in_cache(Z_STRVAL(zfilename), Z_STRLEN(zfilename) TSRMLS_CC);
+ return filename_is_in_cache(Z_STRVAL(zfilename), Z_STRLEN(zfilename));
}
static void accel_file_exists(INTERNAL_FUNCTION_PARAMETERS)
@@ -354,7 +354,7 @@ static ZEND_MINIT_FUNCTION(zend_accelerator)
return SUCCESS;
}
-void zend_accel_override_file_functions(TSRMLS_D)
+void zend_accel_override_file_functions(void)
{
zend_function *old_function;
if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
@@ -379,7 +379,7 @@ static ZEND_MSHUTDOWN_FUNCTION(zend_accelerator)
(void)type; /* keep the compiler happy */
UNREGISTER_INI_ENTRIES();
- accel_shutdown(TSRMLS_C);
+ accel_shutdown();
return SUCCESS;
}
@@ -452,14 +452,14 @@ static zend_module_entry accel_module_entry = {
STANDARD_MODULE_PROPERTIES
};
-int start_accel_module(TSRMLS_D)
+int start_accel_module(void)
{
- return zend_startup_module(&accel_module_entry TSRMLS_CC);
+ return zend_startup_module(&accel_module_entry);
}
/* {{{ proto array accelerator_get_scripts()
Get the scripts which are accelerated by ZendAccelerator */
-static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
+static int accelerator_get_scripts(zval *return_value)
{
uint i;
zval persistent_script_report;
@@ -468,7 +468,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
struct timeval exec_time;
struct timeval fetch_time;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return 0;
}
@@ -502,7 +502,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
zend_hash_str_update(Z_ARRVAL_P(return_value), cache_entry->key, cache_entry->key_length, &persistent_script_report);
}
}
- accelerator_shm_read_unlock(TSRMLS_C);
+ accelerator_shm_read_unlock();
return 1;
}
@@ -515,11 +515,11 @@ static ZEND_FUNCTION(opcache_get_status)
zval memory_usage, statistics, scripts;
zend_bool fetch_scripts = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &fetch_scripts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &fetch_scripts) == FAILURE) {
return;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -574,13 +574,13 @@ static ZEND_FUNCTION(opcache_get_status)
if (fetch_scripts) {
/* accelerated scripts */
- if (accelerator_get_scripts(&scripts TSRMLS_CC)) {
+ if (accelerator_get_scripts(&scripts)) {
add_assoc_zval(return_value, "scripts", &scripts);
}
}
}
-static int add_blacklist_path(zend_blacklist_entry *p, zval *return_value TSRMLS_DC)
+static int add_blacklist_path(zend_blacklist_entry *p, zval *return_value)
{
add_next_index_stringl(return_value, p->path, p->path_length);
return 0;
@@ -596,7 +596,7 @@ static ZEND_FUNCTION(opcache_get_configuration)
RETURN_FALSE;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -642,7 +642,7 @@ static ZEND_FUNCTION(opcache_get_configuration)
/* blacklist */
array_init(&blacklist);
- zend_accel_blacklist_apply(&accel_blacklist, add_blacklist_path, &blacklist TSRMLS_CC);
+ zend_accel_blacklist_apply(&accel_blacklist, add_blacklist_path, &blacklist);
add_assoc_zval(return_value, "blacklist", &blacklist);
}
@@ -654,7 +654,7 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -662,7 +662,7 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
- zend_accel_schedule_restart(ACCEL_RESTART_USER TSRMLS_CC);
+ zend_accel_schedule_restart(ACCEL_RESTART_USER);
RETURN_TRUE;
}
@@ -674,15 +674,15 @@ static ZEND_FUNCTION(opcache_invalidate)
size_t script_name_len;
zend_bool force = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &script_name, &script_name_len, &force) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &script_name, &script_name_len, &force) == FAILURE) {
return;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
- if (zend_accel_invalidate(script_name, script_name_len, force TSRMLS_CC) == SUCCESS) {
+ if (zend_accel_invalidate(script_name, script_name_len, force) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -697,7 +697,7 @@ static ZEND_FUNCTION(opcache_compile_file)
zend_op_array *op_array = NULL;
zend_execute_data *orig_execute_data = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &script_name, &script_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &script_name, &script_name_len) == FAILURE) {
return;
}
@@ -714,20 +714,20 @@ static ZEND_FUNCTION(opcache_compile_file)
orig_execute_data = EG(current_execute_data);
zend_try {
- op_array = persistent_compile_file(&handle, ZEND_INCLUDE TSRMLS_CC);
+ op_array = persistent_compile_file(&handle, ZEND_INCLUDE);
} zend_catch {
EG(current_execute_data) = orig_execute_data;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " could not compile file %s", handle.filename);
} zend_end_try();
if(op_array != NULL) {
- destroy_op_array(op_array TSRMLS_CC);
+ destroy_op_array(op_array);
efree(op_array);
RETVAL_TRUE;
} else {
RETVAL_FALSE;
}
- zend_destroy_file_handle(&handle TSRMLS_CC);
+ zend_destroy_file_handle(&handle);
}
/* {{{ proto bool opcache_is_script_cached(string $script)
@@ -737,7 +737,7 @@ static ZEND_FUNCTION(opcache_is_script_cached)
char *script_name;
size_t script_name_len;
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -745,9 +745,9 @@ static ZEND_FUNCTION(opcache_is_script_cached)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &script_name, &script_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &script_name, &script_name_len) == FAILURE) {
return;
}
- RETURN_BOOL(filename_is_in_cache(script_name, script_name_len TSRMLS_CC));
+ RETURN_BOOL(filename_is_in_cache(script_name, script_name_len));
}
diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h
index c7fe7d8e17..65b984a036 100644
--- a/ext/opcache/zend_accelerator_module.h
+++ b/ext/opcache/zend_accelerator_module.h
@@ -22,8 +22,8 @@
#ifndef ZEND_ACCELERATOR_MODULE_H
#define ZEND_ACCELERATOR_MODULE_H
-int start_accel_module(TSRMLS_D);
+int start_accel_module(void);
-void zend_accel_override_file_functions(TSRMLS_D);
+void zend_accel_override_file_functions(void);
#endif /* _ZEND_ACCELERATOR_MODULE_H */
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 22683245f6..860e18a299 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -48,12 +48,11 @@ static const uint32_t uninitialized_bucket = {INVALID_IDX};
static int zend_prepare_function_for_execution(zend_op_array *op_array);
static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind);
-static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC);
+static zend_ast *zend_ast_clone(zend_ast *ast);
static void zend_accel_destroy_zend_function(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
- TSRMLS_FETCH();
if (function->type == ZEND_USER_FUNCTION) {
if (function->op_array.static_variables) {
@@ -63,7 +62,7 @@ static void zend_accel_destroy_zend_function(zval *zv)
}
}
- destroy_zend_function(function TSRMLS_CC);
+ destroy_zend_function(function);
}
static void zend_accel_destroy_zend_class(zval *zv)
@@ -114,16 +113,16 @@ static int is_not_internal_function(zval *zv)
return(function->type != ZEND_INTERNAL_FUNCTION);
}
-void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC)
+void zend_accel_free_user_functions(HashTable *ht)
{
dtor_func_t orig_dtor = ht->pDestructor;
ht->pDestructor = NULL;
- zend_hash_apply(ht, (apply_func_t) is_not_internal_function TSRMLS_CC);
+ zend_hash_apply(ht, (apply_func_t) is_not_internal_function);
ht->pDestructor = orig_dtor;
}
-static int move_user_function(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int move_user_function(zval *zv, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_function *function = Z_PTR_P(zv);
HashTable *function_table = va_arg(args, HashTable *);
@@ -137,16 +136,16 @@ static int move_user_function(zval *zv TSRMLS_DC, int num_args, va_list args, ze
}
}
-void zend_accel_move_user_functions(HashTable *src, HashTable *dst TSRMLS_DC)
+void zend_accel_move_user_functions(HashTable *src, HashTable *dst)
{
dtor_func_t orig_dtor = src->pDestructor;
src->pDestructor = NULL;
- zend_hash_apply_with_arguments(src TSRMLS_CC, (apply_func_args_t)move_user_function, 1, dst);
+ zend_hash_apply_with_arguments(src, (apply_func_args_t)move_user_function, 1, dst);
src->pDestructor = orig_dtor;
}
-static int copy_internal_function(zval *zv, HashTable *function_table TSRMLS_DC)
+static int copy_internal_function(zval *zv, HashTable *function_table)
{
zend_internal_function *function = Z_PTR_P(zv);
if (function->type == ZEND_INTERNAL_FUNCTION) {
@@ -155,9 +154,9 @@ static int copy_internal_function(zval *zv, HashTable *function_table TSRMLS_DC)
return 0;
}
-void zend_accel_copy_internal_functions(TSRMLS_D)
+void zend_accel_copy_internal_functions(void)
{
- zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table) TSRMLS_CC);
+ zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table));
ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table));
}
@@ -171,7 +170,7 @@ static void zend_destroy_property_info(zval *zv)
}
}
-static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC)
+static inline zend_string *zend_clone_str(zend_string *str)
{
zend_string *ret;
@@ -189,7 +188,7 @@ static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC)
return ret;
}
-static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
+static inline void zend_clone_zval(zval *src, int bind)
{
void *ptr;
@@ -200,7 +199,7 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
switch (Z_TYPE_P(src)) {
case IS_STRING:
case IS_CONSTANT:
- Z_STR_P(src) = zend_clone_str(Z_STR_P(src) TSRMLS_CC);
+ Z_STR_P(src) = zend_clone_str(Z_STR_P(src));
break;
case IS_ARRAY:
if (Z_ARR_P(src) != &EG(symbol_table)) {
@@ -228,7 +227,7 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
if (bind && Z_REFCOUNT_P(src) > 1) {
accel_xlat_set(old, Z_REF_P(src));
}
- zend_clone_zval(Z_REFVAL_P(src), bind TSRMLS_CC);
+ zend_clone_zval(Z_REFVAL_P(src), bind);
}
break;
case IS_CONSTANT_AST:
@@ -242,13 +241,13 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
if (bind && Z_REFCOUNT_P(src) > 1) {
accel_xlat_set(old, Z_AST_P(src));
}
- Z_ASTVAL_P(src) = zend_ast_clone(Z_ASTVAL_P(src) TSRMLS_CC);
+ Z_ASTVAL_P(src) = zend_ast_clone(Z_ASTVAL_P(src));
}
break;
}
}
-static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
+static zend_ast *zend_ast_clone(zend_ast *ast)
{
uint32_t i;
@@ -257,7 +256,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->kind = ZEND_AST_ZVAL;
copy->attr = ast->attr;
ZVAL_COPY_VALUE(&copy->val, zend_ast_get_zval(ast));
- zend_clone_zval(&copy->val, 0 TSRMLS_CC);
+ zend_clone_zval(&copy->val, 0);
return (zend_ast *) copy;
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
@@ -268,7 +267,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->children = list->children;
for (i = 0; i < list->children; i++) {
if (list->child[i]) {
- copy->child[i] = zend_ast_clone(list->child[i] TSRMLS_CC);
+ copy->child[i] = zend_ast_clone(list->child[i]);
} else {
copy->child[i] = NULL;
}
@@ -281,7 +280,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->attr = ast->attr;
for (i = 0; i < children; i++) {
if (ast->child[i]) {
- copy->child[i] = zend_ast_clone(ast->child[i] TSRMLS_CC);
+ copy->child[i] = zend_ast_clone(ast->child[i]);
} else {
copy->child[i] = NULL;
}
@@ -295,7 +294,6 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
uint idx;
Bucket *p, *q, *r;
zend_ulong nIndex;
- TSRMLS_FETCH();
ht->nTableSize = source->nTableSize;
ht->nTableMask = source->nTableMask;
@@ -337,7 +335,7 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
/* Copy data */
ZVAL_COPY_VALUE(&q->val, &p->val);
- zend_clone_zval(&q->val, bind TSRMLS_CC);
+ zend_clone_zval(&q->val, bind);
}
} else {
ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t)));
@@ -359,17 +357,17 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
if (!p->key) {
q->key = NULL;
} else {
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
}
/* Copy data */
ZVAL_COPY_VALUE(&q->val, &p->val);
- zend_clone_zval(&q->val, bind TSRMLS_CC);
+ zend_clone_zval(&q->val, bind);
}
}
}
-static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce TSRMLS_DC)
+static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce)
{
uint idx;
Bucket *p, *q;
@@ -411,7 +409,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class
/* Initialize key */
q->h = p->h;
ZEND_ASSERT(p->key != NULL);
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
/* Copy data */
ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val)));
@@ -446,7 +444,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class
}
}
-static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce TSRMLS_DC)
+static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce)
{
uint idx;
Bucket *p, *q;
@@ -487,14 +485,14 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla
/* Initialize key */
q->h = p->h;
ZEND_ASSERT(p->key != NULL);
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
/* Copy data */
ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val)));
prop_info = Z_PTR(q->val);
/* Copy constructor */
- prop_info->name = zend_clone_str(prop_info->name TSRMLS_CC);
+ prop_info->name = zend_clone_str(prop_info->name);
if (prop_info->doc_comment) {
if (ZCG(accel_directives).load_comments) {
prop_info->doc_comment = zend_string_dup(prop_info->doc_comment, 0);
@@ -548,7 +546,6 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
zend_class_entry *old_ce = ce;
zend_class_entry *new_ce;
zend_function *new_func;
- TSRMLS_FETCH();
*pce = ce = ARENA_REALLOC(old_ce);
ce->refcount = 1;
@@ -564,11 +561,11 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
ce->default_properties_table = emalloc(sizeof(zval) * old_ce->default_properties_count);
for (i = 0; i < old_ce->default_properties_count; i++) {
ZVAL_COPY_VALUE(&ce->default_properties_table[i], &old_ce->default_properties_table[i]);
- zend_clone_zval(&ce->default_properties_table[i], 1 TSRMLS_CC);
+ zend_clone_zval(&ce->default_properties_table[i], 1);
}
}
- zend_hash_clone_methods(&ce->function_table, &old_ce->function_table, old_ce, ce TSRMLS_CC);
+ zend_hash_clone_methods(&ce->function_table, &old_ce->function_table, old_ce, ce);
/* static members */
if (old_ce->default_static_members_table) {
@@ -577,19 +574,19 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
ce->default_static_members_table = emalloc(sizeof(zval) * old_ce->default_static_members_count);
for (i = 0; i < old_ce->default_static_members_count; i++) {
ZVAL_COPY_VALUE(&ce->default_static_members_table[i], &old_ce->default_static_members_table[i]);
- zend_clone_zval(&ce->default_static_members_table[i], 1 TSRMLS_CC);
+ zend_clone_zval(&ce->default_static_members_table[i], 1);
}
}
ce->static_members_table = ce->default_static_members_table;
/* properties_info */
- zend_hash_clone_prop_info(&ce->properties_info, &old_ce->properties_info, old_ce, ce TSRMLS_CC);
+ zend_hash_clone_prop_info(&ce->properties_info, &old_ce->properties_info, old_ce, ce);
/* constants table */
zend_hash_clone_zval(&ce->constants_table, &old_ce->constants_table, 1);
ce->constants_table.u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
- ce->name = zend_clone_str(ce->name TSRMLS_CC);
+ ce->name = zend_clone_str(ce->name);
/* interfaces aren't really implemented, so we create a new table */
if (ce->num_interfaces) {
@@ -650,17 +647,17 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
if (trait_aliases[i]->trait_method) {
if (trait_aliases[i]->trait_method->method_name) {
trait_aliases[i]->trait_method->method_name =
- zend_clone_str(trait_aliases[i]->trait_method->method_name TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->trait_method->method_name);
}
if (trait_aliases[i]->trait_method->class_name) {
trait_aliases[i]->trait_method->class_name =
- zend_clone_str(trait_aliases[i]->trait_method->class_name TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->trait_method->class_name);
}
}
if (trait_aliases[i]->alias) {
trait_aliases[i]->alias =
- zend_clone_str(trait_aliases[i]->alias TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->alias);
}
i++;
}
@@ -684,9 +681,9 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
memcpy(trait_precedences[i]->trait_method, ce->trait_precedences[i]->trait_method, sizeof(zend_trait_method_reference));
trait_precedences[i]->trait_method->method_name =
- zend_clone_str(trait_precedences[i]->trait_method->method_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->trait_method->method_name);
trait_precedences[i]->trait_method->class_name =
- zend_clone_str(trait_precedences[i]->trait_method->class_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->trait_method->class_name);
if (trait_precedences[i]->exclude_from_classes) {
zend_string **exclude_from_classes;
@@ -699,7 +696,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
j = 0;
while (trait_precedences[i]->exclude_from_classes[j].class_name) {
exclude_from_classes[j] =
- zend_clone_str(trait_precedences[i]->exclude_from_classes[j].class_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->exclude_from_classes[j].class_name);
j++;
}
exclude_from_classes[j] = NULL;
@@ -712,7 +709,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
}
}
-static void zend_accel_function_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor TSRMLS_DC)
+static void zend_accel_function_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor)
{
zend_function *function1, *function2;
uint idx;
@@ -752,7 +749,7 @@ failure:
function1 = Z_PTR(p->val);
function2 = Z_PTR_P(t);
CG(in_compilation) = 1;
- zend_set_compiled_filename(function1->op_array.filename TSRMLS_CC);
+ zend_set_compiled_filename(function1->op_array.filename);
CG(zend_lineno) = function1->op_array.opcodes[0].lineno;
if (function2->type == ZEND_USER_FUNCTION
&& function2->op_array.last > 0) {
@@ -765,7 +762,7 @@ failure:
}
}
-static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor TSRMLS_DC)
+static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor)
{
zend_class_entry *ce1;
uint idx;
@@ -805,12 +802,12 @@ static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, uni
failure:
ce1 = Z_PTR(p->val);
CG(in_compilation) = 1;
- zend_set_compiled_filename(ce1->info.user.filename TSRMLS_CC);
+ zend_set_compiled_filename(ce1->info.user.filename);
CG(zend_lineno) = ce1->info.user.line_start;
zend_error(E_ERROR, "Cannot redeclare class %s", ce1->name->val);
}
-zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory TSRMLS_DC)
+zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory)
{
zend_op_array *op_array;
@@ -829,12 +826,12 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
/* 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 TSRMLS_CC);
+ 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(CG(function_table), &persistent_script->function_table, (unique_copy_ctor_func_t)zend_prepare_function_for_execution TSRMLS_CC);
+ zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, (unique_copy_ctor_func_t)zend_prepare_function_for_execution);
}
zend_prepare_function_for_execution(op_array);
@@ -847,7 +844,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
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 TSRMLS_CC);
+ zend_register_long_constant(name->val, name->len, persistent_script->compiler_halt_offset, CONST_CS, 0);
}
zend_string_release(name);
}
@@ -856,17 +853,17 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
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, NULL TSRMLS_CC);
+ zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, NULL);
}
if (zend_hash_num_elements(&persistent_script->class_table) > 0) {
- zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC);
+ 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 TSRMLS_CC);
+ zend_do_delayed_early_binding(op_array);
CG(compiled_filename) = orig_compiled_filename;
}
diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h
index cbcb2ffa8e..7b3f099e65 100644
--- a/ext/opcache/zend_accelerator_util_funcs.h
+++ b/ext/opcache/zend_accelerator_util_funcs.h
@@ -25,15 +25,15 @@
#include "zend.h"
#include "ZendAccelerator.h"
-void zend_accel_copy_internal_functions(TSRMLS_D);
+void zend_accel_copy_internal_functions(void);
zend_persistent_script* create_persistent_script(void);
void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements);
-void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC);
-void zend_accel_move_user_functions(HashTable *str, HashTable *dst TSRMLS_DC);
+void zend_accel_free_user_functions(HashTable *ht);
+void zend_accel_move_user_functions(HashTable *str, HashTable *dst);
-zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory TSRMLS_DC);
+zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory);
#define ADLER32_INIT 1 /* initial Adler-32 value */
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index f790a5d778..cb4f63b0ef 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -29,9 +29,9 @@
#include "zend_operators.h"
#define zend_accel_store(p, size) \
- (p = _zend_shared_memdup((void*)p, size, 1 TSRMLS_CC))
+ (p = _zend_shared_memdup((void*)p, size, 1))
#define zend_accel_memdup(p, size) \
- _zend_shared_memdup((void*)p, size, 0 TSRMLS_CC)
+ _zend_shared_memdup((void*)p, size, 0)
#define zend_accel_store_string(str) do { \
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
@@ -62,14 +62,14 @@
} \
} while (0)
-typedef void (*zend_persist_func_t)(zval* TSRMLS_DC);
+typedef void (*zend_persist_func_t)(zval*);
-static void zend_persist_zval(zval *z TSRMLS_DC);
-static void zend_persist_zval_const(zval *z TSRMLS_DC);
+static void zend_persist_zval(zval *z);
+static void zend_persist_zval_const(zval *z);
static const uint32_t uninitialized_bucket = {INVALID_IDX};
-static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement TSRMLS_DC)
+static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement)
{
uint idx;
Bucket *p;
@@ -102,11 +102,11 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
}
/* persist the data itself */
- pPersistElement(&p->val TSRMLS_CC);
+ pPersistElement(&p->val);
}
}
-static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC)
+static void zend_hash_persist_immutable(HashTable *ht)
{
uint idx;
Bucket *p;
@@ -138,18 +138,18 @@ static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC)
}
/* persist the data itself */
- zend_persist_zval_const(&p->val TSRMLS_CC);
+ zend_persist_zval_const(&p->val);
}
}
-static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
+static zend_ast *zend_persist_ast(zend_ast *ast)
{
uint32_t i;
zend_ast *node;
if (ast->kind == ZEND_AST_ZVAL) {
zend_ast_zval *copy = zend_accel_memdup(ast, sizeof(zend_ast_zval));
- zend_persist_zval(&copy->val TSRMLS_CC);
+ zend_persist_zval(&copy->val);
node = (zend_ast *) copy;
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
@@ -157,7 +157,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
for (i = 0; i < list->children; i++) {
if (copy->child[i]) {
- copy->child[i] = zend_persist_ast(copy->child[i] TSRMLS_CC);
+ copy->child[i] = zend_persist_ast(copy->child[i]);
}
}
node = (zend_ast *) copy;
@@ -166,7 +166,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
node = zend_accel_memdup(ast, sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
for (i = 0; i < children; i++) {
if (node->child[i]) {
- node->child[i] = zend_persist_ast(node->child[i] TSRMLS_CC);
+ node->child[i] = zend_persist_ast(node->child[i]);
}
}
}
@@ -175,7 +175,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
return node;
}
-static void zend_persist_zval(zval *z TSRMLS_DC)
+static void zend_persist_zval(zval *z)
{
zend_uchar flags;
void *new_ptr;
@@ -196,11 +196,11 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
} else {
if (Z_IMMUTABLE_P(z)) {
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
+ zend_hash_persist_immutable(Z_ARRVAL_P(z));
} else {
GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
/* make immutable array */
Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
@@ -214,7 +214,7 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_REF_P(z) = new_ptr;
} else {
zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
- zend_persist_zval(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
@@ -223,13 +223,13 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_AST_P(z) = new_ptr;
} else {
zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
- Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z) TSRMLS_CC);
+ Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_zval_const(zval *z TSRMLS_DC)
+static void zend_persist_zval_const(zval *z)
{
zend_uchar flags;
void *new_ptr;
@@ -250,11 +250,11 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
} else {
if (Z_IMMUTABLE_P(z)) {
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
+ zend_hash_persist_immutable(Z_ARRVAL_P(z));
} else {
GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
/* make immutable array */
Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
@@ -268,7 +268,7 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_REF_P(z) = new_ptr;
} else {
zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
- zend_persist_zval(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
@@ -277,13 +277,13 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_AST_P(z) = new_ptr;
} else {
zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
- Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z) TSRMLS_CC);
+ Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_script* main_persistent_script TSRMLS_DC)
+static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_script* main_persistent_script)
{
int already_stored = 0;
zend_op *persist_ptr;
@@ -306,14 +306,14 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
memset(&fake_execute_data, 0, sizeof(fake_execute_data));
fake_execute_data.func = (zend_function*)op_array;
EG(current_execute_data) = &fake_execute_data;
- if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) {
+ if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
main_persistent_script->compiler_halt_offset = Z_LVAL_P(offset);
}
EG(current_execute_data) = orig_execute_data;
}
if (op_array->static_variables) {
- zend_hash_persist(op_array->static_variables, zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(op_array->static_variables, zend_persist_zval);
zend_accel_store(op_array->static_variables, sizeof(HashTable));
}
@@ -332,7 +332,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
orig_literals = op_array->literals;
op_array->literals = p;
while (p < end) {
- zend_persist_zval(p TSRMLS_CC);
+ zend_persist_zval(p);
p++;
}
efree(orig_literals);
@@ -487,16 +487,16 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
}
}
-static void zend_persist_op_array(zval *zv TSRMLS_DC)
+static void zend_persist_op_array(zval *zv)
{
memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_op_array));
zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem));
Z_PTR_P(zv) = ZCG(arena_mem);
ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_op_array)));
- zend_persist_op_array_ex(Z_PTR_P(zv), NULL TSRMLS_CC);
+ zend_persist_op_array_ex(Z_PTR_P(zv), NULL);
}
-static void zend_persist_property_info(zval *zv TSRMLS_DC)
+static void zend_persist_property_info(zval *zv)
{
zend_property_info *prop;
@@ -518,7 +518,7 @@ static void zend_persist_property_info(zval *zv TSRMLS_DC)
}
}
-static void zend_persist_class_entry(zval *zv TSRMLS_DC)
+static void zend_persist_class_entry(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
@@ -528,13 +528,13 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
ce = Z_PTR_P(zv) = ZCG(arena_mem);
ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_class_entry)));
zend_accel_store_interned_string(ce->name);
- zend_hash_persist(&ce->function_table, zend_persist_op_array TSRMLS_CC);
+ zend_hash_persist(&ce->function_table, zend_persist_op_array);
if (ce->default_properties_table) {
int i;
zend_accel_store(ce->default_properties_table, sizeof(zval) * ce->default_properties_count);
for (i = 0; i < ce->default_properties_count; i++) {
- zend_persist_zval(&ce->default_properties_table[i] TSRMLS_CC);
+ zend_persist_zval(&ce->default_properties_table[i]);
}
}
if (ce->default_static_members_table) {
@@ -542,12 +542,12 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
zend_accel_store(ce->default_static_members_table, sizeof(zval) * ce->default_static_members_count);
for (i = 0; i < ce->default_static_members_count; i++) {
- zend_persist_zval(&ce->default_static_members_table[i] TSRMLS_CC);
+ zend_persist_zval(&ce->default_static_members_table[i]);
}
}
ce->static_members_table = NULL;
- zend_hash_persist(&ce->constants_table, zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(&ce->constants_table, zend_persist_zval);
if (ZEND_CE_FILENAME(ce)) {
/* do not free! PHP has centralized filename storage, compiler will free it */
@@ -564,7 +564,7 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
ZEND_CE_DOC_COMMENT(ce) = NULL;
}
}
- zend_hash_persist(&ce->properties_info, zend_persist_property_info TSRMLS_CC);
+ zend_hash_persist(&ce->properties_info, zend_persist_property_info);
if (ce->num_interfaces && ce->interfaces) {
efree(ce->interfaces);
}
@@ -631,7 +631,7 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
}
}
-static int zend_update_property_info_ce(zval *zv TSRMLS_DC)
+static int zend_update_property_info_ce(zval *zv)
{
zend_property_info *prop = Z_PTR_P(zv);
@@ -639,7 +639,7 @@ static int zend_update_property_info_ce(zval *zv TSRMLS_DC)
return 0;
}
-static int zend_update_parent_ce(zval *zv TSRMLS_DC)
+static int zend_update_parent_ce(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
@@ -703,17 +703,17 @@ static int zend_update_parent_ce(zval *zv TSRMLS_DC)
ce->__debugInfo = zend_shared_alloc_get_xlat_entry(ce->__debugInfo);
ce->__debugInfo->op_array.refcount++;
}
- zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce TSRMLS_CC);
+ zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce);
return 0;
}
-static void zend_accel_persist_class_table(HashTable *class_table TSRMLS_DC)
+static void zend_accel_persist_class_table(HashTable *class_table)
{
- zend_hash_persist(class_table, zend_persist_class_entry TSRMLS_CC);
- zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce TSRMLS_CC);
+ zend_hash_persist(class_table, zend_persist_class_entry);
+ zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
}
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length TSRMLS_DC)
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
{
script->mem = ZCG(mem);
@@ -726,9 +726,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
script->arena_mem = ZCG(arena_mem) = ZCG(mem);
ZCG(mem) = (void*)((char*)ZCG(mem) + script->arena_size);
- zend_accel_persist_class_table(&script->class_table TSRMLS_CC);
- zend_hash_persist(&script->function_table, zend_persist_op_array TSRMLS_CC);
- zend_persist_op_array_ex(&script->main_op_array, script TSRMLS_CC);
+ zend_accel_persist_class_table(&script->class_table);
+ zend_hash_persist(&script->function_table, zend_persist_op_array);
+ zend_persist_op_array_ex(&script->main_op_array, script);
return script;
}
diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h
index 1b95a4ab04..1ae7fabf4e 100644
--- a/ext/opcache/zend_persist.h
+++ b/ext/opcache/zend_persist.h
@@ -23,7 +23,7 @@
#define ZEND_PERSIST_H
int zend_accel_script_persistable(zend_persistent_script *script);
-uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length TSRMLS_DC);
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length TSRMLS_DC);
+uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length);
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
#endif /* ZEND_PERSIST_H */
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index 6a35c5ca9b..9e96d5da42 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -35,7 +35,7 @@
ADD_DUP_SIZE((str), _STR_HEADER_SIZE + (str)->len + 1)
# define ADD_INTERNED_STRING(str, do_free) do { \
if (!IS_ACCEL_INTERNED(str)) { \
- zend_string *tmp = accel_new_interned_string(str TSRMLS_CC); \
+ zend_string *tmp = accel_new_interned_string(str); \
if (tmp != (str)) { \
if (do_free) { \
/*zend_string_release(str);*/ \
@@ -47,9 +47,9 @@
} \
} while (0)
-static void zend_persist_zval_calc(zval *z TSRMLS_DC);
+static void zend_persist_zval_calc(zval *z);
-static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement TSRMLS_DC) TSRMLS_DC)
+static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement))
{
uint idx;
Bucket *p;
@@ -74,23 +74,23 @@ static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *
GC_FLAGS(p->key) |= flags;
}
- pPersistElement(&p->val TSRMLS_CC);
+ pPersistElement(&p->val);
}
}
-static void zend_persist_ast_calc(zend_ast *ast TSRMLS_DC)
+static void zend_persist_ast_calc(zend_ast *ast)
{
uint32_t i;
if (ast->kind == ZEND_AST_ZVAL) {
ADD_SIZE(sizeof(zend_ast_zval));
- zend_persist_zval_calc(zend_ast_get_zval(ast) TSRMLS_CC);
+ zend_persist_zval_calc(zend_ast_get_zval(ast));
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
ADD_SIZE(sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
for (i = 0; i < list->children; i++) {
if (list->child[i]) {
- zend_persist_ast_calc(list->child[i] TSRMLS_CC);
+ zend_persist_ast_calc(list->child[i]);
}
}
} else {
@@ -98,13 +98,13 @@ static void zend_persist_ast_calc(zend_ast *ast TSRMLS_DC)
ADD_SIZE(sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
for (i = 0; i < children; i++) {
if (ast->child[i]) {
- zend_persist_ast_calc(ast->child[i] TSRMLS_CC);
+ zend_persist_ast_calc(ast->child[i]);
}
}
}
}
-static void zend_persist_zval_calc(zval *z TSRMLS_DC)
+static void zend_persist_zval_calc(zval *z)
{
zend_uchar flags;
uint size;
@@ -123,27 +123,27 @@ static void zend_persist_zval_calc(zval *z TSRMLS_DC)
size = zend_shared_memdup_size(Z_ARR_P(z), sizeof(zend_array));
if (size) {
ADD_SIZE(size);
- zend_hash_persist_calc(Z_ARRVAL_P(z), zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(Z_ARRVAL_P(z), zend_persist_zval_calc);
}
break;
case IS_REFERENCE:
size = zend_shared_memdup_size(Z_REF_P(z), sizeof(zend_reference));
if (size) {
ADD_SIZE(size);
- zend_persist_zval_calc(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval_calc(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
size = zend_shared_memdup_size(Z_AST_P(z), sizeof(zend_ast_ref));
if (size) {
ADD_SIZE(size);
- zend_persist_ast_calc(Z_ASTVAL_P(z) TSRMLS_CC);
+ zend_persist_ast_calc(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
+static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
{
if (op_array->type != ZEND_USER_FUNCTION) {
return;
@@ -151,7 +151,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
if (op_array->static_variables) {
ADD_DUP_SIZE(op_array->static_variables, sizeof(HashTable));
- zend_hash_persist_calc(op_array->static_variables, zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(op_array->static_variables, zend_persist_zval_calc);
}
if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) {
@@ -170,7 +170,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
zval *end = p + op_array->last_literal;
ADD_DUP_SIZE(op_array->literals, sizeof(zval) * op_array->last_literal);
while (p < end) {
- zend_persist_zval_calc(p TSRMLS_CC);
+ zend_persist_zval_calc(p);
p++;
}
}
@@ -230,13 +230,13 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
}
}
-static void zend_persist_op_array_calc(zval *zv TSRMLS_DC)
+static void zend_persist_op_array_calc(zval *zv)
{
ADD_ARENA_SIZE(sizeof(zend_op_array));
- zend_persist_op_array_calc_ex(Z_PTR_P(zv) TSRMLS_CC);
+ zend_persist_op_array_calc_ex(Z_PTR_P(zv));
}
-static void zend_persist_property_info_calc(zval *zv TSRMLS_DC)
+static void zend_persist_property_info_calc(zval *zv)
{
zend_property_info *prop = Z_PTR_P(zv);
@@ -247,20 +247,20 @@ static void zend_persist_property_info_calc(zval *zv TSRMLS_DC)
}
}
-static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
+static void zend_persist_class_entry_calc(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
if (ce->type == ZEND_USER_CLASS) {
ADD_ARENA_SIZE(sizeof(zend_class_entry));
ADD_INTERNED_STRING(ce->name, 0);
- zend_hash_persist_calc(&ce->function_table, zend_persist_op_array_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->function_table, zend_persist_op_array_calc);
if (ce->default_properties_table) {
int i;
ADD_SIZE(sizeof(zval) * ce->default_properties_count);
for (i = 0; i < ce->default_properties_count; i++) {
- zend_persist_zval_calc(&ce->default_properties_table[i] TSRMLS_CC);
+ zend_persist_zval_calc(&ce->default_properties_table[i]);
}
}
if (ce->default_static_members_table) {
@@ -268,10 +268,10 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
ADD_SIZE(sizeof(zval) * ce->default_static_members_count);
for (i = 0; i < ce->default_static_members_count; i++) {
- zend_persist_zval_calc(&ce->default_static_members_table[i] TSRMLS_CC);
+ zend_persist_zval_calc(&ce->default_static_members_table[i]);
}
}
- zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc);
if (ZEND_CE_FILENAME(ce)) {
ADD_STRING(ZEND_CE_FILENAME(ce));
@@ -280,7 +280,7 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
ADD_STRING(ZEND_CE_DOC_COMMENT(ce));
}
- zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc);
if (ce->trait_aliases) {
int i = 0;
@@ -329,12 +329,12 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
}
}
-static void zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC)
+static void zend_accel_persist_class_table_calc(HashTable *class_table)
{
- zend_hash_persist_calc(class_table, zend_persist_class_entry_calc TSRMLS_CC);
+ zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
}
-uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length TSRMLS_DC)
+uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length)
{
new_persistent_script->mem = NULL;
new_persistent_script->size = 0;
@@ -346,9 +346,9 @@ uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_scrip
ADD_DUP_SIZE(key, key_length + 1);
ADD_STRING(new_persistent_script->full_path);
- zend_accel_persist_class_table_calc(&new_persistent_script->class_table TSRMLS_CC);
- zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc TSRMLS_CC);
- zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array TSRMLS_CC);
+ zend_accel_persist_class_table_calc(&new_persistent_script->class_table);
+ zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc);
+ zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array);
new_persistent_script->size += new_persistent_script->arena_size;
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index 43a0263ee5..4036abe06f 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -157,7 +157,6 @@ int zend_shared_alloc_startup(size_t requested_size)
const zend_shared_memory_handler_entry *he;
int res = ALLOC_FAILURE;
- TSRMLS_FETCH();
/* shared_free must be valid before we call zend_shared_alloc()
* - make it temporarily point to a local variable
@@ -298,7 +297,6 @@ void *zend_shared_alloc(size_t size)
{
int i;
unsigned int block_size = ZEND_ALIGNED_SIZE(size);
- TSRMLS_FETCH();
#if 1
if (!ZCG(locked)) {
@@ -335,7 +333,7 @@ int zend_shared_memdup_size(void *source, size_t size)
return ZEND_ALIGNED_SIZE(size);
}
-void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRMLS_DC)
+void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source)
{
void *old_p, *retval;
@@ -353,10 +351,10 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRML
return retval;
}
-void zend_shared_alloc_safe_unlock(TSRMLS_D)
+void zend_shared_alloc_safe_unlock(void)
{
if (ZCG(locked)) {
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
}
@@ -366,7 +364,7 @@ static FLOCK_STRUCTURE(mem_write_lock, F_WRLCK, SEEK_SET, 0, 1);
static FLOCK_STRUCTURE(mem_write_unlock, F_UNLCK, SEEK_SET, 0, 1);
#endif
-void zend_shared_alloc_lock(TSRMLS_D)
+void zend_shared_alloc_lock(void)
{
#ifndef ZEND_WIN32
@@ -405,7 +403,7 @@ void zend_shared_alloc_lock(TSRMLS_D)
zend_hash_init(&xlat_table, 128, NULL, NULL, 1);
}
-void zend_shared_alloc_unlock(TSRMLS_D)
+void zend_shared_alloc_unlock(void)
{
/* Destroy translation table */
zend_hash_destroy(&xlat_table);
@@ -476,7 +474,7 @@ const char *zend_accel_get_shared_model(void)
return g_shared_model;
}
-void zend_accel_shared_protect(int mode TSRMLS_DC)
+void zend_accel_shared_protect(int mode)
{
#ifdef HAVE_MPROTECT
int i;
diff --git a/ext/opcache/zend_shared_alloc.h b/ext/opcache/zend_shared_alloc.h
index ec7cc14d07..1476073f71 100644
--- a/ext/opcache/zend_shared_alloc.h
+++ b/ext/opcache/zend_shared_alloc.h
@@ -124,7 +124,7 @@ void zend_shared_alloc_shutdown(void);
void *zend_shared_alloc(size_t size);
/* copy into shared memory */
-void *_zend_shared_memdup(void *p, size_t size, zend_bool free_source TSRMLS_DC);
+void *_zend_shared_memdup(void *p, size_t size, zend_bool free_source);
int zend_shared_memdup_size(void *p, size_t size);
typedef union _align_test {
@@ -143,9 +143,9 @@ typedef union _align_test {
((size + PLATFORM_ALIGNMENT - 1) & ~(PLATFORM_ALIGNMENT - 1))
/* exclusive locking */
-void zend_shared_alloc_lock(TSRMLS_D);
-void zend_shared_alloc_unlock(TSRMLS_D); /* returns the allocated size during lock..unlock */
-void zend_shared_alloc_safe_unlock(TSRMLS_D);
+void zend_shared_alloc_lock(void);
+void zend_shared_alloc_unlock(void); /* returns the allocated size during lock..unlock */
+void zend_shared_alloc_safe_unlock(void);
/* old/new mapping functions */
void zend_shared_alloc_clear_xlat_table(void);
@@ -158,7 +158,7 @@ void zend_shared_alloc_restore_state(void);
const char *zend_accel_get_shared_model(void);
/* memory write protection */
-void zend_accel_shared_protect(int mode TSRMLS_DC);
+void zend_accel_shared_protect(int mode);
#ifdef USE_MMAP
extern zend_shared_memory_handlers zend_alloc_mmap_handlers;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 60d36ff743..a69ce8190b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -542,7 +542,7 @@ int php_openssl_get_x509_list_id(void) /* {{{ */
/* }}} */
/* {{{ resource destructors */
-static void php_pkey_free(zend_resource *rsrc TSRMLS_DC)
+static void php_pkey_free(zend_resource *rsrc)
{
EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr;
@@ -551,13 +551,13 @@ static void php_pkey_free(zend_resource *rsrc TSRMLS_DC)
EVP_PKEY_free(pkey);
}
-static void php_x509_free(zend_resource *rsrc TSRMLS_DC)
+static void php_x509_free(zend_resource *rsrc)
{
X509 *x509 = (X509 *)rsrc->ptr;
X509_free(x509);
}
-static void php_csr_free(zend_resource *rsrc TSRMLS_DC)
+static void php_csr_free(zend_resource *rsrc)
{
X509_REQ * csr = (X509_REQ*)rsrc->ptr;
X509_REQ_free(csr);
@@ -565,9 +565,9 @@ static void php_csr_free(zend_resource *rsrc TSRMLS_DC)
/* }}} */
/* {{{ openssl open_basedir check */
-inline static int php_openssl_open_base_dir_chk(char *filename TSRMLS_DC)
+inline static int php_openssl_open_base_dir_chk(char *filename)
{
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
return -1;
}
@@ -615,15 +615,15 @@ struct php_x509_request { /* {{{ */
};
/* }}} */
-static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC);
-static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval TSRMLS_DC);
-static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC);
-static X509_STORE * setup_verify(zval * calist TSRMLS_DC);
+static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval);
+static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval);
+static int php_openssl_is_private_key(EVP_PKEY* pkey);
+static X509_STORE * setup_verify(zval * calist);
static STACK_OF(X509) * load_all_certs_from_file(char *certfile);
-static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource ** resourceval TSRMLS_DC);
-static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC);
+static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource ** resourceval);
+static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req);
-static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
+static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname) /* {{{ */
{
zval *data;
zval subitem, tmp;
@@ -690,7 +690,7 @@ static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /*
}
/* }}} */
-static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
+static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
{
/*
This is how the time string is formatted:
@@ -706,22 +706,22 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
long gmadjust = 0;
if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME && ASN1_STRING_type(timestr) != V_ASN1_GENERALIZEDTIME) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp");
+ php_error_docref(NULL, E_WARNING, "illegal ASN1 data type for timestamp");
return (time_t)-1;
}
if (ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal length in timestamp");
+ php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
return (time_t)-1;
}
if (ASN1_STRING_length(timestr) < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data);
+ php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
if (ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME && ASN1_STRING_length(timestr) < 15) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data);
+ php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
@@ -783,9 +783,9 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
/* }}} */
#if OPENSSL_VERSION_NUMBER >= 0x10000002L
-static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config) /* {{{ */
#else
-static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config TSRMLS_DC)
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config)
#endif
{
X509V3_CTX ctx;
@@ -793,7 +793,7 @@ static inline int php_openssl_config_check_syntax(const char * section_label, co
X509V3_set_ctx_test(&ctx);
X509V3_set_conf_lhash(&ctx, config);
if (!X509V3_EXT_add_conf(config, &ctx, (char *)section, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading %s section %s of %s",
+ php_error_docref(NULL, E_WARNING, "Error loading %s section %s of %s",
section_label,
section,
config_filename);
@@ -803,7 +803,7 @@ static inline int php_openssl_config_check_syntax(const char * section_label, co
}
/* }}} */
-static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
+static int add_oid_section(struct php_x509_request * req) /* {{{ */
{
char * str;
STACK_OF(CONF_VALUE) * sktmp;
@@ -816,13 +816,13 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
}
sktmp = CONF_get_section(req->req_config, str);
if (sktmp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem loading oid section %s", str);
+ php_error_docref(NULL, E_WARNING, "problem loading oid section %s", str);
return FAILURE;
}
for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
cnf = sk_CONF_VALUE_value(sktmp, i);
if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value);
+ php_error_docref(NULL, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value);
return FAILURE;
}
}
@@ -831,11 +831,11 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
/* }}} */
#define PHP_SSL_REQ_INIT(req) memset(req, 0, sizeof(*req))
-#define PHP_SSL_REQ_DISPOSE(req) php_openssl_dispose_config(req TSRMLS_CC)
-#define PHP_SSL_REQ_PARSE(req, zval) php_openssl_parse_config(req, zval TSRMLS_CC)
+#define PHP_SSL_REQ_DISPOSE(req) php_openssl_dispose_config(req)
+#define PHP_SSL_REQ_PARSE(req, zval) php_openssl_parse_config(req, zval)
#define PHP_SSL_CONFIG_SYNTAX_CHECK(var) if (req->var && php_openssl_config_check_syntax(#var, \
- req->config_filename, req->var, req->req_config TSRMLS_CC) == FAILURE) return FAILURE
+ req->config_filename, req->var, req->req_config) == FAILURE) return FAILURE
#define SET_OPTIONAL_STRING_ARG(key, varname, defval) \
if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key, sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_STRING) \
@@ -853,7 +853,7 @@ static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(zend_long algo);
int openssl_spki_cleanup(const char *src, char *dest);
-static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args TSRMLS_DC) /* {{{ */
+static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args) /* {{{ */
{
char * str;
zval * item;
@@ -869,14 +869,14 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
/* read in the oids */
str = CONF_get_string(req->req_config, NULL, "oid_file");
- if (str && !php_openssl_open_base_dir_chk(str TSRMLS_CC)) {
+ if (str && !php_openssl_open_base_dir_chk(str)) {
BIO *oid_bio = BIO_new_file(str, "r");
if (oid_bio) {
OBJ_create_objects(oid_bio);
BIO_free(oid_bio);
}
}
- if (add_oid_section(req TSRMLS_CC) == FAILURE) {
+ if (add_oid_section(req) == FAILURE) {
return FAILURE;
}
SET_OPTIONAL_STRING_ARG("digest_alg", req->digest_name,
@@ -909,7 +909,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
zend_long cipher_algo = Z_LVAL_P(item);
const EVP_CIPHER* cipher = php_openssl_get_evp_cipher_from_algo(cipher_algo);
if (cipher == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm for private key.");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm for private key.");
return FAILURE;
} else {
req->priv_key_encrypt_cipher = cipher;
@@ -936,7 +936,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
/* set the string mask */
str = CONF_get_string(req->req_config, req->section_name, "string_mask");
if (str && !ASN1_STRING_set_default_mask_asc(str)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid global string mask setting %s", str);
+ php_error_docref(NULL, E_WARNING, "Invalid global string mask setting %s", str);
return FAILURE;
}
@@ -946,7 +946,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
}
/* }}} */
-static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) /* {{{ */
+static void php_openssl_dispose_config(struct php_x509_request * req) /* {{{ */
{
if (req->priv_key) {
EVP_PKEY_free(req->priv_key);
@@ -963,7 +963,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC)
}
/* }}} */
-static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */
+static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
@@ -980,7 +980,7 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se
}
if (file == NULL || !RAND_load_file(file, -1)) {
if (RAND_status() == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to load random state; not enough random data!");
+ php_error_docref(NULL, E_WARNING, "unable to load random state; not enough random data!");
return FAILURE;
}
return FAILURE;
@@ -994,7 +994,6 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see
{
char buffer[MAXPATHLEN];
- TSRMLS_FETCH();
if (egdsocket || !seeded) {
/* if we did not manage to read the seed file, we should not write
@@ -1005,7 +1004,7 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see
file = RAND_file_name(buffer, sizeof(buffer));
}
if (file == NULL || !RAND_write_file(file)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to write random state");
+ php_error_docref(NULL, E_WARNING, "unable to write random state");
return FAILURE;
}
return SUCCESS;
@@ -1227,23 +1226,23 @@ PHP_MINIT_FUNCTION(openssl)
strlcpy(default_ssl_conf_filename, config_filename, sizeof(default_ssl_conf_filename));
}
- php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("ssl", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory);
#ifndef OPENSSL_NO_SSL2
- php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory);
#endif
- php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("tlsv1.0", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tls", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("tlsv1.0", php_openssl_ssl_socket_factory);
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
- php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory);
#endif
/* override the default tcp socket provider */
- php_stream_xport_register("tcp", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tcp", php_openssl_ssl_socket_factory);
- php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("https", &php_stream_http_wrapper);
+ php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper);
REGISTER_INI_ENTRIES();
@@ -1270,23 +1269,23 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
{
EVP_cleanup();
- php_unregister_url_stream_wrapper("https" TSRMLS_CC);
- php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("https");
+ php_unregister_url_stream_wrapper("ftps");
- php_stream_xport_unregister("ssl" TSRMLS_CC);
+ php_stream_xport_unregister("ssl");
#ifndef OPENSSL_NO_SSL2
- php_stream_xport_unregister("sslv2" TSRMLS_CC);
+ php_stream_xport_unregister("sslv2");
#endif
- php_stream_xport_unregister("sslv3" TSRMLS_CC);
- php_stream_xport_unregister("tls" TSRMLS_CC);
- php_stream_xport_unregister("tlsv1.0" TSRMLS_CC);
+ php_stream_xport_unregister("sslv3");
+ php_stream_xport_unregister("tls");
+ php_stream_xport_unregister("tlsv1.0");
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
- php_stream_xport_unregister("tlsv1.1" TSRMLS_CC);
- php_stream_xport_unregister("tlsv1.2" TSRMLS_CC);
+ php_stream_xport_unregister("tlsv1.1");
+ php_stream_xport_unregister("tlsv1.2");
#endif
/* reinstate the default tcp handler */
- php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tcp", php_stream_generic_socket_factory);
UNREGISTER_INI_ENTRIES();
@@ -1325,7 +1324,7 @@ PHP_FUNCTION(openssl_get_cert_locations)
If you supply makeresource, the result will be registered as an x509 resource and
it's value returned in makeresource.
*/
-static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval)
{
X509 *cert = NULL;
@@ -1337,7 +1336,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509", &type, 1, le_x509);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509", &type, 1, le_x509);
if (!what) {
return NULL;
}
@@ -1365,7 +1364,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
/* read cert from the named file */
BIO *in;
- if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1) TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1))) {
return NULL;
}
@@ -1391,7 +1390,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
}
if (cert && makeresource && resourceval) {
- *resourceval = zend_register_resource(NULL, cert, le_x509 TSRMLS_CC);
+ *resourceval = zend_register_resource(NULL, cert, le_x509);
}
return cert;
}
@@ -1410,18 +1409,18 @@ PHP_FUNCTION(openssl_x509_export_to_file)
char * filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return;
}
@@ -1434,7 +1433,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
if (certresource == NULL && cert) {
X509_free(cert);
@@ -1461,15 +1460,15 @@ PHP_FUNCTION(openssl_spki_new)
NETSCAPE_SPKI *spki=NULL;
const EVP_MD *mdtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z", &zpkey, &challenge, &challenge_len, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z", &zpkey, &challenge, &challenge_len, &method) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, 1, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, 1, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied private key");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied private key");
goto cleanup;
}
@@ -1477,19 +1476,19 @@ PHP_FUNCTION(openssl_spki_new)
if (Z_TYPE_P(method) == IS_LONG) {
algo = Z_LVAL_P(method);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Algorithm must be of supported type");
+ php_error_docref(NULL, E_WARNING, "Algorithm must be of supported type");
goto cleanup;
}
}
mdtype = php_openssl_get_evp_md_from_algo(algo);
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
goto cleanup;
}
if ((spki = NETSCAPE_SPKI_new()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create new SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to create new SPKAC");
goto cleanup;
}
@@ -1498,18 +1497,18 @@ PHP_FUNCTION(openssl_spki_new)
}
if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to embed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to embed public key");
goto cleanup;
}
if (!NETSCAPE_SPKI_sign(spki, pkey, mdtype)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to sign with specified algorithm");
+ php_error_docref(NULL, E_WARNING, "Unable to sign with specified algorithm");
goto cleanup;
}
spkstr = NETSCAPE_SPKI_b64_encode(spki);
if (!spkstr){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to encode SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to encode SPKAC");
goto cleanup;
}
@@ -1553,13 +1552,13 @@ PHP_FUNCTION(openssl_spki_verify)
EVP_PKEY *pkey = NULL;
NETSCAPE_SPKI *spki = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1567,19 +1566,19 @@ PHP_FUNCTION(openssl_spki_verify)
openssl_spki_cleanup(spkstr, spkstr_cleaned);
if (strlen(spkstr_cleaned)<=0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SPKAC");
+ php_error_docref(NULL, E_WARNING, "Invalid SPKAC");
goto cleanup;
}
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC");
goto cleanup;
}
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key");
goto cleanup;
}
@@ -1614,13 +1613,13 @@ PHP_FUNCTION(openssl_spki_export)
NETSCAPE_SPKI *spki = NULL;
BIO *out = BIO_new(BIO_s_mem());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1629,13 +1628,13 @@ PHP_FUNCTION(openssl_spki_export)
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC");
goto cleanup;
}
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key");
goto cleanup;
}
@@ -1672,13 +1671,13 @@ PHP_FUNCTION(openssl_spki_export_challenge)
NETSCAPE_SPKI *spki = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1687,7 +1686,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode SPKAC");
goto cleanup;
}
@@ -1729,14 +1728,14 @@ PHP_FUNCTION(openssl_x509_export)
BIO * bio_out;
zend_resource *certresource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/|b", &zcert, &zout, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|b", &zcert, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
@@ -1761,7 +1760,7 @@ PHP_FUNCTION(openssl_x509_export)
}
/* }}} */
-zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw TSRMLS_DC)
+zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw)
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
@@ -1769,10 +1768,10 @@ zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_b
zend_string *ret;
if (!(mdtype = EVP_get_digestbyname(method))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
return NULL;
} else if (!X509_digest(peer, mdtype, md, &n)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not generate signature");
+ php_error_docref(NULL, E_ERROR, "Could not generate signature");
return NULL;
}
@@ -1797,17 +1796,17 @@ PHP_FUNCTION(openssl_x509_fingerprint)
size_t method_len;
zend_string *fingerprint;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
RETURN_FALSE;
}
- fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output TSRMLS_CC);
+ fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output);
if (fingerprint) {
RETVAL_STR(fingerprint);
} else {
@@ -1830,14 +1829,14 @@ PHP_FUNCTION(openssl_x509_check_private_key)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zcert, &zkey) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zcert, &zkey) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
RETURN_FALSE;
}
- key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource);
if (key) {
RETVAL_BOOL(X509_check_private_key(cert, key));
}
@@ -1936,10 +1935,10 @@ PHP_FUNCTION(openssl_x509_parse)
BUF_MEM *bio_buf;
char buf[256];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcert, &useshortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcert, &useshortnames) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
RETURN_FALSE;
}
@@ -1950,7 +1949,7 @@ PHP_FUNCTION(openssl_x509_parse)
}
/* add_assoc_bool(return_value, "valid", cert->valid); */
- add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames);
/* hash as used in CA directories to lookup cert by subject name */
{
char buf[32];
@@ -1958,7 +1957,7 @@ PHP_FUNCTION(openssl_x509_parse)
add_assoc_string(return_value, "hash", buf);
}
- add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames);
add_assoc_long(return_value, "version", X509_get_version(cert));
add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert)));
@@ -1966,8 +1965,8 @@ PHP_FUNCTION(openssl_x509_parse)
add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert));
add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert));
- add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert) TSRMLS_CC));
- add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert) TSRMLS_CC));
+ add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert)));
+ add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert)));
tmpstr = (char *)X509_alias_get0(cert, NULL);
if (tmpstr) {
@@ -2058,27 +2057,26 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
STACK_OF(X509) *stack=NULL, *ret=NULL;
BIO *in=NULL;
X509_INFO *xi;
- TSRMLS_FETCH();
if(!(stack = sk_X509_new_null())) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
+ php_error_docref(NULL, E_ERROR, "memory allocation failure");
goto end;
}
- if (php_openssl_open_base_dir_chk(certfile TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(certfile)) {
sk_X509_free(stack);
goto end;
}
if(!(in=BIO_new_file(certfile, "r"))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening the file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "error opening the file, %s", certfile);
sk_X509_free(stack);
goto end;
}
/* This loads from a file, a stack of x509/crl/pkey sets */
if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error reading the file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "error reading the file, %s", certfile);
sk_X509_free(stack);
goto end;
}
@@ -2093,7 +2091,7 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
X509_INFO_free(xi);
}
if(!sk_X509_num(stack)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no certificates in file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "no certificates in file, %s", certfile);
sk_X509_free(stack);
goto end;
}
@@ -2111,11 +2109,10 @@ static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain,
{
int ret=0;
X509_STORE_CTX *csc;
- TSRMLS_FETCH();
csc = X509_STORE_CTX_new();
if (csc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
+ php_error_docref(NULL, E_ERROR, "memory allocation failure");
return 0;
}
X509_STORE_CTX_init(csc, ctx, x, untrustedchain);
@@ -2143,7 +2140,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
size_t untrusted_len = 0;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) {
return;
}
@@ -2156,11 +2153,11 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
}
}
- cainfo = setup_verify(zcainfo TSRMLS_CC);
+ cainfo = setup_verify(zcainfo);
if (cainfo == NULL) {
goto clean_exit;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -2189,7 +2186,7 @@ clean_exit:
* calist is an array containing file and directory names. create a
* certificate store and add those certs to it for use in verification.
*/
-static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
+static X509_STORE * setup_verify(zval * calist)
{
X509_STORE *store;
X509_LOOKUP * dir_lookup, * file_lookup;
@@ -2208,14 +2205,14 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
convert_to_string_ex(item);
if (VCWD_STAT(Z_STRVAL_P(item), &sb) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to stat %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "unable to stat %s", Z_STRVAL_P(item));
continue;
}
if ((sb.st_mode & S_IFREG) == S_IFREG) {
file_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
if (file_lookup == NULL || !X509_LOOKUP_load_file(file_lookup, Z_STRVAL_P(item), X509_FILETYPE_PEM)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading file %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "error loading file %s", Z_STRVAL_P(item));
} else {
nfiles++;
}
@@ -2223,7 +2220,7 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
} else {
dir_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
if (dir_lookup == NULL || !X509_LOOKUP_add_dir(dir_lookup, Z_STRVAL_P(item), X509_FILETYPE_PEM)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading directory %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "error loading directory %s", Z_STRVAL_P(item));
} else {
ndirs++;
}
@@ -2255,14 +2252,14 @@ PHP_FUNCTION(openssl_x509_read)
X509 *x509;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
- x509 = php_openssl_x509_from_zval(cert, 1, &res TSRMLS_CC);
+ x509 = php_openssl_x509_from_zval(cert, 1, &res);
ZVAL_RES(return_value, res);
if (x509 == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied parameter cannot be coerced into an X509 certificate!");
+ php_error_docref(NULL, E_WARNING, "supplied parameter cannot be coerced into an X509 certificate!");
RETURN_FALSE;
}
}
@@ -2275,7 +2272,7 @@ PHP_FUNCTION(openssl_x509_free)
zval *x509;
X509 *cert;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &x509) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &x509) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(cert, X509 *, x509, -1, "OpenSSL X.509", le_x509);
@@ -2297,7 +2294,7 @@ static void php_sk_X509_free(STACK_OF(X509) * sk) /* {{{ */
}
/* }}} */
-static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
+static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts) /* {{{ */
{
zval * zcertval;
STACK_OF(X509) * sk = NULL;
@@ -2309,7 +2306,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
/* get certs */
if (Z_TYPE_P(zcerts) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(HASH_OF(zcerts), zcertval) {
- cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -2326,7 +2323,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
} ZEND_HASH_FOREACH_END();
} else {
/* a single certificate */
- cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcerts, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
@@ -2364,26 +2361,26 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
zval * item;
STACK_OF(X509) *ca = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
return;
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
goto cleanup;
}
@@ -2396,7 +2393,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
*/
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL)
- ca = php_array_to_X509_sk(item TSRMLS_CC);
+ ca = php_array_to_X509_sk(item);
/* end parse extra config */
/*PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca,
@@ -2411,7 +2408,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
BIO_free(bio_out);
@@ -2445,23 +2442,23 @@ PHP_FUNCTION(openssl_pkcs12_export)
zval * item;
STACK_OF(X509) *ca = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/zs|a", &zcert, &zout, &zpkey, &pass, &pass_len, &args) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/zs|a", &zcert, &zout, &zpkey, &pass, &pass_len, &args) == FAILURE)
return;
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
@@ -2470,7 +2467,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
friendly_name = Z_STRVAL_P(item);
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL)
- ca = php_array_to_X509_sk(item TSRMLS_CC);
+ ca = php_array_to_X509_sk(item);
/* end parse extra config */
p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0);
@@ -2515,7 +2512,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
BIO * bio_in = NULL;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/s", &zp12, &zp12_len, &zout, &pass, &pass_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/s", &zp12, &zp12_len, &zout, &pass, &pass_len) == FAILURE)
return;
RETVAL_FALSE;
@@ -2598,7 +2595,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
/* {{{ x509 CSR functions */
/* {{{ php_openssl_make_REQ */
-static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs TSRMLS_DC)
+static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs)
{
STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL;
char * str, *dn_sect, *attr_sect;
@@ -2642,7 +2639,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_UTF8,
(unsigned char*)Z_STRVAL_P(item), -1, -1, 0))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"dn: add_entry_by_NID %d -> %s (failed; check error"
" queue and value of string_mask OpenSSL option "
"if illegal characters are reported)",
@@ -2650,7 +2647,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex->val);
+ php_error_docref(NULL, E_WARNING, "dn: %s is not a recognized name", strindex->val);
}
}
} ZEND_HASH_FOREACH_END();
@@ -2695,11 +2692,11 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
continue;
}
if (!X509_NAME_add_entry_by_txt(subj, type, MBSTRING_UTF8, (unsigned char*)v->value, -1, -1, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value);
+ php_error_docref(NULL, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value);
return FAILURE;
}
if (!X509_NAME_entry_count(subj)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no objects specified in config file");
+ php_error_docref(NULL, E_WARNING, "no objects specified in config file");
return FAILURE;
}
}
@@ -2712,11 +2709,11 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
nid = OBJ_txt2nid(strindex->val);
if (nid != NID_undef) {
if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_UTF8, (unsigned char*)Z_STRVAL_P(item), -1, -1, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_P(item));
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex->val);
+ php_error_docref(NULL, E_WARNING, "dn: %s is not a recognized name", strindex->val);
}
} ZEND_HASH_FOREACH_END();
for (i = 0; i < sk_CONF_VALUE_num(attr_sk); i++) {
@@ -2727,7 +2724,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
continue;
}
if (!X509_REQ_add1_attr_by_txt(csr, v->name, MBSTRING_UTF8, (unsigned char*)v->value, -1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"add1_attr_by_txt %s -> %s (failed; check error queue "
"and value of string_mask OpenSSL option if illegal "
"characters are reported)",
@@ -2744,7 +2741,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
/* }}} */
/* {{{ php_openssl_csr_from_zval */
-static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource **resourceval)
{
X509_REQ * csr = NULL;
char * filename = NULL;
@@ -2757,7 +2754,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509 CSR", &type, 1, le_csr);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509 CSR", &type, 1, le_csr);
if (what) {
if (resourceval) {
*resourceval = Z_RES_P(val);
@@ -2774,7 +2771,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
filename = Z_STRVAL_P(val) + (sizeof("file://") - 1);
}
if (filename) {
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return NULL;
}
in = BIO_new_file(filename, "r");
@@ -2800,18 +2797,18 @@ PHP_FUNCTION(openssl_csr_export_to_file)
BIO * bio_out;
zend_resource *csr_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return;
}
@@ -2823,7 +2820,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
PEM_write_bio_X509_REQ(bio_out, csr);
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
if (csr_resource == NULL && csr) {
@@ -2843,15 +2840,15 @@ PHP_FUNCTION(openssl_csr_export)
BIO * bio_out;
zend_resource *csr_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|b", &zcsr, &zout, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|b", &zcsr, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
@@ -2893,31 +2890,31 @@ PHP_FUNCTION(openssl_csr_sign)
int i;
struct php_x509_request req;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz!zl|a!l", &zcsr, &zcert, &zpkey, &num_days, &args, &serial) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz!zl|a!l", &zcsr, &zcert, &zpkey, &num_days, &args, &serial) == FAILURE)
return;
RETVAL_FALSE;
PHP_SSL_REQ_INIT(&req);
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
if (zcert) {
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 2");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 2");
goto cleanup;
}
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to signing cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to signing cert");
goto cleanup;
}
@@ -2927,17 +2924,17 @@ PHP_FUNCTION(openssl_csr_sign)
/* Check that the request matches the signature */
key = X509_REQ_get_pubkey(csr);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error unpacking public key");
+ php_error_docref(NULL, E_WARNING, "error unpacking public key");
goto cleanup;
}
i = X509_REQ_verify(csr, key);
if (i < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature verification problems");
+ php_error_docref(NULL, E_WARNING, "Signature verification problems");
goto cleanup;
}
else if (i == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature did not match the certificate request");
+ php_error_docref(NULL, E_WARNING, "Signature did not match the certificate request");
goto cleanup;
}
@@ -2945,7 +2942,7 @@ PHP_FUNCTION(openssl_csr_sign)
new_cert = X509_new();
if (new_cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory");
+ php_error_docref(NULL, E_WARNING, "No memory");
goto cleanup;
}
/* Version 3 cert */
@@ -2981,12 +2978,12 @@ PHP_FUNCTION(openssl_csr_sign)
/* Now sign it */
if (!X509_sign(new_cert, priv_key, req.digest)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to sign it");
+ php_error_docref(NULL, E_WARNING, "failed to sign it");
goto cleanup;
}
/* Succeeded; lets return the cert */
- zend_register_resource(return_value, new_cert, le_x509 TSRMLS_CC);
+ zend_register_resource(return_value, new_cert, le_x509);
new_cert = NULL;
cleanup:
@@ -3025,7 +3022,7 @@ PHP_FUNCTION(openssl_csr_new)
int we_made_the_key = 1;
zend_resource *key_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az/|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "az/|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3035,20 +3032,20 @@ PHP_FUNCTION(openssl_csr_new)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
/* Generate or use a private key */
if (Z_TYPE_P(out_pkey) != IS_NULL) {
- req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, &key_resource TSRMLS_CC);
+ req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, &key_resource);
if (req.priv_key != NULL) {
we_made_the_key = 0;
}
}
if (req.priv_key == NULL) {
- php_openssl_generate_private_key(&req TSRMLS_CC);
+ php_openssl_generate_private_key(&req);
}
if (req.priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to generate a private key");
+ php_error_docref(NULL, E_WARNING, "Unable to generate a private key");
} else {
csr = X509_REQ_new();
if (csr) {
- if (php_openssl_make_REQ(&req, csr, dn, attribs TSRMLS_CC) == SUCCESS) {
+ if (php_openssl_make_REQ(&req, csr, dn, attribs) == SUCCESS) {
X509V3_CTX ext_ctx;
X509V3_set_ctx(&ext_ctx, NULL, NULL, csr, NULL, 0);
@@ -3058,21 +3055,21 @@ PHP_FUNCTION(openssl_csr_new)
if (req.request_extensions_section && !X509V3_EXT_REQ_add_conf(req.req_config,
&ext_ctx, req.request_extensions_section, csr))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading extension section %s", req.request_extensions_section);
+ php_error_docref(NULL, E_WARNING, "Error loading extension section %s", req.request_extensions_section);
} else {
RETVAL_TRUE;
if (X509_REQ_sign(csr, req.priv_key, req.digest)) {
- zend_register_resource(return_value, csr, le_csr TSRMLS_CC);
+ zend_register_resource(return_value, csr, le_csr);
csr = NULL;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request");
+ php_error_docref(NULL, E_WARNING, "Error signing request");
}
if (we_made_the_key) {
/* and a resource for the private key */
zval_dtor(out_pkey);
- zend_register_resource(out_pkey, req.priv_key, le_key TSRMLS_CC);
+ zend_register_resource(out_pkey, req.priv_key, le_key);
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
} else if (key_resource != NULL) {
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
@@ -3105,11 +3102,11 @@ PHP_FUNCTION(openssl_csr_get_subject)
X509_NAME * subject;
X509_REQ * csr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcsr, &use_shortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcsr, &use_shortnames) == FAILURE) {
return;
}
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
RETURN_FALSE;
@@ -3118,7 +3115,7 @@ PHP_FUNCTION(openssl_csr_get_subject)
subject = X509_REQ_get_subject_name(csr);
array_init(return_value);
- add_assoc_name_entry(return_value, NULL, subject, use_shortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, NULL, subject, use_shortnames);
return;
}
/* }}} */
@@ -3134,18 +3131,18 @@ PHP_FUNCTION(openssl_csr_get_public_key)
X509_REQ * csr;
EVP_PKEY *tpubkey;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcsr, &use_shortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcsr, &use_shortnames) == FAILURE) {
return;
}
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
RETURN_FALSE;
}
tpubkey=X509_REQ_get_pubkey(csr);
- zend_register_resource(return_value, tpubkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, tpubkey, le_key);
return;
}
/* }}} */
@@ -3167,7 +3164,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
empty string rather than NULL for the passphrase - NULL causes a passphrase prompt to be emitted in
the Apache error log!
*/
-static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval)
{
EVP_PKEY * key = NULL;
X509 * cert = NULL;
@@ -3193,7 +3190,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* get passphrase */
if ((zphrase = zend_hash_index_find(HASH_OF(val), 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
+ php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
return NULL;
}
@@ -3207,7 +3204,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* now set val to be the key param and continue */
if ((val = zend_hash_index_find(HASH_OF(val), 0)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
+ php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
TMP_CLEAN;
}
}
@@ -3216,7 +3213,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key);
if (!what) {
TMP_CLEAN;
}
@@ -3231,16 +3228,16 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
} else if (type == le_key) {
int is_priv;
- is_priv = php_openssl_is_private_key((EVP_PKEY*)what TSRMLS_CC);
+ is_priv = php_openssl_is_private_key((EVP_PKEY*)what);
/* check whether it is actually a private key if requested */
if (!public_key && !is_priv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param is a public key");
+ php_error_docref(NULL, E_WARNING, "supplied key param is a public key");
TMP_CLEAN;
}
if (public_key && is_priv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Don't know how to get public key from this private key");
+ php_error_docref(NULL, E_WARNING, "Don't know how to get public key from this private key");
TMP_CLEAN;
} else {
if (Z_TYPE(tmp) == IS_STRING) {
@@ -3268,7 +3265,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
}
/* it's an X509 file/cert of some kind, and we need to extract the data from that */
if (public_key) {
- cert = php_openssl_x509_from_zval(val, 0, &cert_res TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(val, 0, &cert_res);
free_cert = (cert_res == NULL);
/* actual extraction done later */
if (!cert) {
@@ -3290,7 +3287,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
BIO *in;
if (filename) {
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
TMP_CLEAN;
}
in = BIO_new_file(filename, "r");
@@ -3325,20 +3322,20 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* }}} */
/* {{{ php_openssl_generate_private_key */
-static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC)
+static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req)
{
char * randfile = NULL;
int egdsocket, seeded;
EVP_PKEY * return_val = NULL;
if (req->priv_key_bits < MIN_KEY_LENGTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at least %d bits, not %d",
+ php_error_docref(NULL, E_WARNING, "private key length is too short; it needs to be at least %d bits, not %d",
MIN_KEY_LENGTH, req->priv_key_bits);
return NULL;
}
randfile = CONF_get_string(req->req_config, req->section_name, "RANDFILE");
- php_openssl_load_rand_file(randfile, &egdsocket, &seeded TSRMLS_CC);
+ php_openssl_load_rand_file(randfile, &egdsocket, &seeded);
if ((req->priv_key = EVP_PKEY_new()) != NULL) {
switch(req->priv_key_type) {
@@ -3384,7 +3381,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported private key type");
+ php_error_docref(NULL, E_WARNING, "Unsupported private key type");
}
}
@@ -3402,7 +3399,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
/* {{{ php_openssl_is_private_key
Check whether the supplied key is a private key by checking if the secret prime factors are set */
-static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
+static int php_openssl_is_private_key(EVP_PKEY* pkey)
{
assert(pkey != NULL);
@@ -3448,7 +3445,7 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
break;
}
return 1;
@@ -3484,7 +3481,7 @@ PHP_FUNCTION(openssl_pkey_new)
zval * args = NULL;
zval *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!", &args) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3508,7 +3505,7 @@ PHP_FUNCTION(openssl_pkey_new)
OPENSSL_PKEY_SET_BN(Z_ARRVAL_P(data), rsa, iqmp);
if (rsa->n && rsa->d) {
if (EVP_PKEY_assign_RSA(pkey, rsa)) {
- zend_register_resource(return_value, pkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, pkey, le_key);
return;
}
}
@@ -3533,7 +3530,7 @@ PHP_FUNCTION(openssl_pkey_new)
DSA_generate_key(dsa);
}
if (EVP_PKEY_assign_DSA(pkey, dsa)) {
- zend_register_resource(return_value, pkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, pkey, le_key);
return;
}
}
@@ -3557,7 +3554,7 @@ PHP_FUNCTION(openssl_pkey_new)
DH_generate_key(dh);
}
if (EVP_PKEY_assign_DH(pkey, dh)) {
- ZVAL_COPY_VALUE(return_value, zend_list_insert(pkey, le_key TSRMLS_CC));
+ ZVAL_COPY_VALUE(return_value, zend_list_insert(pkey, le_key));
return;
}
}
@@ -3573,9 +3570,9 @@ PHP_FUNCTION(openssl_pkey_new)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS)
{
- if (php_openssl_generate_private_key(&req TSRMLS_CC)) {
+ if (php_openssl_generate_private_key(&req)) {
/* pass back a key resource */
- zend_register_resource(return_value, req.priv_key, le_key TSRMLS_CC);
+ zend_register_resource(return_value, req.priv_key, le_key);
/* make sure the cleanup code doesn't zap it! */
req.priv_key = NULL;
}
@@ -3600,19 +3597,19 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
BIO * bio_out = NULL;
const EVP_CIPHER * cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zp|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zp|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
return;
}
RETVAL_FALSE;
- key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
RETURN_FALSE;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
RETURN_FALSE;
}
@@ -3672,15 +3669,15 @@ PHP_FUNCTION(openssl_pkey_export)
BIO * bio_out = NULL;
const EVP_CIPHER * cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/|s!a!", &zpkey, &out, &passphrase, &passphrase_len, &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|s!a!", &zpkey, &out, &passphrase, &passphrase_len, &args) == FAILURE) {
return;
}
RETVAL_FALSE;
- key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
RETURN_FALSE;
}
@@ -3742,10 +3739,10 @@ PHP_FUNCTION(openssl_pkey_get_public)
EVP_PKEY *pkey;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &res TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
}
@@ -3761,7 +3758,7 @@ PHP_FUNCTION(openssl_pkey_free)
zval *key;
EVP_PKEY *pkey;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -3779,10 +3776,10 @@ PHP_FUNCTION(openssl_pkey_get_private)
size_t passphrase_len = sizeof("")-1;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &res TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
@@ -3804,7 +3801,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
char *pbio;
zend_long ktype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -3943,7 +3940,7 @@ PHP_FUNCTION(openssl_pbkdf2)
const EVP_MD *digest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssll|s",
&password, &password_len,
&salt, &salt_len,
&key_length, &iterations,
@@ -3962,7 +3959,7 @@ PHP_FUNCTION(openssl_pbkdf2)
}
if (!digest) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
RETURN_FALSE;
}
@@ -4004,7 +4001,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
RETVAL_LONG(-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|papp", &filename, &filename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl|papp", &filename, &filename_len,
&flags, &signersfilename, &signersfilename_len, &cainfo,
&extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) {
return;
@@ -4019,12 +4016,12 @@ PHP_FUNCTION(openssl_pkcs7_verify)
flags = flags & ~PKCS7_DETACHED;
- store = setup_verify(cainfo TSRMLS_CC);
+ store = setup_verify(cainfo);
if (!store) {
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
goto clean_exit;
}
@@ -4042,7 +4039,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
if (datafilename) {
- if (php_openssl_open_base_dir_chk(datafilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(datafilename)) {
goto clean_exit;
}
@@ -4062,7 +4059,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
if (signersfilename) {
BIO *certout;
- if (php_openssl_open_base_dir_chk(signersfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(signersfilename)) {
goto clean_exit;
}
@@ -4077,7 +4074,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
BIO_free(certout);
sk_X509_free(signers);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "signature OK, but cannot open %s for writing", signersfilename);
+ php_error_docref(NULL, E_WARNING, "signature OK, but cannot open %s for writing", signersfilename);
RETVAL_LONG(-1);
}
}
@@ -4116,12 +4113,12 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppza!|ll", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppza!|ll", &infilename, &infilename_len,
&outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE)
return;
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
return;
}
@@ -4142,7 +4139,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
ZEND_HASH_FOREACH_VAL(HASH_OF(zrecipcerts), zcertval) {
zend_resource *certresource;
- cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -4161,7 +4158,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
/* a single certificate */
zend_resource *certresource;
- cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -4181,7 +4178,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
cipher = php_openssl_get_evp_cipher_from_algo(cipherid);
if (cipher == NULL) {
/* shouldn't happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get cipher");
+ php_error_docref(NULL, E_WARNING, "Failed to get cipher");
goto clean_exit;
}
@@ -4243,7 +4240,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
char * extracertsfilename = NULL;
size_t extracertsfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppzza!|lp",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppzza!|lp",
&infilename, &infilename_len, &outfilename, &outfilename_len,
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
&extracertsfilename_len) == FAILURE) {
@@ -4259,37 +4256,37 @@ PHP_FUNCTION(openssl_pkcs7_sign)
}
}
- privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource TSRMLS_CC);
+ privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource);
if (privkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting private key");
+ php_error_docref(NULL, E_WARNING, "error getting private key");
goto clean_exit;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting cert");
+ php_error_docref(NULL, E_WARNING, "error getting cert");
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
goto clean_exit;
}
infile = BIO_new_file(infilename, "r");
if (infile == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening input file %s!", infilename);
+ php_error_docref(NULL, E_WARNING, "error opening input file %s!", infilename);
goto clean_exit;
}
outfile = BIO_new_file(outfilename, "w");
if (outfile == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening output file %s!", outfilename);
+ php_error_docref(NULL, E_WARNING, "error opening output file %s!", outfilename);
goto clean_exit;
}
p7 = PKCS7_sign(cert, privkey, others, infile, flags);
if (p7 == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error creating PKCS7 structure!");
+ php_error_docref(NULL, E_WARNING, "error creating PKCS7 structure!");
goto clean_exit;
}
@@ -4344,26 +4341,26 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
char * outfilename;
size_t outfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppz|z", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppz|z", &infilename, &infilename_len,
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(recipcert, 0, &certresval TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(recipcert, 0, &certresval);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 3 to x509 cert");
+ php_error_docref(NULL, E_WARNING, "unable to coerce parameter 3 to x509 cert");
goto clean_exit;
}
- key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, &keyresval TSRMLS_CC);
+ key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, &keyresval);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get private key");
+ php_error_docref(NULL, E_WARNING, "unable to get private key");
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
goto clean_exit;
}
@@ -4414,15 +4411,15 @@ PHP_FUNCTION(openssl_private_encrypt)
size_t data_len;
zend_long padding = RSA_PKCS1_PADDING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key param is not a valid private key");
+ php_error_docref(NULL, E_WARNING, "key param is not a valid private key");
RETURN_FALSE;
}
@@ -4439,7 +4436,7 @@ PHP_FUNCTION(openssl_private_encrypt)
padding) == cryptedlen);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
if (successful) {
@@ -4473,14 +4470,14 @@ PHP_FUNCTION(openssl_private_decrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid private key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid private key");
RETURN_FALSE;
}
@@ -4502,7 +4499,7 @@ PHP_FUNCTION(openssl_private_decrypt)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
efree(crypttemp);
@@ -4538,13 +4535,13 @@ PHP_FUNCTION(openssl_public_encrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
return;
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
}
@@ -4561,7 +4558,7 @@ PHP_FUNCTION(openssl_public_encrypt)
padding) == cryptedlen);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
@@ -4596,14 +4593,14 @@ PHP_FUNCTION(openssl_public_decrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
}
@@ -4626,7 +4623,7 @@ PHP_FUNCTION(openssl_public_decrypt)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
@@ -4685,12 +4682,12 @@ PHP_FUNCTION(openssl_sign)
zend_long signature_algo = OPENSSL_ALGO_SHA1;
const EVP_MD *mdtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|z", &data, &data_len, &signature, &key, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|z", &data, &data_len, &signature, &key, &method) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a private key");
+ php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a private key");
RETURN_FALSE;
}
@@ -4702,11 +4699,11 @@ PHP_FUNCTION(openssl_sign)
} else if (Z_TYPE_P(method) == IS_STRING) {
mdtype = EVP_get_digestbyname(Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
@@ -4749,7 +4746,7 @@ PHP_FUNCTION(openssl_verify)
zval *method = NULL;
zend_long signature_algo = OPENSSL_ALGO_SHA1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &data, &data_len, &signature, &signature_len, &key, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssz|z", &data, &data_len, &signature, &signature_len, &key, &method) == FAILURE) {
return;
}
@@ -4761,17 +4758,17 @@ PHP_FUNCTION(openssl_verify)
} else if (Z_TYPE_P(method) == IS_STRING) {
mdtype = EVP_get_digestbyname(Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a public key");
+ php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a public key");
RETURN_FALSE;
}
@@ -4804,20 +4801,20 @@ PHP_FUNCTION(openssl_seal)
const EVP_CIPHER *cipher;
EVP_CIPHER_CTX ctx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z/a/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/a/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) {
return;
}
pubkeysht = HASH_OF(pubkeys);
nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0;
if (!nkeys) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array");
RETURN_FALSE;
}
if (method) {
cipher = EVP_get_cipherbyname(method);
if (!cipher) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
} else {
@@ -4834,9 +4831,9 @@ PHP_FUNCTION(openssl_seal)
/* get the public keys we are using to seal this data */
i = 0;
ZEND_HASH_FOREACH_VAL(pubkeysht, pubkey) {
- pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i] TSRMLS_CC);
+ pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i]);
if (pkeys[i] == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a public key (%dth member of pubkeys)", i+1);
+ php_error_docref(NULL, E_WARNING, "not a public key (%dth member of pubkeys)", i+1);
RETVAL_FALSE;
goto clean_exit;
}
@@ -4933,20 +4930,20 @@ PHP_FUNCTION(openssl_open)
size_t method_len = 0;
const EVP_CIPHER *cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/sz|s", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey, &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/sz|s", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey, &method, &method_len) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 4 into a private key");
+ php_error_docref(NULL, E_WARNING, "unable to coerce parameter 4 into a private key");
RETURN_FALSE;
}
if (method) {
cipher = EVP_get_cipherbyname(method);
if (!cipher) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
} else {
@@ -4997,7 +4994,7 @@ PHP_FUNCTION(openssl_get_md_methods)
{
zend_bool aliases = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &aliases) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
return;
}
array_init(return_value);
@@ -5013,7 +5010,7 @@ PHP_FUNCTION(openssl_get_cipher_methods)
{
zend_bool aliases = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &aliases) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
return;
}
array_init(return_value);
@@ -5035,12 +5032,12 @@ PHP_FUNCTION(openssl_digest)
unsigned int siglen;
zend_string *sigbuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &data, &data_len, &method, &method_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &data, &data_len, &method, &method_len, &raw_output) == FAILURE) {
return;
}
mdtype = EVP_get_digestbyname(method);
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
RETURN_FALSE;
}
@@ -5070,7 +5067,7 @@ PHP_FUNCTION(openssl_digest)
}
/* }}} */
-static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_required_len TSRMLS_DC)
+static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_required_len)
{
char *iv_new;
@@ -5089,14 +5086,14 @@ static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_requir
}
if (*piv_len < iv_required_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is only %d bytes long, cipher expects an IV of precisely %d bytes, padding with \\0", *piv_len, iv_required_len);
+ php_error_docref(NULL, E_WARNING, "IV passed is only %d bytes long, cipher expects an IV of precisely %d bytes, padding with \\0", *piv_len, iv_required_len);
memcpy(iv_new, *piv, *piv_len);
*piv_len = iv_required_len;
*piv = iv_new;
return 1;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is %d bytes long which is longer than the %d expected by selected cipher, truncating", *piv_len, iv_required_len);
+ php_error_docref(NULL, E_WARNING, "IV passed is %d bytes long which is longer than the %d expected by selected cipher, truncating", *piv_len, iv_required_len);
memcpy(iv_new, *piv, iv_required_len);
*piv_len = iv_required_len;
*piv = iv_new;
@@ -5118,12 +5115,12 @@ PHP_FUNCTION(openssl_encrypt)
unsigned char *key;
zend_bool free_iv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
return;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
@@ -5138,9 +5135,9 @@ PHP_FUNCTION(openssl_encrypt)
max_iv_len = EVP_CIPHER_iv_length(cipher_type);
if (iv_len <= 0 && max_iv_len > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Using an empty Initialization Vector (iv) is potentially insecure and not recommended");
+ php_error_docref(NULL, E_WARNING, "Using an empty Initialization Vector (iv) is potentially insecure and not recommended");
}
- free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, max_iv_len TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, max_iv_len);
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5199,25 +5196,25 @@ PHP_FUNCTION(openssl_decrypt)
zend_string *base64_str = NULL;
zend_bool free_iv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
return;
}
if (!method_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
if (!(options & OPENSSL_RAW_DATA)) {
base64_str = php_base64_decode((unsigned char*)data, data_len);
if (!base64_str) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to base64 decode the input");
+ php_error_docref(NULL, E_WARNING, "Failed to base64 decode the input");
RETURN_FALSE;
}
data_len = base64_str->len;
@@ -5233,7 +5230,7 @@ PHP_FUNCTION(openssl_decrypt)
key = (unsigned char*)password;
}
- free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, EVP_CIPHER_iv_length(cipher_type) TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, EVP_CIPHER_iv_length(cipher_type));
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5277,18 +5274,18 @@ PHP_FUNCTION(openssl_cipher_iv_length)
size_t method_len;
const EVP_CIPHER *cipher_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &method, &method_len) == FAILURE) {
return;
}
if (!method_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
@@ -5309,7 +5306,7 @@ PHP_FUNCTION(openssl_dh_compute_key)
zend_string *data;
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sr", &pub_str, &pub_len, &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sr", &pub_str, &pub_len, &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -5344,7 +5341,7 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
zval *zstrong_result_returned = NULL;
int strong_result = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) {
return;
}
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index df2b6dd58e..6ed7c087cb 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -75,7 +75,7 @@
#define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i)))
extern php_stream* php_openssl_get_stream_from_ssl_handle(const SSL *ssl);
-extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw TSRMLS_DC);
+extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw);
extern int php_openssl_get_ssl_stream_data_index();
extern int php_openssl_get_x509_list_id(void);
@@ -119,7 +119,7 @@ typedef struct _php_openssl_netstream_data_t {
/* it doesn't matter that we do some hash traversal here, since it is done only
* in an error condition arising from a network connection problem */
-static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) /* {{{ */
+static int is_http_stream_talking_to_iis(php_stream *stream) /* {{{ */
{
if (Z_TYPE(stream->wrapperdata) == IS_ARRAY && stream->wrapper && strcasecmp(stream->wrapper->wops->label, "HTTP") == 0) {
/* the wrapperdata is an array zval containing the headers */
@@ -140,7 +140,7 @@ static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init TSRMLS_DC) /* {{{ */
+static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes);
@@ -164,8 +164,8 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
case SSL_ERROR_SYSCALL:
if (ERR_peek_error() == 0) {
if (nr_bytes == 0) {
- if (!is_http_stream_talking_to_iis(stream TSRMLS_CC) && ERR_get_error() != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (!is_http_stream_talking_to_iis(stream) && ERR_get_error() != 0) {
+ php_error_docref(NULL, E_WARNING,
"SSL: fatal protocol error");
}
SSL_set_shutdown(sslsock->ssl_handle, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
@@ -174,7 +174,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
} else {
char *estr = php_socket_strerror(php_socket_errno(), NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL: %s", estr);
efree(estr);
@@ -191,7 +191,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
switch (ERR_GET_REASON(ecode)) {
case SSL_R_NO_SHARED_CIPHER:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option)");
+ php_error_docref(NULL, E_WARNING, "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option)");
retry = 0;
break;
@@ -207,7 +207,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
smart_str_0(&ebuf);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL operation failed with code %d. %s%s",
err,
ebuf.s ? "OpenSSL Error messages:\n" : "",
@@ -232,7 +232,6 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
zval *val;
zend_ulong allowed_depth = OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH;
- TSRMLS_FETCH();
ret = preverify_ok;
@@ -247,7 +246,7 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
/* if allow_self_signed is set, make sure that verification succeeds */
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT &&
GET_VER_OPT("allow_self_signed") &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ret = 1;
}
@@ -263,12 +262,12 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
}
/* }}} */
-static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected TSRMLS_DC)
+static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected)
{
zend_string *fingerprint;
int result = -1;
- fingerprint = php_openssl_x509_fingerprint(peer, method, 0 TSRMLS_CC);
+ fingerprint = php_openssl_x509_fingerprint(peer, method, 0);
if (fingerprint) {
result = strcmp(expected, fingerprint->val);
zend_string_release(fingerprint);
@@ -277,7 +276,7 @@ static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *
return result;
}
-static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
+static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
{
if (Z_TYPE_P(val) == IS_STRING) {
const char *method = NULL;
@@ -292,14 +291,14 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
break;
}
- return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val) TSRMLS_CC) == 0;
+ return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val)) == 0;
} else if (Z_TYPE_P(val) == IS_ARRAY) {
zval *current;
zend_string *key;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), key, current) {
if (key && Z_TYPE_P(current) == IS_STRING
- && php_x509_fingerprint_cmp(peer, key->val, Z_STRVAL_P(current) TSRMLS_CC) != 0
+ && php_x509_fingerprint_cmp(peer, key->val, Z_STRVAL_P(current)) != 0
) {
return 0;
}
@@ -343,7 +342,7 @@ static zend_bool matches_wildcard_name(const char *subjectname, const char *cert
}
/* }}} */
-static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
+static zend_bool matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
{
int i, san_name_len;
zend_bool is_match = 0;
@@ -364,7 +363,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC
/* prevent null byte poisoning */
if (san_name_len != strlen((const char*)cert_name)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer SAN entry is malformed");
+ php_error_docref(NULL, E_WARNING, "Peer SAN entry is malformed");
} else {
is_match = matches_wildcard_name(subject_name, (const char *)cert_name);
}
@@ -380,7 +379,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC
}
/* }}} */
-static zend_bool matches_common_name(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
+static zend_bool matches_common_name(X509 *peer, const char *subject_name) /* {{{ */
{
char buf[1024];
X509_NAME *cert_name;
@@ -391,20 +390,20 @@ static zend_bool matches_common_name(X509 *peer, const char *subject_name TSRMLS
cert_name_len = X509_NAME_get_text_by_NID(cert_name, NID_commonName, buf, sizeof(buf));
if (cert_name_len == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate peer certificate CN");
+ php_error_docref(NULL, E_WARNING, "Unable to locate peer certificate CN");
} else if (cert_name_len != strlen(buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf);
+ php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf);
} else if (matches_wildcard_name(subject_name, buf)) {
is_match = 1;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", cert_name_len, buf, subject_name);
+ php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", cert_name_len, buf, subject_name);
}
return is_match;
}
/* }}} */
-static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC) /* {{{ */
+static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *peer_name = NULL;
@@ -417,18 +416,18 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
must_verify_peer = GET_VER_OPT("verify_peer")
- ? zend_is_true(val TSRMLS_CC)
+ ? zend_is_true(val)
: sslsock->is_client;
has_cnmatch_ctx_opt = GET_VER_OPT("CN_match");
must_verify_peer_name = (has_cnmatch_ctx_opt || GET_VER_OPT("verify_peer_name"))
- ? zend_is_true(val TSRMLS_CC)
+ ? zend_is_true(val)
: sslsock->is_client;
- must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(val TSRMLS_CC));
+ must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(val));
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
+ php_error_docref(NULL, E_WARNING, "Could not get peer certificate");
return FAILURE;
}
@@ -440,13 +439,13 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* fine */
break;
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
- if (GET_VER_OPT("allow_self_signed") && zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("allow_self_signed") && zend_is_true(val)) {
/* allowed */
break;
}
/* not allowed, so fall through */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not verify peer: code:%d %s",
err,
X509_verify_cert_error_string(err)
@@ -458,14 +457,14 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* If a peer_fingerprint match is required this trumps peer and peer_name verification */
if (must_verify_fingerprint) {
if (Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_ARRAY) {
- if (!php_x509_fingerprint_match(peer, val TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (!php_x509_fingerprint_match(peer, val)) {
+ php_error_docref(NULL, E_WARNING,
"Peer fingerprint doesn't match"
);
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected peer fingerprint must be a string or an array"
);
}
@@ -487,9 +486,9 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
}
if (peer_name) {
- if (matches_san_list(peer, peer_name TSRMLS_CC)) {
+ if (matches_san_list(peer, peer_name)) {
return SUCCESS;
- } else if (matches_common_name(peer, peer_name TSRMLS_CC)) {
+ } else if (matches_common_name(peer, peer_name)) {
return SUCCESS;
} else {
return FAILURE;
@@ -534,7 +533,6 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
zval *val;
zend_bool is_self_signed = 0;
- TSRMLS_FETCH();
stream = (php_stream*)arg;
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -552,7 +550,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
err_code = e;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error encoding X509 certificate: %d: %s", err_code, ERR_error_string(err_code, err_buf));
+ php_error_docref(NULL, E_WARNING, "Error encoding X509 certificate: %d: %s", err_code, ERR_error_string(err_code, err_buf));
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
@@ -560,7 +558,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
OPENSSL_free(der_buf);
if (cert_ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error creating certificate context: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error creating certificate context: %s", php_win_err());
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
}
@@ -582,7 +580,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
chain_flags = CERT_CHAIN_CACHE_END_CERT | CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT;
if (!CertGetCertificateChain(NULL, cert_ctx, NULL, NULL, &chain_params, chain_flags, NULL, &cert_chain_ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error getting certificate chain: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error getting certificate chain: %s", php_win_err());
CertFreeCertificateContext(cert_ctx);
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
@@ -623,7 +621,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
cert_name = X509_get_subject_name(x509_store_ctx->cert);
index = X509_NAME_get_index_by_NID(cert_name, NID_commonName, -1);
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate certificate CN");
+ php_error_docref(NULL, E_WARNING, "Unable to locate certificate CN");
CertFreeCertificateChain(cert_chain_ctx);
CertFreeCertificateContext(cert_ctx);
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
@@ -633,7 +631,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
num_wchars = MultiByteToWideChar(CP_UTF8, 0, (char*)cert_name_utf8, -1, NULL, 0);
if (num_wchars == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
+ php_error_docref(NULL, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
OPENSSL_free(cert_name_utf8);
CertFreeCertificateChain(cert_chain_ctx);
CertFreeCertificateContext(cert_ctx);
@@ -644,7 +642,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
num_wchars = MultiByteToWideChar(CP_UTF8, 0, (char*)cert_name_utf8, -1, server_name, num_wchars);
if (num_wchars == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
+ php_error_docref(NULL, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
efree(server_name);
OPENSSL_free(cert_name_utf8);
CertFreeCertificateChain(cert_chain_ctx);
@@ -666,14 +664,14 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
CertFreeCertificateContext(cert_ctx);
if (!verify_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error verifying certificate chain policy: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error verifying certificate chain policy: %s", php_win_err());
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
if (chain_policy_status.dwError != 0) {
/* The chain does not match the policy */
if (is_self_signed && chain_policy_status.dwError == CERT_E_UNTRUSTEDROOT
- && GET_VER_OPT("allow_self_signed") && zend_is_true(val TSRMLS_CC)) {
+ && GET_VER_OPT("allow_self_signed") && zend_is_true(val)) {
/* allow self-signed certs */
X509_STORE_CTX_set_error(x509_store_ctx, X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
} else {
@@ -687,7 +685,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
/* }}} */
#endif
-static long load_stream_cafile(X509_STORE *cert_store, const char *cafile TSRMLS_DC) /* {{{ */
+static long load_stream_cafile(X509_STORE *cert_store, const char *cafile) /* {{{ */
{
php_stream *stream;
X509 *cert;
@@ -767,7 +765,7 @@ static long load_stream_cafile(X509_STORE *cert_store, const char *cafile TSRMLS
}
/* }}} */
-static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *cafile = NULL;
@@ -788,7 +786,7 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
if (cafile || capath) {
if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) {
- if (cafile && !load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile TSRMLS_CC)) {
+ if (cafile && !load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile)) {
return FAILURE;
}
}
@@ -801,7 +799,7 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
if (sslsock->is_client && !SSL_CTX_set_default_verify_paths(ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to set default verify locations and no CA settings specified");
return FAILURE;
}
@@ -814,13 +812,13 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
}
/* }}} */
-static void disable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static void disable_peer_verification(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
}
/* }}} */
-static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static int set_local_cert(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *certfile = NULL;
@@ -834,7 +832,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
if (VCWD_REALPATH(certfile, resolved_path_buff)) {
/* a certificate to use for authentication */
if (SSL_CTX_use_certificate_chain_file(ctx, resolved_path_buff) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set local cert chain file `%s'; Check that your cafile/capath settings include details of your certificate and its issuer", certfile);
+ php_error_docref(NULL, E_WARNING, "Unable to set local cert chain file `%s'; Check that your cafile/capath settings include details of your certificate and its issuer", certfile);
return FAILURE;
}
GET_VER_OPT_STRING("local_pk", private_key);
@@ -843,13 +841,13 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
char resolved_path_buff_pk[MAXPATHLEN];
if (VCWD_REALPATH(private_key, resolved_path_buff_pk)) {
if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff_pk, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff_pk);
+ php_error_docref(NULL, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff_pk);
return FAILURE;
}
}
} else {
if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff);
+ php_error_docref(NULL, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff);
return FAILURE;
}
}
@@ -871,7 +869,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
} while (0);
#endif
if (!SSL_CTX_check_private_key(ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!");
+ php_error_docref(NULL, E_WARNING, "Private key does not match certificate!");
}
}
}
@@ -880,13 +878,13 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
}
/* }}} */
-static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is_client TSRMLS_DC) /* {{{ */
+static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is_client) /* {{{ */
{
if (method_value == STREAM_CRYPTO_METHOD_SSLv2) {
#ifndef OPENSSL_NO_SSL2
return is_client ? SSLv2_client_method() : SSLv2_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -894,7 +892,7 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#ifndef OPENSSL_NO_SSL3
return is_client ? SSLv3_client_method() : SSLv3_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -904,7 +902,7 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
return is_client ? TLSv1_1_client_method() : TLSv1_1_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -912,19 +910,19 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
return is_client ? TLSv1_2_client_method() : TLSv1_2_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid crypto method");
return NULL;
}
}
/* }}} */
-static zend_long php_get_crypto_method_ctx_flags(zend_long method_flags TSRMLS_DC) /* {{{ */
+static zend_long php_get_crypto_method_ctx_flags(zend_long method_flags) /* {{{ */
{
zend_long ssl_ctx_options = SSL_OP_ALL;
@@ -987,8 +985,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
if (sslsock->reneg->tokens > sslsock->reneg->limit) {
zval *val;
- TSRMLS_FETCH();
-
+
sslsock->reneg->should_close = 1;
if (PHP_STREAM_CONTEXT(stream) && (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
@@ -1000,7 +997,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
/* Closing the stream inside this callback would segfault! */
stream->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
- if (FAILURE == call_user_function_ex(EG(function_table), NULL, val, &retval, 1, &param, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == call_user_function_ex(EG(function_table), NULL, val, &retval, 1, &param, 0, NULL)) {
php_error(E_WARNING, "SSL: failed invoking reneg limit notification callback");
}
stream->flags ^= PHP_STREAM_FLAG_NO_FCLOSE;
@@ -1012,7 +1009,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
zval_ptr_dtor(&retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL: client-initiated handshake rate limit exceeded by peer");
}
}
@@ -1069,7 +1066,7 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da
}
/* }}} */
-static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
int rsa_key_size;
@@ -1078,7 +1075,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
if ((val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "rsa_key_size")) != NULL) {
rsa_key_size = (int) Z_LVAL_P(val);
if ((rsa_key_size != 1) && (rsa_key_size & (rsa_key_size - 1))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size);
+ php_error_docref(NULL, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size);
rsa_key_size = 2048;
}
} else {
@@ -1088,7 +1085,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
rsa = RSA_generate_key(rsa_key_size, RSA_F4, NULL, NULL);
if (!SSL_CTX_set_tmp_rsa(ctx, rsa)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting RSA key");
+ php_error_docref(NULL, E_WARNING, "Failed setting RSA key");
RSA_free(rsa);
return FAILURE;
}
@@ -1099,7 +1096,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
}
/* }}} */
-static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
+static int set_server_dh_param(SSL_CTX *ctx, char *dh_path) /* {{{ */
{
DH *dh;
BIO* bio;
@@ -1107,7 +1104,7 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
bio = BIO_new_file(dh_path, "r");
if (bio == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid dh_param file: %s", dh_path);
+ php_error_docref(NULL, E_WARNING, "Invalid dh_param file: %s", dh_path);
return FAILURE;
}
@@ -1115,12 +1112,12 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
BIO_free(bio);
if (dh == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed reading DH params from file: %s", dh_path);
+ php_error_docref(NULL, E_WARNING, "Failed reading DH params from file: %s", dh_path);
return FAILURE;
}
if (SSL_CTX_set_tmp_dh(ctx, dh) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DH param assignment failed");
+ php_error_docref(NULL, E_WARNING, "DH param assignment failed");
DH_free(dh);
return FAILURE;
}
@@ -1132,7 +1129,7 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef HAVE_ECDH
-static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
int curve_nid;
@@ -1144,7 +1141,7 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
curve_str = Z_STRVAL_P(val);
curve_nid = OBJ_sn2nid(curve_str);
if (curve_nid == NID_undef) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid ECDH curve: %s", curve_str);
+ php_error_docref(NULL, E_WARNING, "Invalid ECDH curve: %s", curve_str);
return FAILURE;
}
} else {
@@ -1153,7 +1150,7 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
ecdh = EC_KEY_new_by_curve_name(curve_nid);
if (ecdh == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed generating ECDH curve");
return FAILURE;
@@ -1167,19 +1164,19 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
/* }}} */
#endif
-static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
long ssl_ctx_options = SSL_CTX_get_options(ctx);
#ifdef HAVE_ECDH
- if (FAILURE == set_server_ecdh_curve(stream, ctx TSRMLS_CC)) {
+ if (FAILURE == set_server_ecdh_curve(stream, ctx)) {
return FAILURE;
}
#else
val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "ecdh_curve");
if (val != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"ECDH curve support not compiled into the OpenSSL lib against which PHP is linked");
return FAILURE;
@@ -1188,25 +1185,25 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
if ((val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "dh_param")) != NULL) {
convert_to_string_ex(val);
- if (FAILURE == set_server_dh_param(ctx, Z_STRVAL_P(val) TSRMLS_CC)) {
+ if (FAILURE == set_server_dh_param(ctx, Z_STRVAL_P(val))) {
return FAILURE;
}
}
- if (FAILURE == set_server_rsa_key(stream, ctx TSRMLS_CC)) {
+ if (FAILURE == set_server_rsa_key(stream, ctx)) {
return FAILURE;
}
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "honor_cipher_order")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ssl_ctx_options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
}
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "single_dh_use")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ssl_ctx_options |= SSL_OP_SINGLE_DH_USE;
}
@@ -1214,7 +1211,7 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
#ifdef HAVE_ECDH
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "single_ecdh_use")) &&
- zend_is_true(val TSRMLS_CC)) {
+ zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_SINGLE_ECDH_USE;
}
#endif
@@ -1257,7 +1254,7 @@ static int server_sni_callback(SSL *ssl_handle, int *al, void *arg) /* {{{ */
}
/* }}} */
-static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC)
+static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock)
{
zval *val;
zval *current;
@@ -1268,7 +1265,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX *ctx;
/* If the stream ctx disables SNI we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val)) {
return SUCCESS;
}
@@ -1278,7 +1275,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
}
if (Z_TYPE_P(val) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs requires an array mapping host names to cert paths"
);
return FAILURE;
@@ -1286,7 +1283,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
sslsock->sni_cert_count = zend_hash_num_elements(Z_ARRVAL_P(val));
if (sslsock->sni_cert_count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs host cert array must not be empty"
);
return FAILURE;
@@ -1298,7 +1295,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(val), key_index,key, current) {
if (!key) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs array requires string host name keys"
);
return FAILURE;
@@ -1310,7 +1307,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
ctx = SSL_CTX_new(SSLv23_server_method());
if (SSL_CTX_use_certificate_chain_file(ctx, resolved_path_buff) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting local cert chain file `%s'; " \
"check that your cafile/capath settings include " \
"details of your certificate and its issuer",
@@ -1319,7 +1316,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX_free(ctx);
return FAILURE;
} else if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting private key from file `%s'",
resolved_path_buff
);
@@ -1331,7 +1328,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
++i;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting local cert chain file `%s'; file not found",
Z_STRVAL_P(current)
);
@@ -1344,13 +1341,13 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
return SUCCESS;
}
-static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC) /* {{{ */
+static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock) /* {{{ */
{
zval *val;
char *sni_server_name;
/* If SNI is explicitly disabled we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val)) {
return;
}
@@ -1373,7 +1370,7 @@ static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *
int php_openssl_setup_crypto(php_stream *stream,
php_openssl_netstream_data_t *sslsock,
php_stream_xport_crypto_param *cparam
- TSRMLS_DC) /* {{{ */
+ ) /* {{{ */
{
const SSL_METHOD *method;
long ssl_ctx_options;
@@ -1383,7 +1380,7 @@ int php_openssl_setup_crypto(php_stream *stream,
if (sslsock->ssl_handle) {
if (sslsock->s.is_blocked) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS already set-up for this stream");
+ php_error_docref(NULL, E_WARNING, "SSL/TLS already set-up for this stream");
return FAILURE;
} else {
return SUCCESS;
@@ -1400,13 +1397,13 @@ int php_openssl_setup_crypto(php_stream *stream,
/* Should we use a specific crypto method or is generic SSLv23 okay? */
if ((method_flags & (method_flags-1)) == 0) {
ssl_ctx_options = SSL_OP_ALL;
- method = php_select_crypto_method(method_flags, sslsock->is_client TSRMLS_CC);
+ method = php_select_crypto_method(method_flags, sslsock->is_client);
if (method == NULL) {
return FAILURE;
}
} else {
method = sslsock->is_client ? SSLv23_client_method() : SSLv23_server_method();
- ssl_ctx_options = php_get_crypto_method_ctx_flags(method_flags TSRMLS_CC);
+ ssl_ctx_options = php_get_crypto_method_ctx_flags(method_flags);
if (ssl_ctx_options == -1) {
return FAILURE;
}
@@ -1420,12 +1417,12 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
if (sslsock->ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL context creation failure");
+ php_error_docref(NULL, E_WARNING, "SSL context creation failure");
return FAILURE;
}
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL
- if (GET_VER_OPT("no_ticket") && zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("no_ticket") && zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_NO_TICKET;
}
#endif
@@ -1435,14 +1432,14 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- if (!GET_VER_OPT("disable_compression") || zend_is_true(val TSRMLS_CC)) {
+ if (!GET_VER_OPT("disable_compression") || zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_NO_COMPRESSION;
}
#endif
- if (GET_VER_OPT("verify_peer") && !zend_is_true(val TSRMLS_CC)) {
- disable_peer_verification(sslsock->ctx, stream TSRMLS_CC);
- } else if (FAILURE == enable_peer_verification(sslsock->ctx, stream TSRMLS_CC)) {
+ if (GET_VER_OPT("verify_peer") && !zend_is_true(val)) {
+ disable_peer_verification(sslsock->ctx, stream);
+ } else if (FAILURE == enable_peer_verification(sslsock->ctx, stream)) {
return FAILURE;
}
@@ -1463,7 +1460,7 @@ int php_openssl_setup_crypto(php_stream *stream,
return FAILURE;
}
}
- if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) {
+ if (FAILURE == set_local_cert(sslsock->ctx, stream)) {
return FAILURE;
}
@@ -1471,14 +1468,14 @@ int php_openssl_setup_crypto(php_stream *stream,
if (sslsock->is_client == 0 &&
PHP_STREAM_CONTEXT(stream) &&
- FAILURE == set_server_specific_opts(stream, sslsock->ctx TSRMLS_CC)
+ FAILURE == set_server_specific_opts(stream, sslsock->ctx)
) {
return FAILURE;
}
sslsock->ssl_handle = SSL_new(sslsock->ctx);
if (sslsock->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL handle creation failure");
+ php_error_docref(NULL, E_WARNING, "SSL handle creation failure");
SSL_CTX_free(sslsock->ctx);
sslsock->ctx = NULL;
return FAILURE;
@@ -1487,12 +1484,12 @@ int php_openssl_setup_crypto(php_stream *stream,
}
if (!SSL_set_fd(sslsock->ssl_handle, sslsock->s.socket)) {
- handle_ssl_error(stream, 0, 1 TSRMLS_CC);
+ handle_ssl_error(stream, 0, 1);
}
#ifdef HAVE_SNI
/* Enable server-side SNI */
- if (sslsock->is_client == 0 && enable_server_sni(stream, sslsock TSRMLS_CC) == FAILURE) {
+ if (sslsock->is_client == 0 && enable_server_sni(stream, sslsock) == FAILURE) {
return FAILURE;
}
#endif
@@ -1511,9 +1508,9 @@ int php_openssl_setup_crypto(php_stream *stream,
if (cparam->inputs.session) {
if (cparam->inputs.session->ops != &php_openssl_socket_ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied session stream must be an SSL enabled stream");
+ php_error_docref(NULL, E_WARNING, "supplied session stream must be an SSL enabled stream");
} else if (((php_openssl_netstream_data_t*)cparam->inputs.session->abstract)->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied SSL session stream is not initialized");
+ php_error_docref(NULL, E_WARNING, "supplied SSL session stream is not initialized");
} else {
SSL_copy_session_id(sslsock->ssl_handle, ((php_openssl_netstream_data_t*)cparam->inputs.session->abstract)->ssl_handle);
}
@@ -1551,23 +1548,23 @@ static zend_array *capture_session_meta(SSL *ssl_handle) /* {{{ */
}
/* }}} */
-static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *sslsock, X509 *peer_cert TSRMLS_DC) /* {{{ */
+static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *sslsock, X509 *peer_cert) /* {{{ */
{
zval *val, zcert;
int cert_captured = 0;
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_peer_cert")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
- zend_register_resource(&zcert, peer_cert, php_openssl_get_x509_list_id() TSRMLS_CC);
+ zend_register_resource(&zcert, peer_cert, php_openssl_get_x509_list_id());
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_certificate", &zcert);
cert_captured = 1;
}
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_peer_cert_chain")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
zval arr;
STACK_OF(X509) *chain;
@@ -1580,7 +1577,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
for (i = 0; i < sk_X509_num(chain); i++) {
X509 *mycert = X509_dup(sk_X509_value(chain, i));
- zend_register_resource(&zcert, mycert, php_openssl_get_x509_list_id() TSRMLS_CC);
+ zend_register_resource(&zcert, mycert, php_openssl_get_x509_list_id());
add_next_index_zval(&arr, &zcert);
}
@@ -1599,7 +1596,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
static int php_openssl_enable_crypto(php_stream *stream,
php_openssl_netstream_data_t *sslsock,
php_stream_xport_crypto_param *cparam
- TSRMLS_DC)
+ )
{
int n;
int retry = 1;
@@ -1614,7 +1611,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
#ifdef HAVE_SNI
if (sslsock->is_client) {
- enable_client_sni(stream, sslsock TSRMLS_CC);
+ enable_client_sni(stream, sslsock);
}
#endif
@@ -1627,7 +1624,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
sslsock->state_set = 1;
}
- if (SUCCESS == php_set_sock_blocking(sslsock->s.socket, 0 TSRMLS_CC)) {
+ if (SUCCESS == php_set_sock_blocking(sslsock->s.socket, 0)) {
sslsock->s.is_blocked = 0;
}
@@ -1660,14 +1657,14 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (elapsed_time.tv_sec > timeout->tv_sec ||
(elapsed_time.tv_sec == timeout->tv_sec &&
elapsed_time.tv_usec > timeout->tv_usec)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL: Handshake timed out");
+ php_error_docref(NULL, E_WARNING, "SSL: Handshake timed out");
return -1;
}
}
if (n <= 0) {
/* in case of SSL_ERROR_WANT_READ/WRITE, do not retry in non-blocking mode */
- retry = handle_ssl_error(stream, n, blocked TSRMLS_CC);
+ retry = handle_ssl_error(stream, n, blocked);
if (retry) {
/* wait until something interesting happens in the socket. It may be a
* timeout. Also consider the unlikely of possibility of a write block */
@@ -1690,17 +1687,17 @@ static int php_openssl_enable_crypto(php_stream *stream,
}
} while (retry);
- if (sslsock->s.is_blocked != blocked && SUCCESS == php_set_sock_blocking(sslsock->s.socket, blocked TSRMLS_CC)) {
+ if (sslsock->s.is_blocked != blocked && SUCCESS == php_set_sock_blocking(sslsock->s.socket, blocked)) {
sslsock->s.is_blocked = blocked;
}
if (n == 1) {
peer_cert = SSL_get_peer_certificate(sslsock->ssl_handle);
if (peer_cert && PHP_STREAM_CONTEXT(stream)) {
- cert_captured = capture_peer_certs(stream, sslsock, peer_cert TSRMLS_CC);
+ cert_captured = capture_peer_certs(stream, sslsock, peer_cert);
}
- if (FAILURE == apply_peer_verification_policy(sslsock->ssl_handle, peer_cert, stream TSRMLS_CC)) {
+ if (FAILURE == apply_peer_verification_policy(sslsock->ssl_handle, peer_cert, stream)) {
SSL_shutdown(sslsock->ssl_handle);
n = -1;
} else {
@@ -1711,7 +1708,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_session_meta")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
zval meta_arr;
ZVAL_ARR(&meta_arr, capture_session_meta(sslsock->ssl_handle));
@@ -1726,7 +1723,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
n = -1;
peer_cert = SSL_get_peer_certificate(sslsock->ssl_handle);
if (peer_cert && PHP_STREAM_CONTEXT(stream)) {
- cert_captured = capture_peer_certs(stream, sslsock, peer_cert TSRMLS_CC);
+ cert_captured = capture_peer_certs(stream, sslsock, peer_cert);
}
}
@@ -1745,7 +1742,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
return -1;
}
-static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int didwrite;
@@ -1757,7 +1754,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
didwrite = SSL_write(sslsock->ssl_handle, buf, count);
if (didwrite <= 0) {
- retry = handle_ssl_error(stream, didwrite, 0 TSRMLS_CC);
+ retry = handle_ssl_error(stream, didwrite, 0);
} else {
break;
}
@@ -1767,7 +1764,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
php_stream_notify_progress_increment(PHP_STREAM_CONTEXT(stream), didwrite, 0);
}
} else {
- didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
+ didwrite = php_stream_socket_ops.write(stream, buf, count);
}
if (didwrite < 0) {
@@ -1778,7 +1775,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
}
/* }}} */
-static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int nr_bytes = 0;
@@ -1791,12 +1788,12 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
if (sslsock->reneg && sslsock->reneg->should_close) {
/* renegotiation rate limiting triggered */
- php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
+ php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR);
nr_bytes = 0;
stream->eof = 1;
break;
} else if (nr_bytes <= 0) {
- retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
+ retry = handle_ssl_error(stream, nr_bytes, 0);
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
} else {
@@ -1811,7 +1808,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
}
else
{
- nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
+ nr_bytes = php_stream_socket_ops.read(stream, buf, count);
}
if (nr_bytes < 0) {
@@ -1822,7 +1819,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
}
/* }}} */
-static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_close(php_stream *stream, int close_handle) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
#ifdef PHP_WIN32
@@ -1890,20 +1887,20 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_
}
/* }}} */
-static int php_openssl_sockop_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_flush(php_stream *stream) /* {{{ */
{
- return php_stream_socket_ops.flush(stream TSRMLS_CC);
+ return php_stream_socket_ops.flush(stream);
}
/* }}} */
-static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
- return php_stream_socket_ops.stat(stream, ssb TSRMLS_CC);
+ return php_stream_socket_ops.stat(stream, ssb);
}
/* }}} */
static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock,
- php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC)
+ php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
@@ -1916,7 +1913,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
xparam->inputs.timeout,
xparam->want_errortext ? &xparam->outputs.error_text : NULL,
&xparam->outputs.error_code
- TSRMLS_CC);
+ );
if (clisock >= 0) {
php_openssl_netstream_data_t *clisockdata;
@@ -1951,9 +1948,9 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
clisockdata->method = sock->method;
if (php_stream_xport_crypto_setup(xparam->outputs.client, clisockdata->method,
- NULL TSRMLS_CC) < 0 || php_stream_xport_crypto_enable(
- xparam->outputs.client, 1 TSRMLS_CC) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto");
+ NULL) < 0 || php_stream_xport_crypto_enable(
+ xparam->outputs.client, 1) < 0) {
+ php_error_docref(NULL, E_WARNING, "Failed to enable crypto");
php_stream_close(xparam->outputs.client);
xparam->outputs.client = NULL;
@@ -1965,7 +1962,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
return xparam->outputs.client == NULL ? -1 : 0;
}
-static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
php_stream_xport_crypto_param *cparam = (php_stream_xport_crypto_param *)ptrparam;
@@ -2030,11 +2027,11 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
switch(cparam->op) {
case STREAM_XPORT_CRYPTO_OP_SETUP:
- cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam TSRMLS_CC);
+ cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam);
return PHP_STREAM_OPTION_RETURN_OK;
break;
case STREAM_XPORT_CRYPTO_OP_ENABLE:
- cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam TSRMLS_CC);
+ cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam);
return PHP_STREAM_OPTION_RETURN_OK;
break;
default:
@@ -2051,16 +2048,16 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
case STREAM_XPORT_OP_CONNECT_ASYNC:
/* TODO: Async connects need to check the enable_on_connect option when
* we notice that the connect has actually been established */
- php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC);
+ php_stream_socket_ops.set_option(stream, option, value, ptrparam);
if ((sslsock->enable_on_connect) &&
((xparam->outputs.returncode == 0) ||
(xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC &&
xparam->outputs.returncode == 1 && xparam->outputs.error_code == EINPROGRESS)))
{
- if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto");
+ if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_error_docref(NULL, E_WARNING, "Failed to enable crypto");
xparam->outputs.returncode = -1;
}
}
@@ -2069,7 +2066,7 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
case STREAM_XPORT_OP_ACCEPT:
/* we need to copy the additional fields that the underlying tcp transport
* doesn't know about */
- xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC TSRMLS_CC);
+ xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC);
return PHP_STREAM_OPTION_RETURN_OK;
@@ -2080,10 +2077,10 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
}
}
- return php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC);
+ return php_stream_socket_ops.set_option(stream, option, value, ptrparam);
}
-static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret)
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -2144,7 +2141,7 @@ static zend_long get_crypto_method(php_stream_context *ctx, zend_long crypto_met
return crypto_method;
}
-static char *get_url_name(const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC)
+static char *get_url_name(const char *resourcename, size_t resourcenamelen, int is_persistent)
{
php_url *url;
@@ -2183,7 +2180,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
const char *resourcename, size_t resourcenamelen,
const char *persistent_id, int options, int flags,
struct timeval *timeout,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_openssl_netstream_data_t *sslsock = NULL;
@@ -2219,7 +2216,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->method = get_crypto_method(context, STREAM_CRYPTO_METHOD_ANY_CLIENT);
} else if (strncmp(proto, "sslv2", protolen) == 0) {
#ifdef OPENSSL_NO_SSL2
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#else
sslsock->enable_on_connect = 1;
@@ -2227,7 +2224,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
#endif
} else if (strncmp(proto, "sslv3", protolen) == 0) {
#ifdef OPENSSL_NO_SSL3
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#else
sslsock->enable_on_connect = 1;
@@ -2244,7 +2241,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->enable_on_connect = 1;
sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
} else if (strncmp(proto, "tlsv1.2", protolen) == 0) {
@@ -2252,12 +2249,12 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->enable_on_connect = 1;
sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
}
- sslsock->url_name = get_url_name(resourcename, resourcenamelen, !!persistent_id TSRMLS_CC);
+ sslsock->url_name = get_url_name(resourcename, resourcenamelen, !!persistent_id);
return stream;
}
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 1b5efed1c1..d26e691075 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl)
{
php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU);
php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU);
- php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC);
+ php_add_tick_function(pcntl_signal_dispatch);
return SUCCESS;
}
@@ -545,7 +545,7 @@ PHP_FUNCTION(pcntl_fork)
id = fork();
if (id == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d", errno);
}
RETURN_LONG((zend_long) id);
@@ -558,7 +558,7 @@ PHP_FUNCTION(pcntl_alarm)
{
zend_long seconds;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &seconds) == FAILURE)
return;
RETURN_LONG ((zend_long) alarm(seconds));
@@ -574,7 +574,7 @@ PHP_FUNCTION(pcntl_waitpid)
int status;
pid_t child_id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/|l", &pid, &z_status, &options) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz/|l", &pid, &z_status, &options) == FAILURE)
return;
convert_to_long_ex(z_status);
@@ -602,7 +602,7 @@ PHP_FUNCTION(pcntl_wait)
int status;
pid_t child_id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|l", &z_status, &options) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/|l", &z_status, &options) == FAILURE)
return;
convert_to_long_ex(z_status);
@@ -635,7 +635,7 @@ PHP_FUNCTION(pcntl_wifexited)
#ifdef WIFEXITED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -653,7 +653,7 @@ PHP_FUNCTION(pcntl_wifstopped)
#ifdef WIFSTOPPED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -671,7 +671,7 @@ PHP_FUNCTION(pcntl_wifsignaled)
#ifdef WIFSIGNALED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -689,7 +689,7 @@ PHP_FUNCTION(pcntl_wexitstatus)
#ifdef WEXITSTATUS
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -707,7 +707,7 @@ PHP_FUNCTION(pcntl_wtermsig)
#ifdef WTERMSIG
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -725,7 +725,7 @@ PHP_FUNCTION(pcntl_wstopsig)
#ifdef WSTOPSIG
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -753,7 +753,7 @@ PHP_FUNCTION(pcntl_exec)
size_t path_len;
zend_ulong key_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
return;
}
@@ -811,7 +811,7 @@ PHP_FUNCTION(pcntl_exec)
if (execve(path, argv, envp) == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
/* Cleanup */
@@ -821,7 +821,7 @@ PHP_FUNCTION(pcntl_exec)
if (execv(path, argv) == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
}
@@ -840,12 +840,12 @@ PHP_FUNCTION(pcntl_signal)
zend_long signo;
zend_bool restart_syscalls = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
return;
}
if (signo < 1 || signo > 32) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid signal");
+ php_error_docref(NULL, E_WARNING, "Invalid signal");
RETURN_FALSE;
}
@@ -865,21 +865,21 @@ PHP_FUNCTION(pcntl_signal)
/* Special long value case for SIG_DFL and SIG_IGN */
if (Z_TYPE_P(handle) == IS_LONG) {
if (Z_LVAL_P(handle) != (zend_long) SIG_DFL && Z_LVAL_P(handle) != (zend_long) SIG_IGN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for handle argument specified");
+ php_error_docref(NULL, E_WARNING, "Invalid value for handle argument specified");
RETURN_FALSE;
}
if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == SIG_ERR) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
+ php_error_docref(NULL, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
zend_hash_index_del(&PCNTL_G(php_signal_table), signo);
RETURN_TRUE;
}
- if (!zend_is_callable(handle, 0, &func_name TSRMLS_CC)) {
+ if (!zend_is_callable(handle, 0, &func_name)) {
PCNTL_G(last_error) = EINVAL;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a callable function name error", func_name->val);
+ php_error_docref(NULL, E_WARNING, "%s is not a callable function name error", func_name->val);
zend_string_release(func_name);
RETURN_FALSE;
}
@@ -892,7 +892,7 @@ PHP_FUNCTION(pcntl_signal)
if (php_signal4(signo, pcntl_signal_handler, (int) restart_syscalls, 1) == SIG_ERR) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
+ php_error_docref(NULL, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -917,13 +917,13 @@ PHP_FUNCTION(pcntl_sigprocmask)
zval *user_set, *user_oldset = NULL, *user_signo;
sigset_t set, oldset;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|z/", &how, &user_set, &user_oldset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "la|z/", &how, &user_set, &user_oldset) == FAILURE) {
return;
}
if (sigemptyset(&set) != 0 || sigemptyset(&oldset) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -935,14 +935,14 @@ PHP_FUNCTION(pcntl_sigprocmask)
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
if (sigprocmask(how, &set, &oldset) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -977,18 +977,18 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
struct timespec timeout;
if (timedwait) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z/ll", &user_set, &user_siginfo, &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|z/ll", &user_set, &user_siginfo, &tv_sec, &tv_nsec) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z/", &user_set, &user_siginfo) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|z/", &user_set, &user_siginfo) == FAILURE) {
return;
}
}
if (sigemptyset(&set) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -1000,7 +1000,7 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
@@ -1014,7 +1014,7 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
}
if (signo == -1 && errno != EAGAIN) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
/*
@@ -1096,7 +1096,7 @@ PHP_FUNCTION(pcntl_getpriority)
zend_long pid = getpid();
int pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &pid, &who) == FAILURE) {
RETURN_FALSE;
}
@@ -1109,13 +1109,13 @@ PHP_FUNCTION(pcntl_getpriority)
PCNTL_G(last_error) = errno;
switch (errno) {
case ESRCH:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: No process was located using the given parameters", errno);
break;
case EINVAL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Invalid identifier flag", errno);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
+ php_error_docref(NULL, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
@@ -1135,7 +1135,7 @@ PHP_FUNCTION(pcntl_setpriority)
zend_long pid = getpid();
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &pri, &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &pri, &pid, &who) == FAILURE) {
RETURN_FALSE;
}
@@ -1143,19 +1143,19 @@ PHP_FUNCTION(pcntl_setpriority)
PCNTL_G(last_error) = errno;
switch (errno) {
case ESRCH:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: No process was located using the given parameters", errno);
break;
case EINVAL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Invalid identifier flag", errno);
break;
case EPERM:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: A process was located, but neither its effective nor real user ID matched the effective user ID of the caller", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: A process was located, but neither its effective nor real user ID matched the effective user ID of the caller", errno);
break;
case EACCES:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
+ php_error_docref(NULL, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
@@ -1180,7 +1180,7 @@ PHP_FUNCTION(pcntl_strerror)
{
zend_long error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &error) == FAILURE) {
RETURN_FALSE;
}
@@ -1192,7 +1192,6 @@ PHP_FUNCTION(pcntl_strerror)
static void pcntl_signal_handler(int signo)
{
struct php_pcntl_pending_signal *psig;
- TSRMLS_FETCH();
psig = PCNTL_G(spares);
if (!psig) {
@@ -1221,7 +1220,6 @@ void pcntl_signal_dispatch()
struct php_pcntl_pending_signal *queue, *next;
sigset_t mask;
sigset_t old_mask;
- TSRMLS_FETCH();
if(!PCNTL_G(pending_signals)) {
return;
@@ -1252,7 +1250,7 @@ void pcntl_signal_dispatch()
/* Call php signal handler - Note that we do not report errors, and we ignore the return value */
/* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */
- call_user_function(EG(function_table), NULL, handle, &retval, 1, &param TSRMLS_CC);
+ call_user_function(EG(function_table), NULL, handle, &retval, 1, &param);
zval_ptr_dtor(&param);
zval_ptr_dtor(&retval);
}
diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c
index aa2139342c..4090fe6fb9 100644
--- a/ext/pcntl/php_signal.c
+++ b/ext/pcntl/php_signal.c
@@ -29,7 +29,6 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
{
struct sigaction act,oact;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
act.sa_handler = func;
if (mask_all) {
@@ -48,7 +47,7 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
#endif
}
#ifdef ZEND_SIGNALS
- if (zend_sigaction(signo, &act, &oact TSRMLS_CC) < 0)
+ if (zend_sigaction(signo, &act, &oact) < 0)
#else
if (sigaction(signo, &act, &oact) < 0)
#endif
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
index 594b1cb474..1fe4b687f6 100644
--- a/ext/pcre/config.w32
+++ b/ext/pcre/config.w32
@@ -2,7 +2,7 @@
// vim:ft=javascript
EXTENSION("pcre", "php_pcre.c", false /* never shared */,
- "-Iext/pcre/pcrelib");
+ "-Iext/pcre/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c pcre_jit_compile.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
index bfe2009aa0..7749bb68df 100644
--- a/ext/pcre/config0.m4
+++ b/ext/pcre/config0.m4
@@ -47,7 +47,7 @@ PHP_ARG_WITH(pcre-regex,,
AC_DEFINE(HAVE_PCRE, 1, [ ])
PHP_ADD_INCLUDE($PCRE_INCDIR)
- PHP_NEW_EXTENSION(pcre, php_pcre.c, no)
+ PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
else
AC_MSG_CHECKING([for PCRE library to use])
@@ -60,7 +60,7 @@ PHP_ARG_WITH(pcre-regex,,
pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \
pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
pcrelib/pcre_jit_compile.c"
- PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib"
+ PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index eb3b75abd2..9ca197eb54 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -56,7 +56,7 @@ enum {
ZEND_DECLARE_MODULE_GLOBALS(pcre)
-static void pcre_handle_exec_error(int pcre_code TSRMLS_DC) /* {{{ */
+static void pcre_handle_exec_error(int pcre_code) /* {{{ */
{
int preg_code = 0;
@@ -173,7 +173,7 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
/* }}} */
/* {{{ static pcre_clean_cache */
-static int pcre_clean_cache(zval *data, void *arg TSRMLS_DC)
+static int pcre_clean_cache(zval *data, void *arg)
{
int *num_clean = (int *)arg;
@@ -187,7 +187,7 @@ static int pcre_clean_cache(zval *data, void *arg TSRMLS_DC)
/* }}} */
/* {{{ static make_subpats_table */
-static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_DC)
+static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce)
{
pcre_extra *extra = pce->extra;
int name_cnt = pce->name_count, name_size, ni = 0;
@@ -201,7 +201,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
rc2 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
rc = rc2 ? rc2 : rc1;
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
@@ -210,7 +210,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1];
subpat_names[name_idx] = name_table + 2;
if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric named subpatterns are not allowed");
+ php_error_docref(NULL, E_WARNING, "Numeric named subpatterns are not allowed");
efree(subpat_names);
return NULL;
}
@@ -222,7 +222,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
/* {{{ pcre_get_compiled_regex_cache
*/
-PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC)
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
{
pcre *re = NULL;
pcre_extra *extra;
@@ -281,7 +281,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
get to the end without encountering a delimiter. */
while (isspace((int)*(unsigned char *)p)) p++;
if (*p == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
p < regex->val + regex->len ? "Null byte in regex" : "Empty regular expression");
return NULL;
}
@@ -290,7 +290,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
or a backslash. */
delimiter = *p++;
if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Delimiter must not be alphanumeric or backslash");
+ php_error_docref(NULL,E_WARNING, "Delimiter must not be alphanumeric or backslash");
return NULL;
}
@@ -330,11 +330,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
if (*pp == 0) {
if (pp < regex->val + regex->len) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ php_error_docref(NULL,E_WARNING, "Null byte in regex");
} else if (start_delimiter == end_delimiter) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
+ php_error_docref(NULL,E_WARNING, "No ending delimiter '%c' found", delimiter);
} else {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
+ php_error_docref(NULL,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
}
return NULL;
}
@@ -379,9 +379,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
default:
if (pp[-1]) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ php_error_docref(NULL,E_WARNING, "Unknown modifier '%c'", pp[-1]);
} else {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ php_error_docref(NULL,E_WARNING, "Null byte in regex");
}
efree(pattern);
return NULL;
@@ -401,7 +401,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
tables);
if (re == NULL) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
+ php_error_docref(NULL,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
efree(pattern);
if (tables) {
pefree((void*)tables, 1);
@@ -427,7 +427,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
}
if (error != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern");
+ php_error_docref(NULL, E_WARNING, "Error while studying pattern");
}
} else {
extra = NULL;
@@ -442,7 +442,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
*/
if (zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) {
int num_clean = PCRE_CACHE_SIZE / 8;
- zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean TSRMLS_CC);
+ zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean);
}
/* Store the compiled pattern and extra info in the cache. */
@@ -457,13 +457,13 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &new_entry.capture_count);
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &new_entry.name_count);
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
@@ -483,9 +483,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
/* {{{ pcre_get_compiled_regex
*/
-PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *preg_options TSRMLS_DC)
+PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *preg_options)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
if (extra) {
*extra = pce ? pce->extra : NULL;
@@ -500,9 +500,9 @@ PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int
/* {{{ pcre_get_compiled_regex_ex
*/
-PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC)
+PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *compile_options)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
if (extra) {
*extra = pce ? pce->extra : NULL;
@@ -548,7 +548,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
zend_long start_offset = 0; /* Where the new search starts */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/ll", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/ll", &regex,
&subject, &subpats, &flags, &start_offset) == FAILURE) {
RETURN_FALSE;
}
@@ -564,18 +564,18 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
php_pcre_match_impl(pce, subject->val, (int)subject->len, return_value, subpats,
- global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC);
+ global, ZEND_NUM_ARGS() >= 4, flags, start_offset);
}
/* }}} */
/* {{{ php_pcre_match_impl() */
PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC)
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset)
{
zval result_set, /* Holds a set of subpatterns after
a global match */
@@ -621,7 +621,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
}
if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) ||
(!global && subpats_order != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flags specified");
+ php_error_docref(NULL, E_WARNING, "Invalid flags specified");
return;
}
} else {
@@ -657,7 +657,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
*/
subpat_names = NULL;
if (pce->name_count > 0) {
- subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
+ subpat_names = make_subpats_table(num_subpats, pce);
if (!subpat_names) {
RETURN_FALSE;
}
@@ -690,7 +690,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -711,7 +711,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
efree(offsets);
}
if (match_sets) efree(match_sets);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get subpatterns list failed");
+ php_error_docref(NULL, E_WARNING, "Get subpatterns list failed");
RETURN_FALSE;
}
@@ -839,7 +839,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
} else
break;
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
break;
}
@@ -951,7 +951,7 @@ static int preg_get_backref(char **str, int *backref)
/* {{{ preg_do_repl_func
*/
-static zend_string *preg_do_repl_func(zval *function, char *subject, int *offsets, char **subpat_names, int count, unsigned char *mark TSRMLS_DC)
+static zend_string *preg_do_repl_func(zval *function, char *subject, int *offsets, char **subpat_names, int count, unsigned char *mark)
{
zend_string *result_str;
zval retval; /* Function return value */
@@ -975,12 +975,12 @@ static zend_string *preg_do_repl_func(zval *function, char *subject, int *offset
add_assoc_string(&args[0], "MARK", (char *) mark);
}
- if (call_user_function_ex(EG(function_table), NULL, function, &retval, 1, args, 0, NULL TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (call_user_function_ex(EG(function_table), NULL, function, &retval, 1, args, 0, NULL) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
result_str = zval_get_string(&retval);
zval_ptr_dtor(&retval);
} else {
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+ php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
}
result_str = zend_string_init(&subject[offsets[0]], offsets[1] - offsets[0], 0);
@@ -995,7 +995,7 @@ static zend_string *preg_do_repl_func(zval *function, char *subject, int *offset
/* {{{ preg_do_eval
*/
static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject,
- int *offsets, int count TSRMLS_DC)
+ int *offsets, int count)
{
zval retval; /* Return value from evaluation */
char *eval_str_end, /* End of eval string */
@@ -1032,7 +1032,7 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
match = subject + offsets[backref<<1];
match_len = offsets[(backref<<1)+1] - offsets[backref<<1];
if (match_len) {
- esc_match = php_addslashes(match, match_len, 0 TSRMLS_CC);
+ esc_match = php_addslashes(match, match_len, 0);
} else {
esc_match = zend_string_init(match, match_len, 0);
}
@@ -1054,11 +1054,11 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
smart_str_appendl(&code, segment, walk - segment);
smart_str_0(&code);
- compiled_string_description = zend_make_compiled_string_description("regexp code" TSRMLS_CC);
+ compiled_string_description = zend_make_compiled_string_description("regexp code");
/* Run the code */
- if (zend_eval_stringl(code.s->val, code.s->len, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
+ if (zend_eval_stringl(code.s->val, code.s->len, &retval, compiled_string_description) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.s->val);
+ php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.s->val);
/* zend_error() does not return in this case */
}
efree(compiled_string_description);
@@ -1079,23 +1079,23 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
PHPAPI zend_string *php_pcre_replace(zend_string *regex,
char *subject, int subject_len,
zval *replace_val, int is_callable_replace,
- int limit, int *replace_count TSRMLS_DC)
+ int limit, int *replace_count)
{
pcre_cache_entry *pce; /* Compiled regular expression */
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
return NULL;
}
return php_pcre_replace_impl(pce, subject, subject_len, replace_val,
- is_callable_replace, limit, replace_count TSRMLS_CC);
+ is_callable_replace, limit, replace_count);
}
/* }}} */
/* {{{ php_pcre_replace_impl() */
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *replace_val,
- int is_callable_replace, int limit, int *replace_count TSRMLS_DC)
+ int is_callable_replace, int limit, int *replace_count)
{
pcre_extra *extra = pce->extra;/* Holds results of studying */
pcre_extra extra_data; /* Used locally for exec options */
@@ -1136,7 +1136,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
eval = pce->preg_options & PREG_REPLACE_EVAL;
if (is_callable_replace) {
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifier /e cannot be used with replacement callback");
+ php_error_docref(NULL, E_WARNING, "Modifier /e cannot be used with replacement callback");
return NULL;
}
} else {
@@ -1146,7 +1146,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
}
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The /e modifier is deprecated, use preg_replace_callback instead");
+ php_error_docref(NULL, E_DEPRECATED, "The /e modifier is deprecated, use preg_replace_callback instead");
}
/* Calculate the size of the offsets array, and allocate memory for it. */
@@ -1164,7 +1164,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
*/
subpat_names = NULL;
if (pce->name_count > 0) {
- subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
+ subpat_names = make_subpats_table(num_subpats, pce);
if (!subpat_names) {
return NULL;
}
@@ -1193,7 +1193,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL,E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -1211,11 +1211,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* If evaluating, do it and add the return string's length */
if (eval) {
eval_result = preg_do_eval(replace, replace_len, subject,
- offsets, count TSRMLS_CC);
+ offsets, count);
new_len += (int)eval_result->len;
} else if (is_callable_replace) {
/* Use custom function to get replacement string and its length. */
- eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark TSRMLS_CC);
+ eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark);
new_len += (int)eval_result->len;
} else { /* do regular substitution */
walk = replace;
@@ -1309,7 +1309,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
break;
}
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
zend_string_free(result);
result = NULL;
break;
@@ -1343,7 +1343,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* {{{ php_replace_in_subject
*/
-static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *subject, int limit, int is_callable_replace, int *replace_count TSRMLS_DC)
+static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *subject, int limit, int is_callable_replace, int *replace_count)
{
zval *regex_entry,
*replace_entry = NULL,
@@ -1397,7 +1397,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
replace_value,
is_callable_replace,
limit,
- replace_count TSRMLS_CC)) != NULL) {
+ replace_count)) != NULL) {
zend_string_release(subject_str);
subject_str = result;
} else {
@@ -1417,7 +1417,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
replace,
is_callable_replace,
limit,
- replace_count TSRMLS_CC);
+ replace_count);
zend_string_release(subject_str);
return result;
}
@@ -1443,7 +1443,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
#ifndef FAST_ZPP
/* Get function parameters and do error-checking. */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|lz/", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|lz/", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
return;
}
#else
@@ -1458,7 +1458,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
#endif
if (!is_callable_replace && Z_TYPE_P(replace) == IS_ARRAY && Z_TYPE_P(regex) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
+ php_error_docref(NULL, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
RETURN_FALSE;
}
@@ -1467,8 +1467,8 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
convert_to_string_ex(replace);
}
if (is_callable_replace) {
- if (!zend_is_callable(replace, 0, &callback_name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name->val);
+ if (!zend_is_callable(replace, 0, &callback_name)) {
+ php_error_docref(NULL, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name->val);
zend_string_release(callback_name);
ZVAL_DUP(return_value, subject);
return;
@@ -1493,7 +1493,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
and add the result to the return_value array. */
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
old_replace_count = replace_count;
- if ((result = php_replace_in_subject(regex, replace, subject_entry, limit_val, is_callable_replace, &replace_count TSRMLS_CC)) != NULL) {
+ if ((result = php_replace_in_subject(regex, replace, subject_entry, limit_val, is_callable_replace, &replace_count)) != NULL) {
if (!is_filter || replace_count > old_replace_count) {
/* Add to return array */
if (string_key) {
@@ -1508,7 +1508,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
} ZEND_HASH_FOREACH_END();
} else { /* if subject is not an array */
old_replace_count = replace_count;
- if ((result = php_replace_in_subject(regex, replace, subject, limit_val, is_callable_replace, &replace_count TSRMLS_CC)) != NULL) {
+ if ((result = php_replace_in_subject(regex, replace, subject, limit_val, is_callable_replace, &replace_count)) != NULL) {
if (!is_filter || replace_count > old_replace_count) {
RETVAL_STR(result);
} else {
@@ -1560,7 +1560,7 @@ static PHP_FUNCTION(preg_split)
/* Get function parameters and do error checking */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", &regex,
&subject, &limit_val, &flags) == FAILURE) {
RETURN_FALSE;
}
@@ -1575,18 +1575,18 @@ static PHP_FUNCTION(preg_split)
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
- php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags TSRMLS_CC);
+ php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags);
}
/* }}} */
/* {{{ php_pcre_split
*/
PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zend_long limit_val, zend_long flags TSRMLS_DC)
+ zend_long limit_val, zend_long flags)
{
pcre_extra *extra = NULL; /* Holds results of studying */
pcre *re_bump = NULL; /* Regex instance for empty matches */
@@ -1651,7 +1651,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL,E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -1702,7 +1702,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
if (re_bump == NULL) {
int dummy;
zend_string *regex = zend_string_init("/./us", sizeof("/./us")-1, 0);
- re_bump = pcre_get_compiled_regex(regex, &extra_bump, &dummy TSRMLS_CC);
+ re_bump = pcre_get_compiled_regex(regex, &extra_bump, &dummy);
zend_string_release(regex);
if (re_bump == NULL) {
RETURN_FALSE;
@@ -1712,7 +1712,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
subject_len, start_offset,
exoptions, offsets, size_offsets);
if (count < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
RETURN_FALSE;
}
} else {
@@ -1722,7 +1722,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
} else
break;
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
break;
}
@@ -1778,7 +1778,7 @@ static PHP_FUNCTION(preg_quote)
/* Get the arguments and check for errors */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &in_str, &in_str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &in_str, &in_str_len,
&delim, &delim_len) == FAILURE) {
return;
}
@@ -1867,7 +1867,7 @@ static PHP_FUNCTION(preg_grep)
/* Get arguments and do error checking */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sa|l", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sa|l", &regex,
&input, &flags) == FAILURE) {
return;
}
@@ -1881,15 +1881,15 @@ static PHP_FUNCTION(preg_grep)
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
- php_pcre_grep_impl(pce, input, return_value, flags TSRMLS_CC);
+ php_pcre_grep_impl(pce, input, return_value, flags);
}
/* }}} */
-PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags TSRMLS_DC) /* {{{ */
+PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags) /* {{{ */
{
zval *entry; /* An entry in the input array */
pcre_extra *extra = pce->extra;/* Holds results of studying */
@@ -1939,10 +1939,10 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
} else if (count < 0 && count != PCRE_ERROR_NOMATCH) {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
zend_string_release(subject_str);
break;
}
@@ -1978,7 +1978,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
static PHP_FUNCTION(preg_last_error)
{
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
#else
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index a8523cff9c..86f13e3447 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -33,9 +33,9 @@
#include <locale.h>
#endif
-PHPAPI zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC);
+PHPAPI zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count);
+PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
+PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry
@@ -54,19 +54,19 @@ typedef struct {
int refcount;
} pcre_cache_entry;
-PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC);
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC);
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset);
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
+ int is_callable_replace, int limit, int *replace_count);
PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zend_long limit_val, zend_long flags TSRMLS_DC);
+ zend_long limit_val, zend_long flags);
PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value,
- zend_long flags TSRMLS_DC);
+ zend_long flags);
ZEND_BEGIN_MODULE_GLOBALS(pcre)
HashTable pcre_cache;
@@ -79,7 +79,7 @@ ZEND_BEGIN_MODULE_GLOBALS(pcre)
ZEND_END_MODULE_GLOBALS(pcre)
#ifdef ZTS
-# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v)
+# define PCRE_G(v) ZEND_TSRMG(pcre_globals_id, zend_pcre_globals *, v)
#else
# define PCRE_G(v) (pcre_globals.v)
#endif
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 61c68ff46d..0e2759793b 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -77,7 +77,7 @@ PDO_API char *php_pdo_str_tolower_dup(const char *src, int len) /* {{{ */
}
/* }}} */
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC) /* {{{ */
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
{
#if defined(HAVE_SPL)
if (!root) {
@@ -93,7 +93,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC) /* {{{
}
}
#endif
- return zend_exception_get_default(TSRMLS_C);
+ return zend_exception_get_default();
}
/* }}} */
@@ -309,7 +309,7 @@ PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_s
/* }}} */
static const char digit_vec[] = "0123456789";
-PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC) /* {{{ */
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
{
char buffer[65];
char outbuf[65] = "";
@@ -368,12 +368,12 @@ PHP_MINIT_FUNCTION(pdo)
INIT_CLASS_ENTRY(ce, "PDOException", NULL);
- pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0 TSRMLS_CC) TSRMLS_CC);
+ pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0));
- zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC);
- pdo_dbh_init(TSRMLS_C);
- pdo_stmt_init(TSRMLS_C);
+ pdo_dbh_init();
+ pdo_stmt_init();
return SUCCESS;
}
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 571e08b4c0..9cc1c7dfbf 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -36,9 +36,9 @@
#include "zend_object_handlers.h"
#include "zend_hash.h"
-static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSRMLS_DC);
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value);
-void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp TSRMLS_DC) /* {{{ */
+void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp) /* {{{ */
{
pdo_error_type *pdo_err = &dbh->error_code;
char *message = NULL;
@@ -72,24 +72,24 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
}
if (dbh && dbh->error_mode != PDO_ERRMODE_EXCEPTION) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
} else {
zval ex, info;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_string(def_ex, &ex, "message", sizeof("message")-1, message TSRMLS_CC);
- zend_update_property_string(def_ex, &ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC);
+ zend_update_property_string(def_ex, &ex, "message", sizeof("message")-1, message);
+ zend_update_property_string(def_ex, &ex, "code", sizeof("code")-1, *pdo_err);
array_init(&info);
add_next_index_string(&info, *pdo_err);
add_next_index_long(&info, 0);
- zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo")-1, &info TSRMLS_CC);
+ zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo")-1, &info);
zval_ptr_dtor(&info);
- zend_throw_exception_object(&ex TSRMLS_CC);
+ zend_throw_exception_object(&ex);
}
if (message) {
@@ -98,7 +98,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
}
/* }}} */
-PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */
{
pdo_error_type *pdo_err = &dbh->error_code;
const char *msg = "<<Unknown>>";
@@ -127,7 +127,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
add_next_index_string(&info, *pdo_err);
- if (dbh->methods->fetch_err(dbh, stmt, &info TSRMLS_CC)) {
+ if (dbh->methods->fetch_err(dbh, stmt, &info)) {
zval *item;
if ((item = zend_hash_index_find(Z_ARRVAL(info), 1)) != NULL) {
@@ -147,21 +147,21 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
}
if (dbh->error_mode == PDO_ERRMODE_WARNING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message->val);
+ php_error_docref(NULL, E_WARNING, "%s", message->val);
} else if (EG(exception) == NULL) {
zval ex;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_str(def_ex, &ex, "message", sizeof("message") - 1, message TSRMLS_CC);
- zend_update_property_string(def_ex, &ex, "code", sizeof("code") - 1, *pdo_err TSRMLS_CC);
+ zend_update_property_str(def_ex, &ex, "message", sizeof("message") - 1, message);
+ zend_update_property_string(def_ex, &ex, "code", sizeof("code") - 1, *pdo_err);
if (!Z_ISUNDEF(info)) {
- zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo") - 1, &info TSRMLS_CC);
+ zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo") - 1, &info);
}
- zend_throw_exception_object(&ex TSRMLS_CC);
+ zend_throw_exception_object(&ex);
}
if (!Z_ISUNDEF(info)) {
@@ -178,7 +178,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
}
/* }}} */
-static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) /* {{{ */
+static char *dsn_from_uri(char *uri, char *buf, size_t buflen) /* {{{ */
{
php_stream *stream;
char *dsn = NULL;
@@ -209,7 +209,7 @@ static PHP_METHOD(PDO, dbh_constructor)
char alt_dsn[512];
int call_factory = 1;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!", &data_source, &data_source_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!a!", &data_source, &data_source_len,
&username, &usernamelen, &password, &passwordlen, &options)) {
ZEND_CTOR_MAKE_NULL();
return;
@@ -224,7 +224,7 @@ static PHP_METHOD(PDO, dbh_constructor)
snprintf(alt_dsn, sizeof(alt_dsn), "pdo.dsn.%s", data_source);
if (FAILURE == cfg_get_string(alt_dsn, &ini_dsn)) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -233,7 +233,7 @@ static PHP_METHOD(PDO, dbh_constructor)
colon = strchr(data_source, ':');
if (!colon) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via INI: %s)", alt_dsn);
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name (via INI: %s)", alt_dsn);
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -241,15 +241,15 @@ static PHP_METHOD(PDO, dbh_constructor)
if (!strncmp(data_source, "uri:", sizeof("uri:")-1)) {
/* the specified URI holds connection details */
- data_source = dsn_from_uri(data_source + sizeof("uri:")-1, alt_dsn, sizeof(alt_dsn) TSRMLS_CC);
+ data_source = dsn_from_uri(data_source + sizeof("uri:")-1, alt_dsn, sizeof(alt_dsn));
if (!data_source) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source URI");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source URI");
ZEND_CTOR_MAKE_NULL();
return;
}
colon = strchr(data_source, ':');
if (!colon) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via URI)");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name (via URI)");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -260,7 +260,7 @@ static PHP_METHOD(PDO, dbh_constructor)
if (!driver) {
/* NB: don't want to include the data_source in the error message as
* it might contain a password */
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "could not find driver");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "could not find driver");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -300,7 +300,7 @@ static PHP_METHOD(PDO, dbh_constructor)
pdbh = (pdo_dbh_t*)le->ptr;
/* is the connection still alive ? */
- if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh TSRMLS_CC)) {
+ if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh)) {
/* nope... need to kill it */
/*??? memory leak */
zend_list_close(le);
@@ -316,13 +316,13 @@ static PHP_METHOD(PDO, dbh_constructor)
pdbh = pecalloc(1, sizeof(*pdbh), 1);
if (!pdbh) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO handle");
/* NOTREACHED */
}
pdbh->is_persistent = 1;
if (!(pdbh->persistent_id = pemalloc(plen + 1, 1))) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO handle");
}
memcpy((char *)pdbh->persistent_id, hashkey, plen+1);
pdbh->persistent_id_len = plen;
@@ -350,10 +350,10 @@ static PHP_METHOD(PDO, dbh_constructor)
dbh->default_fetch_type = PDO_FETCH_BOTH;
}
- dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1 TSRMLS_CC);
+ dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1);
if (!dbh->data_source || (username && !dbh->username) || (password && !dbh->password)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory");
+ php_error_docref(NULL, E_ERROR, "out of memory");
}
if (!call_factory) {
@@ -361,7 +361,7 @@ static PHP_METHOD(PDO, dbh_constructor)
goto options;
}
- if (driver->db_handle_factory(dbh, options TSRMLS_CC)) {
+ if (driver->db_handle_factory(dbh, options)) {
/* all set */
if (is_persistent) {
@@ -377,7 +377,7 @@ static PHP_METHOD(PDO, dbh_constructor)
if ((zend_hash_str_update_mem(&EG(persistent_list),
(char*)dbh->persistent_id, dbh->persistent_id_len, &le, sizeof(le))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry");
+ php_error_docref(NULL, E_ERROR, "Failed to register persistent entry");
}
}
@@ -392,7 +392,7 @@ options:
if (str_key) {
continue;
}
- pdo_dbh_attribute_set(dbh, long_key, attr_value TSRMLS_CC);
+ pdo_dbh_attribute_set(dbh, long_key, attr_value);
} ZEND_HASH_FOREACH_END();
}
@@ -405,15 +405,15 @@ options:
}
/* }}} */
-static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args) /* {{{ */
{
if (!Z_ISUNDEF_P(ctor_args)) {
if (Z_TYPE_P(ctor_args) != IS_ARRAY) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array");
return NULL;
}
if (!dbstmt_ce->constructor) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments");
return NULL;
}
}
@@ -425,14 +425,14 @@ static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry
return object;
} /* }}} */
-static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args) /* {{{ */
{
zval query_string;
zval z_key;
ZVAL_STRINGL(&query_string, stmt->query_string, stmt->query_stringlen);
ZVAL_STRINGL(&z_key, "queryString", sizeof("queryString") - 1);
- std_object_handlers.write_property(object, &z_key, &query_string, NULL TSRMLS_CC);
+ std_object_handlers.write_property(object, &z_key, &query_string, NULL);
zval_ptr_dtor(&query_string);
zval_ptr_dtor(&z_key);
@@ -451,7 +451,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
fci.params = NULL;
fci.no_separation = 1;
- zend_fcall_info_args(&fci, ctor_args TSRMLS_CC);
+ zend_fcall_info_args(&fci, ctor_args);
fcc.initialized = 1;
fcc.function_handler = dbstmt_ce->constructor;
@@ -459,7 +459,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
fcc.called_scope = Z_OBJCE_P(object);
fcc.object = Z_OBJ_P(object);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
Z_OBJ_P(object) = NULL;
ZEND_CTOR_MAKE_NULL();
object = NULL; /* marks failure */
@@ -484,7 +484,7 @@ static PHP_METHOD(PDO, prepare)
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis());
pdo_dbh_t *dbh = dbh_obj->inner;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &statement,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &statement,
&statement_len, &options)) {
RETURN_FALSE;
}
@@ -495,25 +495,25 @@ static PHP_METHOD(PDO, prepare)
if (ZEND_NUM_ARGS() > 1 && (opt = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS)) != NULL) {
if (Z_TYPE_P(opt) != IS_ARRAY || (item = zend_hash_index_find(Z_ARRVAL_P(opt), 0)) == NULL
|| Z_TYPE_P(item) != IS_STRING
- || (pce = zend_lookup_class(Z_STR_P(item) TSRMLS_CC)) == NULL
+ || (pce = zend_lookup_class(Z_STR_P(item))) == NULL
) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
"the classname must be a string specifying an existing class"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
dbstmt_ce = pce;
- if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce TSRMLS_CC)) {
+ if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ "user-supplied statement class must be derived from PDOStatement");
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
if (dbstmt_ce->constructor && !(dbstmt_ce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ "user-supplied statement class cannot have a public constructor");
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
@@ -522,7 +522,7 @@ static PHP_METHOD(PDO, prepare)
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, ctor_args); "
"ctor_args must be an array"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
@@ -535,10 +535,10 @@ static PHP_METHOD(PDO, prepare)
ZVAL_COPY_VALUE(&ctor_args, &dbh->def_stmt_ctor_args);
}
- if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, &ctor_args TSRMLS_CC)) {
+ if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, &ctor_args)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"failed to instantiate user-supplied statement class"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
@@ -555,8 +555,8 @@ static PHP_METHOD(PDO, prepare)
/* we haven't created a lazy object yet */
ZVAL_UNDEF(&stmt->lazy_object_ref);
- if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) {
- pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC);
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options)) {
+ pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args);
return;
}
@@ -581,18 +581,18 @@ static PHP_METHOD(PDO, beginTransaction)
PDO_CONSTRUCT_CHECK;
if (dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is already an active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is already an active transaction");
RETURN_FALSE;
}
if (!dbh->methods->begin) {
/* TODO: this should be an exception; see the auto-commit mode
* comments below */
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "This driver doesn't support transactions");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "This driver doesn't support transactions");
RETURN_FALSE;
}
- if (dbh->methods->begin(dbh TSRMLS_CC)) {
+ if (dbh->methods->begin(dbh)) {
dbh->in_txn = 1;
RETURN_TRUE;
}
@@ -614,11 +614,11 @@ static PHP_METHOD(PDO, commit)
PDO_CONSTRUCT_CHECK;
if (!dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is no active transaction");
RETURN_FALSE;
}
- if (dbh->methods->commit(dbh TSRMLS_CC)) {
+ if (dbh->methods->commit(dbh)) {
dbh->in_txn = 0;
RETURN_TRUE;
}
@@ -640,11 +640,11 @@ static PHP_METHOD(PDO, rollBack)
PDO_CONSTRUCT_CHECK;
if (!dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is no active transaction");
RETURN_FALSE;
}
- if (dbh->methods->rollback(dbh TSRMLS_CC)) {
+ if (dbh->methods->rollback(dbh)) {
dbh->in_txn = 0;
RETURN_TRUE;
}
@@ -669,16 +669,16 @@ static PHP_METHOD(PDO, inTransaction)
RETURN_BOOL(dbh->in_txn);
}
- RETURN_BOOL(dbh->methods->in_transaction(dbh TSRMLS_CC));
+ RETURN_BOOL(dbh->methods->in_transaction(dbh));
}
/* }}} */
-static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSRMLS_DC) /* {{{ */
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* {{{ */
{
#define PDO_LONG_PARAM_CHECK \
if (Z_TYPE_P(value) != IS_LONG && Z_TYPE_P(value) != IS_STRING && Z_TYPE_P(value) != IS_FALSE && Z_TYPE_P(value) != IS_TRUE) { \
- pdo_raise_impl_error(dbh, NULL, "HY000", "attribute value must be an integer" TSRMLS_CC); \
+ pdo_raise_impl_error(dbh, NULL, "HY000", "attribute value must be an integer"); \
PDO_HANDLE_DBH_ERR(); \
return FAILURE; \
} \
@@ -694,7 +694,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
dbh->error_mode = Z_LVAL_P(value);
return SUCCESS;
default:
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -710,7 +710,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
dbh->desired_case = Z_LVAL_P(value);
return SUCCESS;
default:
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -727,7 +727,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
zval *tmp;
if ((tmp = zend_hash_index_find(Z_ARRVAL_P(value), 0)) != NULL && Z_TYPE_P(tmp) == IS_LONG) {
if (Z_LVAL_P(tmp) == PDO_FETCH_INTO || Z_LVAL_P(tmp) == PDO_FETCH_CLASS) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch modes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch modes");
return FAILURE;
}
}
@@ -736,7 +736,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
}
convert_to_long(value);
if (Z_LVAL_P(value) == PDO_FETCH_USE_DEFAULT) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type");
return FAILURE;
}
dbh->default_fetch_type = Z_LVAL_P(value);
@@ -756,31 +756,31 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
if (dbh->is_persistent) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS cannot be used with persistent PDO instances"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
if (Z_TYPE_P(value) != IS_ARRAY
|| (item = zend_hash_index_find(Z_ARRVAL_P(value), 0)) == NULL
|| Z_TYPE_P(item) != IS_STRING
- || (pce = zend_lookup_class(Z_STR_P(item) TSRMLS_CC)) == NULL
+ || (pce = zend_lookup_class(Z_STR_P(item))) == NULL
) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
"the classname must be a string specifying an existing class"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
- if (!instanceof_function(pce, pdo_dbstmt_ce TSRMLS_CC)) {
+ if (!instanceof_function(pce, pdo_dbstmt_ce)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ "user-supplied statement class must be derived from PDOStatement");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
if (pce->constructor && !(pce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ "user-supplied statement class cannot have a public constructor");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -794,7 +794,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
"ctor_args must be an array"
- TSRMLS_CC);
+ );
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -812,15 +812,15 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
}
PDO_DBH_CLEAR_ERR();
- if (dbh->methods->set_attribute(dbh, attr, value TSRMLS_CC)) {
+ if (dbh->methods->set_attribute(dbh, attr, value)) {
return SUCCESS;
}
fail:
if (attr == PDO_ATTR_AUTOCOMMIT) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "The auto-commit mode cannot be changed for this driver");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "The auto-commit mode cannot be changed for this driver");
} else if (!dbh->methods->set_attribute) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes");
} else {
PDO_HANDLE_DBH_ERR();
}
@@ -836,14 +836,14 @@ static PHP_METHOD(PDO, setAttribute)
zend_long attr;
zval *value;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &attr, &value)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lz", &attr, &value)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- if (pdo_dbh_attribute_set(dbh, attr, value TSRMLS_CC) != FAILURE) {
+ if (pdo_dbh_attribute_set(dbh, attr, value) != FAILURE) {
RETURN_TRUE;
}
RETURN_FALSE;
@@ -857,7 +857,7 @@ static PHP_METHOD(PDO, getAttribute)
pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis());
zend_long attr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr)) {
RETURN_FALSE;
}
@@ -896,17 +896,17 @@ static PHP_METHOD(PDO, getAttribute)
}
if (!dbh->methods->get_attribute) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes");
RETURN_FALSE;
}
- switch (dbh->methods->get_attribute(dbh, attr, return_value TSRMLS_CC)) {
+ switch (dbh->methods->get_attribute(dbh, attr, return_value)) {
case -1:
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
case 0:
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute");
RETURN_FALSE;
default:
@@ -924,17 +924,17 @@ static PHP_METHOD(PDO, exec)
size_t statement_len;
zend_long ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &statement, &statement_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &statement, &statement_len)) {
RETURN_FALSE;
}
if (!statement_len) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "trying to execute an empty query" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "trying to execute an empty query");
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- ret = dbh->methods->doer(dbh, statement, statement_len TSRMLS_CC);
+ ret = dbh->methods->doer(dbh, statement, statement_len);
if(ret == -1) {
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
@@ -952,19 +952,19 @@ static PHP_METHOD(PDO, lastInsertId)
char *name = NULL;
size_t namelen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &namelen)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &name, &namelen)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
if (!dbh->methods->last_id) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()");
RETURN_FALSE;
} else {
int id_len;
char *id;
- id = dbh->methods->last_id(dbh, name, (unsigned int *)&id_len TSRMLS_CC);
+ id = dbh->methods->last_id(dbh, name, (unsigned int *)&id_len);
if (!id) {
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
@@ -1029,7 +1029,7 @@ static PHP_METHOD(PDO, errorInfo)
}
if (dbh->methods->fetch_err) {
- dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value TSRMLS_CC);
+ dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value);
}
/**
@@ -1062,11 +1062,11 @@ static PHP_METHOD(PDO, query)
/* Return a meaningful error when no parameters were passed */
if (!ZEND_NUM_ARGS()) {
- zend_parse_parameters(0 TSRMLS_CC, "z|z", NULL, NULL);
+ zend_parse_parameters(0, "z|z", NULL, NULL);
RETURN_FALSE;
}
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &statement,
+ if (FAILURE == zend_parse_parameters(1, "s", &statement,
&statement_len)) {
RETURN_FALSE;
}
@@ -1074,8 +1074,8 @@ static PHP_METHOD(PDO, query)
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC)) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class" TSRMLS_CC);
+ if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class");
return;
}
stmt = Z_PDO_STMT_P(return_value);
@@ -1094,22 +1094,22 @@ static PHP_METHOD(PDO, query)
/* we haven't created a lazy object yet */
ZVAL_UNDEF(&stmt->lazy_object_ref);
- if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL TSRMLS_CC)) {
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL)) {
PDO_STMT_CLEAR_ERR();
if (ZEND_NUM_ARGS() == 1 || SUCCESS == pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, 1)) {
/* now execute the statement */
PDO_STMT_CLEAR_ERR();
- if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ if (stmt->methods->executer(stmt)) {
int ret = 1;
if (!stmt->executed) {
if (stmt->dbh->alloc_own_columns) {
- ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ ret = pdo_stmt_describe_columns(stmt);
}
stmt->executed = 1;
}
if (ret) {
- pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC);
+ pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args);
return;
}
}
@@ -1138,18 +1138,18 @@ static PHP_METHOD(PDO, quote)
char *qstr;
int qlen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &paramtype)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &paramtype)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
if (!dbh->methods->quoter) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting");
RETURN_FALSE;
}
- if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype TSRMLS_CC)) {
+ if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype)) {
RETVAL_STRINGL(qstr, qlen);
efree(qstr);
return;
@@ -1163,7 +1163,7 @@ static PHP_METHOD(PDO, quote)
Prevents use of a PDO instance that has been unserialized */
static PHP_METHOD(PDO, __wakeup)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances");
}
/* }}} */
@@ -1171,7 +1171,7 @@ static PHP_METHOD(PDO, __wakeup)
Prevents serialization of a PDO instance */
static PHP_METHOD(PDO, __sleep)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances");
}
/* }}} */
@@ -1264,7 +1264,7 @@ static void cls_method_dtor(zval *el) /* {{{ */ {
/* }}} */
/* {{{ overloaded object handlers for PDO class */
-int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
+int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
{
const zend_function_entry *funcs;
zend_function func;
@@ -1276,13 +1276,13 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) {
return 0;
}
- funcs = dbh->methods->get_driver_methods(dbh, kind TSRMLS_CC);
+ funcs = dbh->methods->get_driver_methods(dbh, kind);
if (!funcs) {
return 0;
}
if (!(dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent))) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO methods.");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO methods.");
}
zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, cls_method_dtor, dbh->is_persistent, 0);
@@ -1329,7 +1329,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
return 1;
}
-static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key TSRMLS_DC)
+static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key)
{
zend_function *fbc = NULL;
pdo_dbh_object_t *dbh_obj = php_pdo_dbh_fetch_object(*object);
@@ -1338,12 +1338,12 @@ static union _zend_function *dbh_method_get(zend_object **object, zend_string *m
lc_method_name = zend_string_init(method_name->val, method_name->len, 0);
zend_str_tolower_copy(lc_method_name->val, method_name->val, method_name->len);
- if ((fbc = std_object_handlers.get_method(object, method_name, key TSRMLS_CC)) == NULL) {
+ if ((fbc = std_object_handlers.get_method(object, method_name, key)) == NULL) {
/* not a pre-defined method, nor a user-defined method; check
* the driver specific methods */
if (!dbh_obj->inner->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
if (!pdo_hash_methods(dbh_obj,
- PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)
+ PDO_DBH_DRIVER_METHOD_KIND_DBH)
|| !dbh_obj->inner->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
goto out;
}
@@ -1357,20 +1357,20 @@ out:
return fbc;
}
-static int dbh_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int dbh_compare(zval *object1, zval *object2)
{
return -1;
}
static zend_object_handlers pdo_dbh_object_handlers;
-static void pdo_dbh_free_storage(zend_object *std TSRMLS_DC);
+static void pdo_dbh_free_storage(zend_object *std);
-void pdo_dbh_init(TSRMLS_D)
+void pdo_dbh_init(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
- pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbh_ce = zend_register_internal_class(&ce);
pdo_dbh_ce->create_object = pdo_dbh_new;
memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
@@ -1478,7 +1478,7 @@ void pdo_dbh_init(TSRMLS_D)
}
-static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
+static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent)
{
int i;
@@ -1492,7 +1492,7 @@ static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
}
if (dbh->methods) {
- dbh->methods->closer(dbh TSRMLS_CC);
+ dbh->methods->closer(dbh);
}
if (dbh->data_source) {
@@ -1523,27 +1523,27 @@ static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
pefree(dbh, dbh->is_persistent);
}
-static void pdo_dbh_free_storage(zend_object *std TSRMLS_DC)
+static void pdo_dbh_free_storage(zend_object *std)
{
pdo_dbh_t *dbh = php_pdo_dbh_fetch_inner(std);
if (dbh->in_txn && dbh->methods && dbh->methods->rollback) {
- dbh->methods->rollback(dbh TSRMLS_CC);
+ dbh->methods->rollback(dbh);
dbh->in_txn = 0;
}
if (dbh->is_persistent && dbh->methods && dbh->methods->persistent_shutdown) {
- dbh->methods->persistent_shutdown(dbh TSRMLS_CC);
+ dbh->methods->persistent_shutdown(dbh);
}
- zend_object_std_dtor(std TSRMLS_CC);
- dbh_free(dbh, 0 TSRMLS_CC);
+ zend_object_std_dtor(std);
+ dbh_free(dbh, 0);
}
-zend_object *pdo_dbh_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_dbh_new(zend_class_entry *ce)
{
pdo_dbh_object_t *dbh;
dbh = ecalloc(1, sizeof(pdo_dbh_object_t) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&dbh->std, ce TSRMLS_CC);
+ zend_object_std_init(&dbh->std, ce);
object_properties_init(&dbh->std, ce);
rebuild_object_properties(&dbh->std);
dbh->inner = ecalloc(1, sizeof(pdo_dbh_t));
@@ -1560,7 +1560,7 @@ ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor) /* {{{ */
{
if (res->ptr) {
pdo_dbh_t *dbh = (pdo_dbh_t*)res->ptr;
- dbh_free(dbh, 1 TSRMLS_CC);
+ dbh_free(dbh, 1);
res->ptr = NULL;
}
}
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 9dd7305723..be65a927dd 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -419,7 +419,7 @@ static void free_param_name(zval *el) {
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC)
+ char **outquery, int *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;
@@ -473,7 +473,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* did the query make sense to me? */
if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
/* they mixed both types; punt */
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters");
ret = -1;
goto clean_up;
}
@@ -497,7 +497,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* Do we have placeholders but no bound params */
if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound");
ret = -1;
goto clean_up;
}
@@ -516,7 +516,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
goto safe;
}
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens");
ret = -1;
goto clean_up;
}
@@ -537,7 +537,7 @@ safe:
if (param == NULL) {
/* parameter was not defined */
ret = -1;
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
goto clean_up;
}
if (stmt->dbh->methods->quoter) {
@@ -556,7 +556,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!stmt->dbh->methods->quoter(stmt->dbh, buf->val, buf->len, &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -569,7 +569,7 @@ safe:
zend_string_release(buf);
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
ret = -1;
goto clean_up;
}
@@ -600,7 +600,7 @@ safe:
convert_to_string(&tmp_param);
if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param),
Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -740,7 +740,7 @@ clean_up:
#if 0
int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
- int *outquery_len TSRMLS_DC)
+ int *outquery_len)
{
Scanner s;
char *ptr;
@@ -805,7 +805,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
@@ -841,7 +841,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index 79e167ba1d..847f69ac18 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -81,7 +81,7 @@ static void free_param_name(zval *el) {
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC)
+ char **outquery, int *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;
@@ -135,7 +135,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* did the query make sense to me? */
if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
/* they mixed both types; punt */
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters");
ret = -1;
goto clean_up;
}
@@ -159,7 +159,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* Do we have placeholders but no bound params */
if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound");
ret = -1;
goto clean_up;
}
@@ -178,7 +178,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
goto safe;
}
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens");
ret = -1;
goto clean_up;
}
@@ -199,7 +199,7 @@ safe:
if (param == NULL) {
/* parameter was not defined */
ret = -1;
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
goto clean_up;
}
if (stmt->dbh->methods->quoter) {
@@ -218,7 +218,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!stmt->dbh->methods->quoter(stmt->dbh, buf->val, buf->len, &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -231,7 +231,7 @@ safe:
zend_string_release(buf);
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
ret = -1;
goto clean_up;
}
@@ -262,7 +262,7 @@ safe:
convert_to_string(&tmp_param);
if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param),
Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -402,7 +402,7 @@ clean_up:
#if 0
int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
- int *outquery_len TSRMLS_DC)
+ int *outquery_len)
{
Scanner s;
char *ptr;
@@ -467,7 +467,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
@@ -503,7 +503,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 1491c80cfd..e4daca7b87 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -115,11 +115,11 @@ ZEND_END_ARG_INFO()
static PHP_FUNCTION(dbstmt_constructor) /* {{{ */
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a PDOStatement manually");
+ php_error_docref(NULL, E_ERROR, "You should not create a PDOStatement manually");
}
/* }}} */
-static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param TSRMLS_DC) /* {{{ */
+static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /* {{{ */
{
if (stmt->bound_param_map) {
/* rewriting :name to ? style.
@@ -141,7 +141,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
param->name = zend_string_init(name, strlen(name), 0);
return 1;
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
return 0;
}
@@ -151,13 +151,13 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
continue;
}
if (param->paramno >= 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead");
return -1;
}
param->paramno = position;
return 1;
} ZEND_HASH_FOREACH_END();
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
return 0;
}
return 1;
@@ -165,7 +165,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
/* }}} */
/* trigger callback hook for parameters */
-static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type) /* {{{ */
{
int ret = 1, is_param = 1;
struct pdo_bound_param_data *param;
@@ -180,7 +180,7 @@ static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_typ
iterate:
if (ht) {
ZEND_HASH_FOREACH_PTR(ht, param) {
- if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) {
+ if (!stmt->methods->param_hook(stmt, param, event_type)) {
ret = 0;
break;
}
@@ -196,14 +196,14 @@ iterate:
}
/* }}} */
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
{
int col;
stmt->columns = ecalloc(stmt->column_count, sizeof(struct pdo_column_data));
for (col = 0; col < stmt->column_count; col++) {
- if (!stmt->methods->describer(stmt, col TSRMLS_CC)) {
+ if (!stmt->methods->describer(stmt, col)) {
return 0;
}
@@ -254,12 +254,12 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value TSRMLS_DC) /* {{{ */
+static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
{
if (Z_ISUNDEF(stmt->lazy_object_ref)) {
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
row->stmt = stmt;
- zend_object_std_init(&row->std, pdo_row_ce TSRMLS_CC);
+ zend_object_std_init(&row->std, pdo_row_ce);
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
row->std.handlers = &pdo_row_object_handlers;
stmt->std.gc.refcount++;
@@ -274,8 +274,7 @@ static void param_dtor(zval *el) /* {{{ */
/* tell the driver that it is going away */
if (param->stmt->methods->param_hook) {
- TSRMLS_FETCH();
- param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE TSRMLS_CC);
+ param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE);
}
if (param->name) {
@@ -293,7 +292,7 @@ static void param_dtor(zval *el) /* {{{ */
}
/* }}} */
-static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param TSRMLS_DC) /* {{{ */
+static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param) /* {{{ */
{
HashTable *hash;
zval *parameter;
@@ -356,7 +355,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
if (param->paramno == -1) {
char *tmp;
spprintf(&tmp, 0, "Did not find column name '%s' in the defined columns; it will not be bound", param->name->val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", tmp TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", tmp);
efree(tmp);
}
}
@@ -372,7 +371,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
}
}
- if (is_param && !rewrite_name_to_position(stmt, param TSRMLS_CC)) {
+ if (is_param && !rewrite_name_to_position(stmt, param)) {
if (param->name) {
zend_string_release(param->name);
param->name = NULL;
@@ -386,7 +385,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
* at this time. */
if (stmt->methods->param_hook) {
if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE
- TSRMLS_CC)) {
+ )) {
if (param->name) {
zend_string_release(param->name);
param->name = NULL;
@@ -412,7 +411,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
/* tell the driver we just created a parameter */
if (stmt->methods->param_hook) {
if (!stmt->methods->param_hook(stmt, pparam, PDO_PARAM_EVT_ALLOC
- TSRMLS_CC)) {
+ )) {
/* undo storage allocation; the hash will free the parameter
* name if required */
if (pparam->name) {
@@ -437,7 +436,7 @@ static PHP_METHOD(PDOStatement, execute)
int ret = 1;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &input_params)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|a!", &input_params)) {
RETURN_FALSE;
}
@@ -466,7 +465,7 @@ static PHP_METHOD(PDOStatement, execute)
/* we're okay to be zero based here */
/* num_index is unsignend
if (num_index < 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL);
RETURN_FALSE;
}
*/
@@ -476,7 +475,7 @@ static PHP_METHOD(PDOStatement, execute)
param.param_type = PDO_PARAM_STR;
ZVAL_COPY(&param.parameter, tmp);
- if (!really_register_bound_param(&param, stmt, 1 TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, 1)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&param.parameter);
}
@@ -492,7 +491,7 @@ static PHP_METHOD(PDOStatement, execute)
*/
ret = pdo_parse_params(stmt, stmt->query_string, stmt->query_stringlen,
- &stmt->active_query_string, &stmt->active_query_stringlen TSRMLS_CC);
+ &stmt->active_query_string, &stmt->active_query_stringlen);
if (ret == 0) {
/* no changes were made */
@@ -504,11 +503,11 @@ static PHP_METHOD(PDOStatement, execute)
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE TSRMLS_CC)) {
+ } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ if (stmt->methods->executer(stmt)) {
if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) {
efree(stmt->active_query_string);
}
@@ -519,13 +518,13 @@ static PHP_METHOD(PDOStatement, execute)
if (stmt->dbh->alloc_own_columns && !stmt->columns) {
/* for "big boy" drivers, we need to allocate memory to fetch
* the results into, so lets do that now */
- ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ ret = pdo_stmt_describe_columns(stmt);
}
stmt->executed = 1;
}
- if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST TSRMLS_CC)) {
+ if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST)) {
RETURN_FALSE;
}
@@ -540,7 +539,7 @@ static PHP_METHOD(PDOStatement, execute)
}
/* }}} */
-static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *type_override TSRMLS_DC) /* {{{ */
+static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *type_override) /* {{{ */
{
struct pdo_column_data *col;
char *value = NULL;
@@ -555,7 +554,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
value = NULL;
value_len = 0;
- stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees TSRMLS_CC);
+ stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees);
switch (type) {
case PDO_PARAM_ZVAL:
@@ -674,26 +673,26 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
}
/* }}} */
-static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset, int do_bind TSRMLS_DC) /* {{{ */
+static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset, int do_bind) /* {{{ */
{
if (!stmt->executed) {
return 0;
}
- if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE TSRMLS_CC)) {
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE)) {
return 0;
}
- if (!stmt->methods->fetcher(stmt, ori, offset TSRMLS_CC)) {
+ if (!stmt->methods->fetcher(stmt, ori, offset)) {
return 0;
}
/* some drivers might need to describe the columns now */
- if (!stmt->columns && !pdo_stmt_describe_columns(stmt TSRMLS_CC)) {
+ if (!stmt->columns && !pdo_stmt_describe_columns(stmt)) {
return 0;
}
- if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST TSRMLS_CC)) {
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST)) {
return 0;
}
@@ -712,7 +711,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen
zval_dtor(Z_REFVAL(param->parameter));
/* set new value */
- fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)&param->param_type TSRMLS_CC);
+ fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)&param->param_type);
/* TODO: some smart thing that avoids duplicating the value in the
* general loop below. For now, if you're binding output columns,
@@ -726,7 +725,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen
}
/* }}} */
-static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
{
zend_class_entry *ce = stmt->fetch.cls.ce;
zend_fcall_info *fci = &stmt->fetch.cls.fci;
@@ -748,7 +747,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
fci->params = NULL;
fci->no_separation = 1;
- zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args TSRMLS_CC);
+ zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args);
fcc->initialized = 1;
fcc->function_handler = ce->constructor;
@@ -756,7 +755,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
fcc->called_scope = ce;
return 1;
} else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it");
return 0;
} else {
return 1; /* no ctor no args is also ok */
@@ -764,16 +763,16 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args TSRMLS_DC) /* {{{ */
+static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args) /* {{{ */
{
char *is_callable_error = NULL;
- if (zend_fcall_info_init(callable, 0, fci, fcc, NULL, &is_callable_error TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_init(callable, 0, fci, fcc, NULL, &is_callable_error) == FAILURE) {
if (is_callable_error) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", is_callable_error TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", is_callable_error);
efree(is_callable_error);
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback");
}
return 0;
}
@@ -789,12 +788,12 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
}
/* }}} */
-static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int do_fetch_func_prepare(pdo_stmt_t *stmt) /* {{{ */
{
zend_fcall_info *fci = &stmt->fetch.cls.fci;
zend_fcall_info_cache *fcc = &stmt->fetch.cls.fcc;
- if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count TSRMLS_CC)) {
+ if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count)) {
return 0;
} else {
stmt->fetch.func.values = safe_emalloc(sizeof(zval), stmt->column_count, 0);
@@ -803,7 +802,7 @@ static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /* {{{ */
+static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */
{
/* fci.size is used to check if it is valid */
if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) {
@@ -832,7 +831,7 @@ static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /
/* perform a fetch. If do_bind is true, update any bound columns.
* If return_value is not null, store values into it according to HOW. */
-static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all TSRMLS_DC) /* {{{ */
+static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all) /* {{{ */
{
int flags, idx, old_arg_count = 0;
zend_class_entry *ce = NULL, *old_ce = NULL;
@@ -845,7 +844,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
flags = how & PDO_FETCH_FLAGS;
how = how & ~PDO_FETCH_FLAGS;
- if (!do_fetch_common(stmt, ori, offset, do_bind TSRMLS_CC)) {
+ if (!do_fetch_common(stmt, ori, offset, do_bind)) {
return 0;
}
@@ -864,7 +863,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
int i = 0;
if (how == PDO_FETCH_LAZY) {
- get_lazy_object(stmt, return_value TSRMLS_CC);
+ get_lazy_object(stmt, return_value);
return 1;
}
@@ -886,7 +885,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_KEY_PAIR:
if (stmt->column_count != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain extactly 2 columns." TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain extactly 2 columns.");
return 0;
}
if (!return_all) {
@@ -897,11 +896,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_COLUMN:
if (colno >= 0 && colno < stmt->column_count) {
if (flags == PDO_FETCH_GROUP && stmt->fetch.column == -1) {
- fetch_value(stmt, return_value, 1, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, 1, NULL);
} else if (flags == PDO_FETCH_GROUP && colno) {
- fetch_value(stmt, return_value, 0, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, 0, NULL);
} else {
- fetch_value(stmt, return_value, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, colno, NULL);
}
if (!return_all) {
return 1;
@@ -909,7 +908,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
break;
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index");
}
return 0;
@@ -925,30 +924,30 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
old_ce = stmt->fetch.cls.ce;
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
- fetch_value(stmt, &val, i++, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i++, NULL);
if (Z_TYPE(val) != IS_NULL) {
convert_to_string(&val);
- if ((cep = zend_lookup_class(Z_STR(val) TSRMLS_CC)) == NULL) {
+ if ((cep = zend_lookup_class(Z_STR(val))) == NULL) {
stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR;
} else {
stmt->fetch.cls.ce = cep;
}
}
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
zval_dtor(&val);
}
ce = stmt->fetch.cls.ce;
if (!ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified");
return 0;
}
if ((flags & PDO_FETCH_SERIALIZE) == 0) {
object_init_ex(return_value, ce);
if (!stmt->fetch.cls.fci.size) {
- if (!do_fetch_class_prepare(stmt TSRMLS_CC))
+ if (!do_fetch_class_prepare(stmt))
{
return 0;
}
@@ -956,8 +955,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if (ce->constructor && (flags & PDO_FETCH_PROPS_LATE)) {
stmt->fetch.cls.fci.object = Z_OBJ_P(return_value);
stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor");
return 0;
} else {
if (!Z_ISUNDEF(stmt->fetch.cls.retval)) {
@@ -971,7 +970,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_INTO:
if (Z_ISUNDEF(stmt->fetch.into)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified." TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified.");
return 0;
break;
}
@@ -985,11 +984,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_FUNC:
if (Z_ISUNDEF(stmt->fetch.func.function)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified");
return 0;
}
if (!stmt->fetch.func.fci.size) {
- if (!do_fetch_func_prepare(stmt TSRMLS_CC))
+ if (!do_fetch_func_prepare(stmt))
{
return 0;
}
@@ -1006,9 +1005,9 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
//???
//ZVAL_NULL(&grp_val);
if (flags == PDO_FETCH_GROUP && how == PDO_FETCH_COLUMN && stmt->fetch.column > 0) {
- fetch_value(stmt, &grp_val, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, &grp_val, colno, NULL);
} else {
- fetch_value(stmt, &grp_val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &grp_val, i, NULL);
}
convert_to_string(&grp_val);
if (how == PDO_FETCH_COLUMN) {
@@ -1020,7 +1019,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
for (idx = 0; i < stmt->column_count; i++, idx++) {
zval val;
- fetch_value(stmt, &val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i, NULL);
switch (how) {
case PDO_FETCH_ASSOC:
@@ -1030,7 +1029,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_KEY_PAIR:
{
zval tmp;
- fetch_value(stmt, &tmp, ++i, NULL TSRMLS_CC);
+ fetch_value(stmt, &tmp, ++i, NULL);
if (Z_TYPE(val) == IS_LONG) {
zend_hash_index_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_LVAL(val), &tmp);
@@ -1095,7 +1094,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_INTO:
zend_update_property(NULL, return_value,
stmt->columns[i].name, stmt->columns[i].namelen,
- &val TSRMLS_CC);
+ &val);
zval_ptr_dtor(&val);
break;
@@ -1103,15 +1102,15 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) {
zend_update_property(ce, return_value,
stmt->columns[i].name, stmt->columns[i].namelen,
- &val TSRMLS_CC);
+ &val);
zval_ptr_dtor(&val);
} else {
#ifdef MBO_0
php_unserialize_data_t var_hash;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (php_var_unserialize(return_value, (const unsigned char**)&Z_STRVAL(val), Z_STRVAL(val)+Z_STRLEN(val), NULL TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data" TSRMLS_CC);
+ if (php_var_unserialize(return_value, (const unsigned char**)&Z_STRVAL(val), Z_STRVAL(val)+Z_STRLEN(val), NULL) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data");
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return 0;
}
@@ -1119,11 +1118,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
#endif
if (!ce->unserialize) {
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class");
return 0;
- } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL TSRMLS_CC) == FAILURE) {
+ } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL) == FAILURE) {
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class");
zval_dtor(return_value);
ZVAL_NULL(return_value);
return 0;
@@ -1140,7 +1139,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
default:
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range");
return 0;
break;
}
@@ -1151,8 +1150,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if (ce->constructor && !(flags & (PDO_FETCH_PROPS_LATE | PDO_FETCH_SERIALIZE))) {
stmt->fetch.cls.fci.object = Z_OBJ_P(return_value);
stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor");
return 0;
} else {
if (!Z_ISUNDEF(stmt->fetch.cls.retval)) {
@@ -1161,7 +1160,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
}
}
if (flags & PDO_FETCH_CLASSTYPE) {
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
stmt->fetch.cls.fci.param_count = old_arg_count;
@@ -1171,8 +1170,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_FUNC:
stmt->fetch.func.fci.param_count = idx;
stmt->fetch.func.fci.retval = &retval;
- if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function");
return 0;
} else {
if (return_all) {
@@ -1213,14 +1212,14 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
}
/* }}} */
-static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all TSRMLS_DC) /* {{{ */
+static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all) /* {{{ */
{
int flags = mode & PDO_FETCH_FLAGS;
mode = mode & ~PDO_FETCH_FLAGS;
if (mode < 0 || mode > PDO_FETCH__MAX) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode");
return 0;
}
@@ -1232,29 +1231,29 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all
switch(mode) {
case PDO_FETCH_FUNC:
if (!fetch_all) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()");
return 0;
}
return 1;
case PDO_FETCH_LAZY:
if (fetch_all) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()");
return 0;
}
/* fall through */
default:
if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS");
return 0;
}
if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS");
return 0;
}
if (mode >= PDO_FETCH__MAX) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode");
return 0;
}
/* no break; */
@@ -1274,18 +1273,18 @@ static PHP_METHOD(PDOStatement, fetch)
zend_long off = 0;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lll", &how,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|lll", &how,
&ori, &off)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 0)) {
RETURN_FALSE;
}
- if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -1306,13 +1305,13 @@ static PHP_METHOD(PDOStatement, fetchObject)
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S!a", &class_name, &ctor_args)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!a", &class_name, &ctor_args)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 0)) {
RETURN_FALSE;
}
@@ -1320,7 +1319,7 @@ static PHP_METHOD(PDOStatement, fetchObject)
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
if (ctor_args) {
if (Z_TYPE_P(ctor_args) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) {
@@ -1330,23 +1329,23 @@ static PHP_METHOD(PDOStatement, fetchObject)
}
}
if (class_name && !error) {
- stmt->fetch.cls.ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ stmt->fetch.cls.ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
if (!stmt->fetch.cls.ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class");
error = 1;
}
} else if (!error) {
stmt->fetch.cls.ce = zend_standard_class_def;
}
- if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) {
error = 1;
}
if (error) {
PDO_HANDLE_STMT_ERR();
}
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
@@ -1364,18 +1363,18 @@ static PHP_METHOD(PDOStatement, fetchColumn)
zend_long col_n = 0;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &col_n)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &col_n)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE TSRMLS_CC)) {
+ if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- fetch_value(stmt, return_value, col_n, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, col_n, NULL);
}
/* }}} */
@@ -1391,11 +1390,11 @@ static PHP_METHOD(PDOStatement, fetchAll)
int error = 0, flags, old_arg_count;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lzz", &how, &arg2, &ctor_args)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|lzz", &how, &arg2, &ctor_args)) {
RETURN_FALSE;
}
- if (!pdo_stmt_verify_mode(stmt, how, 1 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 1)) {
RETURN_FALSE;
}
@@ -1403,7 +1402,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
switch(how & ~PDO_FETCH_FLAGS) {
case PDO_FETCH_CLASS:
@@ -1414,7 +1413,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
break;
case 3:
if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array");
error = 1;
break;
}
@@ -1429,20 +1428,20 @@ static PHP_METHOD(PDOStatement, fetchAll)
ZVAL_UNDEF(&stmt->fetch.cls.ctor_args);
}
if (Z_TYPE_P(arg2) != IS_STRING) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)");
error = 1;
break;
} else {
- stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO);
if (!stmt->fetch.cls.ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class");
error = 1;
break;
}
}
}
if (!error) {
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
}
break;
@@ -1450,13 +1449,13 @@ static PHP_METHOD(PDOStatement, fetchAll)
switch (ZEND_NUM_ARGS()) {
case 0:
case 1:
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified");
error = 1;
break;
case 3:
case 2:
ZVAL_COPY_VALUE(&stmt->fetch.func.function, arg2);
- if (do_fetch_func_prepare(stmt TSRMLS_CC) == 0) {
+ if (do_fetch_func_prepare(stmt) == 0) {
error = 1;
}
break;
@@ -1474,14 +1473,14 @@ static PHP_METHOD(PDOStatement, fetchAll)
stmt->fetch.column = Z_LVAL_P(arg2);
break;
case 3:
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN");
error = 1;
}
break;
default:
if (ZEND_NUM_ARGS() > 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters");
error = 1;
}
}
@@ -1503,7 +1502,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
} else {
return_all = 0;
}
- if (!do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC)) {
+ if (!do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all)) {
error = 2;
}
}
@@ -1511,18 +1510,18 @@ static PHP_METHOD(PDOStatement, fetchAll)
if ((how & PDO_FETCH_GROUP)) {
do {
//??? MAKE_STD_ZVAL(data);
- } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
+ } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all));
} else if (how == PDO_FETCH_KEY_PAIR || (how == PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR)) {
- while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
+ while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all));
} else {
array_init(return_value);
do {
add_next_index_zval(return_value, &data);
- } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC));
+ } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, 0));
}
}
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
@@ -1550,10 +1549,10 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
param.paramno = -1;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len,
&param.driver_params)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|llz!", &param.name,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name,
&parameter, &param_type, &param.max_value_len,
&param.driver_params)) {
return 0;
@@ -1565,12 +1564,12 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
} else if (!param.name) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
return 0;
}
ZVAL_COPY(&param.parameter, parameter);
- if (!really_register_bound_param(&param, stmt, is_param TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, is_param)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
}
@@ -1590,9 +1589,9 @@ static PHP_METHOD(PDOStatement, bindValue)
param.paramno = -1;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lz/|l", &param.paramno, &parameter, &param_type)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz/|l", &param.name,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name,
&parameter, &param_type)) {
RETURN_FALSE;
}
@@ -1603,12 +1602,12 @@ static PHP_METHOD(PDOStatement, bindValue)
if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
} else if (!param.name) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
RETURN_FALSE;
}
ZVAL_COPY(&param.parameter, parameter);
- if (!really_register_bound_param(&param, stmt, TRUE TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, TRUE)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1683,7 +1682,7 @@ static PHP_METHOD(PDOStatement, errorInfo)
add_next_index_string(return_value, stmt->error_code);
if (stmt->dbh->methods->fetch_err) {
- stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value TSRMLS_CC);
+ stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value);
}
error_count = zend_hash_num_elements(Z_ARRVAL_P(return_value));
@@ -1707,7 +1706,7 @@ static PHP_METHOD(PDOStatement, setAttribute)
zval *value = NULL;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lz!", &attr, &value)) {
RETURN_FALSE;
}
@@ -1716,13 +1715,13 @@ static PHP_METHOD(PDOStatement, setAttribute)
}
PDO_STMT_CLEAR_ERR();
- if (stmt->methods->set_attribute(stmt, attr, value TSRMLS_CC)) {
+ if (stmt->methods->set_attribute(stmt, attr, value)) {
RETURN_TRUE;
}
fail:
if (!stmt->methods->set_attribute) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes");
} else {
PDO_HANDLE_STMT_ERR();
}
@@ -1748,21 +1747,21 @@ static PHP_METHOD(PDOStatement, getAttribute)
zend_long attr;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr)) {
RETURN_FALSE;
}
if (!stmt->methods->get_attribute) {
if (!generic_stmt_attr_get(stmt, return_value, attr)) {
pdo_raise_impl_error(stmt->dbh, stmt, "IM001",
- "This driver doesn't support getting attributes" TSRMLS_CC);
+ "This driver doesn't support getting attributes");
RETURN_FALSE;
}
return;
}
PDO_STMT_CLEAR_ERR();
- switch (stmt->methods->get_attribute(stmt, attr, return_value TSRMLS_CC)) {
+ switch (stmt->methods->get_attribute(stmt, attr, return_value)) {
case -1:
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
@@ -1771,7 +1770,7 @@ static PHP_METHOD(PDOStatement, getAttribute)
if (!generic_stmt_attr_get(stmt, return_value, attr)) {
/* XXX: should do something better here */
pdo_raise_impl_error(stmt->dbh, stmt, "IM001",
- "driver doesn't support getting that attribute" TSRMLS_CC);
+ "driver doesn't support getting that attribute");
RETURN_FALSE;
}
return;
@@ -1802,21 +1801,21 @@ static PHP_METHOD(PDOStatement, getColumnMeta)
struct pdo_column_data *col;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colno)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &colno)) {
RETURN_FALSE;
}
if(colno < 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative");
RETURN_FALSE;
}
if (!stmt->methods->get_column_meta) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data");
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value TSRMLS_CC)) {
+ if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -1844,7 +1843,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
zend_class_entry *cep;
int retval;
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
switch (stmt->default_fetch_type) {
case PDO_FETCH_INTO:
@@ -1869,13 +1868,13 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
if (SUCCESS == retval) {
if (Z_TYPE(args[skip]) != IS_LONG) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "mode must be an integer" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "mode must be an integer");
retval = FAILURE;
} else {
mode = Z_LVAL(args[skip]);
flags = mode & PDO_FETCH_FLAGS;
- retval = pdo_stmt_verify_mode(stmt, mode, 0 TSRMLS_CC);
+ retval = pdo_stmt_verify_mode(stmt, mode, 0);
}
}
@@ -1897,7 +1896,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_NAMED:
case PDO_FETCH_KEY_PAIR:
if (argc != 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments");
} else {
retval = SUCCESS;
}
@@ -1905,9 +1904,9 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_COLUMN:
if (argc != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the colno argument" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the colno argument");
} else if (Z_TYPE(args[skip+1]) != IS_LONG) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "colno must be an integer" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "colno must be an integer");
} else {
stmt->fetch.column = Z_LVAL(args[skip+1]);
retval = SUCCESS;
@@ -1918,20 +1917,20 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
/* Gets its class name from 1st column */
if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) {
if (argc != 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments");
} else {
stmt->fetch.cls.ce = NULL;
retval = SUCCESS;
}
} else {
if (argc < 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the classname argument" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the classname argument");
} else if (argc > 3) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "too many arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "too many arguments");
} else if (Z_TYPE(args[skip+1]) != IS_STRING) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "classname must be a string" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "classname must be a string");
} else {
- cep = zend_lookup_class(Z_STR(args[skip+1]) TSRMLS_CC);
+ cep = zend_lookup_class(Z_STR(args[skip+1]));
if (cep) {
retval = SUCCESS;
stmt->fetch.cls.ce = cep;
@@ -1943,12 +1942,12 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
ZVAL_UNDEF(&stmt->fetch.cls.ctor_args);
#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */
if (stmt->dbh->is_persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
}
#endif
if (argc == 3) {
if (Z_TYPE(args[skip+2]) != IS_NULL && Z_TYPE(args[skip+2]) != IS_ARRAY) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array");
retval = FAILURE;
} else if (Z_TYPE(args[skip+2]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL(args[skip+2]))) {
ZVAL_DUP(&stmt->fetch.cls.ctor_args, &args[skip+2]);
@@ -1956,7 +1955,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
}
if (SUCCESS == retval) {
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
}
}
@@ -1964,9 +1963,9 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_INTO:
if (argc != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the object parameter" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the object parameter");
} else if (Z_TYPE(args[skip+1]) != IS_OBJECT) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "object must be an object" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "object must be an object");
} else {
retval = SUCCESS;
}
@@ -1974,7 +1973,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
if (SUCCESS == retval) {
#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */
if (stmt->dbh->is_persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
}
#endif
ZVAL_COPY(&stmt->fetch.into, &args[skip+1]);
@@ -1983,7 +1982,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
break;
default:
- pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified");
}
if (SUCCESS == retval) {
@@ -2018,7 +2017,7 @@ static PHP_METHOD(PDOStatement, setFetchMode)
/* {{{ proto bool PDOStatement::nextRowset()
Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */
-static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt)
{
/* un-describe */
if (stmt->columns) {
@@ -2033,13 +2032,13 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
stmt->column_count = 0;
}
- if (!stmt->methods->next_rowset(stmt TSRMLS_CC)) {
+ if (!stmt->methods->next_rowset(stmt)) {
/* Set the executed flag to 0 to reallocate columns on next execute */
stmt->executed = 0;
return 0;
}
- pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ pdo_stmt_describe_columns(stmt);
return 1;
}
@@ -2049,13 +2048,13 @@ static PHP_METHOD(PDOStatement, nextRowset)
PHP_STMT_GET_OBJ;
if (!stmt->methods->next_rowset) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets");
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ if (!pdo_stmt_do_next_rowset(stmt)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -2073,13 +2072,13 @@ static PHP_METHOD(PDOStatement, closeCursor)
if (!stmt->methods->cursor_closer) {
/* emulate it by fetching and discarding rows */
do {
- while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0 TSRMLS_CC))
+ while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0))
;
if (!stmt->methods->next_rowset) {
break;
}
- if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ if (!pdo_stmt_do_next_rowset(stmt)) {
break;
}
@@ -2090,7 +2089,7 @@ static PHP_METHOD(PDOStatement, closeCursor)
PDO_STMT_CLEAR_ERR();
- if (!stmt->methods->cursor_closer(stmt TSRMLS_CC)) {
+ if (!stmt->methods->cursor_closer(stmt)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -2111,11 +2110,11 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
RETURN_FALSE;
}
- php_stream_printf(out TSRMLS_CC, "SQL: [%d] %.*s\n",
+ php_stream_printf(out, "SQL: [%d] %.*s\n",
stmt->query_stringlen,
stmt->query_stringlen, stmt->query_string);
- php_stream_printf(out TSRMLS_CC, "Params: %d\n",
+ php_stream_printf(out, "Params: %d\n",
stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0);
if (stmt->bound_params) {
@@ -2123,12 +2122,12 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
zend_string *key = NULL;
ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) {
if (key) {
- php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", key->len, key->len, key->val);
+ php_stream_printf(out, "Key: Name: [%d] %.*s\n", key->len, key->len, key->val);
} else {
- php_stream_printf(out TSRMLS_CC, "Key: Position #%pd:\n", num);
+ php_stream_printf(out, "Key: Position #%pd:\n", num);
}
- php_stream_printf(out TSRMLS_CC, "paramno=%pd\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
+ php_stream_printf(out, "paramno=%pd\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
param->paramno, param->name? param->name->len : 0, param->name? param->name->len : 0,
param->name ? param->name->val : "",
param->is_param,
@@ -2145,7 +2144,7 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
Prevents use of a PDOStatement instance that has been unserialized */
static PHP_METHOD(PDOStatement, __wakeup)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances");
}
/* }}} */
@@ -2153,7 +2152,7 @@ static PHP_METHOD(PDOStatement, __wakeup)
Prevents serialization of a PDOStatement instance */
static PHP_METHOD(PDOStatement, __sleep)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances");
}
/* }}} */
@@ -2183,33 +2182,33 @@ const zend_function_entry pdo_dbstmt_functions[] = {
};
/* {{{ overloaded handlers for PDOStatement class */
-static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
convert_to_string(member);
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only");
} else {
- std_object_handlers.write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_object_handlers.write_property(object, member, value, cache_slot);
}
}
-static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
convert_to_string(member);
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only");
} else {
- std_object_handlers.unset_property(object, member, cache_slot TSRMLS_CC);
+ std_object_handlers.unset_property(object, member, cache_slot);
}
}
-static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key TSRMLS_DC)
+static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key)
{
zend_function *fbc = NULL;
zend_string *lc_method_name;
@@ -2228,7 +2227,7 @@ static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_str
* the driver specific methods */
if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
if (!pdo_hash_methods(Z_PDO_OBJECT_P(&stmt->database_object_handle),
- PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)
+ PDO_DBH_DRIVER_METHOD_KIND_STMT)
|| !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
goto out;
}
@@ -2245,40 +2244,40 @@ out:
return fbc;
}
-static int dbstmt_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int dbstmt_compare(zval *object1, zval *object2)
{
return -1;
}
-static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC)
+static zend_object *dbstmt_clone_obj(zval *zobject)
{
pdo_stmt_t *stmt;
pdo_stmt_t *old_stmt;
stmt = ecalloc(1, sizeof(pdo_stmt_t) + sizeof(zval) * (Z_OBJCE_P(zobject)->default_properties_count - 1));
- zend_object_std_init(&stmt->std, Z_OBJCE_P(zobject) TSRMLS_CC);
+ zend_object_std_init(&stmt->std, Z_OBJCE_P(zobject));
object_properties_init(&stmt->std, Z_OBJCE_P(zobject));
old_stmt = Z_PDO_STMT_P(zobject);
- zend_objects_clone_members(&stmt->std, &old_stmt->std TSRMLS_CC);
+ zend_objects_clone_members(&stmt->std, &old_stmt->std);
return &stmt->std;
}
zend_object_handlers pdo_dbstmt_object_handlers;
-static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
-void pdo_stmt_init(TSRMLS_D)
+void pdo_stmt_init(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions);
- pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbstmt_ce = zend_register_internal_class(&ce);
pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get;
pdo_dbstmt_ce->create_object = pdo_dbstmt_new;
- zend_class_implements(pdo_dbstmt_ce TSRMLS_CC, 1, zend_ce_traversable);
- zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_class_implements(pdo_dbstmt_ce, 1, zend_ce_traversable);
+ zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC);
memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
pdo_dbstmt_object_handlers.offset = XtOffsetOf(pdo_stmt_t, std);
@@ -2291,13 +2290,13 @@ void pdo_stmt_init(TSRMLS_D)
pdo_dbstmt_object_handlers.clone_obj = dbstmt_clone_obj;
INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions);
- pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_row_ce = zend_register_internal_class(&ce);
pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */
pdo_row_ce->create_object = pdo_row_new;
pdo_row_ce->serialize = pdo_row_serialize;
}
-static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
+static void free_statement(pdo_stmt_t *stmt)
{
if (stmt->bound_params) {
zend_hash_destroy(stmt->bound_params);
@@ -2316,7 +2315,7 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
}
if (stmt->methods && stmt->methods->dtor) {
- stmt->methods->dtor(stmt TSRMLS_CC);
+ stmt->methods->dtor(stmt);
}
if (stmt->query_string) {
efree(stmt->query_string);
@@ -2340,26 +2339,26 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
ZVAL_UNDEF(&stmt->fetch.into);
}
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
if (!Z_ISUNDEF(stmt->database_object_handle)) {
zval_ptr_dtor(&stmt->database_object_handle);
}
- zend_object_std_dtor(&stmt->std TSRMLS_CC);
+ zend_object_std_dtor(&stmt->std);
}
-void pdo_dbstmt_free_storage(zend_object *std TSRMLS_DC)
+void pdo_dbstmt_free_storage(zend_object *std)
{
pdo_stmt_t *stmt = php_pdo_stmt_fetch_object(std);
- free_statement(stmt TSRMLS_CC);
+ free_statement(stmt);
}
-zend_object *pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_dbstmt_new(zend_class_entry *ce)
{
pdo_stmt_t *stmt;
stmt = ecalloc(1, sizeof(pdo_stmt_t) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&stmt->std, ce TSRMLS_CC);
+ zend_object_std_init(&stmt->std, ce);
object_properties_init(&stmt->std, ce);
stmt->std.handlers = &pdo_dbstmt_object_handlers;
@@ -2376,7 +2375,7 @@ struct php_pdo_iterator {
zval fetch_ahead;
};
-static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void pdo_stmt_iter_dtor(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2387,14 +2386,14 @@ static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
}
}
-static int pdo_stmt_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int pdo_stmt_iter_valid(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
return Z_ISUNDEF(I->fetch_ahead) ? FAILURE : SUCCESS;
}
-static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2406,7 +2405,7 @@ static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
return &I->fetch_ahead;
}
-static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2417,7 +2416,7 @@ static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_D
}
}
-static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
pdo_stmt_t *stmt = Z_PDO_STMT_P(&I->iter.data); /* for PDO_HANDLE_STMT_ERR() */
@@ -2427,7 +2426,7 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
}
if (!do_fetch(stmt, TRUE, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
- PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ PDO_FETCH_ORI_NEXT, 0, 0)) {
PDO_HANDLE_STMT_ERR();
I->key = (ulong)-1;
@@ -2448,7 +2447,7 @@ static zend_object_iterator_funcs pdo_stmt_iter_funcs = {
NULL
};
-zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
struct php_pdo_iterator *I;
@@ -2458,12 +2457,12 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int
}
I = ecalloc(1, sizeof(struct php_pdo_iterator));
- zend_iterator_init(&I->iter TSRMLS_CC);
+ zend_iterator_init(&I->iter);
I->iter.funcs = &pdo_stmt_iter_funcs;
ZVAL_COPY(&I->iter.data, object);
if (!do_fetch(stmt, 1, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
- PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ PDO_FETCH_ORI_NEXT, 0, 0)) {
PDO_HANDLE_STMT_ERR();
I->key = (ulong)-1;
ZVAL_UNDEF(&I->fetch_ahead);
@@ -2480,7 +2479,7 @@ const zend_function_entry pdo_row_functions[] = {
{NULL, NULL, NULL}
};
-static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2492,12 +2491,12 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (stmt) {
if (Z_TYPE_P(member) == IS_LONG) {
if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) {
- fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC);
+ fetch_value(stmt, rv, Z_LVAL_P(member), NULL);
}
} else if (Z_TYPE_P(member) == IS_STRING
&& is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
if (lval >= 0 && lval < stmt->column_count) {
- fetch_value(stmt, rv, lval, NULL TSRMLS_CC);
+ fetch_value(stmt, rv, lval, NULL);
}
} else {
convert_to_string(member);
@@ -2505,7 +2504,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
* numbers */
for (colno = 0; colno < stmt->column_count; colno++) {
if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
- fetch_value(stmt, rv, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, rv, colno, NULL);
//???
//Z_SET_REFCOUNT_P(rv, 0);
//Z_UNSET_ISREF_P(rv);
@@ -2515,7 +2514,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
ZVAL_OBJ(&zobj, &stmt->std);
//zval_ptr_dtor(rv);
- return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC);
+ return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv);
}
}
}
@@ -2527,22 +2526,22 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
return rv;
}
-static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC)
+static zval *row_dim_read(zval *object, zval *member, int type, zval *rv)
{
- return row_prop_read(object, member, type, NULL, rv TSRMLS_CC);
+ return row_prop_read(object, member, type, NULL, rv);
}
-static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set");
+ php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set");
}
-static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC)
+static void row_dim_write(zval *object, zval *member, zval *value)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set");
+ php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set");
}
-static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2572,22 +2571,22 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c
return 0;
}
-static int row_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int row_dim_exists(zval *object, zval *member, int check_empty)
{
- return row_prop_exists(object, member, check_empty, NULL TSRMLS_CC);
+ return row_prop_exists(object, member, check_empty, NULL);
}
-static void row_prop_delete(zval *object, zval *offset, void **cache_slot TSRMLS_DC)
+static void row_prop_delete(zval *object, zval *offset, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow");
}
-static void row_dim_delete(zval *object, zval *offset TSRMLS_DC)
+static void row_dim_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow");
}
-static HashTable *row_get_properties(zval *object TSRMLS_DC)
+static HashTable *row_get_properties(zval *object)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2602,7 +2601,7 @@ static HashTable *row_get_properties(zval *object TSRMLS_DC)
}
for (i = 0; i < stmt->column_count; i++) {
zval val;
- fetch_value(stmt, &val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i, NULL);
zend_hash_str_update(stmt->std.properties, stmt->columns[i].name, stmt->columns[i].namelen, &val);
}
@@ -2612,7 +2611,7 @@ static HashTable *row_get_properties(zval *object TSRMLS_DC)
static union _zend_function *row_method_get(
zend_object **object_pp,
- zend_string *method_name, const zval *key TSRMLS_DC)
+ zend_string *method_name, const zval *key)
{
zend_function *fbc;
zend_string *lc_method_name;
@@ -2634,7 +2633,7 @@ static int row_call_method(zend_string *method, zend_object *object, INTERNAL_FU
return FAILURE;
}
-static union _zend_function *row_get_ctor(zend_object *object TSRMLS_DC)
+static union _zend_function *row_get_ctor(zend_object *object)
{
static zend_internal_function ctor = {0};
@@ -2647,12 +2646,12 @@ static union _zend_function *row_get_ctor(zend_object *object TSRMLS_DC)
return (union _zend_function*)&ctor;
}
-static zend_string *row_get_classname(const zend_object *object TSRMLS_DC)
+static zend_string *row_get_classname(const zend_object *object)
{
return zend_string_init("PDORow", sizeof("PDORow") - 1, 0);
}
-static int row_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int row_compare(zval *object1, zval *object2)
{
return -1;
}
@@ -2683,7 +2682,7 @@ zend_object_handlers pdo_row_object_handlers = {
NULL
};
-void pdo_row_free_storage(zend_object *std TSRMLS_DC)
+void pdo_row_free_storage(zend_object *std)
{
pdo_row_t *row = (pdo_row_t *)std;
if (row->stmt) {
@@ -2692,18 +2691,18 @@ void pdo_row_free_storage(zend_object *std TSRMLS_DC)
}
}
-zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_row_new(zend_class_entry *ce)
{
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
- zend_object_std_init(&row->std, ce TSRMLS_CC);
+ zend_object_std_init(&row->std, ce);
row->std.handlers = &pdo_row_object_handlers;
return &row->std;
}
-static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized");
+ php_error_docref(NULL, E_WARNING, "PDORow instances may not be serialized");
return FAILURE;
}
/* }}} */
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index ce5b3a229d..956f7544e2 100644
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -59,20 +59,20 @@ ZEND_END_MODULE_GLOBALS(pdo)
#endif
#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value);
#define REGISTER_PDO_CONST_LONG(const_name, value) { \
zend_class_entry **pce; \
if (zend_hash_find(CG(class_table), "pdo", sizeof("pdo"), (void **) &pce) != FAILURE) \
- zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC); \
+ zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (zend_long)value); \
} \
#define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1);
#define PDO_CONSTRUCT_CHECK \
if (!dbh->driver) { \
- pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC); \
+ pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called"); \
return; \
} \
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index de9780e226..6f2a01aa30 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -37,7 +37,7 @@ typedef unsigned __int64 pdo_uint64_t;
typedef long long int pdo_int64_t;
typedef unsigned long long int pdo_uint64_t;
#endif
-PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC);
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64);
#ifndef TRUE
# define TRUE 1
@@ -194,7 +194,7 @@ enum pdo_null_handling {
};
/* {{{ utils for reading attributes set as driver_options */
-static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, zend_long defval TSRMLS_DC)
+static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, zend_long defval)
{
zval *v;
@@ -204,7 +204,7 @@ static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type opt
}
return defval;
}
-static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval TSRMLS_DC)
+static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval)
{
zval *v;
@@ -234,33 +234,33 @@ typedef struct {
* data in the db, otherwise you will crash PHP when persistent connections
* are used.
*/
- int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC);
+ int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options);
} pdo_driver_t;
/* {{{ methods for a database handle */
/* close or otherwise disconnect the database */
-typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
/* prepare a statement and stash driver specific portion into stmt */
-typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC);
+typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options);
/* execute a statement (that does not return a result set) */
-typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC);
+typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len);
/* quote a string */
-typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC);
+typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype);
/* transaction related */
-typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh);
/* setting of attributes */
-typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val);
/* return last insert id. NULL indicates error condition, otherwise, the return value
* MUST be an emalloc'd NULL terminated string. */
-typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC);
+typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len);
/* fetch error information. if stmt is not null, fetch information pertaining
* to the statement, otherwise fetch global error information. The driver
@@ -268,20 +268,20 @@ typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned
* - native error code
* - string representation of the error code ... any other optional driver
* specific data ... */
-typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC);
+typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info);
/* fetching of attributes */
-typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val);
/* checking/pinging persistent connections; return SUCCESS if the connection
* is still alive and ready to be used, FAILURE otherwise.
* You may set this handler to NULL, which is equivalent to returning SUCCESS. */
-typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh);
/* called at request end for each persistent dbh; this gives the driver
* the opportunity to safely release resources that only have per-request
* scope */
-typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh);
/* for adding methods to the dbh or stmt objects
pointer to a list of driver specific functions. The convention is
@@ -295,7 +295,7 @@ enum {
PDO_DBH_DRIVER_METHOD_KIND__MAX
};
-typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind);
struct pdo_dbh_methods {
pdo_dbh_close_func closer;
@@ -320,20 +320,20 @@ struct pdo_dbh_methods {
/* {{{ methods for a statement handle */
/* free the statement handle */
-typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt);
/* start the query */
-typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt);
/* causes the next row in the set to be fetched; indicates if there are no
* more rows. The ori and offset params modify which row should be returned,
* if the stmt represents a scrollable cursor */
typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC);
+ enum pdo_fetch_orientation ori, zend_long offset);
/* queries information about the type of a column, by index (0 based).
* Driver should populate stmt->columns[colno] with appropriate info */
-typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC);
+typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno);
/* retrieves pointer and size of the value for a column.
* Note that PDO expects the driver to manage the lifetime of this data;
@@ -341,7 +341,7 @@ typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC)
* If the driver sets caller_frees, ptr should point to emalloc'd memory
* and PDO will free it as soon as it is done using it.
*/
-typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC);
+typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees);
/* hook for bound params */
enum pdo_param_event {
@@ -354,13 +354,13 @@ enum pdo_param_event {
PDO_PARAM_EVT_NORMALIZE
};
-typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC);
+typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type);
/* setting of attributes */
-typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val);
/* fetching of attributes */
-typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val);
/* retrieves meta data for a numbered column.
* Returns SUCCESS/FAILURE.
@@ -390,19 +390,19 @@ typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *va
* or
* 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key
*/
-typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC);
+typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value);
/* advances the statement to the next rowset of the batch.
* If it returns 1, PDO will tear down its idea of columns
* and meta data. If it returns 0, PDO will indicate an error
* to the caller. */
-typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt);
/* closes the active cursor on a statement, leaving the prepared
* statement ready for re-execution. Useful to explicitly state
* that you are done with a given rowset, without having to explicitly
* fetch all the rows. */
-typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt);
struct pdo_stmt_methods {
pdo_stmt_dtor_func dtor;
@@ -679,16 +679,16 @@ PDO_API zend_class_entry *php_pdo_get_dbh_ce(void);
PDO_API zend_class_entry *php_pdo_get_exception(void);
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC);
+ char **outquery, int *outquery_len);
PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
- const char *sqlstate, const char *supp TSRMLS_DC);
+ const char *sqlstate, const char *supp);
-PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC);
-PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC);
+PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh);
+PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh);
-PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC);
-PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC);
+PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt);
+PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt);
#endif /* PHP_PDO_DRIVER_H */
diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h
index e89a2b8811..5320f54e2d 100644
--- a/ext/pdo/php_pdo_error.h
+++ b/ext/pdo/php_pdo_error.h
@@ -23,7 +23,7 @@
#include "php_pdo_driver.h"
-PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
+PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt);
#define PDO_DBH_CLEAR_ERR() do { \
strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
@@ -33,8 +33,8 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
} \
} while (0)
#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE)
-#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); }
-#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); }
+#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL); }
+#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); }
#endif /* PHP_PDO_ERROR_H */
/*
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index 23de705ec1..faade8d248 100644
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -27,40 +27,40 @@
extern HashTable pdo_driver_hash;
extern zend_class_entry *pdo_exception_ce;
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC);
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root);
int php_pdo_list_entry(void);
-void pdo_dbh_init(TSRMLS_D);
-void pdo_stmt_init(TSRMLS_D);
+void pdo_dbh_init(void);
+void pdo_stmt_init(void);
-extern zend_object *pdo_dbh_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_dbh_new(zend_class_entry *ce);
extern const zend_function_entry pdo_dbh_functions[];
extern zend_class_entry *pdo_dbh_ce;
extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor);
-extern zend_object *pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_dbstmt_new(zend_class_entry *ce);
extern const zend_function_entry pdo_dbstmt_functions[];
extern zend_class_entry *pdo_dbstmt_ce;
-void pdo_dbstmt_free_storage(zend_object *std TSRMLS_DC);
-zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+void pdo_dbstmt_free_storage(zend_object *std);
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref);
extern zend_object_handlers pdo_dbstmt_object_handlers;
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC);
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt);
int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip_first_arg);
-extern zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_row_new(zend_class_entry *ce);
extern const zend_function_entry pdo_row_functions[];
extern zend_class_entry *pdo_row_ce;
-void pdo_row_free_storage(zend_object *std TSRMLS_DC);
+void pdo_row_free_storage(zend_object *std);
extern zend_object_handlers pdo_row_object_handlers;
-zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object);
extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
int pdo_sqlstate_init_error_table(void);
void pdo_sqlstate_fini_error_table(void);
const char *pdo_sqlstate_state_to_description(char *state);
-int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind TSRMLS_DC);
+int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind);
/*
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index a433e8652c..c664ce8c40 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -35,7 +35,7 @@
/* Cache of the server supported datatypes, initialized in handle_factory */
zval* pdo_dblib_datatypes;
-static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
pdo_dblib_err *einfo = &H->err;
@@ -73,7 +73,7 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS
}
-static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_closer(pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -92,7 +92,7 @@ static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
return 0;
}
-static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
pdo_dblib_stmt *S = ecalloc(1, sizeof(*S));
@@ -106,7 +106,7 @@ static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
return 1;
}
-static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
RETCODE ret, resret;
@@ -142,7 +142,7 @@ static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
return DBCOUNT(H->link);
}
-static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
int useBinaryEncoding = 0;
@@ -200,7 +200,7 @@ static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
return 1;
}
-static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -215,22 +215,22 @@ static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int dblib_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_begin(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("BEGIN TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("BEGIN TRANSACTION", dbh);
}
-static int dblib_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_commit(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("COMMIT TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("COMMIT TRANSACTION", dbh);
}
-static int dblib_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_rollback(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("ROLLBACK TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("ROLLBACK TRANSACTION", dbh);
}
-char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -274,7 +274,7 @@ char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len T
return id;
}
-static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
switch(attr) {
case PDO_ATTR_TIMEOUT:
@@ -285,7 +285,7 @@ static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
}
-static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
/* dblib_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */
return 0;
@@ -309,7 +309,7 @@ static struct pdo_dbh_methods dblib_methods = {
NULL /* in transaction */
};
-static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
+static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
{
pdo_dblib_db_handle *H;
int i, nvars, nvers, ret = 0;
@@ -348,7 +348,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars);
if (driver_options) {
- int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
+ int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
dbsetlogintime(timeout); /* Connection/Login Timeout */
dbsettime(timeout); /* Statement Timeout */
}
@@ -368,7 +368,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
for(i=0;i<nvers;i++) {
if(strcmp(vars[5].optval,tdsver[i].key) == 0) {
if(FAIL==dbsetlversion(H->login, tdsver[i].value)) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string." TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string.");
goto cleanup;
}
break;
@@ -377,7 +377,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
if (i==nvers) {
printf("Invalid version '%s'\n", vars[5].optval);
- pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string." TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string.");
goto cleanup; /* unknown version specified */
}
}
@@ -451,7 +451,7 @@ cleanup:
dbh->driver_data = H;
if (!ret) {
- zend_throw_exception_ex(php_pdo_get_exception(), DBLIB_G(err).dberr TSRMLS_CC,
+ zend_throw_exception_ex(php_pdo_get_exception(), DBLIB_G(err).dberr,
"SQLSTATE[%s] %s (severity %d)",
DBLIB_G(err).sqlstate,
DBLIB_G(err).dberrstr,
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index bd79be3e9c..a4552d4f57 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -95,7 +95,7 @@ static char *pdo_dblib_get_field_name(int type)
}
/* }}} */
-static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -106,7 +106,7 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
@@ -115,7 +115,7 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -124,7 +124,7 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
ret = dbresults(H->link);
if (FAIL == ret) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL");
return 0;
}
@@ -138,7 +138,7 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -146,7 +146,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
dbsetuserdata(H->link, (BYTE*) &S->err);
- pdo_dblib_stmt_cursor_closer(stmt TSRMLS_CC);
+ pdo_dblib_stmt_cursor_closer(stmt);
if (FAIL == dbcmd(H->link, stmt->active_query_string)) {
return 0;
@@ -156,7 +156,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
return 0;
}
- ret = pdo_dblib_stmt_next_rowset(stmt TSRMLS_CC);
+ ret = pdo_dblib_stmt_next_rowset(stmt);
stmt->row_count = DBCOUNT(H->link);
stmt->column_count = dbnumcols(H->link);
@@ -165,7 +165,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
RETCODE ret;
@@ -176,7 +176,7 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
ret = dbnextrow(H->link);
if (FAIL == ret) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL");
return 0;
}
@@ -187,7 +187,7 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
return 1;
}
-static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -207,7 +207,7 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
}
static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
- zend_ulong *len, int *caller_frees TSRMLS_DC)
+ zend_ulong *len, int *caller_frees)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
@@ -275,12 +275,12 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
}
static int pdo_dblib_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
return 1;
}
-static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index 4cd0749cf8..7f38396e17 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -91,7 +91,6 @@ int pdo_dblib_error_handler(DBPROCESS *dbproc, int severity, int dberr,
{
pdo_dblib_err *einfo;
char *state = "HY000";
- TSRMLS_FETCH();
if(dbproc) {
einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
@@ -136,7 +135,6 @@ int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line)
{
pdo_dblib_err *einfo;
- TSRMLS_FETCH();
if (severity) {
einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index c80f61aa43..31432e2707 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -32,10 +32,10 @@
#include "php_pdo_firebird_int.h"
static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, zend_long, XSQLDA*, isc_stmt_handle*,
- HashTable* TSRMLS_DC);
+ HashTable*);
/* map driver specific error message to PDO error */
-void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line TSRMLS_DC) /* {{{ */
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line) /* {{{ */
{
#if 0
pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H
@@ -90,10 +90,10 @@ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_lo
}
/* }}} */
-#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC)
+#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__)
/* called by PDO to close a db handle */
-static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -131,7 +131,7 @@ static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* called by PDO to prepare an SQL query */
static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, /* {{{ */
- pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+ pdo_stmt_t *stmt, zval *driver_options)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
pdo_firebird_stmt *S = NULL;
@@ -150,7 +150,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long s
zend_hash_init(np, 8, NULL, NULL, 0);
/* allocate and prepare statement */
- if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np TSRMLS_CC)) {
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np)) {
break;
}
@@ -216,7 +216,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long s
/* }}} */
/* called by PDO to execute a statement that doesn't produce a result set */
-static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC) /* {{{ */
+static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
isc_stmt_handle stmt = NULL;
@@ -231,7 +231,7 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long
out_sqlda.sqln = 1;
/* allocate and prepare statement */
- if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0 TSRMLS_CC)) {
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0)) {
return -1;
}
@@ -271,7 +271,7 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long
/* called by the PDO SQL parser to add quotes to values that are copied into SQL */
static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, /* {{{ */
- char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+ char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
int qcount = 0;
char const *co, *l, *r;
@@ -310,7 +310,7 @@ static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unqu
/* }}} */
/* called by PDO to start a transaction */
-static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_begin(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
char tpb[8] = { isc_tpb_version3 }, *ptpb = tpb+1;
@@ -363,7 +363,7 @@ static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to commit a transaction */
-static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_commit(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -376,7 +376,7 @@ static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to rollback a transaction */
-static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_rollback(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -390,7 +390,7 @@ static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* used by prepare and exec to allocate a statement handle and prepare the SQL */
static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, /* {{{ */
- XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params TSRMLS_DC)
+ XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
char *c, *new_sql, in_quote, in_param, pname[64], *ppname;
@@ -406,7 +406,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_lon
if (dbh->auto_commit && !dbh->in_txn) {
/* dbh->transaction_flags = PDO_TRANS_READ_UNCOMMITTED; */
- if (!firebird_handle_begin(dbh TSRMLS_CC)) {
+ if (!firebird_handle_begin(dbh)) {
return 0;
}
dbh->in_txn = 1;
@@ -468,7 +468,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_lon
/* }}} */
/* called by PDO to set a driver-specific dbh attribute */
-static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -487,7 +487,7 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v
return 0;
} else {
/* close the transaction */
- if (!firebird_handle_commit(dbh TSRMLS_CC)) {
+ if (!firebird_handle_commit(dbh)) {
break;
}
dbh->in_txn = 0;
@@ -543,7 +543,7 @@ static void firebird_info_cb(void *arg, char const *s) /* {{{ */
/* }}} */
/* called by PDO to get a driver-specific dbh attribute */
-static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -599,7 +599,7 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v
/* }}} */
/* called by PDO to retrieve driver-specific information about an error that has occurred */
-static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
const ISC_STATUS *s = H->isc_status;
@@ -639,7 +639,7 @@ static struct pdo_dbh_methods firebird_methods = { /* {{{ */
/* }}} */
/* the driver-specific PDO handle constructor */
-static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
struct pdo_data_src_parser vars[] = {
{ "dbname", NULL, 0 },
@@ -694,12 +694,12 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM
char errmsg[512];
const ISC_STATUS *s = H->isc_status;
fb_interpret(errmsg, sizeof(errmsg),&s);
- zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1] TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%d] %s",
"HY000", H->isc_status[1], errmsg);
}
if (!ret) {
- firebird_handle_closer(dbh TSRMLS_CC);
+ firebird_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index d46a67d504..fd91a9672e 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -30,7 +30,7 @@
#include <time.h>
-#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC)
+#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__)
/* free the allocated space for passing field values to the db and back */
static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
@@ -48,7 +48,7 @@ static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
/* }}} */
/* called by PDO to clean up a statement handle */
-static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
int result = 1, i;
@@ -84,7 +84,7 @@ static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to execute a prepared query */
-static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -153,7 +153,7 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* called by PDO to fetch the next row from a statement */
static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -180,7 +180,7 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
/* }}} */
/* called by PDO to retrieve information about the fields being returned */
-static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
struct pdo_column_data *col = &stmt->columns[colno];
@@ -219,7 +219,7 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
/* fetch a blob into a fetch buffer */
static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
- zend_ulong *len, ISC_QUAD *blob_id TSRMLS_DC)
+ zend_ulong *len, ISC_QUAD *blob_id)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -296,7 +296,7 @@ fetch_blob_end:
/* }}} */
static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
- zend_ulong *len, int *caller_frees TSRMLS_DC)
+ zend_ulong *len, int *caller_frees)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
XSQLVAR const *var = &S->out_sqlda.sqlvar[colno];
@@ -400,7 +400,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
break;
case SQL_BLOB:
return firebird_fetch_blob(stmt,colno,ptr,len,
- (ISC_QUAD*)var->sqldata TSRMLS_CC);
+ (ISC_QUAD*)var->sqldata);
}
}
}
@@ -408,7 +408,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
}
/* }}} */
-static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param TSRMLS_DC)
+static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -447,7 +447,7 @@ static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param T
}
static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
XSQLDA *sqlda = param->is_param ? S->in_sqlda : &S->out_sqlda;
@@ -530,7 +530,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
zval_ptr_dtor(parameter);
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
}
@@ -542,7 +542,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
return 0;
case SQL_BLOB:
- return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter TSRMLS_CC);
+ return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter);
}
/* check if a NULL should be inserted */
@@ -617,7 +617,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
zval_ptr_dtor(parameter);
ZVAL_NULL(parameter);
- if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) {
+ if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees)) {
switch (PDO_PARAM_TYPE(param->param_type)) {
case PDO_PARAM_STR:
if (value) {
@@ -654,7 +654,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
}
/* }}} */
-static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
@@ -675,7 +675,7 @@ static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *v
}
/* }}} */
-static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
@@ -694,7 +694,7 @@ static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *v
}
/* }}} */
-static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
index 18670fee18..59e053136c 100644
--- a/ext/pdo_firebird/php_pdo_firebird_int.h
+++ b/ext/pdo_firebird/php_pdo_firebird_int.h
@@ -128,7 +128,7 @@ extern pdo_driver_t pdo_firebird_driver;
extern struct pdo_stmt_methods firebird_stmt_methods;
-void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line TSRMLS_DC);
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line);
enum {
PDO_FB_ATTR_DATE_FORMAT = PDO_ATTR_DRIVER_SPECIFIC,
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index f237f413be..95ae6ca7ed 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -144,7 +144,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
fi
dnl fix after renaming to pdo_mysql
- PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I)
+ PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
index da085dc569..f150916b2a 100644
--- a/ext/pdo_mysql/config.w32
+++ b/ext/pdo_mysql/config.w32
@@ -12,7 +12,7 @@ if (PHP_PDO_MYSQL != "no") {
} else {
if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
- EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
+ EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
} else {
WARNING("pdo_mysql not enabled; libraries and headers not found");
}
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 73889af5ea..66b70949cb 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -43,7 +43,7 @@
#endif
/* {{{ _pdo_mysql_error */
-int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC)
+int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err;
@@ -105,7 +105,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin
if (!dbh->methods) {
PDO_DBG_INF("Throwing exception");
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -114,7 +114,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin
/* }}} */
/* {{{ pdo_mysql_fetch_error_func */
-static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_mysql_error_info *einfo = &H->einfo;
@@ -138,7 +138,7 @@ static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
/* }}} */
/* {{{ mysql_handle_closer */
-static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_closer(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
@@ -161,7 +161,7 @@ static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
/* }}} */
/* {{{ mysql_handle_preparer */
-static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
@@ -187,7 +187,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
goto fallback;
}
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was rewritten */
@@ -240,7 +240,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
}
dbh->alloc_own_columns = 1;
- S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0 TSRMLS_CC);
+ S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0);
PDO_DBG_RETURN(1);
@@ -253,7 +253,7 @@ end:
/* }}} */
/* {{{ mysql_handle_doer */
-static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
PDO_DBG_ENTER("mysql_handle_doer");
@@ -288,10 +288,10 @@ static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
/* }}} */
/* {{{ pdo_mysql_last_insert_id */
-static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- char *id = php_pdo_int64_to_str(mysql_insert_id(H->server) TSRMLS_CC);
+ char *id = php_pdo_int64_to_str(mysql_insert_id(H->server));
PDO_DBG_ENTER("pdo_mysql_last_insert_id");
*len = strlen(id);
PDO_DBG_RETURN(id);
@@ -299,7 +299,7 @@ static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
/* }}} */
/* {{{ mysql_handle_quoter */
-static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype )
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
PDO_DBG_ENTER("mysql_handle_quoter");
@@ -315,42 +315,42 @@ static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
/* }}} */
/* {{{ mysql_handle_begin */
-static int mysql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_begin(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_quoter");
PDO_DBG_INF_FMT("dbh=%p", dbh);
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION")));
}
/* }}} */
/* {{{ mysql_handle_commit */
-static int mysql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_commit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_commit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
#endif
}
/* }}} */
/* {{{ mysql_handle_rollback */
-static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_rollback(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_rollback");
PDO_DBG_INF_FMT("dbh=%p", dbh);
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server));
#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK")));
#endif
}
/* }}} */
/* {{{ mysql_handle_autocommit */
-static inline int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
+static inline int mysql_handle_autocommit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_autocommit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
@@ -359,16 +359,16 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
PDO_DBG_RETURN(0 <= mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit));
#else
if (dbh->auto_commit) {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1")));
} else {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0")));
}
#endif
}
/* }}} */
/* {{{ pdo_mysql_set_attribute */
-static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
PDO_DBG_ENTER("pdo_mysql_set_attribute");
PDO_DBG_INF_FMT("dbh=%p", dbh);
@@ -379,7 +379,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSR
/* ignore if the new value equals the old one */
if (dbh->auto_commit ^ (Z_TYPE_P(val) == IS_TRUE)) {
dbh->auto_commit = (Z_TYPE_P(val) == IS_TRUE);
- mysql_handle_autocommit(dbh TSRMLS_CC);
+ mysql_handle_autocommit(dbh);
}
PDO_DBG_RETURN(1);
@@ -419,7 +419,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSR
/* }}} */
/* {{{ pdo_mysql_get_attribute */
-static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
@@ -482,7 +482,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
/* }}} */
/* {{{ pdo_mysql_check_liveness */
-static int pdo_mysql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_mysql_check_liveness(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
#if MYSQL_VERSION_ID <= 32230
@@ -538,7 +538,7 @@ static struct pdo_dbh_methods mysql_methods = {
#endif
/* {{{ pdo_mysql_handle_factory */
-static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
+static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
{
pdo_mysql_db_handle *H;
int i, ret = 0;
@@ -565,7 +565,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
#ifdef CLIENT_MULTI_STATEMENTS
if (!driver_options) {
connect_opts |= CLIENT_MULTI_STATEMENTS;
- } else if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MULTI_STATEMENTS, 1 TSRMLS_CC)) {
+ } else if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MULTI_STATEMENTS, 1)) {
connect_opts |= CLIENT_MULTI_STATEMENTS;
}
#endif
@@ -601,30 +601,30 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
/* handle MySQL options */
if (driver_options) {
- zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
- zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
+ zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
+ zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0);
char *init_cmd = NULL;
#ifndef PDO_USE_MYSQLND
char *default_file = NULL, *default_group = NULL;
#endif
zend_long compress = 0;
char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
- H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC);
+ H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare TSRMLS_CC);
+ PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare);
H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare TSRMLS_CC);
+ PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare);
#ifndef PDO_USE_MYSQLND
- H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size TSRMLS_CC);
+ H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size);
#endif
- if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0 TSRMLS_CC)) {
+ if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0)) {
connect_opts |= CLIENT_FOUND_ROWS;
}
- if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_IGNORE_SPACE, 0 TSRMLS_CC)) {
+ if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_IGNORE_SPACE, 0)) {
connect_opts |= CLIENT_IGNORE_SPACE;
}
@@ -657,7 +657,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
mysql_options(H->server, MYSQL_OPT_RECONNECT, (const char*)&reconnect);
}
#endif
- init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL TSRMLS_CC);
+ init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL);
if (init_cmd) {
if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)init_cmd)) {
efree(init_cmd);
@@ -667,7 +667,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(init_cmd);
}
#ifndef PDO_USE_MYSQLND
- default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL TSRMLS_CC);
+ default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL);
if (default_file) {
if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) {
efree(default_file);
@@ -677,7 +677,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(default_file);
}
- default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC);
+ default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL);
if (default_group) {
if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) {
efree(default_group);
@@ -687,7 +687,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(default_group);
}
#endif
- compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
+ compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0);
if (compress) {
if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) {
pdo_mysql_error(dbh);
@@ -695,11 +695,11 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
}
- ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC);
- ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC);
- ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL TSRMLS_CC);
- ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL TSRMLS_CC);
- ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL TSRMLS_CC);
+ ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL);
+ ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL);
+ ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL);
+ ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL);
+ ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL);
if (ssl_key || ssl_cert || ssl_ca || ssl_capath || ssl_cipher) {
mysql_ssl_set(H->server, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
@@ -722,7 +722,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND)
{
- char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL TSRMLS_CC);
+ char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL);
if (public_key) {
if (mysql_options(H->server, MYSQL_SERVER_PUBLIC_KEY, public_key)) {
pdo_mysql_error(dbh);
@@ -762,7 +762,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_len,
- port, unix_socket, connect_opts, MYSQLND_CLIENT_NO_FLAG TSRMLS_CC) == NULL) {
+ port, unix_socket, connect_opts, MYSQLND_CLIENT_NO_FLAG) == NULL) {
#else
if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) {
#endif
@@ -771,7 +771,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (!dbh->auto_commit) {
- mysql_handle_autocommit(dbh TSRMLS_CC);
+ mysql_handle_autocommit(dbh);
}
H->attached = 1;
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 20d3ede0f6..500ca20513 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -33,18 +33,18 @@
#include "php_pdo_mysql_int.h"
#ifdef PDO_USE_MYSQLND
-# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_mysqlnd(stmt TSRMLS_CC)
+# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_mysqlnd(stmt)
# define pdo_free_bound_result(res) zval_dtor(res.zv)
# define pdo_mysql_stmt_close(stmt) mysqlnd_stmt_close(stmt, 0)
#else
-# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_libmysql(stmt TSRMLS_CC)
+# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_libmysql(stmt)
# define pdo_free_bound_result(res) efree(res.buffer)
# define pdo_mysql_stmt_close(stmt) mysql_stmt_close(stmt)
#endif
-static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
@@ -114,7 +114,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
{
zend_long row_count;
pdo_mysql_stmt *S = stmt->driver_data;
@@ -125,7 +125,7 @@ static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -159,7 +159,7 @@ static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* }}} */
#ifndef PDO_USE_MYSQLND
-static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -263,14 +263,14 @@ static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC)
}
}
- pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
+ pdo_mysql_stmt_set_row_count(stmt);
PDO_DBG_RETURN(1);
}
/* }}} */
#endif
#ifdef PDO_USE_MYSQLND
-static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -306,13 +306,13 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /
}
}
- pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
+ pdo_mysql_stmt_set_row_count(stmt);
PDO_DBG_RETURN(1);
}
/* }}} */
#endif
-static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -334,11 +334,11 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
PDO_DBG_RETURN(0);
}
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
/* }}} */
-static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -424,14 +424,14 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#else
if (mysql_next_result(H->server) > 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#endif
}
@@ -450,7 +450,7 @@ static const char * const pdo_param_event_names[] =
};
-static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */
{
zval *parameter;
#ifndef PDO_USE_MYSQLND
@@ -528,7 +528,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
if (stm) {
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
}
@@ -608,7 +608,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
}
/* }}} */
-static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
#if PDO_USE_MYSQLND
@@ -672,7 +672,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori
}
/* }}} */
-static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -722,7 +722,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
}
/* }}} */
-static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
@@ -823,7 +823,7 @@ static char *type_to_name_native(int type) /* {{{ */
#undef PDO_MYSQL_NATIVE_TYPE_NAME
} /* }}} */
-static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
const MYSQL_FIELD *F;
@@ -893,7 +893,7 @@ static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *retu
PDO_DBG_RETURN(SUCCESS);
} /* }}} */
-static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 87ff61f6de..1c94058535 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -32,6 +32,9 @@
#include "php_pdo_mysql_int.h"
#ifdef COMPILE_DL_PDO_MYSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pdo_mysql)
#endif
@@ -59,18 +62,18 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql)
#ifdef PDO_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC)
+static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv)
{
- if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) {
+ if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce())) {
pdo_dbh_t * dbh = Z_PDO_DBH_P(zv);
if (!dbh) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to retrieve handle from object store");
+ php_error_docref(NULL, E_WARNING, "Failed to retrieve handle from object store");
return NULL;
}
if (dbh->driver != &pdo_mysql_driver) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name);
+ php_error_docref(NULL, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name);
return NULL;
}
@@ -129,7 +132,7 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MULTI_STATEMENTS", (zend_long)PDO_MYSQL_ATTR_MULTI_STATEMENTS);
#ifdef PDO_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api);
#endif
return php_pdo_register_driver(&pdo_mysql_driver);
@@ -173,7 +176,7 @@ static PHP_MINFO_FUNCTION(pdo_mysql)
static PHP_RINIT_FUNCTION(pdo_mysql)
{
if (PDO_MYSQL_G(debug)) {
- MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
+ MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs);
if (!dbg) {
return FAILURE;
}
@@ -206,6 +209,9 @@ static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
*/
static PHP_GINIT_FUNCTION(pdo_mysql)
{
+#if defined(COMPILE_DL_PDO_MYSQL) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
#ifndef PHP_WIN32
pdo_mysql_globals->default_socket = NULL;
#endif
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index c9e091f414..03f42509a2 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -83,7 +83,10 @@ ZEND_END_MODULE_GLOBALS(pdo_mysql)
ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql)
#ifdef ZTS
-#define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+#define PDO_MYSQL_G(v) ZEND_TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+# ifdef COMPILE_DL_PDO_MYSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
#define PDO_MYSQL_G(v) (pdo_mysql_globals.v)
#endif
@@ -147,9 +150,9 @@ typedef struct {
extern pdo_driver_t pdo_mysql_driver;
-extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
-#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line);
+#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__)
+#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__)
extern struct pdo_stmt_methods mysql_stmt_methods;
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index 2abc84ba33..3b7db421ab 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -33,7 +33,7 @@
static inline ub4 pdo_oci_sanitize_prefetch(long prefetch);
-static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
pdo_oci_error_info *einfo;
@@ -57,7 +57,7 @@ static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info
}
/* }}} */
-ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line TSRMLS_DC) /* {{{ */
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line) /* {{{ */
{
text errbuf[1024] = "<<Unknown>>";
char tmp_buf[2048];
@@ -188,14 +188,14 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
/* little mini hack so that we can use this code from the dbh ctor */
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
}
return einfo->errcode;
}
/* }}} */
-static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -248,7 +248,7 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) /* {{{ */
+static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
pdo_oci_stmt *S = ecalloc(1, sizeof(*S));
@@ -259,7 +259,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
#if HAVE_OCISTMTFETCH2
S->exec_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
- PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL ?
+ PDO_CURSOR_FWDONLY) == PDO_CURSOR_SCROLL ?
OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT;
#else
S->exec_type = OCI_DEFAULT;
@@ -267,7 +267,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
S->H = H;
stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -302,7 +302,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
}
- prefetch = pdo_oci_sanitize_prefetch(pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, PDO_OCI_PREFETCH_DEFAULT TSRMLS_CC));
+ prefetch = pdo_oci_sanitize_prefetch(pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, PDO_OCI_PREFETCH_DEFAULT));
if (prefetch) {
H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0,
OCI_ATTR_PREFETCH_ROWS, H->err);
@@ -324,7 +324,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
}
/* }}} */
-static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */
+static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
OCIStmt *stmt;
@@ -346,7 +346,7 @@ static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS
if (stmt_type == OCI_STMT_SELECT) {
/* invalid usage; cancel it */
OCIHandleFree(stmt, OCI_HTYPE_STMT);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "issuing a SELECT query here is invalid");
+ php_error_docref(NULL, E_WARNING, "issuing a SELECT query here is invalid");
return -1;
}
@@ -368,7 +368,7 @@ static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS
}
/* }}} */
-static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) /* {{{ */
+static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype ) /* {{{ */
{
int qcount = 0;
char const *cu, *l, *r;
@@ -405,14 +405,14 @@ static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedl
}
/* }}} */
-static int oci_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_begin(pdo_dbh_t *dbh) /* {{{ */
{
/* with Oracle, there is nothing special to be done */
return 1;
}
/* }}} */
-static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_commit(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -426,7 +426,7 @@ static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_rollback(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -440,7 +440,7 @@ static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
+static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -467,7 +467,7 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_
}
/* }}} */
-static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) /* {{{ */
+static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -533,7 +533,7 @@ static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_valu
}
/* }}} */
-static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int pdo_oci_check_liveness(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
sb4 error_code = 0;
@@ -588,7 +588,7 @@ static struct pdo_dbh_methods oci_methods = {
NULL /* get_driver_methods */
};
-static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_oci_db_handle *H;
int i, ret = 0;
@@ -708,7 +708,7 @@ cleanup:
}
if (!ret) {
- oci_handle_closer(dbh TSRMLS_CC);
+ oci_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c
index 7c86a23dcc..92f726bb9b 100644
--- a/ext/pdo_oci/oci_statement.c
+++ b/ext/pdo_oci/oci_statement.c
@@ -36,7 +36,7 @@
#define STMT_CALL(name, params) \
do { \
S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__); \
if (S->last_err) { \
return 0; \
} \
@@ -45,15 +45,15 @@
#define STMT_CALL_MSG(name, msg, params) \
do { \
S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__); \
if (S->last_err) { \
return 0; \
} \
} while(0)
-static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC);
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob);
-static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int oci_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
HashTable *BC = stmt->bound_columns;
@@ -116,7 +116,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
return 1;
} /* }}} */
-static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int oci_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
ub4 rowcount;
@@ -188,10 +188,9 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv
{
struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
+ php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
return OCI_ERROR;
}
@@ -220,10 +219,9 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d
{
struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
+ php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
return OCI_ERROR;
}
@@ -258,7 +256,7 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d
return OCI_CONTINUE;
} /* }}} */
-static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
@@ -372,7 +370,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa
* wanted to bind a lob locator into it from the query
* */
- stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing TSRMLS_CC);
+ stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing);
if (stm) {
OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE);
php_stream_to_zval(stm, param->parameter);
@@ -437,7 +435,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa
return 1;
} /* }}} */
-static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */
+static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset) /* {{{ */
{
#if HAVE_OCISTMTFETCH2
ub4 ociori;
@@ -481,7 +479,6 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp)
{
pdo_oci_column *col = (pdo_oci_column*)octxp;
- TSRMLS_FETCH();
switch (col->dtype) {
case SQLT_BLOB:
@@ -493,7 +490,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"unhandled datatype in oci_define_callback; this should not happen");
return OCI_ERROR;
}
@@ -501,7 +498,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
return OCI_CONTINUE;
}
-static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
OCIParam *param = NULL;
@@ -611,7 +608,7 @@ struct oci_lob_self {
ub4 offset;
};
-static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
ub4 amt;
@@ -631,7 +628,7 @@ static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count T
return amt;
}
-static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t oci_blob_read(php_stream *stream, char *buf, size_t count)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
ub4 amt;
@@ -653,7 +650,7 @@ static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_D
return amt;
}
-static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int oci_blob_close(php_stream *stream, int close_handle)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
pdo_stmt_t *stmt = self->stmt;
@@ -663,18 +660,18 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
efree(self);
}
- php_pdo_stmt_delref(stmt TSRMLS_CC);
+ php_pdo_stmt_delref(stmt);
return 0;
}
-static int oci_blob_flush(php_stream *stream TSRMLS_DC)
+static int oci_blob_flush(php_stream *stream)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
OCILobFlushBuffer(self->S->H->svc, self->S->err, self->lob, 0);
return 0;
}
-static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
+static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
@@ -698,7 +695,7 @@ static php_stream_ops oci_blob_stream_ops = {
NULL
};
-static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC)
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob)
{
php_stream *stm;
struct oci_lob_self *self = ecalloc(1, sizeof(*self));
@@ -710,7 +707,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS
stm = php_stream_alloc(&oci_blob_stream_ops, self, 0, "r+b");
if (stm) {
- php_pdo_stmt_addref(stmt TSRMLS_CC);
+ php_pdo_stmt_addref(stmt);
return stm;
}
@@ -718,7 +715,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS
return NULL;
}
-static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) /* {{{ */
+static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
pdo_oci_column *C = &S->cols[colno];
@@ -734,7 +731,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo
if (C->dtype == SQLT_BLOB || C->dtype == SQLT_CLOB) {
if (C->data) {
- *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data TSRMLS_CC);
+ *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data);
OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY);
}
*len = 0;
@@ -746,7 +743,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo
return 1;
} else {
/* it was truncated */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno);
+ php_error_docref(NULL, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno);
*ptr = C->data;
*len = C->fetched_len;
diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h
index 36d45d0af7..ada423ccf0 100644
--- a/ext/pdo_oci/php_pdo_oci_int.h
+++ b/ext/pdo_oci/php_pdo_oci_int.h
@@ -86,10 +86,10 @@ extern const ub4 PDO_OCI_INIT_MODE;
extern pdo_driver_t pdo_oci_driver;
extern OCIEnv *pdo_oci_Env;
-ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line TSRMLS_DC);
-#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__ TSRMLS_CC)
-#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC)
-#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC)
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line);
+#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__)
+#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__)
+#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__)
extern struct pdo_stmt_methods oci_stmt_methods;
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index c0034d43ea..4b9bd24818 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -31,7 +31,7 @@
#include "php_pdo_odbc_int.h"
#include "zend_exceptions.h"
-static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
pdo_odbc_errinfo *einfo = &H->einfo;
@@ -56,7 +56,7 @@ static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *inf
}
-void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC) /* {{{ */
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line) /* {{{ */
{
SQLRETURN rc;
SQLSMALLINT errmsgsize = 0;
@@ -104,7 +104,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
strcpy(*pdo_err, einfo->last_state);
/* printf("@@ SQLSTATE[%s] %s\n", *pdo_err, einfo->last_err_msg); */
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->last_error TSRMLS_CC, "SQLSTATE[%s] %s: %d %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->last_error, "SQLSTATE[%s] %s: %d %s",
*pdo_err, what, einfo->last_error, einfo->last_err_msg);
}
@@ -124,7 +124,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
}
/* }}} */
-static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_closer(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
@@ -142,7 +142,7 @@ static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
return 0;
}
-static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
RETCODE rc;
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
@@ -158,7 +158,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
/* before we prepare, we need to peek at the query; if it uses named parameters,
* we want PDO to rewrite them for us */
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -181,7 +181,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
return 0;
}
- cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC);
+ cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY);
if (cursor_type != PDO_CURSOR_FWDONLY) {
rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
@@ -220,7 +220,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
return 1;
}
-static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -261,14 +261,14 @@ out:
return row_count;
}
-static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC)
+static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type )
{
/* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */
/* TODO: figure it out */
return 0;
}
-static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_begin(pdo_dbh_t *dbh)
{
if (dbh->auto_commit) {
/* we need to disable auto-commit now, to be able to initiate a transaction */
@@ -284,7 +284,7 @@ static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_commit(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -310,7 +310,7 @@ static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_rollback(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -336,7 +336,7 @@ static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -351,7 +351,7 @@ static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS
}
}
-static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -388,7 +388,7 @@ static struct pdo_dbh_methods odbc_methods = {
NULL, /* check_liveness */
};
-static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_odbc_db_handle *H;
RETCODE rc;
@@ -431,7 +431,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_D
}
/* set up the cursor library, if needed, or if configured explicitly */
- cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC);
+ cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED);
rc = SQLSetConnectAttr(H->dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, SQL_IS_INTEGER);
if (rc != SQL_SUCCESS && cursor_lib != SQL_CUR_USE_IF_NEEDED) {
pdo_odbc_drv_error("SQLSetConnectAttr SQL_ODBC_CURSORS");
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 7491ec685d..9b73cd5ef9 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -123,7 +123,7 @@ static int pdo_odbc_ucs22utf8(pdo_stmt_t *stmt, int is_unicode, const char *buf,
return PDO_ODBC_CONV_NOT_REQUIRED;
}
-static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC)
+static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S)
{
if (S->cols) {
int i;
@@ -138,7 +138,7 @@ static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC)
}
}
-static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -150,7 +150,7 @@ static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
S->stmt = SQL_NULL_HANDLE;
}
- free_cols(stmt, S TSRMLS_CC);
+ free_cols(stmt, S);
if (S->convbuf) {
efree(S->convbuf);
}
@@ -159,7 +159,7 @@ static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_execute(pdo_stmt_t *stmt)
{
RETCODE rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -280,7 +280,7 @@ static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
RETCODE rc;
@@ -524,7 +524,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
}
static int odbc_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
RETCODE rc;
SQLSMALLINT odbcori;
@@ -561,7 +561,7 @@ static int odbc_stmt_fetch(pdo_stmt_t *stmt,
return 0;
}
-static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
struct pdo_column_data *col = &stmt->columns[colno];
@@ -628,7 +628,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
pdo_odbc_column *C = &S->cols[colno];
@@ -755,7 +755,7 @@ in_data:
return 1;
}
-static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -782,7 +782,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val TSRML
}
}
-static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -814,7 +814,7 @@ static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS
}
}
-static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_next_rowset(pdo_stmt_t *stmt)
{
SQLRETURN rc;
SQLSMALLINT colcount;
@@ -829,7 +829,7 @@ static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
return 0;
}
- free_cols(stmt, S TSRMLS_CC);
+ free_cols(stmt, S);
/* how many columns do we have ? */
SQLNumResultCols(S->stmt, &colcount);
stmt->column_count = (int)colcount;
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index 914b8bc980..21dd0e0ce5 100644
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -127,7 +127,7 @@ PHP_MINIT_FUNCTION(pdo_odbc)
} else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) {
pdo_odbc_pool_on = SQL_CP_OFF;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
+ php_error_docref(NULL, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
return FAILURE;
}
diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h
index 52e8e6f8e7..776c373c24 100644
--- a/ext/pdo_odbc/php_pdo_odbc.h
+++ b/ext/pdo_odbc/php_pdo_odbc.h
@@ -46,9 +46,9 @@ ZEND_END_MODULE_GLOBALS(pdo_odbc)
/* In every utility function you add that needs to use variables
in php_pdo_odbc_globals, call TSRMLS_FETCH(); after declaring other
- variables used by that function, or better yet, pass in TSRMLS_CC
+ variables used by that function, or better yet, pass in
after the last function argument and declare your utility function
- with TSRMLS_DC after the last declared argument. Always refer to
+ with after the last declared argument. Always refer to
the globals in your function as PDO_ODBC_G(variable). You are
encouraged to rename these macros something shorter, see
examples in any other php module directory.
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
index 0d6d488b65..bfa83016c9 100644
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -167,10 +167,10 @@ typedef struct {
extern pdo_driver_t pdo_odbc_driver;
extern struct pdo_stmt_methods odbc_stmt_methods;
-void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC);
-#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__ TSRMLS_CC)
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line);
+#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
+#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
+#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__)
void pdo_odbc_init_error_table(void);
void pdo_odbc_fini_error_table(void);
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 2d45152ad9..c2f744f0d5 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -62,7 +62,7 @@ static char * _pdo_pgsql_trim_message(const char *message, int persistent)
return tmp;
}
-int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC) /* {{{ */
+int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
@@ -93,7 +93,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *
}
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -107,7 +107,7 @@ static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */
}
/* }}} */
-static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_error_info *einfo = &H->einfo;
@@ -122,19 +122,19 @@ static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
/* }}} */
/* {{{ pdo_pgsql_create_lob_stream */
-static size_t pgsql_lob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t pgsql_lob_write(php_stream *stream, const char *buf, size_t count)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
return lo_write(self->conn, self->lfd, (char*)buf, count);
}
-static size_t pgsql_lob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t pgsql_lob_read(php_stream *stream, char *buf, size_t count)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
return lo_read(self->conn, self->lfd, buf, count);
}
-static int pgsql_lob_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int pgsql_lob_close(php_stream *stream, int close_handle)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
@@ -146,13 +146,13 @@ static int pgsql_lob_close(php_stream *stream, int close_handle TSRMLS_DC)
return 0;
}
-static int pgsql_lob_flush(php_stream *stream TSRMLS_DC)
+static int pgsql_lob_flush(php_stream *stream)
{
return 0;
}
static int pgsql_lob_seek(php_stream *stream, zend_off_t offset, int whence,
- zend_off_t *newoffset TSRMLS_DC)
+ zend_off_t *newoffset)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
int pos = lo_lseek(self->conn, self->lfd, offset, whence);
@@ -172,7 +172,7 @@ php_stream_ops pdo_pgsql_lob_stream_ops = {
NULL
};
-php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid TSRMLS_DC)
+php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid)
{
php_stream *stm;
struct pdo_pgsql_lob_self *self = ecalloc(1, sizeof(*self));
@@ -195,7 +195,7 @@ php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid TSRMLS_DC)
}
/* }}} */
-static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (H) {
@@ -214,7 +214,7 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt));
@@ -230,7 +230,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
stmt->methods = &pgsql_stmt_methods;
scrollable = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
- PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
+ PDO_CURSOR_FWDONLY) == PDO_CURSOR_SCROLL;
if (scrollable) {
if (S->cursor_name) {
@@ -239,14 +239,14 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
spprintf(&S->cursor_name, 0, "pdo_crsr_%08x", ++H->stmt_counter);
emulate = 1;
} else if (driver_options) {
- if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, H->disable_native_prepares TSRMLS_CC) == 1) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
+ if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, H->disable_native_prepares) == 1) {
+ php_error_docref(NULL, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
emulate = 1;
}
- if (pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepares TSRMLS_CC) == 1) {
+ if (pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepares) == 1) {
emulate = 1;
}
- if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_PREPARES, H->disable_prepares TSRMLS_CC) == 1) {
+ if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_PREPARES, H->disable_prepares) == 1) {
execute_only = 1;
}
} else {
@@ -257,7 +257,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
if (!emulate && PQprotocolVersion(H->server) > 2) {
stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
stmt->named_rewrite_template = "$%d";
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -287,7 +287,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
return 1;
}
-static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
PGresult *res;
@@ -316,7 +316,7 @@ static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
return ret;
}
-static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
unsigned char *escaped;
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -345,7 +345,7 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
return 1;
}
-static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
char *id = NULL;
@@ -377,7 +377,7 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
return id;
}
-static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -461,7 +461,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
}
/* {{{ */
-static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (PQstatus(H->server) == CONNECTION_BAD) {
@@ -471,7 +471,7 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
}
/* }}} */
-static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_in_transaction(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H;
@@ -480,7 +480,7 @@ static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
return PQtransactionStatus(H->server) > PQTRANS_IDLE;
}
-static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
PGresult *res;
@@ -497,27 +497,27 @@ static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
return ret;
}
-static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_begin(pdo_dbh_t *dbh)
{
- return pdo_pgsql_transaction_cmd("BEGIN", dbh TSRMLS_CC);
+ return pdo_pgsql_transaction_cmd("BEGIN", dbh);
}
-static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_commit(pdo_dbh_t *dbh)
{
- int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC);
+ int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh);
/* When deferred constraints are used the commit could
fail, and a ROLLBACK implicitly ran. See bug #67462 */
if (!ret) {
- dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC);
+ dbh->in_txn = pgsql_handle_in_transaction(dbh);
}
return ret;
}
-static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_rollback(pdo_dbh_t *dbh)
{
- return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC);
+ return pdo_pgsql_transaction_cmd("ROLLBACK", dbh);
}
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields])
@@ -536,14 +536,14 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
PGresult *pgsql_result;
ExecStatusType status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s/a|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s/a|sss",
&table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
}
if (!zend_hash_num_elements(Z_ARRVAL_P(pg_rows))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot copy from an empty array");
+ php_error_docref(NULL, E_WARNING, "Cannot copy from an empty array");
RETURN_FALSE;
}
@@ -645,7 +645,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
ExecStatusType status;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -746,7 +746,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile)
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -839,7 +839,7 @@ static PHP_METHOD(PDO, pgsqlCopyToArray)
PGresult *pgsql_result;
ExecStatusType status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sss",
&table_name, &table_name_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -944,7 +944,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
int mode = INV_READ;
char *end_ptr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|s",
&oidstr, &oidstrlen, &modestr, &modestrlen)) {
RETURN_FALSE;
}
@@ -967,7 +967,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
lfd = lo_open(H->server, oid, mode);
if (lfd >= 0) {
- php_stream *stream = pdo_pgsql_create_lob_stream(getThis(), lfd, oid TSRMLS_CC);
+ php_stream *stream = pdo_pgsql_create_lob_stream(getThis(), lfd, oid);
if (stream) {
php_stream_to_zval(stream, return_value);
return;
@@ -991,7 +991,7 @@ static PHP_METHOD(PDO, pgsqlLOBUnlink)
char *oidstr, *end_ptr;
size_t oidlen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&oidstr, &oidlen)) {
RETURN_FALSE;
}
@@ -1027,7 +1027,7 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
zend_long ms_timeout = 0;
PGnotify *pgsql_notify;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|ll",
&result_type, &ms_timeout)) {
RETURN_FALSE;
}
@@ -1040,12 +1040,12 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
}
if (result_type != PDO_FETCH_BOTH && result_type != PDO_FETCH_ASSOC && result_type != PDO_FETCH_NUM) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
if (ms_timeout < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid timeout");
+ php_error_docref(NULL, E_WARNING, "Invalid timeout");
RETURN_FALSE;
}
@@ -1115,7 +1115,7 @@ static const zend_function_entry dbh_methods[] = {
PHP_FE_END
};
-static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, int kind)
{
switch (kind) {
case PDO_DBH_DRIVER_METHOD_KIND_DBH:
@@ -1125,7 +1125,7 @@ static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, i
}
}
-static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -1136,7 +1136,7 @@ static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_D
return 1;
case PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT:
convert_to_long(val);
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
+ php_error_docref(NULL, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
H->disable_native_prepares = Z_LVAL_P(val);
return 1;
case PDO_PGSQL_ATTR_DISABLE_PREPARES:
@@ -1166,7 +1166,7 @@ static struct pdo_dbh_methods pgsql_methods = {
pgsql_handle_in_transaction,
};
-static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_pgsql_db_handle *H;
int ret = 0;
@@ -1190,7 +1190,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (driver_options) {
- connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
+ connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
}
if (dbh->password) {
@@ -1253,7 +1253,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
cleanup:
dbh->methods = &pgsql_methods;
if (!ret) {
- pgsql_handle_closer(dbh TSRMLS_CC);
+ pgsql_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 49fbc63745..8c2f449e61 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -44,7 +44,7 @@
#define TEXTOID 25
#define OIDOID 26
-static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -113,7 +113,7 @@ static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pgsql_stmt_execute(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
pdo_pgsql_db_handle *H = S->H;
@@ -240,7 +240,7 @@ stmt_retry:
}
static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -266,7 +266,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
ZEND_ATOL(param->paramno, namevar + 1);
param->paramno--;
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val);
return 0;
}
}
@@ -386,7 +386,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
}
static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -433,7 +433,7 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
}
}
-static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -493,7 +493,7 @@ static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees )
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -532,7 +532,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulon
Oid oid = (Oid)strtoul(*ptr, &end_ptr, 10);
int loid = lo_open(S->H->server, oid, INV_READ);
if (loid >= 0) {
- *ptr = (char*)pdo_pgsql_create_lob_stream(&stmt->database_object_handle, loid, oid TSRMLS_CC);
+ *ptr = (char*)pdo_pgsql_create_lob_stream(&stmt->database_object_handle, loid, oid);
*len = 0;
return *ptr ? 1 : 0;
}
@@ -572,7 +572,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulon
return 1;
}
-static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
PGresult *res;
@@ -615,7 +615,7 @@ done:
return 1;
}
-static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt)
{
return 1;
}
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
index 722d63706e..b98afa875b 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql_int.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -79,11 +79,11 @@ typedef struct {
extern pdo_driver_t pdo_pgsql_driver;
-extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC);
-#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line);
+#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__)
+#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__)
+#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__)
+#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__)
extern struct pdo_stmt_methods pgsql_stmt_methods;
@@ -109,7 +109,7 @@ enum pdo_pgsql_specific_constants {
PGSQL_TRANSACTION_UNKNOWN = PQTRANS_UNKNOWN
};
-php_stream *pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid TSRMLS_DC);
+php_stream *pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid);
extern php_stream_ops pdo_pgsql_lob_stream_ops;
#endif /* PHP_PDO_PGSQL_INT_H */
diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h
index 9413e1bb70..21977d7f2b 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite.h
@@ -47,9 +47,9 @@ ZEND_END_MODULE_GLOBALS(pdo_sqlite)
/* In every utility function you add that needs to use variables
in php_pdo_sqlite_globals, call TSRMLS_FETCH(); after declaring other
- variables used by that function, or better yet, pass in TSRMLS_CC
+ variables used by that function, or better yet, pass in
after the last function argument and declare your utility function
- with TSRMLS_DC after the last declared argument. Always refer to
+ with after the last declared argument. Always refer to
the globals in your function as PDO_SQLITE_G(variable). You are
encouraged to rename these macros something shorter, see
examples in any other php module directory.
diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h
index 133893bf8f..6fbef66269 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite_int.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h
@@ -70,9 +70,9 @@ typedef struct {
extern pdo_driver_t pdo_sqlite_driver;
-extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
-#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line);
+#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__)
+#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__)
extern struct pdo_stmt_methods sqlite_stmt_methods;
#endif
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 413b50b9d4..8e1de906a5 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -31,7 +31,7 @@
#include "php_pdo_sqlite_int.h"
#include "zend_exceptions.h"
-int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
+int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
@@ -78,7 +78,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li
}
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -86,7 +86,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li
}
/* }}} */
-static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_sqlite_error_info *einfo = &H->einfo;
@@ -99,7 +99,7 @@ static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *i
return 1;
}
-static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC)
+static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H)
{
struct pdo_sqlite_func *func;
@@ -152,14 +152,14 @@ static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC)
}
}
-static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
if (H) {
pdo_sqlite_error_info *einfo = &H->einfo;
- pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ pdo_sqlite_cleanup_callbacks(H);
if (H->db) {
sqlite3_close(H->db);
H->db = NULL;
@@ -175,7 +175,7 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt));
@@ -187,7 +187,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql
stmt->methods = &sqlite_stmt_methods;
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL|PDO_PLACEHOLDER_NAMED;
- if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) {
+ if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY)) {
H->einfo.errcode = SQLITE_ERROR;
pdo_sqlite_error(dbh);
return 0;
@@ -203,7 +203,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql
return 0;
}
-static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -219,18 +219,18 @@ static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long s
}
}
-static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *id;
- id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db) TSRMLS_CC);
+ id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db));
*len = strlen(id);
return id;
}
/* NB: doesn't handle binary strings... use prepared stmts for that */
-static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype )
{
*quoted = safe_emalloc(2, unquotedlen, 3);
sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted);
@@ -238,7 +238,7 @@ static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquot
return 1;
}
-static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_begin(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -252,7 +252,7 @@ static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_commit(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -266,7 +266,7 @@ static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_rollback(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -280,7 +280,7 @@ static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
switch (attr) {
case PDO_ATTR_CLIENT_VERSION:
@@ -295,7 +295,7 @@ static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return
return 1;
}
-static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
@@ -310,7 +310,7 @@ static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_
static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
int argc, sqlite3_value **argv, sqlite3_context *context,
- int is_agg TSRMLS_DC)
+ int is_agg)
{
zval *zargs = NULL;
zval retval;
@@ -379,8 +379,8 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
fc->fci.params = zargs;
- if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&fc->fci, &fc->fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
}
/* clean up the params */
@@ -448,26 +448,23 @@ static void php_sqlite3_func_callback(sqlite3_context *context, int argc,
sqlite3_value **argv)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->afunc, &func->func, argc, argv, context, 0 TSRMLS_CC);
+ do_callback(&func->afunc, &func->func, argc, argv, context, 0);
}
static void php_sqlite3_func_step_callback(sqlite3_context *context, int argc,
sqlite3_value **argv)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->astep, &func->step, argc, argv, context, 1 TSRMLS_CC);
+ do_callback(&func->astep, &func->step, argc, argv, context, 1);
}
static void php_sqlite3_func_final_callback(sqlite3_context *context)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->afini, &func->fini, 0, NULL, context, 1 TSRMLS_CC);
+ do_callback(&func->afini, &func->fini, 0, NULL, context, 1);
}
static int php_sqlite3_collation_callback(void *context,
@@ -478,7 +475,6 @@ static int php_sqlite3_collation_callback(void *context,
zval zargs[2];
zval retval;
struct pdo_sqlite_collation *collation = (struct pdo_sqlite_collation*) context;
- TSRMLS_FETCH();
collation->fc.fci.size = sizeof(collation->fc.fci);
collation->fc.fci.function_table = EG(function_table);
@@ -493,8 +489,8 @@ static int php_sqlite3_collation_callback(void *context,
collation->fc.fci.param_count = 2;
collation->fc.fci.params = zargs;
- if ((ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -528,7 +524,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz|l",
&func_name, &func_name_len, &callback, &argc)) {
RETURN_FALSE;
}
@@ -536,8 +532,8 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -598,7 +594,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l",
&func_name, &func_name_len, &step_callback, &fini_callback, &argc)) {
RETURN_FALSE;
}
@@ -606,14 +602,14 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(step_callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(step_callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
zend_string_release(cbname);
- if (!zend_is_callable(fini_callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(fini_callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -658,7 +654,7 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz",
&collation_name, &collation_name_len, &callback)) {
RETURN_FALSE;
}
@@ -666,8 +662,8 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -701,7 +697,7 @@ static const zend_function_entry dbh_methods[] = {
PHP_FE_END
};
-static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind)
{
switch (kind) {
case PDO_DBH_DRIVER_METHOD_KIND_DBH:
@@ -712,13 +708,13 @@ static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TS
}
}
-static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh TSRMLS_DC)
+static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
/* unregister functions, so that they don't linger for the next
* request */
if (H) {
- pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ pdo_sqlite_cleanup_callbacks(H);
}
}
@@ -739,16 +735,16 @@ static struct pdo_dbh_methods sqlite_methods = {
pdo_sqlite_request_shutdown
};
-static char *make_filename_safe(const char *filename TSRMLS_DC)
+static char *make_filename_safe(const char *filename)
{
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
- char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+ char *fullpath = expand_filepath(filename, NULL);
if (!fullpath) {
return NULL;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
return NULL;
}
@@ -763,8 +759,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
char *filename;
switch (access_type) {
case SQLITE_COPY: {
- TSRMLS_FETCH();
- filename = make_filename_safe(arg4 TSRMLS_CC);
+ filename = make_filename_safe(arg4);
if (!filename) {
return SQLITE_DENY;
}
@@ -773,8 +768,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
}
case SQLITE_ATTACH: {
- TSRMLS_FETCH();
- filename = make_filename_safe(arg3 TSRMLS_CC);
+ filename = make_filename_safe(arg3);
if (!filename) {
return SQLITE_DENY;
}
@@ -788,7 +782,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
}
}
-static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_sqlite_db_handle *H;
int i, ret = 0;
@@ -801,10 +795,10 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS
H->einfo.errmsg = NULL;
dbh->driver_data = H;
- filename = make_filename_safe(dbh->data_source TSRMLS_CC);
+ filename = make_filename_safe(dbh->data_source);
if (!filename) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+ zend_throw_exception_ex(php_pdo_get_exception(), 0,
"open_basedir prohibits opening %s",
dbh->data_source);
goto cleanup;
@@ -823,7 +817,7 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS
}
if (driver_options) {
- timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout TSRMLS_CC);
+ timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout);
}
sqlite3_busy_timeout(H->db, timeout * 1000);
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index 378d8bb337..ae7a5140df 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -31,7 +31,7 @@
#include "php_pdo_sqlite_int.h"
-static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -43,7 +43,7 @@ static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -76,7 +76,7 @@ static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
zval *parameter;
@@ -144,7 +144,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
zval_ptr_dtor(parameter);
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
} else if (Z_TYPE_P(parameter) == IS_NULL) {
@@ -198,7 +198,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
}
static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
int i;
@@ -230,7 +230,7 @@ static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
}
}
-static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -259,7 +259,7 @@ static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
if (!S->stmt) {
@@ -288,7 +288,7 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend
}
}
-static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
const char *str;
@@ -343,7 +343,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
return SUCCESS;
}
-static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
sqlite3_reset(S->stmt);
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index 186469861f..0ec34c4c25 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -105,7 +105,7 @@ if test "$PHP_PGSQL" != "no"; then
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
- PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared)
+ PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index d38048d90b..5775dfa023 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("pgsql", "PostgreSQL support", "no");
if (PHP_PGSQL != "no") {
if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) {
- EXTENSION("pgsql", "pgsql.c");
+ EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT /D HAVE_PQPROTOCOLVERSION /D HAVE_PG_LO_CREATE /D HAVE_PG_LO_IMPORT_WITH_OID /D HAVE_PG_LO_TRUNCATE /D HAVE_PG_LO64 /D HAVE_PQESCAPELITERAL /D HAVE_PQOIDVALUE");
} else {
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 119a47f24c..f8635298fc 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -86,7 +86,7 @@
#define PQ_SETNONBLOCKING(pg_link, flag) 0
#endif
-#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); }
+#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL, E_WARNING, "No PostgreSQL link opened yet"); }
#define FETCH_DEFAULT_LINK() PGG(default_link) ? (int)PGG(default_link)->handle : -1
#ifndef HAVE_PQFREEMEM
@@ -772,6 +772,9 @@ zend_module_entry pgsql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_PGSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pgsql)
#endif
@@ -835,9 +838,8 @@ static char *php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le
!strncmp(encoding, "GBK", sizeof("GBK")-1) ||
!strncmp(encoding, "JOHAB", sizeof("JOHAB")-1) ||
!strncmp(encoding, "UHC", sizeof("UHC")-1) ) {
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding);
+
+ php_error_docref(NULL, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding);
}
/* check backslashes */
tmp_len = strspn(str, "\\");
@@ -907,13 +909,13 @@ static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf)
#define PHP_PQ_ERROR(text, pgsql) { \
char *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, text, msgbuf); \
+ php_error_docref(NULL, E_WARNING, text, msgbuf); \
efree(msgbuf); \
} \
/* {{{ php_pgsql_set_default_link
*/
-static void php_pgsql_set_default_link(zend_resource *res TSRMLS_DC)
+static void php_pgsql_set_default_link(zend_resource *res)
{
GC_REFCOUNT(res)++;
@@ -927,7 +929,7 @@ static void php_pgsql_set_default_link(zend_resource *res TSRMLS_DC)
/* {{{ _close_pgsql_link
*/
-static void _close_pgsql_link(zend_resource *rsrc TSRMLS_DC)
+static void _close_pgsql_link(zend_resource *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
@@ -942,7 +944,7 @@ static void _close_pgsql_link(zend_resource *rsrc TSRMLS_DC)
/* {{{ _close_pgsql_plink
*/
-static void _close_pgsql_plink(zend_resource *rsrc TSRMLS_DC)
+static void _close_pgsql_plink(zend_resource *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
@@ -962,12 +964,11 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
{
php_pgsql_notice *notice;
- TSRMLS_FETCH();
if (! PGG(ignore_notices)) {
notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
notice->message = _php_pgsql_trim_message(message, &notice->len);
if (PGG(log_notices)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
+ php_error_docref(NULL, E_NOTICE, "%s", notice->message);
}
zend_hash_index_update_ptr(&PGG(notices), (zend_ulong)resource_id, notice);
}
@@ -990,7 +991,7 @@ static void _php_pgsql_notice_ptr_dtor(zval *el)
/* {{{ _rollback_transactions
*/
-static int _rollback_transactions(zval *el TSRMLS_DC)
+static int _rollback_transactions(zval *el)
{
PGconn *link;
PGresult *res;
@@ -1003,7 +1004,7 @@ static int _rollback_transactions(zval *el TSRMLS_DC)
link = (PGconn *) rsrc->ptr;
if (PQ_SETNONBLOCKING(link, 0)) {
- php_error_docref("ref.pgsql" TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref("ref.pgsql", E_NOTICE, "Cannot set connection to blocking mode");
return -1;
}
@@ -1033,7 +1034,7 @@ static int _rollback_transactions(zval *el TSRMLS_DC)
/* {{{ _free_ptr
*/
-static void _free_ptr(zend_resource *rsrc TSRMLS_DC)
+static void _free_ptr(zend_resource *rsrc)
{
pgLofp *lofp = (pgLofp *)rsrc->ptr;
efree(lofp);
@@ -1042,7 +1043,7 @@ static void _free_ptr(zend_resource *rsrc TSRMLS_DC)
/* {{{ _free_result
*/
-static void _free_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_result(zend_resource *rsrc)
{
pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr;
@@ -1091,6 +1092,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(pgsql)
{
+#if defined(COMPILE_DL_PGSQL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(pgsql_globals, 0, sizeof(zend_pgsql_globals));
/* Initilize notice message hash at MINIT only */
zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0);
@@ -1228,7 +1232,7 @@ PHP_RSHUTDOWN_FUNCTION(pgsql)
/* clean up notice messages */
zend_hash_clean(&PGG(notices));
/* clean up persistent connection */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions);
return SUCCESS;
}
/* }}} */
@@ -1334,12 +1338,12 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_resource new_le;
if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Cannot create new link. Too many open links (%pd)", PGG(num_links));
goto err;
}
if (PGG(max_persistent) != -1 && PGG(num_persistent) >= PGG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Cannot create new link. Too many open persistent links (%pd)", PGG(num_persistent));
goto err;
}
@@ -1390,7 +1394,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
PQreset(le->ptr);
}
if (le->ptr == NULL || PQstatus(le->ptr) == CONNECTION_BAD) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"PostgreSQL link lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING,"PostgreSQL link lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), str.s);
goto err;
}
@@ -1424,7 +1428,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
link = (zend_resource *)index_ptr->ptr;
if (link->ptr && (link->type == le_link || link->type == le_plink)) {
- php_pgsql_set_default_link(link TSRMLS_CC);
+ php_pgsql_set_default_link(link);
GC_REFCOUNT(link)++;
RETVAL_RES(link);
goto cleanup;
@@ -1433,7 +1437,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create new link. Too many open links (%pd)", PGG(num_links));
+ php_error_docref(NULL, E_WARNING, "Cannot create new link. Too many open links (%pd)", PGG(num_links));
goto err;
}
@@ -1449,7 +1453,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
goto err;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection string required for async connections");
+ php_error_docref(NULL, E_WARNING, "Connection string required for async connections");
goto err;
}
} else {
@@ -1482,7 +1486,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) {
PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RES_HANDLE_P(return_value));
}
- php_pgsql_set_default_link(Z_RES_P(return_value) TSRMLS_CC);
+ php_pgsql_set_default_link(Z_RES_P(return_value));
cleanup:
smart_str_free(&str);
@@ -1525,7 +1529,7 @@ PHP_FUNCTION(pg_connect_poll)
PGconn *pgsql;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -1557,7 +1561,7 @@ PHP_FUNCTION(pg_close)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -1604,7 +1608,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
char *msgbuf;
char *result;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -1752,9 +1756,9 @@ PHP_FUNCTION(pg_parameter_status)
char *param;
size_t len;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &param, &len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rs", &pgsql_link, &param, &len) == SUCCESS) {
id = -1;
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &param, &len) == SUCCESS) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &param, &len) == SUCCESS) {
pgsql_link = NULL;
id = FETCH_DEFAULT_LINK();
} else {
@@ -1785,7 +1789,7 @@ PHP_FUNCTION(pg_ping)
PGconn *pgsql;
PGresult *res;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r", &pgsql_link) == SUCCESS) {
id = -1;
} else {
pgsql_link = NULL;
@@ -1829,13 +1833,13 @@ PHP_FUNCTION(pg_query)
pgsql_result_handle *pg_result;
if (argc == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &query_len) == FAILURE) {
return;
}
}
@@ -1847,7 +1851,7 @@ PHP_FUNCTION(pg_query)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -1855,7 +1859,7 @@ PHP_FUNCTION(pg_query)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
pgsql_result = PQexec(pgsql, query);
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
@@ -1932,13 +1936,13 @@ PHP_FUNCTION(pg_query_params)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sa", &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "sa", &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
}
@@ -1950,7 +1954,7 @@ PHP_FUNCTION(pg_query_params)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -1958,7 +1962,7 @@ PHP_FUNCTION(pg_query_params)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr));
@@ -1976,7 +1980,7 @@ PHP_FUNCTION(pg_query_params)
ZVAL_COPY(&tmp_val, tmp);
convert_to_cstring(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -2048,13 +2052,13 @@ PHP_FUNCTION(pg_prepare)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
}
@@ -2066,7 +2070,7 @@ PHP_FUNCTION(pg_prepare)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -2074,7 +2078,7 @@ PHP_FUNCTION(pg_prepare)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL);
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
@@ -2135,13 +2139,13 @@ PHP_FUNCTION(pg_execute)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) {
+ if (zend_parse_parameters(argc, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa/", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "rsa/", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
return;
}
}
@@ -2153,7 +2157,7 @@ PHP_FUNCTION(pg_execute)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -2161,7 +2165,7 @@ PHP_FUNCTION(pg_execute)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr));
@@ -2179,7 +2183,7 @@ PHP_FUNCTION(pg_execute)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -2248,7 +2252,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2267,7 +2271,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
#if HAVE_PQCMDTUPLES
RETVAL_LONG(atoi(PQcmdTuples(pgsql_result)));
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported under this build");
+ php_error_docref(NULL, E_WARNING, "Not supported under this build");
RETVAL_LONG(0);
#endif
break;
@@ -2312,7 +2316,7 @@ PHP_FUNCTION(pg_last_notice)
int id = -1;
php_pgsql_notice *notice;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -2332,7 +2336,7 @@ PHP_FUNCTION(pg_last_notice)
/* {{{ get_field_name
*/
-static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
{
PGresult *result;
smart_str str = {0};
@@ -2405,14 +2409,14 @@ PHP_FUNCTION(pg_field_table)
char *table_name;
zend_resource *field_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b", &result, &fnum, &return_oid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|b", &result, &fnum, &return_oid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result);
if (fnum < 0 || fnum >= PQnfields(pg_result->result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad field offset specified");
RETURN_FALSE;
}
@@ -2496,7 +2500,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
pgsql_result_handle *pg_result;
Oid oid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &field) == FAILURE) {
return;
}
@@ -2505,7 +2509,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
pgsql_result = pg_result->result;
if (field < 0 || field >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad field offset specified");
RETURN_FALSE;
}
@@ -2517,7 +2521,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
RETURN_LONG(PQfsize(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_TYPE: {
- char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list) TSRMLS_CC);
+ char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list));
RETVAL_STRING(name);
efree(name);
}
@@ -2585,7 +2589,7 @@ PHP_FUNCTION(pg_field_num)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result, &field, &field_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result, &field, &field_len) == FAILURE) {
return;
}
@@ -2608,11 +2612,11 @@ PHP_FUNCTION(pg_fetch_result)
int field_offset, pgsql_row, argc = ZEND_NUM_ARGS();
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "rz", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz", &result, &field) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rlz", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rlz", &result, &row, &field) == FAILURE) {
return;
}
}
@@ -2630,7 +2634,7 @@ PHP_FUNCTION(pg_fetch_result)
}
} else {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -2640,14 +2644,14 @@ PHP_FUNCTION(pg_fetch_result)
case IS_STRING:
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
default:
convert_to_long_ex(field);
if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
field_offset = (int)Z_LVAL_P(field);
@@ -2678,21 +2682,21 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!Sz", &result, &zrow, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!Sz", &result, &zrow, &class_name, &ctor_params) == FAILURE) {
return;
}
if (!class_name) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
result_type = PGSQL_ASSOC;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l", &result, &zrow, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!l", &result, &zrow, &result_type) == FAILURE) {
return;
}
}
@@ -2702,14 +2706,14 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
convert_to_long(zrow);
row = Z_LVAL_P(zrow);
if (row < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The row parameter must be greater or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The row parameter must be greater or equal to zero");
RETURN_FALSE;
}
}
use_row = ZEND_NUM_ARGS() > 1 && row != -1;
if (!(result_type & PGSQL_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
@@ -2719,7 +2723,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (use_row) {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -2774,7 +2778,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_ptr_dtor(&dataset);
}
@@ -2790,14 +2794,14 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -2808,8 +2812,8 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- 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);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
} else {
zval_ptr_dtor(&retval);
}
@@ -2817,7 +2821,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
efree(fci.params);
}
} else if (ctor_params) {
- 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);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
}
}
}
@@ -2869,7 +2873,7 @@ PHP_FUNCTION(pg_fetch_all)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2877,7 +2881,7 @@ PHP_FUNCTION(pg_fetch_all)
pgsql_result = pg_result->result;
array_init(return_value);
- if (php_pgsql_result2array(pgsql_result, return_value TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_result2array(pgsql_result, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2895,7 +2899,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
int pg_numrows, pg_row;
size_t num_fields;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result, &colno) == FAILURE) {
RETURN_FALSE;
}
@@ -2905,7 +2909,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
num_fields = PQnfields(pgsql_result);
if (colno >= (zend_long)num_fields || colno < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%pd'", colno);
+ php_error_docref(NULL, E_WARNING, "Invalid column number '%pd'", colno);
RETURN_FALSE;
}
@@ -2933,7 +2937,7 @@ PHP_FUNCTION(pg_result_seek)
zend_long row;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &row) == FAILURE) {
return;
}
@@ -2963,11 +2967,11 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
int field_offset, pgsql_row, argc = ZEND_NUM_ARGS();
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "rz", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz", &result, &field) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rlz", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rlz", &result, &row, &field) == FAILURE) {
return;
}
}
@@ -2985,7 +2989,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
} else {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -2997,14 +3001,14 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
convert_to_string_ex(field);
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
default:
convert_to_long_ex(field);
if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
field_offset = (int)Z_LVAL_P(field);
@@ -3045,7 +3049,7 @@ PHP_FUNCTION(pg_free_result)
zval *result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -3069,7 +3073,7 @@ PHP_FUNCTION(pg_last_oid)
Oid oid;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -3104,7 +3108,7 @@ PHP_FUNCTION(pg_trace)
php_stream *stream;
id = FETCH_DEFAULT_LINK();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
return;
}
@@ -3142,7 +3146,7 @@ PHP_FUNCTION(pg_untrace)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3170,7 +3174,7 @@ PHP_FUNCTION(pg_lo_create)
Oid pgsql_oid, wanted_oid = InvalidOid;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "|zz", &pgsql_link, &oid) == FAILURE) {
+ if (zend_parse_parameters(argc, "|zz", &pgsql_link, &oid) == FAILURE) {
return;
}
@@ -3191,7 +3195,7 @@ PHP_FUNCTION(pg_lo_create)
if (oid) {
#ifndef HAVE_PG_LO_CREATE
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Passing OID value is not supported. Upgrade your PostgreSQL");
+ php_error_docref(NULL, E_NOTICE, "Passing OID value is not supported. Upgrade your PostgreSQL");
#else
switch (Z_TYPE_P(oid)) {
case IS_STRING:
@@ -3200,24 +3204,24 @@ PHP_FUNCTION(pg_lo_create)
wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10);
if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
}
break;
case IS_LONG:
if (Z_LVAL_P(oid) < (zend_long)InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
wanted_oid = (Oid)Z_LVAL_P(oid);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
}
@@ -3226,7 +3230,7 @@ PHP_FUNCTION(pg_lo_create)
}
if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
}
@@ -3248,38 +3252,38 @@ PHP_FUNCTION(pg_lo_unlink)
int argc = ZEND_NUM_ARGS();
/* accept string type since Oid type is unsigned int */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rs", &pgsql_link, &oid_string, &oid_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rl", &pgsql_link, &oid_long) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"s", &oid_string, &oid_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"l", &oid_long) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID is specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
@@ -3287,7 +3291,7 @@ PHP_FUNCTION(pg_lo_unlink)
CHECK_DEFAULT_LINK(id);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 1 or 2 arguments");
RETURN_FALSE;
}
if (pgsql_link == NULL && id == -1) {
@@ -3297,7 +3301,7 @@ PHP_FUNCTION(pg_lo_unlink)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (lo_unlink(pgsql, oid) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete PostgreSQL large object %u", oid);
+ php_error_docref(NULL, E_WARNING, "Unable to delete PostgreSQL large object %u", oid);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -3320,38 +3324,38 @@ PHP_FUNCTION(pg_lo_open)
int argc = ZEND_NUM_ARGS();
/* accept string type since Oid is unsigned int */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rss", &pgsql_link, &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"ss", &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
@@ -3359,7 +3363,7 @@ PHP_FUNCTION(pg_lo_open)
CHECK_DEFAULT_LINK(id);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 1 or 2 arguments");
RETURN_FALSE;
}
if (pgsql_link == NULL && id == -1) {
@@ -3393,17 +3397,17 @@ PHP_FUNCTION(pg_lo_open)
if (create) {
if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
} else {
if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) {
if (lo_unlink(pgsql, oid) == -1) {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Something is really messed up! Your database is badly corrupted in a way NOT related to PHP");
+ php_error_docref(NULL, E_WARNING, "Something is really messed up! Your database is badly corrupted in a way NOT related to PHP");
RETURN_FALSE;
}
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to open PostgreSQL large object");
RETURN_FALSE;
} else {
pgsql_lofp->conn = pgsql;
@@ -3413,7 +3417,7 @@ PHP_FUNCTION(pg_lo_open)
}
} else {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to open PostgreSQL large object");
RETURN_FALSE;
}
} else {
@@ -3431,14 +3435,14 @@ PHP_FUNCTION(pg_lo_close)
zval *pgsql_lofp;
pgLofp *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_lofp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_lofp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp);
if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd);
+ php_error_docref(NULL, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd);
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -3462,7 +3466,7 @@ PHP_FUNCTION(pg_lo_read)
zend_string *buf;
pgLofp *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &pgsql_id, &len) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &pgsql_id, &len) == FAILURE) {
return;
}
@@ -3496,17 +3500,17 @@ PHP_FUNCTION(pg_lo_write)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) {
return;
}
if (argc > 2) {
if (z_len > (zend_long)str_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
+ php_error_docref(NULL, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
RETURN_FALSE;
}
if (z_len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len);
+ php_error_docref(NULL, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len);
RETURN_FALSE;
}
len = z_len;
@@ -3535,7 +3539,7 @@ PHP_FUNCTION(pg_lo_read_all)
char buf[PGSQL_LO_READ_BUF_SIZE];
pgLofp *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_id) == FAILURE) {
return;
}
@@ -3562,25 +3566,25 @@ PHP_FUNCTION(pg_lo_import)
PGconn *pgsql;
Oid returned_oid;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rp|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"p|z", &file_in, &name_len, &oid) == SUCCESS) {
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
/* old calling convention, deprecated since PHP 4.2 */
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"pr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
+ php_error_docref(NULL, E_NOTICE, "Old API is used");
}
else {
WRONG_PARAM_COUNT;
}
- if (php_check_open_basedir(file_in TSRMLS_CC)) {
+ if (php_check_open_basedir(file_in)) {
RETURN_FALSE;
}
@@ -3592,7 +3596,7 @@ PHP_FUNCTION(pg_lo_import)
if (oid) {
#ifndef HAVE_PG_LO_IMPORT_WITH_OID
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "OID value passing not supported");
+ php_error_docref(NULL, E_NOTICE, "OID value passing not supported");
#else
Oid wanted_oid;
switch (Z_TYPE_P(oid)) {
@@ -3602,20 +3606,20 @@ PHP_FUNCTION(pg_lo_import)
wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10);
if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
}
break;
case IS_LONG:
if (Z_LVAL_P(oid) < (zend_long)InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
wanted_oid = (Oid)Z_LVAL_P(oid);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
@@ -3653,68 +3657,68 @@ PHP_FUNCTION(pg_lo_export)
int argc = ZEND_NUM_ARGS();
/* allow string to handle large OID value correctly */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rss", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"lp", &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"sp", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"spr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
+ php_error_docref(NULL, E_NOTICE, "Old API is used");
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 2 or 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 2 or 3 arguments");
RETURN_FALSE;
}
- if (php_check_open_basedir(file_out TSRMLS_CC)) {
+ if (php_check_open_basedir(file_out)) {
RETURN_FALSE;
}
@@ -3740,11 +3744,11 @@ PHP_FUNCTION(pg_lo_seek)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) {
return;
}
if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid whence parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid whence parameter");
return;
}
@@ -3776,7 +3780,7 @@ PHP_FUNCTION(pg_lo_tell)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r", &pgsql_id) == FAILURE) {
+ if (zend_parse_parameters(argc, "r", &pgsql_id) == FAILURE) {
return;
}
@@ -3806,7 +3810,7 @@ PHP_FUNCTION(pg_lo_truncate)
int argc = ZEND_NUM_ARGS();
int result;
- if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_id, &size) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl", &pgsql_id, &size) == FAILURE) {
return;
}
@@ -3841,13 +3845,13 @@ PHP_FUNCTION(pg_set_error_verbosity)
PGconn *pgsql;
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "l", &verbosity) == FAILURE) {
+ if (zend_parse_parameters(argc, "l", &verbosity) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_link, &verbosity) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl", &pgsql_link, &verbosity) == FAILURE) {
return;
}
}
@@ -3879,13 +3883,13 @@ PHP_FUNCTION(pg_set_client_encoding)
PGconn *pgsql;
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s", &encoding, &encoding_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) {
return;
}
}
@@ -3908,7 +3912,7 @@ PHP_FUNCTION(pg_client_encoding)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3943,7 +3947,7 @@ PHP_FUNCTION(pg_end_copy)
PGconn *pgsql;
int result = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3980,13 +3984,13 @@ PHP_FUNCTION(pg_put_line)
int result = 0, argc = ZEND_NUM_ARGS();
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s", &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
return;
}
}
@@ -4026,7 +4030,7 @@ PHP_FUNCTION(pg_copy_to)
int ret;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|ss",
+ if (zend_parse_parameters(argc, "rs|ss",
&pgsql_link, &table_name, &table_name_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
@@ -4158,7 +4162,7 @@ PHP_FUNCTION(pg_copy_from)
ExecStatusType status;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|ss",
+ if (zend_parse_parameters(argc, "rsa|ss",
&pgsql_link, &table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
@@ -4277,7 +4281,7 @@ PHP_FUNCTION(pg_escape_string)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &from) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &from) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4285,7 +4289,7 @@ PHP_FUNCTION(pg_escape_string)
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rS", &pgsql_link, &from) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS", &pgsql_link, &from) == FAILURE) {
return;
}
break;
@@ -4322,7 +4326,7 @@ PHP_FUNCTION(pg_escape_bytea)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &from, &from_len) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4330,7 +4334,7 @@ PHP_FUNCTION(pg_escape_bytea)
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
break;
@@ -4462,7 +4466,7 @@ PHP_FUNCTION(pg_unescape_bytea)
char *from = NULL, *to = NULL, *tmp = NULL;
size_t to_len;
size_t from_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&from, &from_len) == FAILURE) {
return;
}
@@ -4475,7 +4479,7 @@ PHP_FUNCTION(pg_unescape_bytea)
to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len);
#endif
if (!to) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid parameter");
+ php_error_docref(NULL, E_WARNING,"Invalid parameter");
RETURN_FALSE;
}
RETVAL_STRINGL(to, to_len);
@@ -4495,7 +4499,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &from, &from_len) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4503,20 +4507,20 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
break;
}
if (pgsql_link == NULL && id == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link");
+ php_error_docref(NULL, E_WARNING,"Cannot get default pgsql link");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (pgsql == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get pgsql link");
+ php_error_docref(NULL, E_WARNING,"Cannot get pgsql link");
RETURN_FALSE;
}
@@ -4526,7 +4530,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
tmp = PGSQLescapeIdentifier(pgsql, from, (size_t)from_len);
}
if (!tmp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
+ php_error_docref(NULL, E_WARNING,"Failed to escape");
RETURN_FALSE;
}
@@ -4561,7 +4565,7 @@ PHP_FUNCTION(pg_result_error)
pgsql_result_handle *pg_result;
char *err = NULL;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&result) == FAILURE) {
RETURN_FALSE;
}
@@ -4588,7 +4592,7 @@ PHP_FUNCTION(pg_result_error_field)
pgsql_result_handle *pg_result;
char *field = NULL;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rl",
&result, &fieldcode) == FAILURE) {
RETURN_FALSE;
}
@@ -4630,7 +4634,7 @@ PHP_FUNCTION(pg_connection_status)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4651,7 +4655,7 @@ PHP_FUNCTION(pg_transaction_status)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4672,7 +4676,7 @@ PHP_FUNCTION(pg_connection_reset)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4692,13 +4696,13 @@ PHP_FUNCTION(pg_connection_reset)
/* {{{ php_pgsql_flush_query
*/
-static int php_pgsql_flush_query(PGconn *pgsql TSRMLS_DC)
+static int php_pgsql_flush_query(PGconn *pgsql)
{
PGresult *res;
int leftover = 0;
if (PQ_SETNONBLOCKING(pgsql, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to nonblocking mode");
return -1;
}
while ((res = PQgetResult(pgsql))) {
@@ -4719,7 +4723,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
PGconn *pgsql;
PGresult *pgsql_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4727,7 +4731,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
switch(entry_type) {
@@ -4742,11 +4746,11 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "PostgreSQL module error, please report this error");
+ php_error_docref(NULL, E_ERROR, "PostgreSQL module error, please report this error");
break;
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
convert_to_boolean_ex(return_value);
}
@@ -4791,7 +4795,7 @@ PHP_FUNCTION(pg_send_query)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &len) == FAILURE) {
return;
}
@@ -4800,12 +4804,12 @@ PHP_FUNCTION(pg_send_query)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -4827,14 +4831,14 @@ PHP_FUNCTION(pg_send_query)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -4863,7 +4867,7 @@ PHP_FUNCTION(pg_send_query_params)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
@@ -4876,12 +4880,12 @@ PHP_FUNCTION(pg_send_query_params)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -4899,7 +4903,7 @@ PHP_FUNCTION(pg_send_query_params)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -4933,14 +4937,14 @@ PHP_FUNCTION(pg_send_query_params)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -4968,7 +4972,7 @@ PHP_FUNCTION(pg_send_prepare)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
@@ -4981,12 +4985,12 @@ PHP_FUNCTION(pg_send_prepare)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -5009,13 +5013,13 @@ PHP_FUNCTION(pg_send_prepare)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -5046,7 +5050,7 @@ PHP_FUNCTION(pg_send_execute)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
return;
}
@@ -5059,12 +5063,12 @@ PHP_FUNCTION(pg_send_execute)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -5082,7 +5086,7 @@ PHP_FUNCTION(pg_send_execute)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -5116,13 +5120,13 @@ PHP_FUNCTION(pg_send_execute)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -5147,7 +5151,7 @@ PHP_FUNCTION(pg_get_result)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -5176,7 +5180,7 @@ PHP_FUNCTION(pg_result_status)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l",
&result, &result_type) == FAILURE) {
RETURN_FALSE;
}
@@ -5192,7 +5196,7 @@ PHP_FUNCTION(pg_result_status)
RETURN_STRING(PQcmdStatus(pgsql_result));
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Optional 2nd parameter should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING");
+ php_error_docref(NULL, E_WARNING, "Optional 2nd parameter should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING");
RETURN_FALSE;
}
}
@@ -5208,7 +5212,7 @@ PHP_FUNCTION(pg_get_notify)
PGconn *pgsql;
PGnotify *pgsql_notify;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l",
&pgsql_link, &result_type) == FAILURE) {
RETURN_FALSE;
}
@@ -5216,7 +5220,7 @@ PHP_FUNCTION(pg_get_notify)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (!(result_type & PGSQL_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
@@ -5265,7 +5269,7 @@ PHP_FUNCTION(pg_get_pid)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -5276,31 +5280,31 @@ PHP_FUNCTION(pg_get_pid)
}
/* }}} */
-static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return 0;
}
/* }}} */
-static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
return 0;
}
/* }}} */
-static int php_pgsql_fd_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_close(php_stream *stream, int close_handle) /* {{{ */
{
return EOF;
}
/* }}} */
-static int php_pgsql_fd_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_flush(php_stream *stream) /* {{{ */
{
return FAILURE;
}
/* }}} */
-static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */
{
PGconn *pgsql = (PGconn *) stream->abstract;
switch (option) {
@@ -5312,7 +5316,7 @@ static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, vo
}
/* }}} */
-static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret) /* {{{ */
{
PGconn *pgsql = (PGconn *) stream->abstract;
int fd_number;
@@ -5345,7 +5349,7 @@ PHP_FUNCTION(pg_socket)
PGconn *pgsql;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5370,7 +5374,7 @@ PHP_FUNCTION(pg_consume_input)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5390,7 +5394,7 @@ PHP_FUNCTION(pg_flush)
int ret;
int is_non_blocking;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5399,14 +5403,14 @@ PHP_FUNCTION(pg_flush)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
ret = PQflush(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 0) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed resetting connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Failed resetting connection to blocking mode");
}
switch (ret) {
@@ -5420,7 +5424,7 @@ PHP_FUNCTION(pg_flush)
/* {{{ php_pgsql_meta_data
* TODO: Add meta_data cache for better performance
*/
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended)
{
PGresult *pg_result;
char *src, *tmp_name, *tmp_name2 = NULL;
@@ -5431,7 +5435,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
zval elem;
if (!*table_name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified");
+ php_error_docref(NULL, E_WARNING, "The table name must be specified");
return FAILURE;
}
@@ -5484,7 +5488,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
pg_result = PQexec(pg_link, querystr.s->val);
if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name);
+ php_error_docref(NULL, E_WARNING, "Table '%s' doesn't exists", table_name);
smart_str_free(&querystr);
PQclear(pg_result);
return FAILURE;
@@ -5538,7 +5542,7 @@ PHP_FUNCTION(pg_meta_data)
PGconn *pgsql;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|b",
&pgsql_link, &table_name, &table_name_len, &extended) == FAILURE) {
return;
}
@@ -5546,7 +5550,7 @@ PHP_FUNCTION(pg_meta_data)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
array_init(return_value);
- if (php_pgsql_meta_data(pgsql, table_name, return_value, extended TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) {
zval_dtor(return_value); /* destroy array */
RETURN_FALSE;
}
@@ -5646,7 +5650,7 @@ static php_pgsql_data_type php_pgsql_get_data_type(const char *type_name, size_t
/* {{{ php_pgsql_convert_match
* test field value with regular expression specified.
*/
-static int php_pgsql_convert_match(const char *str, size_t str_len, const char *regex , int icase TSRMLS_DC)
+static int php_pgsql_convert_match(const char *str, size_t str_len, const char *regex , int icase)
{
regex_t re;
regmatch_t *subs;
@@ -5669,7 +5673,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
regerr = regcomp(&re, regex, regopt);
if (regerr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex");
+ php_error_docref(NULL, E_WARNING, "Cannot compile regex");
regfree(&re);
return FAILURE;
}
@@ -5678,12 +5682,12 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
if (regerr == REG_NOMATCH) {
#ifdef PHP_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex);
+ php_error_docref(NULL, E_NOTICE, "'%s' does not match with '%s'", str, regex);
#endif
ret = FAILURE;
}
else if (regerr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot exec regex");
+ php_error_docref(NULL, E_WARNING, "Cannot exec regex");
ret = FAILURE;
}
regfree(&re);
@@ -5696,7 +5700,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
/* {{{ php_pgsql_add_quote
* add quotes around string.
*/
-static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
+static int php_pgsql_add_quotes(zval *src, zend_bool should_free)
{
smart_str str = {0};
@@ -5727,7 +5731,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
} \
/* raise error if it's not null and cannot be ignored */ \
else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_TYPE_P(not_null) == IS_TRUE) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field->val); \
+ php_error_docref(NULL, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field->val); \
err = 1; \
} \
}
@@ -5735,7 +5739,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
/* {{{ php_pgsql_convert
* check and convert array values (fieldname=>vlaue pair) for sql
*/
-PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt)
{
zend_string *field = NULL;
zend_ulong num_idx = -1;
@@ -5754,7 +5758,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
array_init(&meta);
/* table_name is escaped by php_pgsql_meta_data */
- if (php_pgsql_meta_data(pg_link, table_name, &meta, 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_meta_data(pg_link, table_name, &meta, 0) == FAILURE) {
zval_ptr_dtor(&meta);
return FAILURE;
}
@@ -5764,32 +5768,32 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_NULL(&new_val);
if (!err && field == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values");
+ php_error_docref(NULL, E_WARNING, "Accepts only string key for values");
err = 1;
}
if (!err && (def = zend_hash_find(Z_ARRVAL(meta), field)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid field name (%s) in values", field->val);
+ php_error_docref(NULL, E_NOTICE, "Invalid field name (%s) in values", field->val);
err = 1;
}
if (!err && (type = zend_hash_str_find(Z_ARRVAL_P(def), "type", sizeof("type") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'type'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'type'");
err = 1;
}
if (!err && (not_null = zend_hash_str_find(Z_ARRVAL_P(def), "not null", sizeof("not null") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'not null'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'not null'");
err = 1;
}
if (!err && (has_default = zend_hash_str_find(Z_ARRVAL_P(def), "has default", sizeof("has default") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'has default'");
err = 1;
}
if (!err && (is_enum = zend_hash_str_find(Z_ARRVAL_P(def), "is enum", sizeof("is enum") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'is enum'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'is enum'");
err = 1;
}
if (!err && (Z_TYPE_P(val) == IS_ARRAY || Z_TYPE_P(val) == IS_OBJECT)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scalar values as field values");
+ php_error_docref(NULL, E_NOTICE, "Expects scalar values as field values");
err = 1;
}
if (err) {
@@ -5828,7 +5832,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "'f'", sizeof("'f'")-1);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_P(val), Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_P(val), Z_STRVAL_P(type), field->val);
err = 1;
}
}
@@ -5860,7 +5864,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5875,7 +5879,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([+-]{0,1}[0-9]+)$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([+-]{0,1}[0-9]+)$", 0) == FAILURE) {
err = 1;
}
else {
@@ -5902,7 +5906,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for pgsql '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for pgsql '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5917,7 +5921,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0) == FAILURE) {
err = 1;
}
else {
@@ -5943,7 +5947,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5983,7 +5987,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
str->len = PQescapeStringConn(pg_link, str->val, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
str = zend_string_realloc(str, str->len, 0);
ZVAL_NEW_STR(&new_val, str);
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
break;
@@ -6006,7 +6010,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6020,7 +6024,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[0-9]+$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[0-9]+$", 0) == FAILURE) {
err = 1;
}
else {
@@ -6048,7 +6052,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6061,12 +6065,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? IPV6 and IPV4 */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", 0) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6080,7 +6084,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6095,11 +6099,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "NOW()", sizeof("NOW()")-1);
} else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1) == FAILURE) {
err = 1;
} else {
ZVAL_STRING(&new_val, Z_STRVAL_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6113,7 +6117,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6125,12 +6129,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6144,7 +6148,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6156,12 +6160,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6175,7 +6179,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6235,12 +6239,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
"(([0-9]{1,2}:){0,2}[0-9]{0,2})" /* hh:[mm:[ss]] */
")?))"
"([ \\t]+ago)?$",
- 1 TSRMLS_CC) == FAILURE) {
+ 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRING(&new_val, Z_STRVAL_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6254,7 +6258,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
#ifdef HAVE_PQESCAPE
@@ -6275,7 +6279,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
#endif
ZVAL_STRINGL(&new_val, (char *)tmp, to_len - 1); /* PQescapeBytea's to_len includes additional '\0' */
PQfreemem(tmp);
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
smart_str_appendl(&s, Z_STRVAL(new_val), Z_STRLEN(new_val));
smart_str_0(&s);
zval_ptr_dtor(&new_val);
@@ -6302,7 +6306,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6314,12 +6318,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "NULL", sizeof("NULL")-1);
}
else {
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6333,13 +6337,13 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
default:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or system data type '%s' for '%s'. Report error", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Unknown or system data type '%s' for '%s'. Report error", Z_STRVAL_P(type), field->val);
err = 1;
break;
} /* switch */
@@ -6383,33 +6387,33 @@ PHP_FUNCTION(pg_convert)
PGconn *pg_link;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(),
"rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) {
return;
}
if (option & ~PGSQL_CONV_OPTS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
if (!table_name_len) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Table name is invalid");
+ php_error_docref(NULL, E_NOTICE, "Table name is invalid");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
array_init(return_value);
- if (php_pgsql_convert(pg_link, table_name, values, return_value, option TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong opt TSRMLS_DC) /* {{{ */
+static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong opt) /* {{{ */
{
if (opt & PGSQL_DML_ASYNC) {
if (PQsendQuery(pg_link, querystr->s->val)) {
@@ -6424,7 +6428,7 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong
PQclear(pg_result);
return 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", PQresultErrorMessage(pg_result));
+ php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result));
PQclear(pg_result);
}
}
@@ -6468,7 +6472,7 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
/* {{{ php_pgsql_insert
*/
-PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, zend_ulong opt, zend_string **sql)
{
zval *val, converted;
char buf[256];
@@ -6494,7 +6498,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
/* convert input array if needed */
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&converted);
- if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
var_array = &converted;
@@ -6506,7 +6510,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(var_array), num_idx, fld) {
if (fld == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted");
+ php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted");
goto cleanup;
}
if (opt & PGSQL_DML_ESCAPE) {
@@ -6549,7 +6553,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
smart_str_appendl(&querystr, "NULL", sizeof("NULL")-1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects scaler values. type = %d", Z_TYPE_P(val));
+ php_error_docref(NULL, E_WARNING, "Expects scaler values. type = %d", Z_TYPE_P(val));
goto cleanup;
break;
}
@@ -6564,7 +6568,7 @@ no_values:
smart_str_0(&querystr);
if ((opt & (PGSQL_DML_EXEC|PGSQL_DML_ASYNC)) &&
- do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == 0) {
+ do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS)) == 0) {
ret = SUCCESS;
}
else if (opt & PGSQL_DML_STRING) {
@@ -6598,25 +6602,25 @@ PHP_FUNCTION(pg_insert)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &values, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
return_sql = option & PGSQL_DML_STRING;
if (option & PGSQL_DML_EXEC) {
/* return resource when executed */
option = option & ~PGSQL_DML_EXEC;
- if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql) == FAILURE) {
RETURN_FALSE;
}
pg_result = PQexec(pg_link, sql->val);
@@ -6657,7 +6661,7 @@ PHP_FUNCTION(pg_insert)
}
break;
}
- } else if (php_pgsql_insert(pg_link, table, values, option, &sql TSRMLS_CC) == FAILURE) {
+ } else if (php_pgsql_insert(pg_link, table, values, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (return_sql) {
@@ -6668,7 +6672,7 @@ PHP_FUNCTION(pg_insert)
}
/* }}} */
-static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, zend_ulong opt TSRMLS_DC) /* {{{ */
+static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, zend_ulong opt) /* {{{ */
{
char *tmp;
char buf[256];
@@ -6678,7 +6682,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
ZEND_HASH_FOREACH_KEY_VAL(ht, num_idx, fld, val) {
if (fld == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted");
+ php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted");
return -1;
}
if (opt & PGSQL_DML_ESCAPE) {
@@ -6718,7 +6722,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
smart_str_appendl(querystr, "NULL", sizeof("NULL")-1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects scaler values. type=%d", Z_TYPE_P(val));
+ php_error_docref(NULL, E_WARNING, "Expects scaler values. type=%d", Z_TYPE_P(val));
return -1;
}
smart_str_appendl(querystr, pad, pad_len);
@@ -6733,7 +6737,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
/* {{{ php_pgsql_update
*/
-PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, zend_ulong opt, zend_string **sql)
{
zval var_converted, ids_converted;
smart_str querystr = {0};
@@ -6754,12 +6758,12 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&var_converted);
- if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
var_array = &var_converted;
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6769,18 +6773,18 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " SET ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt))
goto cleanup;
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
smart_str_0(&querystr);
- if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) {
+ if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
ret = SUCCESS;
} else if (opt & PGSQL_DML_STRING) {
ret = SUCCESS;
@@ -6811,21 +6815,21 @@ PHP_FUNCTION(pg_update)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsaa|l",
+ if (zend_parse_parameters(argc, "rsaa|l",
&pgsql_link, &table, &table_len, &values, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
- if (php_pgsql_update(pg_link, table, values, ids, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_update(pg_link, table, values, ids, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (option & PGSQL_DML_STRING) {
@@ -6837,7 +6841,7 @@ PHP_FUNCTION(pg_update)
/* {{{ php_pgsql_delete
*/
-PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, zend_ulong opt, zend_string **sql)
{
zval ids_converted;
smart_str querystr = {0};
@@ -6855,7 +6859,7 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6865,13 +6869,13 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
smart_str_0(&querystr);
- if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) {
+ if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
ret = SUCCESS;
} else if (opt & PGSQL_DML_STRING) {
ret = SUCCESS;
@@ -6901,21 +6905,21 @@ PHP_FUNCTION(pg_delete)
zend_string *sql;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
- if (php_pgsql_delete(pg_link, table, ids, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_delete(pg_link, table, ids, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (option & PGSQL_DML_STRING) {
@@ -6927,7 +6931,7 @@ PHP_FUNCTION(pg_delete)
/* {{{ php_pgsql_result2array
*/
-PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array)
{
zval row;
char *field_name;
@@ -6963,7 +6967,7 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TS
/* {{{ php_pgsql_select
*/
-PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, zend_ulong opt, zend_string **sql)
{
zval ids_converted;
smart_str querystr = {0};
@@ -6983,7 +6987,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6993,7 +6997,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
@@ -7001,9 +7005,9 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
pg_result = PQexec(pg_link, querystr.s->val);
if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) {
- ret = php_pgsql_result2array(pg_result, ret_array TSRMLS_CC);
+ ret = php_pgsql_result2array(pg_result, ret_array);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr.s->val);
+ php_error_docref(NULL, E_NOTICE, "Failed to execute '%s'", querystr.s->val);
}
PQclear(pg_result);
@@ -7031,22 +7035,22 @@ PHP_FUNCTION(pg_select)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
array_init(return_value);
- if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 661c02f77f..4c50666e12 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -210,29 +210,29 @@ PHP_FUNCTION(pg_select);
/* exported functions */
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC);
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended);
+PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt);
+PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, zend_ulong opt, zend_string **sql);
+PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql);
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, zend_ulong opt, zend_string **sql);
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, zend_ulong opt, zend_string **sql );
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array);
/* internal functions */
static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC);
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list);
static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type);
-static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int php_pgsql_fd_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int php_pgsql_fd_flush(php_stream *stream TSRMLS_DC);
-static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
-static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret TSRMLS_DC);
+static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count);
+static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count);
+static int php_pgsql_fd_close(php_stream *stream, int close_handle);
+static int php_pgsql_fd_flush(php_stream *stream);
+static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam);
+static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret);
typedef enum _php_pgsql_data_type {
/* boolean */
@@ -322,7 +322,10 @@ ZEND_END_MODULE_GLOBALS(pgsql)
ZEND_EXTERN_MODULE_GLOBALS(pgsql)
#ifdef ZTS
-# define PGG(v) TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# define PGG(v) ZEND_TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# ifdef COMPILE_DL_PGSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define PGG(v) (pgsql_globals.v)
#endif
diff --git a/ext/phar/config.m4 b/ext/phar/config.m4
index 614d672eab..8b91caaedc 100644
--- a/ext/phar/config.m4
+++ b/ext/phar/config.m4
@@ -5,7 +5,7 @@ PHP_ARG_ENABLE(phar, for phar archive support,
[ --disable-phar Disable phar support], yes)
if test "$PHP_PHAR" != "no"; then
- PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared)
+ PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
AC_MSG_CHECKING([for phar openssl support])
if test "$PHP_HASH_SHARED" != "yes"; then
if test "$PHP_HASH" != "no"; then
diff --git a/ext/phar/config.w32 b/ext/phar/config.w32
index 93504f61fb..6dba20affb 100644
--- a/ext/phar/config.w32
+++ b/ext/phar/config.w32
@@ -9,7 +9,7 @@ if (PHP_PHAR_NATIVE_SSL != "no") {
}
if (PHP_PHAR != "no") {
- EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c");
+ EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c", PHP_PHAR_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if (PHP_PHAR_SHARED || (PHP_PHAR_NATIVE_SSL_SHARED && PHP_SNAPSHOT_BUILD == "no")) {
ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR ");
}
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c
index b8875891b0..33a3cd20c2 100644
--- a/ext/phar/dirstream.c
+++ b/ext/phar/dirstream.c
@@ -22,7 +22,7 @@
#include "dirstream.h"
BEGIN_EXTERN_C()
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir TSRMLS_DC);
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir);
END_EXTERN_C()
php_stream_ops phar_dir_ops = {
@@ -40,7 +40,7 @@ php_stream_ops phar_dir_ops = {
/**
* Used for closedir($fp) where $fp is an opendir('phar://...') directory handle
*/
-static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int phar_dir_close(php_stream *stream, int close_handle) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
@@ -58,7 +58,7 @@ static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{
/**
* Used for seeking on a phar directory handle
*/
-static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
@@ -90,7 +90,7 @@ static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend
/**
* Used for readdir() on an opendir()ed phar directory handle
*/
-static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_dir_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
size_t to_read;
HashTable *data = (HashTable *)stream->abstract;
@@ -119,7 +119,7 @@ static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_D
/**
* Dummy: Used for writing to a phar directory (i.e. not used)
*/
-static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return 0;
}
@@ -128,7 +128,7 @@ static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count T
/**
* Dummy: Used for flushing writes to a phar directory (i.e. not used)
*/
-static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int phar_dir_flush(php_stream *stream) /* {{{ */
{
return EOF;
}
@@ -152,7 +152,7 @@ static int phar_add_empty(HashTable *ht, char *arKey, uint nKeyLength) /* {{{ *
/**
* Used for sorting directories alphabetically
*/
-static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int phar_compare_dir_name(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -177,7 +177,7 @@ static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{
* files in a phar and retrieving its relative path. From this, construct
* a list of files/directories that are "in" the directory represented by dir
*/
-static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) /* {{{ */
+static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */
{
HashTable *data;
int dirlen = strlen(dir);
@@ -285,7 +285,7 @@ PHAR_ADD_ENTRY:
if (FAILURE != zend_hash_has_more_elements(data)) {
efree(dir);
- if (zend_hash_sort(data, zend_qsort, phar_compare_dir_name, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(data, zend_qsort, phar_compare_dir_name, 0) == FAILURE) {
FREE_HASHTABLE(data);
return NULL;
}
@@ -300,7 +300,7 @@ PHAR_ADD_ENTRY:
/**
* Open a directory handle within a phar archive
*/
-php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
php_url *resource = NULL;
php_stream *ret;
@@ -311,39 +311,39 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
phar_entry_info *entry = NULL;
uint host_len;
- if ((resource = phar_parse_url(wrapper, path, mode, options TSRMLS_CC)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar url \"%s\" is unknown", path);
+ if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) {
+ php_stream_wrapper_log_error(wrapper, options, "phar url \"%s\" is unknown", path);
return NULL;
}
/* we must have at the very least phar://alias.phar/ */
if (!resource->scheme || !resource->host || !resource->path) {
if (resource->host && !resource->path) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, resource->host);
php_url_free(resource);
return NULL;
}
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\", must have at least phar://%s/", path, path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\", must have at least phar://%s/", path, path);
return NULL;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar url \"%s\"", path);
return NULL;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
internal_file = resource->path + 1; /* strip leading "/" */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar file \"%s\" is unknown", resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", resource->host);
}
php_url_free(resource);
return NULL;
@@ -356,7 +356,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
if (*internal_file == '\0') {
/* root directory requested */
internal_file = estrndup(internal_file - 1, 1);
- ret = phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ ret = phar_make_dirstream(internal_file, &phar->manifest);
php_url_free(resource);
return ret;
}
@@ -376,7 +376,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
}
internal_file = estrdup(internal_file);
php_url_free(resource);
- return phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ return phar_make_dirstream(internal_file, &phar->manifest);
} else {
int i_len = strlen(internal_file);
@@ -391,7 +391,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
internal_file = estrndup(internal_file,
i_len);
php_url_free(resource);
- return phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ return phar_make_dirstream(internal_file, &phar->manifest);
}
}
@@ -409,7 +409,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
/**
* Make a new directory within a phar archive
*/
-int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context) /* {{{ */
{
phar_entry_info entry, *e;
phar_archive_data *phar = NULL;
@@ -419,12 +419,12 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
uint host_len;
/* pre-readonly check, we need to know if this is a data phar */
- if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2 TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\", no phar archive specified", url_from);
+ if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", no phar archive specified", url_from);
return 0;
}
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar = NULL;
}
@@ -432,63 +432,63 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
efree(entry2);
if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\", write operations disabled", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", write operations disabled", url_from);
return 0;
}
- if ((resource = phar_parse_url(wrapper, url_from, "w", options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url_from, "w", options)) == NULL) {
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url_from);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url_from);
return 0;
}
host_len = strlen(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
}
- if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1 TSRMLS_CC))) {
+ if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1))) {
/* directory exists, or is a subdirectory of an existing file */
if (e->is_temp_dir) {
efree(e->filename);
efree(e);
}
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", resource->path+1, resource->host);
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
}
- if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1 TSRMLS_CC)) {
+ if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1)) {
/* entry exists as a file */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", resource->path+1, resource->host);
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
@@ -518,22 +518,22 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
entry.old_flags = PHAR_ENT_PERM_DEF_DIR;
if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", entry.filename, phar->fname);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", entry.filename, phar->fname);
efree(error);
efree(entry.filename);
return 0;
}
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry.filename, phar->fname, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry.filename, phar->fname, error);
zend_hash_str_del(&phar->manifest, entry.filename, entry.filename_len);
efree(error);
return 0;
}
- phar_add_virtual_dirs(phar, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, entry.filename, entry.filename_len);
return 1;
}
/* }}} */
@@ -541,7 +541,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
/**
* Remove a directory within a phar archive
*/
-int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */
{
phar_entry_info *entry;
phar_archive_data *phar = NULL;
@@ -554,12 +554,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
uint path_len;
/* pre-readonly check, we need to know if this is a data phar */
- if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2 TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url);
+ if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url);
return 0;
}
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar = NULL;
}
@@ -567,31 +567,31 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
efree(entry2);
if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot rmdir directory \"%s\", write operations disabled", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot rmdir directory \"%s\", write operations disabled", url);
return 0;
}
- if ((resource = phar_parse_url(wrapper, url, "w", options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) {
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
host_len = strlen(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
@@ -599,12 +599,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
path_len = strlen(resource->path+1);
- if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1 TSRMLS_CC))) {
+ if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1))) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", resource->path+1, resource->host);
}
php_url_free(resource);
return 0;
@@ -618,7 +618,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
if (str_key->len > path_len &&
memcmp(str_key->val, resource->path+1, path_len) == 0 &&
IS_SLASH(str_key->val[path_len])) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
efree(entry->filename);
efree(entry);
@@ -635,7 +635,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
if (str_key->len > path_len &&
memcmp(str_key->val, resource->path+1, path_len) == 0 &&
IS_SLASH(str_key->val[path_len])) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
efree(entry->filename);
efree(entry);
@@ -653,10 +653,10 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
} else {
entry->is_deleted = 1;
entry->is_modified = 1;
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
php_url_free(resource);
efree(error);
return 0;
diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h
index f9a300a63c..c59ba1b95b 100644
--- a/ext/phar/dirstream.h
+++ b/ext/phar/dirstream.h
@@ -20,20 +20,20 @@
/* $Id$ */
BEGIN_EXTERN_C()
-int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC);
-int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
+int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context);
+int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
#ifdef PHAR_DIRSTREAM
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC);
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
/* directory handlers */
-static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t phar_dir_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int phar_dir_flush(php_stream *stream TSRMLS_DC);
-static int phar_dir_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
+static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count);
+static size_t phar_dir_read( php_stream *stream, char *buf, size_t count);
+static int phar_dir_close(php_stream *stream, int close_handle);
+static int phar_dir_flush(php_stream *stream);
+static int phar_dir_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset);
#else
-php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
#endif
END_EXTERN_C()
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index fa303a3b22..afdf58b665 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -38,14 +38,14 @@ PHAR_FUNC(phar_opendir) /* {{{ */
goto skip_phar;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -54,7 +54,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
php_stream_context *context = NULL;
php_stream *stream;
char *name;
@@ -64,7 +64,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (entry[0] == '/') {
spprintf(&name, 4096, "phar://%s%s", arch, entry);
@@ -112,7 +112,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
}
/* Parse arguments */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
goto skip_phar;
}
@@ -121,13 +121,13 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
int arch_len, entry_len, fname_len;
php_stream_context *context = NULL;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
char *name;
phar_archive_data *phar;
@@ -138,17 +138,17 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
if (ZEND_NUM_ARGS() == 5 && maxlen < 0) {
efree(arch);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "length must be greater than or equal to zero");
RETURN_FALSE;
}
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if ((entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if ((entry = phar_find_in_include_path(entry, entry_len, NULL))) {
name = entry;
goto phar_it;
} else {
@@ -157,7 +157,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
goto skip_phar;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -195,7 +195,7 @@ phar_it:
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %pd in the stream", offset);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position %pd in the stream", offset);
php_stream_close(stream);
RETURN_FALSE;
}
@@ -238,7 +238,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -247,13 +247,13 @@ PHAR_FUNC(phar_readfile) /* {{{ */
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
goto skip_phar;
}
@@ -262,12 +262,12 @@ PHAR_FUNC(phar_readfile) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if (!(entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if (!(entry = phar_find_in_include_path(entry, entry_len, NULL))) {
/* this file is not in the phar, use the original path */
efree(arch);
goto skip_phar;
@@ -275,7 +275,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
name = entry;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -334,7 +334,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
/* no need to check, include_path not even specified in fopen/ no active phars */
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -343,13 +343,13 @@ PHAR_FUNC(phar_fopen) /* {{{ */
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
goto skip_phar;
}
@@ -358,12 +358,12 @@ PHAR_FUNC(phar_fopen) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if (!(entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if (!(entry = phar_find_in_include_path(entry, entry_len, NULL))) {
/* this file is not in the phar, use the original path */
efree(arch);
goto skip_phar;
@@ -371,7 +371,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
name = entry;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -433,7 +433,7 @@ skip_phar:
/* {{{ php_stat
*/
-static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value TSRMLS_DC)
+static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
@@ -512,7 +512,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
case S_IFDIR: RETURN_STRING("dir");
case S_IFREG: RETURN_STRING("file");
}
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%u)", stat_sb->st_mode & S_IFMT);
+ php_error_docref(NULL, E_NOTICE, "Unknown file type (%u)", stat_sb->st_mode & S_IFMT);
RETURN_STRING("unknown");
case FS_IS_W:
RETURN_BOOL((stat_sb->st_mode & wmask) != 0);
@@ -597,7 +597,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call");
+ php_error_docref(NULL, E_WARNING, "Didn't understand stat call");
RETURN_FALSE;
}
/* }}} */
@@ -615,7 +615,7 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
phar_entry_info *data = NULL;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -633,19 +633,19 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
phar = PHAR_G(last_phar);
goto splitted;
}
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
entry = estrndup(filename, filename_length);
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = (int) filename_length;
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
efree(entry);
goto skip_phar;
}
splitted:
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
efree(entry);
@@ -690,7 +690,7 @@ notfound:
PHAR_G(cwd) = "/";
PHAR_G(cwd_len) = 0;
/* clean path without cwd */
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
PHAR_G(cwd) = save;
PHAR_G(cwd_len) = save_len;
@@ -729,7 +729,7 @@ notfound:
efree(arch);
/* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
+ php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
RETURN_FALSE;
}
@@ -789,7 +789,7 @@ statme_baby:
sb.st_blksize = -1;
sb.st_blocks = -1;
#endif
- phar_fancy_stat(&sb, type, return_value TSRMLS_CC);
+ phar_fancy_stat(&sb, type, return_value);
return;
}
}
@@ -807,7 +807,7 @@ void fname(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
size_t filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
@@ -899,13 +899,13 @@ PHAR_FUNC(phar_is_file) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -914,7 +914,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
phar_archive_data *phar;
efree(entry);
@@ -922,10 +922,10 @@ PHAR_FUNC(phar_is_file) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar_entry_info *etemp;
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
/* this file is not in the current directory, use the original path */
@@ -966,13 +966,13 @@ PHAR_FUNC(phar_is_link) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -981,7 +981,7 @@ PHAR_FUNC(phar_is_link) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
phar_archive_data *phar;
efree(entry);
@@ -989,10 +989,10 @@ PHAR_FUNC(phar_is_link) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar_entry_info *etemp;
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
/* this file is not in the current directory, use the original path */
@@ -1028,8 +1028,8 @@ PharFileFunction(phar_lstat, FS_LSTAT, orig_lstat)
PharFileFunction(phar_stat, FS_STAT, orig_stat)
/* }}} */
-/* {{{ void phar_intercept_functions(TSRMLS_D) */
-void phar_intercept_functions(TSRMLS_D)
+/* {{{ void phar_intercept_functions(void) */
+void phar_intercept_functions(void)
{
if (!PHAR_G(request_init)) {
PHAR_G(cwd) = NULL;
@@ -1039,14 +1039,14 @@ void phar_intercept_functions(TSRMLS_D)
}
/* }}} */
-/* {{{ void phar_release_functions(TSRMLS_D) */
-void phar_release_functions(TSRMLS_D)
+/* {{{ void phar_release_functions(void) */
+void phar_release_functions(void)
{
PHAR_G(intercepted) = 0;
}
/* }}} */
-/* {{{ void phar_intercept_functions_init(TSRMLS_D) */
+/* {{{ void phar_intercept_functions_init(void) */
#define PHAR_INTERCEPT(func) \
PHAR_G(orig_##func) = NULL; \
if (NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
@@ -1054,7 +1054,7 @@ void phar_release_functions(TSRMLS_D)
orig->internal_function.handler = phar_##func; \
}
-void phar_intercept_functions_init(TSRMLS_D)
+void phar_intercept_functions_init(void)
{
zend_function *orig;
@@ -1084,14 +1084,14 @@ void phar_intercept_functions_init(TSRMLS_D)
}
/* }}} */
-/* {{{ void phar_intercept_functions_shutdown(TSRMLS_D) */
+/* {{{ void phar_intercept_functions_shutdown(void) */
#define PHAR_RELEASE(func) \
if (PHAR_G(orig_##func) && NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
orig->internal_function.handler = PHAR_G(orig_##func); \
} \
PHAR_G(orig_##func) = NULL;
-void phar_intercept_functions_shutdown(TSRMLS_D)
+void phar_intercept_functions_shutdown(void)
{
zend_function *orig;
@@ -1145,7 +1145,7 @@ static struct _phar_orig_functions {
void (*orig_stat)(INTERNAL_FUNCTION_PARAMETERS);
} phar_orig_functions = {NULL};
-void phar_save_orig_functions(TSRMLS_D) /* {{{ */
+void phar_save_orig_functions(void) /* {{{ */
{
phar_orig_functions.orig_fopen = PHAR_G(orig_fopen);
phar_orig_functions.orig_file_get_contents = PHAR_G(orig_file_get_contents);
@@ -1172,7 +1172,7 @@ void phar_save_orig_functions(TSRMLS_D) /* {{{ */
}
/* }}} */
-void phar_restore_orig_functions(TSRMLS_D) /* {{{ */
+void phar_restore_orig_functions(void) /* {{{ */
{
PHAR_G(orig_fopen) = phar_orig_functions.orig_fopen;
PHAR_G(orig_file_get_contents) = phar_orig_functions.orig_file_get_contents;
diff --git a/ext/phar/func_interceptors.h b/ext/phar/func_interceptors.h
index ff271460fe..e0aba7a8a2 100644
--- a/ext/phar/func_interceptors.h
+++ b/ext/phar/func_interceptors.h
@@ -20,12 +20,12 @@
/* $Id$ */
BEGIN_EXTERN_C()
-void phar_intercept_functions(TSRMLS_D);
-void phar_release_functions(TSRMLS_D);
-void phar_intercept_functions_init(TSRMLS_D);
-void phar_intercept_functions_shutdown(TSRMLS_D);
-void phar_save_orig_functions(TSRMLS_D);
-void phar_restore_orig_functions(TSRMLS_D);
+void phar_intercept_functions(void);
+void phar_release_functions(void);
+void phar_intercept_functions_init(void);
+void phar_intercept_functions_shutdown(void);
+void phar_save_orig_functions(void);
+void phar_restore_orig_functions(void);
END_EXTERN_C()
/*
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 0903f6c952..b601669507 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -27,12 +27,12 @@
static void destroy_phar_data(zval *zv);
ZEND_DECLARE_MODULE_GLOBALS(phar)
-char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+char *(*phar_save_resolve_path)(const char *filename, int filename_len);
/**
* set's phar->is_writeable based on the current INI value
*/
-static int phar_set_writeable_bit(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_set_writeable_bit(zval *zv, void *argument) /* {{{ */
{
zend_bool keep = *(zend_bool *)argument;
phar_archive_data *phar = (phar_archive_data *)Z_PTR_P(zv);
@@ -83,7 +83,7 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
if (entry->name->len == sizeof("phar.readonly")-1) {
PHAR_G(readonly) = ini;
if (PHAR_GLOBALS->request_init && PHAR_GLOBALS->phar_fname_map.arHash) {
- zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_fname_map), phar_set_writeable_bit, (void *)&ini TSRMLS_CC);
+ zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_fname_map), phar_set_writeable_bit, (void *)&ini);
}
} else {
PHAR_G(require_hash) = ini;
@@ -97,7 +97,7 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
HashTable cached_phars;
HashTable cached_alias;
-static void phar_split_cache_list(TSRMLS_D) /* {{{ */
+static void phar_split_cache_list(void) /* {{{ */
{
char *tmp;
char *key, *lasts, *end;
@@ -135,7 +135,7 @@ static void phar_split_cache_list(TSRMLS_D) /* {{{ */
end = strchr(key, DEFAULT_DIR_SEPARATOR);
if (end) {
- if (SUCCESS == phar_open_from_filename(key, end - key, NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename(key, end - key, NULL, 0, 0, &phar, NULL)) {
finish_up:
phar->phar_pos = i++;
php_stream_close(phar->fp);
@@ -158,7 +158,7 @@ finish_error:
return;
}
} else {
- if (SUCCESS == phar_open_from_filename(key, strlen(key), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename(key, strlen(key), NULL, 0, 0, &phar, NULL)) {
goto finish_up;
} else {
goto finish_error;
@@ -186,7 +186,7 @@ ZEND_INI_MH(phar_ini_cache_list) /* {{{ */
PHAR_G(cache_list) = new_value->val;
if (stage == ZEND_INI_STAGE_STARTUP) {
- phar_split_cache_list(TSRMLS_C);
+ phar_split_cache_list();
}
return SUCCESS;
@@ -203,7 +203,7 @@ PHP_INI_END()
* When all uses of a phar have been concluded, this frees the manifest
* and the phar slot
*/
-void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */
{
if (phar->alias && phar->alias != phar->fname) {
pefree(phar->alias, phar->is_persistent);
@@ -267,7 +267,7 @@ void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/**
* Delete refcount and destruct if needed. On destruct return 1 else 0.
*/
-int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+int phar_archive_delref(phar_archive_data *phar) /* {{{ */
{
if (phar->is_persistent) {
return 0;
@@ -276,7 +276,7 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
if (--phar->refcount < 0) {
if (PHAR_GLOBALS->request_done
|| zend_hash_str_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_len) != SUCCESS) {
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
}
return 1;
} else if (!phar->refcount) {
@@ -297,7 +297,7 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/* this is a new phar that has perhaps had an alias/metadata set, but has never
been flushed */
if (zend_hash_str_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_len) != SUCCESS) {
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
}
return 1;
}
@@ -312,10 +312,9 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
static void destroy_phar_data_only(zval *zv) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *) Z_PTR_P(zv);
- TSRMLS_FETCH();
if (EG(exception) || --phar_data->refcount < 0) {
- phar_destroy_phar_data(phar_data TSRMLS_CC);
+ phar_destroy_phar_data(phar_data);
}
}
/* }}}*/
@@ -323,7 +322,7 @@ static void destroy_phar_data_only(zval *zv) /* {{{ */
/**
* Delete aliases to phar's that got kicked out of the global table
*/
-static int phar_unalias_apply(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_unalias_apply(zval *zv, void *argument) /* {{{ */
{
return Z_PTR_P(zv) == argument ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_KEEP;
}
@@ -332,7 +331,7 @@ static int phar_unalias_apply(zval *zv, void *argument TSRMLS_DC) /* {{{ */
/**
* Delete aliases to phar's that got kicked out of the global table
*/
-static int phar_tmpclose_apply(zval *zv TSRMLS_DC) /* {{{ */
+static int phar_tmpclose_apply(zval *zv) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv);
@@ -355,20 +354,19 @@ static int phar_tmpclose_apply(zval *zv TSRMLS_DC) /* {{{ */
static void destroy_phar_data(zval *zv) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *)Z_PTR_P(zv);
- TSRMLS_FETCH();
if (PHAR_GLOBALS->request_ends) {
/* first, iterate over the manifest and close all PHAR_TMP entry fp handles,
this prevents unnecessary unfreed stream resources */
- zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply TSRMLS_CC);
+ zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply);
destroy_phar_data_only(zv);
return;
}
- zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_alias_map), phar_unalias_apply, phar_data TSRMLS_CC);
+ zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_alias_map), phar_unalias_apply, phar_data);
if (--phar_data->refcount < 0) {
- phar_destroy_phar_data(phar_data TSRMLS_CC);
+ phar_destroy_phar_data(phar_data);
}
}
/* }}}*/
@@ -378,7 +376,6 @@ static void destroy_phar_data(zval *zv) /* {{{ */
*/
void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */
{
- TSRMLS_FETCH();
if (entry->cfp) {
php_stream_close(entry->cfp);
@@ -432,7 +429,7 @@ void destroy_phar_manifest_entry(zval *zv) /* {{{ */
}
/* }}} */
-int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
+int phar_entry_delref(phar_entry_data *idata) /* {{{ */
{
int ret = 0;
@@ -451,7 +448,7 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
}
}
- phar_archive_delref(idata->phar TSRMLS_CC);
+ phar_archive_delref(idata->phar);
efree(idata);
return ret;
}
@@ -460,7 +457,7 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
/**
* Removes an entry, either by actually removing it or by marking it.
*/
-void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
+void phar_entry_remove(phar_entry_data *idata, char **error) /* {{{ */
{
phar_archive_data *phar;
@@ -475,11 +472,11 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
efree(idata);
} else {
idata->internal_file->is_deleted = 1;
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
}
if (!phar->donotflush) {
- phar_flush(phar, 0, 0, 0, error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, error);
}
}
/* }}} */
@@ -496,7 +493,7 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
#define MAPPHAR_FAIL(msg) \
efree(savebuf);\
if (mydata) {\
- phar_destroy_phar_data(mydata TSRMLS_CC);\
+ phar_destroy_phar_data(mydata);\
}\
if (signature) {\
pefree(signature, PHAR_G(persist));\
@@ -532,7 +529,7 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
/**
* Open an already loaded phar
*/
-int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
#ifdef PHP_WIN32
@@ -546,14 +543,14 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
unixfname = estrndup(fname, fname_len);
phar_unixify_path_separators(unixfname, fname_len);
- if (SUCCESS == phar_get_archive(&phar, unixfname, fname_len, alias, alias_len, error TSRMLS_CC)
+ if (SUCCESS == phar_get_archive(&phar, unixfname, fname_len, alias, alias_len, error)
&& ((alias && fname_len == phar->fname_len
&& !strncmp(unixfname, phar->fname, fname_len)) || !alias)
) {
phar_entry_info *stub;
efree(unixfname);
#else
- if (SUCCESS == phar_get_archive(&phar, fname, fname_len, alias, alias_len, error TSRMLS_CC)
+ if (SUCCESS == phar_get_archive(&phar, fname, fname_len, alias, alias_len, error)
&& ((alias && fname_len == phar->fname_len
&& !strncmp(fname, phar->fname, fname_len)) || !alias)
) {
@@ -607,7 +604,7 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
*
* data is the serialized zval
*/
-int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRMLS_DC) /* {{{ */
+int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len) /* {{{ */
{
const unsigned char *p;
php_uint32 buf_len;
@@ -624,7 +621,7 @@ int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRM
p = (const unsigned char*) *buffer;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_ptr_dtor(metadata);
ZVAL_UNDEF(metadata);
@@ -662,7 +659,7 @@ int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRM
* This is used by phar_open_from_filename to process the manifest, but can be called
* directly.
*/
-static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, zend_long halt_offset, phar_archive_data** pphar, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
+static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, zend_long halt_offset, phar_archive_data** pphar, php_uint32 compression, char **error) /* {{{ */
{
char b32[4], *buffer, *endbuffer, *savebuf;
phar_archive_data *mydata = NULL;
@@ -823,7 +820,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname, &signature, &sig_len, error)) {
efree(savebuf);
efree(sig);
php_stream_close(fp);
@@ -853,7 +850,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -880,7 +877,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -918,7 +915,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -945,7 +942,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -1036,11 +1033,11 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
/* check whether we have meta data, zero check works regardless of byte order */
if (mydata->is_persistent) {
PHAR_GET_32(buffer, mydata->metadata_len);
- if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
} else {
- if (phar_parse_metadata(&buffer, &mydata->metadata, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &mydata->metadata, 0) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
}
@@ -1088,7 +1085,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
entry.is_dir = 0;
}
- phar_add_virtual_dirs(mydata, buffer, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(mydata, buffer, entry.filename_len);
entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent);
buffer += entry.filename_len;
PHAR_GET_32(buffer, entry.uncompressed_filesize);
@@ -1117,12 +1114,12 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
if (entry.is_persistent) {
PHAR_GET_32(buffer, entry.metadata_len);
if (!entry.metadata_len) buffer -= 4;
- if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
} else {
- if (phar_parse_metadata(&buffer, &entry.metadata, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &entry.metadata, 0) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
@@ -1176,7 +1173,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK);
/* if signature matched, no need to check CRC32 for each file */
entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0);
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
}
@@ -1204,7 +1201,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
mydata->fp = fp;
mydata->sig_len = sig_len;
mydata->signature = signature;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (register_alias) {
phar_archive_data *fd_ptr;
@@ -1218,7 +1215,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
}
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
signature = NULL;
fp = NULL;
MAPPHAR_FAIL("Cannot open archive \"%s\", alias is already in use by existing archive");
@@ -1244,7 +1241,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
/**
* Create or open a phar for writing
*/
-int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
const char *ext_str, *z;
char *my_error;
@@ -1258,12 +1255,12 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al
}
/* first try to open an existing file */
- if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, 1 TSRMLS_CC) == SUCCESS) {
+ if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, 1) == SUCCESS) {
goto check_file;
}
/* next try to create a new file */
- if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, 1)) {
if (error) {
if (ext_len == -2) {
spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname);
@@ -1274,7 +1271,7 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al
return FAILURE;
}
check_file:
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, test, &my_error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, test, &my_error) == SUCCESS) {
if (pphar) {
*pphar = *test;
}
@@ -1309,19 +1306,19 @@ check_file:
if (ext_len > 3 && (z = memchr(ext_str, 'z', ext_len)) && ((ext_str + ext_len) - z >= 2) && !memcmp(z + 1, "ip", 2)) {
/* assume zip-based phar */
- return phar_open_or_create_zip(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_open_or_create_zip(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
if (ext_len > 3 && (z = memchr(ext_str, 't', ext_len)) && ((ext_str + ext_len) - z >= 2) && !memcmp(z + 1, "ar", 2)) {
/* assume tar-based phar */
- return phar_open_or_create_tar(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_open_or_create_tar(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
- return phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
/* }}} */
-int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *mydata;
php_stream *fp;
@@ -1335,7 +1332,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
return FAILURE;
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -1348,7 +1345,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
}
if (fp) {
- if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == SUCCESS) {
if ((*pphar)->is_data || !PHAR_G(readonly)) {
(*pphar)->is_writeable = 1;
}
@@ -1380,7 +1377,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
/* set up our manifest */
mydata = ecalloc(1, sizeof(phar_archive_data));
- mydata->fname = expand_filepath(fname, NULL TSRMLS_CC);
+ mydata->fname = expand_filepath(fname, NULL);
fname_len = strlen(mydata->fname);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
@@ -1414,7 +1411,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
mydata->fp = NULL;
mydata->is_writeable = 1;
mydata->is_brandnew = 1;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_fname_map), mydata->fname, fname_len, mydata);
if (is_data) {
@@ -1427,7 +1424,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
phar_archive_data *fd_ptr;
if (alias && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias);
}
@@ -1475,7 +1472,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
* that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
* or FAILURE is returned and pphar is set to a pointer to the phar's manifest
*/
-int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
php_stream *fp;
char *actual;
@@ -1489,7 +1486,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
is_data = 1;
}
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, pphar, error) == SUCCESS) {
return SUCCESS;
} else if (error && *error) {
return FAILURE;
@@ -1499,7 +1496,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
return FAILURE;
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -1522,7 +1519,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
fname_len = strlen(actual);
}
- ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TSRMLS_CC);
+ ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error);
if (actual) {
efree(actual);
@@ -1566,7 +1563,7 @@ static inline char *phar_strnstr(const char *buf, int buf_len, const char *searc
* that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
* or FAILURE is returned and pphar is set to a pointer to the phar's manifest
*/
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error TSRMLS_DC) /* {{{ */
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error) /* {{{ */
{
const char token[] = "__HALT_COMPILER();";
const char zip_magic[] = "PK\x03\x04";
@@ -1626,12 +1623,12 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_rewind(fp);
- filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
if (!filter) {
err = 1;
add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS);
- filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -1654,7 +1651,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(fp);
fp = temp;
php_stream_rewind(fp);
@@ -1677,7 +1674,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_rewind(fp);
- filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
if (!filter) {
php_stream_close(temp);
@@ -1692,7 +1689,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(fp);
fp = temp;
php_stream_rewind(fp);
@@ -1705,20 +1702,20 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
if (!memcmp(pos, zip_magic, 4)) {
php_stream_seek(fp, 0, SEEK_END);
- return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error TSRMLS_CC);
+ return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error);
}
if (got > 512) {
if (phar_is_tar(pos, fname)) {
php_stream_rewind(fp);
- return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, error TSRMLS_CC);
+ return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, error);
}
}
}
if (got > 0 && (pos = phar_strnstr(buffer, got + sizeof(token), token, sizeof(token)-1)) != NULL) {
halt_offset += (pos - buffer); /* no -tokenlen+tokenlen here */
- return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression, error TSRMLS_CC);
+ return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression, error);
}
halt_offset += got;
@@ -1738,13 +1735,13 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
* if not, check to see if its dirname() exists (i.e. "/path/to") and is a directory
* succeed if we are creating the file, otherwise fail.
*/
-static int phar_analyze_path(const char *fname, const char *ext, int ext_len, int for_create TSRMLS_DC) /* {{{ */
+static int phar_analyze_path(const char *fname, const char *ext, int ext_len, int for_create) /* {{{ */
{
php_stream_statbuf ssb;
char *realpath;
char *filename = estrndup(fname, (ext - fname) + ext_len);
- if ((realpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if ((realpath = expand_filepath(filename, NULL))) {
#ifdef PHP_WIN32
phar_unixify_path_separators(realpath, strlen(realpath));
#endif
@@ -1791,7 +1788,7 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
if (SUCCESS != php_stream_stat_path((char *) filename, &ssb)) {
if (!slash) {
- if (!(realpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if (!(realpath = expand_filepath(filename, NULL))) {
efree(filename);
return FAILURE;
}
@@ -1840,7 +1837,7 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
/* }}} */
/* check for ".phar" in extension */
-static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create TSRMLS_DC) /* {{{ */
+static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create) /* {{{ */
{
char test[51];
const char *pos;
@@ -1859,7 +1856,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
if (pos && (*(pos - 1) != '/')
&& (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
} else {
return FAILURE;
}
@@ -1870,11 +1867,11 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
pos = strstr(ext_str, ".phar");
if (!(pos && (*(pos - 1) != '/')
&& (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) && *(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
}
} else {
if (*(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
}
}
@@ -1895,7 +1892,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
* the last parameter should be set to tell the thing to assume that filename is the full path, and only to check the
* extension rules, not to iterate.
*/
-int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete TSRMLS_DC) /* {{{ */
+int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete) /* {{{ */
{
const char *pos, *slash;
@@ -1906,7 +1903,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha
return FAILURE;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
/* first check for alias in first segment */
pos = memchr(filename, '/', filename_len);
@@ -2023,7 +2020,7 @@ next_extension:
*ext_len = strlen(pos);
/* file extension must contain "phar" */
- switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create TSRMLS_CC)) {
+ switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create)) {
case SUCCESS:
return SUCCESS;
case FAILURE:
@@ -2036,7 +2033,7 @@ next_extension:
*ext_str = pos;
*ext_len = slash - pos;
- switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create TSRMLS_CC)) {
+ switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create)) {
case SUCCESS:
return SUCCESS;
case FAILURE:
@@ -2075,7 +2072,7 @@ static int php_check_dots(const char *element, int n) /* {{{ */
/**
* Remove .. and . references within a phar filename
*/
-char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{ */
+char *phar_fix_filepath(char *path, int *new_len, int use_cwd) /* {{{ */
{
char newpath[MAXPATHLEN];
int newpath_len;
@@ -2183,7 +2180,7 @@ last_time:
*
* This is used by phar_parse_url()
*/
-int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC) /* {{{ */
+int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create) /* {{{ */
{
const char *ext_str;
#ifdef PHP_WIN32
@@ -2202,7 +2199,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
filename = estrndup(filename, filename_len);
phar_unixify_path_separators(filename, filename_len);
#endif
- if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0) == FAILURE) {
if (ext_len != -1) {
if (!ext_str) {
/* no / detected, restore arch for error message */
@@ -2232,7 +2229,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
#ifdef PHP_WIN32
phar_unixify_path_separators(*entry, *entry_len);
#endif
- *entry = phar_fix_filepath(*entry, entry_len, 0 TSRMLS_CC);
+ *entry = phar_fix_filepath(*entry, entry_len, 0);
} else {
*entry_len = 1;
*entry = estrndup("/", 1);
@@ -2250,7 +2247,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
* Invoked when a user calls Phar::mapPhar() from within an executing .phar
* to set up its manifest directly
*/
-int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
+int phar_open_executed_filename(char *alias, int alias_len, char **error) /* {{{ */
{
char *fname;
php_stream *fp;
@@ -2262,10 +2259,10 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
*error = NULL;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, 0, REPORT_ERRORS, NULL, 0 TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, 0, REPORT_ERRORS, NULL, 0) == SUCCESS) {
return SUCCESS;
}
@@ -2276,7 +2273,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
return FAILURE;
}
- if (0 == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1 TSRMLS_CC)) {
+ if (0 == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
if (error) {
spprintf(error, 0, "__HALT_COMPILER(); must be declared in a phar");
}
@@ -2290,7 +2287,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -2311,7 +2308,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
fname_len = strlen(actual);
}
- ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error TSRMLS_CC);
+ ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error);
if (actual) {
efree(actual);
@@ -2324,7 +2321,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
/**
* Validate the CRC32 of a file opened from within the phar
*/
-int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip TSRMLS_DC) /* {{{ */
+int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip) /* {{{ */
{
php_uint32 crc = ~0;
int len = idata->internal_file->uncompressed_filesize;
@@ -2340,13 +2337,13 @@ int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error
phar_zip_file_header local;
phar_zip_data_desc desc;
- if (SUCCESS != phar_open_archive_fp(idata->phar TSRMLS_CC)) {
+ if (SUCCESS != phar_open_archive_fp(idata->phar)) {
spprintf(error, 0, "phar error: unable to open zip-based phar archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
return FAILURE;
}
- php_stream_seek(phar_get_entrypfp(idata->internal_file TSRMLS_CC), entry->header_offset, SEEK_SET);
+ php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET);
- if (sizeof(local) != php_stream_read(phar_get_entrypfp(idata->internal_file TSRMLS_CC), (char *) &local, sizeof(local))) {
+ if (sizeof(local) != php_stream_read(phar_get_entrypfp(idata->internal_file), (char *) &local, sizeof(local))) {
spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
return FAILURE;
@@ -2354,12 +2351,12 @@ int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error
/* check for data descriptor */
if (((PHAR_ZIP_16(local.flags)) & 0x8) == 0x8) {
- php_stream_seek(phar_get_entrypfp(idata->internal_file TSRMLS_CC),
+ php_stream_seek(phar_get_entrypfp(idata->internal_file),
entry->header_offset + sizeof(local) +
PHAR_ZIP_16(local.filename_len) +
PHAR_ZIP_16(local.extra_len) +
entry->compressed_filesize, SEEK_SET);
- if (sizeof(desc) != php_stream_read(phar_get_entrypfp(idata->internal_file TSRMLS_CC),
+ if (sizeof(desc) != php_stream_read(phar_get_entrypfp(idata->internal_file),
(char *) &desc, sizeof(desc))) {
spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
return FAILURE;
@@ -2420,7 +2417,7 @@ static inline void phar_set_32(char *buffer, int var) /* {{{ */
#endif
} /* }}} */
-static int phar_flush_clean_deleted_apply(zval *zv TSRMLS_DC) /* {{{ */
+static int phar_flush_clean_deleted_apply(zval *zv) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
@@ -2434,7 +2431,7 @@ static int phar_flush_clean_deleted_apply(zval *zv TSRMLS_DC) /* {{{ */
#include "stub.h"
-char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error TSRMLS_DC) /* {{{ */
+char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error) /* {{{ */
{
char *stub = NULL;
int index_len, web_len;
@@ -2475,7 +2472,7 @@ char *phar_create_default_stub(const char *index_php, const char *web_index, siz
}
}
- phar_get_stub(index_php, web_index, len, &stub, index_len+1, web_len+1 TSRMLS_CC);
+ phar_get_stub(index_php, web_index, len, &stub, index_len+1, web_len+1);
return stub;
}
/* }}} */
@@ -2486,7 +2483,7 @@ char *phar_create_default_stub(const char *index_php, const char *web_index, siz
* user_stub contains either a string, or a resource pointer, if len is a negative length.
* user_stub and len should be both 0 if the default or existing stub should be used
*/
-int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int convert, char **error TSRMLS_DC) /* {{{ */
+int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int convert, char **error) /* {{{ */
{
char halt_stub[] = "__HALT_COMPILER();";
char *newstub, *tmp;
@@ -2524,11 +2521,11 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
zend_hash_clean(&phar->virtual_dirs);
if (phar->is_zip) {
- return phar_zip_flush(phar, user_stub, len, convert, error TSRMLS_CC);
+ return phar_zip_flush(phar, user_stub, len, convert, error);
}
if (phar->is_tar) {
- return phar_tar_flush(phar, user_stub, len, convert, error TSRMLS_CC);
+ return phar_tar_flush(phar, user_stub, len, convert, error);
}
if (PHAR_G(readonly)) {
@@ -2635,7 +2632,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
newstub = NULL;
} else {
/* this is either a brand new phar or a default stub overwrite */
- newstub = phar_create_default_stub(NULL, NULL, &(phar->halt_offset), NULL TSRMLS_CC);
+ newstub = phar_create_default_stub(NULL, NULL, &(phar->halt_offset), NULL);
written = php_stream_write(newfile, newstub, phar->halt_offset);
}
if (phar->halt_offset != written) {
@@ -2665,13 +2662,13 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
/* Check whether we can get rid of some of the deleted entries which are
* unused. However some might still be in use so even after this clean-up
* we need to skip entries marked is_deleted. */
- zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply TSRMLS_CC);
+ zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply);
/* compress as necessary, calculate crcs, serialize meta-data, manifest size, and file sizes */
main_metadata_str.s = NULL;
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
}
new_manifest_count = 0;
@@ -2705,7 +2702,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
/* after excluding deleted files, calculate manifest size in bytes and number of entries */
++new_manifest_count;
- phar_add_virtual_dirs(phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
if (entry->is_dir) {
/* we use this to calculate API version, 1.1.1 is used for phars with directories */
@@ -2717,7 +2714,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
} else {
if (entry->metadata_str.s) {
@@ -2737,9 +2734,9 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
continue;
}
- if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
+ if (!phar_get_efp(entry, 0)) {
/* re-open internal file pointer just-in-time */
- newentry = phar_open_jit(phar, entry, error TSRMLS_CC);
+ newentry = phar_open_jit(phar, entry, error);
if (!newentry) {
/* major problem re-opening, so we ignore this file and the error */
efree(*error);
@@ -2748,8 +2745,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
entry = newentry;
}
- file = phar_get_efp(entry, 0 TSRMLS_CC);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC)) {
+ file = phar_get_efp(entry, 0);
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -2771,7 +2768,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
entry->compressed_filesize = entry->uncompressed_filesize;
continue;
}
- filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
if (!filter) {
if (closeoldfile) {
php_stream_close(oldfile);
@@ -2804,7 +2801,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
return EOF;
}
php_stream_flush(file);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -2827,7 +2824,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
php_stream_filter_flush(filter, 1);
php_stream_flush(entry->cfp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_seek(entry->cfp, 0, SEEK_END);
entry->compressed_filesize = (php_uint32) php_stream_tell(entry->cfp);
/* generate crc on compressed file */
@@ -3021,8 +3018,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
file = entry->cfp;
php_stream_rewind(file);
} else {
- file = phar_get_efp(entry, 0 TSRMLS_CC);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ file = phar_get_efp(entry, 0);
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -3110,7 +3107,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
char *digest = NULL;
int digest_len;
- if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error)) {
if (error) {
char *save = *error;
spprintf(error, 0, "phar error: unable to write signature: %s", save);
@@ -3183,7 +3180,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
array_init(&filterparams);
add_assoc_long(&filterparams, "window", MAX_WBITS+16);
- filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -3196,16 +3193,16 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
- filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
@@ -3228,6 +3225,9 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
/* }}} */
#ifdef COMPILE_DL_PHAR
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(phar)
#endif
@@ -3240,26 +3240,26 @@ zend_function_entry phar_functions[] = {
};
/* }}}*/
-static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len TSRMLS_DC) /* {{{ */
+static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len) /* {{{ */
{
- return php_stream_read(phar_get_pharfp((phar_archive_data*)handle TSRMLS_CC), buf, len);
+ return php_stream_read(phar_get_pharfp((phar_archive_data*)handle), buf, len);
}
/* }}} */
-static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */
+static size_t phar_zend_stream_fsizer(void *handle) /* {{{ */
{
return ((phar_archive_data*)handle)->halt_offset + 32;
} /* }}} */
-zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
+zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type);
#define phar_orig_zend_open zend_stream_open_function
-static char *phar_resolve_path(const char *filename, int filename_len TSRMLS_DC)
+static char *phar_resolve_path(const char *filename, int filename_len)
{
- return phar_find_in_include_path((char *) filename, filename_len, NULL TSRMLS_CC);
+ return phar_find_in_include_path((char *) filename, filename_len, NULL);
}
-static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) /* {{{ */
+static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) /* {{{ */
{
zend_op_array *res;
char *name = NULL;
@@ -3267,16 +3267,16 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
phar_archive_data *phar;
if (!file_handle || !file_handle->filename) {
- return phar_orig_compile_file(file_handle, type TSRMLS_CC);
+ return phar_orig_compile_file(file_handle, type);
}
if (strstr(file_handle->filename, ".phar") && !strstr(file_handle->filename, "://")) {
- if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL)) {
if (phar->is_zip || phar->is_tar) {
zend_file_handle f = *file_handle;
/* zip or tar-based phar */
spprintf(&name, 4096, "phar://%s/%s", file_handle->filename, ".phar/stub.php");
- if (SUCCESS == phar_orig_zend_open((const char *)name, file_handle TSRMLS_CC)) {
+ if (SUCCESS == phar_orig_zend_open((const char *)name, file_handle)) {
efree(name);
name = NULL;
file_handle->filename = f.filename;
@@ -3308,7 +3308,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
zend_try {
failed = 0;
CG(zend_lineno) = 0;
- res = phar_orig_compile_file(file_handle, type TSRMLS_CC);
+ res = phar_orig_compile_file(file_handle, type);
} zend_catch {
failed = 1;
res = NULL;
@@ -3326,7 +3326,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
}
/* }}} */
-typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int TSRMLS_DC);
+typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int);
typedef zend_compile_t* (compile_hook)(zend_compile_t *ptr);
static void mime_type_dtor(zval *zv)
@@ -3336,6 +3336,9 @@ static void mime_type_dtor(zval *zv)
PHP_GINIT_FUNCTION(phar) /* {{{ */
{
+#if defined(COMPILE_DL_PHAR) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
phar_mime_type mime;
memset(phar_globals, 0, sizeof(zend_phar_globals));
@@ -3390,7 +3393,7 @@ PHP_GINIT_FUNCTION(phar) /* {{{ */
PHAR_SET_MIME("image/xbm", PHAR_MIME_OTHER, "xbm")
PHAR_SET_MIME("text/xml", PHAR_MIME_OTHER, "xml")
- phar_restore_orig_functions(TSRMLS_C);
+ phar_restore_orig_functions();
}
/* }}} */
@@ -3410,20 +3413,20 @@ PHP_MINIT_FUNCTION(phar) /* {{{ */
phar_save_resolve_path = zend_resolve_path;
zend_resolve_path = phar_resolve_path;
- phar_object_init(TSRMLS_C);
+ phar_object_init();
- phar_intercept_functions_init(TSRMLS_C);
- phar_save_orig_functions(TSRMLS_C);
+ phar_intercept_functions_init();
+ phar_save_orig_functions();
- return php_register_url_stream_wrapper("phar", &php_stream_phar_wrapper TSRMLS_CC);
+ return php_register_url_stream_wrapper("phar", &php_stream_phar_wrapper);
}
/* }}} */
PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
{
- php_unregister_url_stream_wrapper("phar" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("phar");
- phar_intercept_functions_shutdown(TSRMLS_C);
+ phar_intercept_functions_shutdown();
if (zend_compile_file == phar_compile_file) {
zend_compile_file = phar_orig_compile_file;
@@ -3438,7 +3441,7 @@ PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
}
/* }}} */
-void phar_request_initialize(TSRMLS_D) /* {{{ */
+void phar_request_initialize(void) /* {{{ */
{
if (!PHAR_GLOBALS->request_init)
{
@@ -3482,7 +3485,7 @@ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
if (PHAR_GLOBALS->request_init)
{
- phar_release_functions(TSRMLS_C);
+ phar_release_functions();
zend_hash_destroy(&(PHAR_GLOBALS->phar_alias_map));
PHAR_GLOBALS->phar_alias_map.arHash = NULL;
zend_hash_destroy(&(PHAR_GLOBALS->phar_fname_map));
@@ -3523,7 +3526,7 @@ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
PHP_MINFO_FUNCTION(phar) /* {{{ */
{
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
php_info_print_table_start();
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index f49143bc8c..fed80029f6 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -196,8 +196,11 @@ ZEND_EXTERN_MODULE_GLOBALS(phar)
#ifdef ZTS
# include "TSRM.h"
-# define PHAR_G(v) TSRMG(phar_globals_id, zend_phar_globals *, v)
-# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)])
+# ifdef COMPILE_DL_PHAR
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
+# define PHAR_G(v) ZEND_TSRMG(phar_globals_id, zend_phar_globals *, v)
+# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) ZEND_TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)])
#else
# define PHAR_G(v) (phar_globals.v)
# define PHAR_GLOBALS (&phar_globals)
@@ -343,7 +346,7 @@ struct _phar_entry_fp {
phar_entry_fp_info *manifest;
};
-static inline php_stream *phar_get_entrypfp(phar_entry_info *entry TSRMLS_DC)
+static inline php_stream *phar_get_entrypfp(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->phar->fp;
@@ -351,7 +354,7 @@ static inline php_stream *phar_get_entrypfp(phar_entry_info *entry TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].fp;
}
-static inline php_stream *phar_get_entrypufp(phar_entry_info *entry TSRMLS_DC)
+static inline php_stream *phar_get_entrypufp(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->phar->ufp;
@@ -359,7 +362,7 @@ static inline php_stream *phar_get_entrypufp(phar_entry_info *entry TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].ufp;
}
-static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp TSRMLS_DC)
+static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp)
{
if (!entry->phar->is_persistent) {
entry->phar->fp = fp;
@@ -369,7 +372,7 @@ static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp TSRM
PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].fp = fp;
}
-static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp TSRMLS_DC)
+static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp)
{
if (!entry->phar->is_persistent) {
entry->phar->ufp = fp;
@@ -379,7 +382,7 @@ static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp TSR
PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].ufp = fp;
}
-static inline php_stream *phar_get_pharfp(phar_archive_data *phar TSRMLS_DC)
+static inline php_stream *phar_get_pharfp(phar_archive_data *phar)
{
if (!phar->is_persistent) {
return phar->fp;
@@ -387,7 +390,7 @@ static inline php_stream *phar_get_pharfp(phar_archive_data *phar TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[phar->phar_pos].fp;
}
-static inline php_stream *phar_get_pharufp(phar_archive_data *phar TSRMLS_DC)
+static inline php_stream *phar_get_pharufp(phar_archive_data *phar)
{
if (!phar->is_persistent) {
return phar->ufp;
@@ -395,7 +398,7 @@ static inline php_stream *phar_get_pharufp(phar_archive_data *phar TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[phar->phar_pos].ufp;
}
-static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp TSRMLS_DC)
+static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp)
{
if (!phar->is_persistent) {
phar->fp = fp;
@@ -405,7 +408,7 @@ static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp TSRML
PHAR_GLOBALS->cached_fp[phar->phar_pos].fp = fp;
}
-static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp TSRMLS_DC)
+static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp)
{
if (!phar->is_persistent) {
phar->ufp = fp;
@@ -415,7 +418,7 @@ static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp TSRM
PHAR_GLOBALS->cached_fp[phar->phar_pos].ufp = fp;
}
-static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zend_off_t offset TSRMLS_DC)
+static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zend_off_t offset)
{
phar_entry_fp_info *data;
@@ -429,7 +432,7 @@ static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type ty
data->offset = offset;
}
-static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry TSRMLS_DC)
+static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->fp_type;
@@ -437,7 +440,7 @@ static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry TSRMLS_D
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type;
}
-static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry TSRMLS_DC)
+static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->offset;
@@ -492,7 +495,7 @@ union _phar_entry_object {
#endif
#ifndef PHAR_MAIN
-extern char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+extern char *(*phar_save_resolve_path)(const char *filename, int filename_len);
#endif
BEGIN_EXTERN_C()
@@ -522,7 +525,7 @@ static inline int phar_validate_alias(const char *alias, int alias_len) /* {{{ *
}
/* }}} */
-static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+static inline void phar_set_inode(phar_entry_info *entry) /* {{{ */
{
char tmp[MAXPATHLEN];
int tmp_len;
@@ -534,75 +537,75 @@ static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
}
/* }}} */
-void phar_request_initialize(TSRMLS_D);
+void phar_request_initialize(void);
-void phar_object_init(TSRMLS_D);
-void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC);
+void phar_object_init(void);
+void phar_destroy_phar_data(phar_archive_data *phar);
-int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip TSRMLS_DC);
-int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_DC);
-int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC);
-int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC);
-int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error TSRMLS_DC);
-int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC);
+int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip);
+int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error);
+int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_open_executed_filename(char *alias, int alias_len, char **error);
+int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len);
+int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error);
+int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error);
+int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error);
/* utility functions */
-char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error TSRMLS_DC);
+char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error);
char *phar_decompress_filter(phar_entry_info * entry, int return_unknown);
char *phar_compress_filter(phar_entry_info * entry, int return_unknown);
-void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC);
-void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC);
-int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len TSRMLS_DC);
-char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar TSRMLS_DC);
-char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC);
-phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRMLS_DC);
+void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
+void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
+int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len);
+char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar);
+char *phar_fix_filepath(char *path, int *new_len, int use_cwd);
+phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len);
void destroy_phar_manifest_entry(zval *zv);
-int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC);
-php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC);
-int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC);
-int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TSRMLS_DC);
-phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC);
-int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC);
-int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC);
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links);
+php_stream *phar_get_efp(phar_entry_info *entry, int follow_links);
+int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error);
+int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links);
+phar_entry_info *phar_get_link_source(phar_entry_info *entry);
+int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_separate_entry_fp(phar_entry_info *entry, char **error);
+int phar_open_archive_fp(phar_archive_data *phar);
+int phar_copy_on_write(phar_archive_data **pphar);
/* tar functions in tar.c */
int phar_is_tar(char *buf, char *fname);
-int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC);
-int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC);
+int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error);
+int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error);
/* zip functions in zip.c */
-int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_zip_flush(phar_archive_data *archive, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC);
+int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error);
+int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_zip_flush(phar_archive_data *archive, char *user_stub, zend_long len, int defaultstub, char **error);
#ifdef PHAR_MAIN
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error TSRMLS_DC);
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error);
extern php_stream_wrapper php_stream_phar_wrapper;
#else
extern HashTable cached_phars;
extern HashTable cached_alias;
#endif
-int phar_archive_delref(phar_archive_data *phar TSRMLS_DC);
-int phar_entry_delref(phar_entry_data *idata TSRMLS_DC);
+int phar_archive_delref(phar_archive_data *phar);
+int phar_entry_delref(phar_entry_data *idata);
-phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC);
-phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC);
-phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC);
-int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC);
-int phar_flush(phar_archive_data *archive, char *user_stub, zend_long len, int convert, char **error TSRMLS_DC);
-int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete TSRMLS_DC);
-int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC);
+phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security);
+phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security);
+phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security);
+int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security);
+int phar_flush(phar_archive_data *archive, char *user_stub, zend_long len, int convert, char **error);
+int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete);
+int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create);
typedef enum {
pcr_use_query,
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index b6ce546086..737ec97852 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -36,7 +36,7 @@ static zend_class_entry *phar_ce_entry;
# define PHAR_ARG_INFO static
#endif
-static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_DC) /* {{{ */
+static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ */
{
char *ext;
phar_mime_type *mime;
@@ -56,7 +56,7 @@ static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_
}
/* }}} */
-static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len TSRMLS_DC) /* {{{ */
+static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len) /* {{{ */
{
HashTable *_SERVER;
zval *stuff;
@@ -142,7 +142,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
}
/* }}} */
-static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */
+static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len) /* {{{ */
{
char *name = NULL, buf[8192];
const char *cwd;
@@ -168,7 +168,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file(name, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file(name, &syntax_highlighter_ini);
efree(name);
#ifdef PHP_WIN32
@@ -179,32 +179,32 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
/* send headers, output file contents */
efree(basename);
ctr.line_len = spprintf(&(ctr.line), 0, "Content-type: %s", mime_type);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
efree(ctr.line);
ctr.line_len = spprintf(&(ctr.line), 0, "Content-length: %u", info->uncompressed_filesize);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
efree(ctr.line);
- if (FAILURE == sapi_send_headers(TSRMLS_C)) {
+ if (FAILURE == sapi_send_headers()) {
zend_bailout();
}
/* prepare to output */
- fp = phar_get_efp(info, 1 TSRMLS_CC);
+ fp = phar_get_efp(info, 1);
if (!fp) {
char *error;
- if (!phar_open_jit(phar, info, &error TSRMLS_CC)) {
+ if (!phar_open_jit(phar, info, &error)) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
return -1;
}
- fp = phar_get_efp(info, 1 TSRMLS_CC);
+ fp = phar_get_efp(info, 1);
}
position = 0;
- phar_seek_efp(info, 0, SEEK_SET, 0, 1 TSRMLS_CC);
+ phar_seek_efp(info, 0, SEEK_SET, 0, 1);
do {
got = php_stream_read(fp, buf, MIN(8192, info->uncompressed_filesize - position));
@@ -220,7 +220,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
zend_bailout();
case PHAR_MIME_PHP:
if (basename) {
- phar_mung_server_vars(arch, entry, entry_len, basename, ru_len TSRMLS_CC);
+ phar_mung_server_vars(arch, entry, entry_len, basename, ru_len);
efree(basename);
}
@@ -256,13 +256,13 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
}
- new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE);
if (!new_op_array) {
zend_hash_str_del(&EG(included_files), name, name_len);
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
} else {
efree(name);
@@ -275,7 +275,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
ZVAL_UNDEF(&result);
zend_try {
- zend_execute(new_op_array, &result TSRMLS_CC);
+ zend_execute(new_op_array, &result);
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));
PHAR_G(cwd) = NULL;
@@ -284,7 +284,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
PHAR_G(cwd_init) = 0;
efree(name);
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree(new_op_array);
zval_ptr_dtor(&result);
} zend_catch {
@@ -307,31 +307,31 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
/* }}} */
-static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
+static void phar_do_403(char *entry, int entry_len) /* {{{ */
{
sapi_header_line ctr = {0};
ctr.response_code = 403;
ctr.line_len = sizeof("HTTP/1.0 403 Access Denied")-1;
ctr.line = "HTTP/1.0 403 Access Denied";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
PHPWRITE("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ", sizeof("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ") - 1);
PHPWRITE(entry, entry_len);
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
}
/* }}} */
-static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len TSRMLS_DC) /* {{{ */
+static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len) /* {{{ */
{
sapi_header_line ctr = {0};
phar_entry_info *info;
if (phar && f404_len) {
- info = phar_get_entry_info(phar, f404, f404_len, NULL, 1 TSRMLS_CC);
+ info = phar_get_entry_info(phar, f404, f404_len, NULL, 1);
if (info) {
- phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0 TSRMLS_CC);
+ phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0);
return;
}
}
@@ -339,8 +339,8 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
ctr.response_code = 404;
ctr.line_len = sizeof("HTTP/1.0 404 Not Found")-1;
ctr.line = "HTTP/1.0 404 Not Found";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
PHPWRITE("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ", sizeof("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ") - 1);
PHPWRITE(entry, entry_len);
PHPWRITE(" Not Found</h1>\n </body>\n</html>", sizeof(" Not Found</h1>\n </body>\n</html>") - 1);
@@ -350,7 +350,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
-static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char **ru, int *ru_len TSRMLS_DC) /* {{{ */
+static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char **ru, int *ru_len) /* {{{ */
{
char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL;
int e_len = *entry_len - 1, u_len = 0;
@@ -421,14 +421,14 @@ PHP_METHOD(Phar, running)
int fname_len, arch_len, entry_len;
zend_bool retphar = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &retphar) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) {
return;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
if (retphar) {
RETVAL_STRINGL(fname, arch_len + 7);
@@ -459,35 +459,35 @@ PHP_METHOD(Phar, mount)
size_t path_len, actual_len;
phar_archive_data *pphar;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &actual, &actual_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &path, &path_len, &actual, &actual_len) == FAILURE) {
return;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
#ifdef PHP_WIN32
phar_unixify_path_separators(fname, fname_len);
#endif
- if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
entry = NULL;
if (path_len > 7 && !memcmp(path, "phar://", 7)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path);
efree(arch);
return;
}
carry_on2:
if (NULL == (pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len))) {
if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, arch, arch_len))) {
- if (SUCCESS == phar_copy_on_write(&pphar TSRMLS_CC)) {
+ if (SUCCESS == phar_copy_on_write(&pphar)) {
goto carry_on;
}
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s is not a phar archive, cannot mount", arch);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s is not a phar archive, cannot mount", arch);
if (arch) {
efree(arch);
@@ -495,8 +495,8 @@ carry_on2:
return;
}
carry_on:
- if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Mounting of %s to %s within phar %s failed", path, actual, arch);
+ if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch);
if (path && path == entry) {
efree(entry);
}
@@ -520,18 +520,18 @@ carry_on:
} else if (PHAR_GLOBALS->phar_fname_map.arHash && NULL != (pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), fname, fname_len))) {
goto carry_on;
} else if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, fname, fname_len))) {
- if (SUCCESS == phar_copy_on_write(&pphar TSRMLS_CC)) {
+ if (SUCCESS == phar_copy_on_write(&pphar)) {
goto carry_on;
}
goto carry_on;
- } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
path = entry;
path_len = entry_len;
goto carry_on2;
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Mounting of %s to %s failed", path, actual);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s failed", path, actual);
}
/* }}} */
@@ -556,17 +556,17 @@ PHP_METHOD(Phar, webPhar)
phar_entry_info *info = NULL;
size_t sapi_mod_name_len = strlen(sapi_module.name);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ phar_request_initialize();
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) {
+ if (phar_open_executed_filename(alias, alias_len, &error) != SUCCESS) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
return;
@@ -622,13 +622,13 @@ PHP_METHOD(Phar, webPhar)
} else {
char *testit;
- testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC);
+ testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1);
if (!(pt = strstr(testit, basename))) {
efree(testit);
return;
}
- path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
+ path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1);
if (path_info) {
entry = path_info;
@@ -668,8 +668,8 @@ PHP_METHOD(Phar, webPhar)
ZVAL_STRINGL(&params, entry, entry_len);
- if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: invalid rewrite callback");
+ if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: invalid rewrite callback");
if (free_pathinfo) {
efree(path_info);
@@ -683,9 +683,9 @@ PHP_METHOD(Phar, webPhar)
Z_ADDREF(params);
fci.retval = &retval;
- if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) {
+ if (FAILURE == zend_call_function(&fci, &fcc)) {
if (!EG(exception)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: failed to call rewrite callback");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback");
}
if (free_pathinfo) {
@@ -699,7 +699,7 @@ PHP_METHOD(Phar, webPhar)
if (free_pathinfo) {
efree(path_info);
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: rewrite callback must return a string or false");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
return;
}
@@ -711,7 +711,7 @@ PHP_METHOD(Phar, webPhar)
break;
case IS_TRUE:
case IS_FALSE:
- phar_do_403(entry, entry_len TSRMLS_CC);
+ phar_do_403(entry, entry_len);
if (free_pathinfo) {
efree(path_info);
@@ -724,13 +724,13 @@ PHP_METHOD(Phar, webPhar)
efree(path_info);
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: rewrite callback must return a string or false");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
return;
}
}
if (entry_len) {
- phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len TSRMLS_CC);
+ phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len);
}
if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
@@ -749,9 +749,9 @@ PHP_METHOD(Phar, webPhar)
entry_len = sizeof("/index.php")-1;
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL TSRMLS_CC) ||
- (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
- phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
+ (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
+ phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
if (free_pathinfo) {
efree(path_info);
@@ -764,7 +764,7 @@ PHP_METHOD(Phar, webPhar)
ctr.response_code = 301;
ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")-1;
ctr.line = "HTTP/1.1 301 Moved Permanently";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
if (not_cgi) {
tmp = strstr(path_info, basename) + fname_len;
@@ -788,16 +788,16 @@ PHP_METHOD(Phar, webPhar)
efree(path_info);
}
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
efree(ctr.line);
zend_bailout();
}
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL TSRMLS_CC) ||
- (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
- phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
+ (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
+ phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -818,7 +818,7 @@ PHP_METHOD(Phar, webPhar)
mime_type = "";
code = Z_LVAL_P(val);
} else {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed");
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -830,7 +830,7 @@ PHP_METHOD(Phar, webPhar)
code = PHAR_MIME_OTHER;
break;
default:
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed");
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -841,9 +841,9 @@ PHP_METHOD(Phar, webPhar)
}
if (!mime_type) {
- code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC);
+ code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type);
}
- phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len TSRMLS_CC);
+ phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len);
}
/* }}} */
@@ -857,26 +857,26 @@ PHP_METHOD(Phar, mungServer)
{
zval *mungvalues, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &mungvalues) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &mungvalues) == FAILURE) {
return;
}
if (!zend_hash_num_elements(Z_ARRVAL_P(mungvalues))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
if (zend_hash_num_elements(Z_ARRVAL_P(mungvalues)) > 4) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(mungvalues), data) {
if (Z_TYPE_P(data) != IS_STRING) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
@@ -913,7 +913,7 @@ PHP_METHOD(Phar, interceptFileFuncs)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- phar_intercept_functions(TSRMLS_C);
+ phar_intercept_functions();
}
/* }}} */
@@ -928,14 +928,14 @@ PHP_METHOD(Phar, createDefaultStub)
size_t index_len = 0, webindex_len = 0;
size_t stub_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ss", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
return;
}
- stub = phar_create_default_stub(index, webindex, &stub_len, &error TSRMLS_CC);
+ stub = phar_create_default_stub(index, webindex, &stub_len, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
return;
}
@@ -953,16 +953,16 @@ PHP_METHOD(Phar, mapPhar)
size_t alias_len = 0;
zend_long dataoffset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
- RETVAL_BOOL(phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_open_executed_filename(alias, alias_len, &error) == SUCCESS);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} /* }}} */
@@ -974,16 +974,16 @@ PHP_METHOD(Phar, loadPhar)
char *fname, *alias = NULL, *error;
size_t fname_len, alias_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
- RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, &error TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, &error) == SUCCESS);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} /* }}} */
@@ -1005,11 +1005,11 @@ PHP_METHOD(Phar, canCompress)
{
zend_long method = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &method) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
switch (method) {
case PHAR_ENT_COMPRESSED_GZ:
if (PHAR_G(has_zlib)) {
@@ -1054,12 +1054,12 @@ PHP_METHOD(Phar, isValidPharFilename)
int ext_len, is_executable;
zend_bool executable = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &fname, &fname_len, &executable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &fname, &fname_len, &executable) == FAILURE) {
return;
}
is_executable = executable;
- RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1 TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS);
}
/* }}} */
@@ -1067,12 +1067,12 @@ PHP_METHOD(Phar, isValidPharFilename)
/**
* from spl_directory
*/
-static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{{ */
+static void phar_spl_foreign_dtor(spl_filesystem_object *object) /* {{{ */
{
phar_archive_data *phar = (phar_archive_data *) object->oth;
if (!phar->is_persistent) {
- phar_archive_delref(phar TSRMLS_CC);
+ phar_archive_delref(phar);
}
object->oth = NULL;
@@ -1082,7 +1082,7 @@ static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{
/**
* from spl_directory
*/
-static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC) /* {{{ */
+static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *) dst->oth;
@@ -1110,7 +1110,7 @@ static spl_other_handler phar_spl_foreign_handler = {
PHP_METHOD(Phar, __construct)
{
#if !HAVE_SPL
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Cannot instantiate Phar object without SPL extension");
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Cannot instantiate Phar object without SPL extension");
#else
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
size_t fname_len, alias_len = 0;
@@ -1123,25 +1123,25 @@ PHP_METHOD(Phar, __construct)
phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
- is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data TSRMLS_CC);
+ is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data);
if (is_data) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!l", &fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ls!l", &fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!", &fname, &fname_len, &flags, &alias, &alias_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ls!", &fname, &fname_len, &flags, &alias, &alias_len) == FAILURE) {
return;
}
}
if (phar_obj->archive) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot call constructor twice");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice");
return;
}
save_fname = fname;
- if (SUCCESS == phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, 2 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, 2)) {
/* use arch (the basename for the archive) for fname instead of fname */
/* this allows support for RecursiveDirectoryIterator of subdirectories */
#ifdef PHP_WIN32
@@ -1158,7 +1158,7 @@ PHP_METHOD(Phar, __construct)
#endif
}
- if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error TSRMLS_CC) == FAILURE) {
+ if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error) == FAILURE) {
if (fname == arch && fname != save_fname) {
efree(arch);
@@ -1170,11 +1170,11 @@ PHP_METHOD(Phar, __construct)
}
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"%s", error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Phar creation or opening failed");
}
@@ -1193,10 +1193,10 @@ PHP_METHOD(Phar, __construct)
if ((is_data && !phar_data->is_data) || (!is_data && phar_data->is_data)) {
if (is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"PharData class can only be used for non-executable tar and zip archives");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Phar class can only be used for executable tar and zip archives");
}
efree(entry);
@@ -1277,7 +1277,7 @@ PHP_METHOD(Phar, getSupportedCompression)
}
array_init(return_value);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (PHAR_G(has_zlib)) {
add_next_index_stringl(return_value, "GZ", 2);
@@ -1299,31 +1299,31 @@ PHP_METHOD(Phar, unlinkArchive)
int zname_len, arch_len, entry_len;
phar_archive_data *phar;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
RETURN_FALSE;
}
if (!fname_len) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"\"");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"\"");
return;
}
- if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error TSRMLS_CC)) {
+ if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error)) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"%s\": %s", fname, error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\": %s", fname, error);
efree(error);
} else {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"%s\"", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\"", fname);
}
return;
}
- zname = (char*)zend_get_executed_filename(TSRMLS_C);
+ zname = (char*)zend_get_executed_filename();
zname_len = strlen(zname);
- if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" cannot be unlinked from within itself", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname);
efree(arch);
efree(entry);
return;
@@ -1333,12 +1333,12 @@ PHP_METHOD(Phar, unlinkArchive)
}
if (phar->is_persistent) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" is in phar.cache_list, cannot unlinkArchive()", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" is in phar.cache_list, cannot unlinkArchive()", fname);
return;
}
if (phar->refcount) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", fname);
return;
}
@@ -1348,7 +1348,7 @@ PHP_METHOD(Phar, unlinkArchive)
PHAR_G(last_phar) = NULL;
PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL;
- phar_archive_delref(phar TSRMLS_CC);
+ phar_archive_delref(phar);
unlink(fname);
efree(fname);
RETURN_TRUE;
@@ -1361,7 +1361,7 @@ PHP_METHOD(Phar, unlinkArchive)
zval *zobj = getThis(); \
phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!phar_obj->archive) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Cannot call method on an uninitialized Phar object"); \
return; \
}
@@ -1390,7 +1390,7 @@ struct _phar_t {
int count;
};
-static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *value;
zend_bool close_fp = 1;
@@ -1405,7 +1405,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
phar_archive_object *phar_obj = p_obj->p;
char *str = "[stream]";
- value = iter->funcs->get_current_data(iter TSRMLS_CC);
+ value = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1413,7 +1413,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
if (!value) {
/* failure in get_current_data */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned no value", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned no value", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1424,13 +1424,13 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
php_stream_from_zval_no_verify(fp, value);
if (!fp) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returned an invalid stream handle", ce->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returned an invalid stream handle", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1438,7 +1438,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
if (Z_TYPE(key) != IS_STRING) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1448,7 +1448,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
save = str_key;
zval_dtor(&key);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1456,21 +1456,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
opened = (char *) estrndup(str, sizeof("[stream]") - 1);
goto after_open_fp;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo)) {
char *test = NULL;
zval dummy;
spl_filesystem_object *intern = (spl_filesystem_object*)((char*)Z_OBJ_P(value) - Z_OBJ_P(value)->handlers->offset);
if (!base_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
switch (intern->type) {
case SPL_FS_DIR:
- test = spl_filesystem_object_get_path(intern, NULL TSRMLS_CC);
+ test = spl_filesystem_object_get_path(intern, NULL);
fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name);
- php_stat(fname, fname_len, FS_IS_DIR, &dummy TSRMLS_CC);
+ php_stat(fname, fname_len, FS_IS_DIR, &dummy);
if (Z_TYPE(dummy) == IS_TRUE) {
/* ignore directories */
@@ -1478,14 +1478,14 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
return ZEND_HASH_APPLY_KEEP;
}
- test = expand_filepath(fname, NULL TSRMLS_CC);
+ test = expand_filepath(fname, NULL);
efree(fname);
if (test) {
fname = test;
fname_len = strlen(fname);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
return ZEND_HASH_APPLY_STOP;
}
@@ -1493,9 +1493,9 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
goto phar_spl_fileinfo;
case SPL_FS_INFO:
case SPL_FS_FILE:
- fname = expand_filepath(intern->file_name, NULL TSRMLS_CC);
+ fname = expand_filepath(intern->file_name, NULL);
if (!fname) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
return ZEND_HASH_APPLY_STOP;
}
@@ -1506,7 +1506,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
/* fall-through */
default:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid value (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid value (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1515,9 +1515,9 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
phar_spl_fileinfo:
if (base_len) {
- temp = expand_filepath(base, NULL TSRMLS_CC);
+ temp = expand_filepath(base, NULL);
if (!temp) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
if (save) {
efree(save);
}
@@ -1546,7 +1546,7 @@ phar_spl_fileinfo:
}
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name->val, fname, base);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name->val, fname, base);
if (save) {
efree(save);
@@ -1558,7 +1558,7 @@ phar_spl_fileinfo:
} else {
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1566,7 +1566,7 @@ phar_spl_fileinfo:
if (Z_TYPE(key) != IS_STRING) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1576,13 +1576,13 @@ phar_spl_fileinfo:
save = str_key;
zval_dtor(&key);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name->val, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name->val, fname);
if (save) {
efree(save);
@@ -1596,8 +1596,8 @@ phar_spl_fileinfo:
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name->val, fname);
+ if (php_check_open_basedir(fname)) {
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name->val, fname);
if (save) {
efree(save);
@@ -1614,7 +1614,7 @@ phar_spl_fileinfo:
fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened);
if (!fp) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a file that could not be opened \"%s\"", ce->name->val, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a file that could not be opened \"%s\"", ce->name->val, fname);
if (save) {
efree(save);
@@ -1648,8 +1648,8 @@ after_open_fp:
return ZEND_HASH_APPLY_KEEP;
}
- if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, 1 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s cannot be created: %s", str_key, error);
+ if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, 1))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s cannot be created: %s", str_key, error);
efree(error);
if (save) {
@@ -1705,7 +1705,7 @@ after_open_fp:
}
data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize = contents_len;
- phar_entry_delref(data TSRMLS_CC);
+ phar_entry_delref(data);
return ZEND_HASH_APPLY_KEEP;
}
@@ -1728,18 +1728,18 @@ PHP_METHOD(Phar, buildFromDirectory)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write to archive - write operations restricted by INI setting");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &dir, &dir_len, &regex, &regex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &dir, &dir_len, &regex, &regex_len) == FAILURE) {
RETURN_FALSE;
}
if (SUCCESS != object_init_ex(&iter, spl_ce_RecursiveDirectoryIterator)) {
zval_ptr_dtor(&iter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1758,7 +1758,7 @@ PHP_METHOD(Phar, buildFromDirectory)
if (SUCCESS != object_init_ex(&iteriter, spl_ce_RecursiveIteratorIterator)) {
zval_ptr_dtor(&iter);
zval_ptr_dtor(&iteriter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1779,7 +1779,7 @@ PHP_METHOD(Phar, buildFromDirectory)
if (SUCCESS != object_init_ex(&regexiter, spl_ce_RegexIterator)) {
zval_ptr_dtor(&iteriter);
zval_dtor(&regexiter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1800,21 +1800,21 @@ PHP_METHOD(Phar, buildFromDirectory)
pass.ret = return_value;
pass.fp = php_stream_fopen_tmpfile();
if (pass.fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname);
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
zval_ptr_dtor(&iteriter);
if (apply_reg) {
zval_ptr_dtor(&regexiter);
}
php_stream_close(pass.fp);
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- if (SUCCESS == spl_iterator_apply((apply_reg ? &regexiter : &iteriter), (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) {
+ if (SUCCESS == spl_iterator_apply((apply_reg ? &regexiter : &iteriter), (spl_iterator_apply_func_t) phar_build, (void *) &pass)) {
zval_ptr_dtor(&iteriter);
if (apply_reg) {
@@ -1822,10 +1822,10 @@ PHP_METHOD(Phar, buildFromDirectory)
}
phar_obj->archive->ufp = pass.fp;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -1860,17 +1860,17 @@ PHP_METHOD(Phar, buildFromIterator)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
RETURN_FALSE;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
@@ -1884,15 +1884,15 @@ PHP_METHOD(Phar, buildFromIterator)
pass.count = 0;
pass.fp = php_stream_fopen_tmpfile();
if (pass.fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname);
return;
}
- if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) {
+ if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass)) {
phar_obj->archive->ufp = pass.fp;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} else {
@@ -1910,7 +1910,7 @@ PHP_METHOD(Phar, count)
zend_long mode;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -1927,7 +1927,7 @@ PHP_METHOD(Phar, isFileFormat)
zend_long type;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
RETURN_FALSE;
}
@@ -1939,40 +1939,40 @@ PHP_METHOD(Phar, isFileFormat)
case PHAR_FORMAT_PHAR:
RETURN_BOOL(!phar_obj->archive->is_tar && !phar_obj->archive->is_zip);
default:
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown file format specified");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown file format specified");
}
}
/* }}} */
-static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */
+static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp) /* {{{ */
{
char *error;
zend_off_t offset;
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(entry, &error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, &error, 1)) {
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, entry->filename, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents", entry->phar->fname, entry->filename);
}
return FAILURE;
}
/* copy old contents in entirety */
- phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 1);
offset = php_stream_tell(fp);
- link = phar_get_link_source(entry TSRMLS_CC);
+ link = phar_get_link_source(entry);
if (!link) {
link = entry;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), fp, link->uncompressed_filesize, NULL)) {
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filename);
return FAILURE;
}
@@ -1990,7 +1990,7 @@ static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS
}
/* }}} */
-static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */
+static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress) /* {{{ */
{
const char *oldname = NULL;
char *oldpath = NULL;
@@ -2054,9 +2054,9 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
} else if (phar_path_check(&ext, &ext_len, &pcr_error) > pcr_is_ok) {
if (phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
}
return NULL;
}
@@ -2085,7 +2085,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, newpath, phar->fname_len))) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", phar->fname);
return NULL;
}
@@ -2098,7 +2098,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
pphar->flags = phar->flags;
pphar->fp = phar->fp;
phar->fp = NULL;
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
phar = pphar;
phar->refcount++;
newpath = oldpath;
@@ -2107,19 +2107,19 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
}
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", phar->fname);
return NULL;
}
its_ok:
if (SUCCESS == php_stream_stat_path(newpath, &ssb)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
return NULL;
}
if (!phar->is_data) {
- if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 1, 1, 1 TSRMLS_CC)) {
+ if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 1, 1, 1)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", phar->fname, ext);
return NULL;
}
@@ -2137,9 +2137,9 @@ its_ok:
} else {
- if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 0, 1, 1 TSRMLS_CC)) {
+ if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 0, 1, 1)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", phar->fname, ext);
return NULL;
}
@@ -2149,14 +2149,14 @@ its_ok:
if ((!pphar || phar == pphar) && NULL == zend_hash_str_update_ptr(&(PHAR_GLOBALS->phar_fname_map), newpath, phar->fname_len, phar)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars", phar->fname);
return NULL;
}
- phar_flush(phar, 0, 0, 1, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 1, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
efree(oldpath);
return NULL;
@@ -2173,7 +2173,7 @@ its_ok:
ZVAL_NULL(&ret);
if (SUCCESS != object_init_ex(&ret, ce)) {
zval_dtor(&ret);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
return NULL;
}
@@ -2185,7 +2185,7 @@ its_ok:
}
/* }}} */
-static zend_object *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags TSRMLS_DC) /* {{{ */
+static zend_object *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry, newentry;
@@ -2221,7 +2221,7 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert
phar->fp = php_stream_fopen_tmpfile();
if (phar->fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "unable to create temporary file");
return NULL;
}
phar->fname = source->fname;
@@ -2251,7 +2251,7 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert
newentry.metadata_str.s = NULL;
- if (FAILURE == phar_copy_file_contents(&newentry, phar->fp TSRMLS_CC)) {
+ if (FAILURE == phar_copy_file_contents(&newentry, phar->fp)) {
zend_hash_destroy(&(phar->manifest));
php_stream_close(phar->fp);
efree(phar);
@@ -2276,12 +2276,12 @@ no_copy:
newentry.is_modified = 1;
newentry.phar = phar;
newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */
- phar_set_inode(&newentry TSRMLS_CC);
+ phar_set_inode(&newentry);
zend_hash_str_add_mem(&(phar->manifest), newentry.filename, newentry.filename_len, (void*)&newentry, sizeof(phar_entry_info));
- phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len);
} ZEND_HASH_FOREACH_END();
- if ((ret = phar_rename_archive(phar, ext, 0 TSRMLS_CC))) {
+ if ((ret = phar_rename_archive(phar, ext, 0))) {
return ret;
} else {
zend_hash_destroy(&(phar->manifest));
@@ -2311,12 +2311,12 @@ PHP_METHOD(Phar, convertToExecutable)
zend_long format = 9021976, method = 9021976;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out executable phar archive, phar is read-only");
return;
}
@@ -2338,7 +2338,7 @@ PHP_METHOD(Phar, convertToExecutable)
case PHAR_FORMAT_ZIP:
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP");
return;
}
@@ -2352,13 +2352,13 @@ PHP_METHOD(Phar, convertToExecutable)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -2367,13 +2367,13 @@ PHP_METHOD(Phar, convertToExecutable)
break;
case PHAR_ENT_COMPRESSED_BZ2:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
@@ -2381,14 +2381,14 @@ PHP_METHOD(Phar, convertToExecutable)
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
is_data = phar_obj->archive->is_data;
phar_obj->archive->is_data = 0;
- ret = phar_convert_to_other(phar_obj->archive, format, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, format, ext, flags);
phar_obj->archive->is_data = is_data;
if (ret) {
@@ -2415,7 +2415,7 @@ PHP_METHOD(Phar, convertToData)
zend_long format = 9021976, method = 9021976;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
return;
}
@@ -2428,20 +2428,20 @@ PHP_METHOD(Phar, convertToData)
} else if (phar_obj->archive->is_zip) {
format = PHAR_FORMAT_ZIP;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out data phar archive, use Phar::TAR or Phar::ZIP");
return;
}
break;
case PHAR_FORMAT_PHAR:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out data phar archive, use Phar::TAR or Phar::ZIP");
return;
case PHAR_FORMAT_TAR:
case PHAR_FORMAT_ZIP:
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP");
return;
}
@@ -2455,13 +2455,13 @@ PHP_METHOD(Phar, convertToData)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -2470,13 +2470,13 @@ PHP_METHOD(Phar, convertToData)
break;
case PHAR_ENT_COMPRESSED_BZ2:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
@@ -2484,14 +2484,14 @@ PHP_METHOD(Phar, convertToData)
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
is_data = phar_obj->archive->is_data;
phar_obj->archive->is_data = 1;
- ret = phar_convert_to_other(phar_obj->archive, format, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, format, ext, flags);
phar_obj->archive->is_data = is_data;
if (ret) {
@@ -2566,17 +2566,17 @@ PHP_METHOD(Phar, delete)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
RETURN_FALSE;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) {
@@ -2591,13 +2591,13 @@ PHP_METHOD(Phar, delete)
}
}
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be deleted", fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be deleted", fname);
RETURN_FALSE;
}
- phar_flush(phar_obj->archive, NULL, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, NULL, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -2651,7 +2651,7 @@ PHP_METHOD(Phar, setAlias)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
RETURN_FALSE;
}
@@ -2662,37 +2662,37 @@ PHP_METHOD(Phar, setAlias)
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar alias cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar alias cannot be set in a plain zip archive");
}
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &alias, &alias_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &alias, &alias_len) == SUCCESS) {
if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) {
RETURN_TRUE;
}
if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", alias, fd_ptr->fname);
- if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
efree(error);
goto valid_alias;
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
}
if (!phar_validate_alias(alias, alias_len)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname);
RETURN_FALSE;
}
valid_alias:
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), phar_obj->archive->alias, phar_obj->archive->alias_len))) {
@@ -2712,13 +2712,13 @@ valid_alias:
phar_obj->archive->alias_len = alias_len;
phar_obj->archive->is_temporary_alias = 0;
- phar_flush(phar_obj->archive, NULL, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, NULL, 0, 0, &error);
if (error) {
phar_obj->archive->alias = oldalias;
phar_obj->archive->alias_len = oldalias_len;
phar_obj->archive->is_temporary_alias = old_temp;
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
if (readd) {
zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_alias_map), oldalias, oldalias_len, phar_obj->archive);
}
@@ -2798,16 +2798,16 @@ PHP_METHOD(Phar, stopBuffering)
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
phar_obj->archive->donotflush = 0;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -2827,52 +2827,52 @@ PHP_METHOD(Phar, setStub)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub, phar is read-only");
return;
}
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain zip archive");
}
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zstub, &len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l", &zstub, &len) == SUCCESS) {
if ((php_stream_from_zval_no_verify(stream, zstub)) != NULL) {
if (len > 0) {
len = -len;
} else {
len = -1;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, (char *) zstub, len, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, (char *) zstub, len, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
RETURN_TRUE;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub, unable to read from input stream");
}
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &stub, &stub_len) == SUCCESS) {
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &stub, &stub_len) == SUCCESS) {
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, stub, stub_len, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, stub, stub_len, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -2906,35 +2906,35 @@ PHP_METHOD(Phar, setDefaultStub)
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain zip archive");
}
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 0 && (phar_obj->archive->is_tar || phar_obj->archive->is_zip)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "method accepts no arguments for a tar- or zip-based phar stub, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "method accepts no arguments for a tar- or zip-based phar stub, %d given", ZEND_NUM_ARGS());
RETURN_FALSE;
}
if (PHAR_G(readonly)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub: phar.readonly=1");
RETURN_FALSE;
}
if (!phar_obj->archive->is_tar && !phar_obj->archive->is_zip) {
- stub = phar_create_default_stub(index, webindex, &stub_len, &error TSRMLS_CC);
+ stub = phar_create_default_stub(index, webindex, &stub_len, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "%s", error);
efree(error);
if (stub) {
efree(stub);
@@ -2945,18 +2945,18 @@ PHP_METHOD(Phar, setDefaultStub)
created_stub = 1;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, stub, stub_len, 1, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, stub, stub_len, 1, &error);
if (created_stub) {
efree(stub);
}
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
}
@@ -2980,12 +2980,12 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot set signature algorithm, phar is read-only");
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &algo, &key, &key_len) != SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l|s", &algo, &key, &key_len) != SUCCESS) {
return;
}
@@ -2993,15 +2993,15 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
case PHAR_SIG_SHA256:
case PHAR_SIG_SHA512:
#ifndef PHAR_HASH_OK
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"SHA-256 and SHA-512 signatures are only supported if the hash extension is enabled and built non-shared");
return;
#endif
case PHAR_SIG_MD5:
case PHAR_SIG_SHA1:
case PHAR_SIG_OPENSSL:
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
phar_obj->archive->sig_flags = algo;
@@ -3009,14 +3009,14 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
PHAR_G(openssl_privatekey) = key;
PHAR_G(openssl_privatekey_len) = key_len;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
break;
default:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Unknown signature algorithm specified");
}
}
@@ -3080,7 +3080,7 @@ PHP_METHOD(Phar, getModified)
}
/* }}} */
-static int phar_set_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_set_compression(zval *zv, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
php_uint32 compress = *(php_uint32 *)argument;
@@ -3097,7 +3097,7 @@ static int phar_set_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int phar_test_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_test_compression(zval *zv, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
@@ -3121,18 +3121,18 @@ static int phar_test_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void pharobj_set_compression(HashTable *manifest, php_uint32 compress TSRMLS_DC) /* {{{ */
+static void pharobj_set_compression(HashTable *manifest, php_uint32 compress) /* {{{ */
{
- zend_hash_apply_with_argument(manifest, phar_set_compression, &compress TSRMLS_CC);
+ zend_hash_apply_with_argument(manifest, phar_set_compression, &compress);
}
/* }}} */
-static int pharobj_cancompress(HashTable *manifest TSRMLS_DC) /* {{{ */
+static int pharobj_cancompress(HashTable *manifest) /* {{{ */
{
int test;
test = 1;
- zend_hash_apply_with_argument(manifest, phar_test_compression, &test TSRMLS_CC);
+ zend_hash_apply_with_argument(manifest, phar_test_compression, &test);
return test;
}
/* }}} */
@@ -3151,18 +3151,18 @@ PHP_METHOD(Phar, compress)
zend_object *ret;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s", &method, &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot compress phar archive, phar is read-only");
return;
}
if (phar_obj->archive->is_zip) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot compress zip-based archives with whole-archive compression");
return;
}
@@ -3173,7 +3173,7 @@ PHP_METHOD(Phar, compress)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -3182,22 +3182,22 @@ PHP_METHOD(Phar, compress)
case PHAR_ENT_COMPRESSED_BZ2:
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
if (phar_obj->archive->is_tar) {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags);
} else {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags);
}
if (ret) {
@@ -3218,26 +3218,26 @@ PHP_METHOD(Phar, decompress)
zend_object *ret;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot decompress phar archive, phar is read-only");
return;
}
if (phar_obj->archive->is_zip) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot decompress zip-based archives with whole-archive compression");
return;
}
if (phar_obj->archive->is_tar) {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE);
} else {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE);
}
if (ret) {
@@ -3260,12 +3260,12 @@ PHP_METHOD(Phar, compressFiles)
zend_long method;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
@@ -3273,7 +3273,7 @@ PHP_METHOD(Phar, compressFiles)
switch (method) {
case PHAR_ENT_COMPRESSED_GZ:
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress files within archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -3282,45 +3282,45 @@ PHP_METHOD(Phar, compressFiles)
case PHAR_ENT_COMPRESSED_BZ2:
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress files within archive with bz2, enable ext/bz2 in php.ini");
return;
}
flags = PHAR_ENT_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with Gzip compression, tar archives cannot compress individual files, use compress() to compress the whole archive");
return;
}
- if (!pharobj_cancompress(&phar_obj->archive->manifest TSRMLS_CC)) {
+ if (!pharobj_cancompress(&phar_obj->archive->manifest)) {
if (flags == PHAR_FILE_COMPRESSED_GZ) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress all files as Gzip, some are compressed as bzip2 and cannot be decompressed");
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress all files as Bzip2, some are compressed as gzip and cannot be decompressed");
}
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- pharobj_set_compression(&phar_obj->archive->manifest, flags TSRMLS_CC);
+ pharobj_set_compression(&phar_obj->archive->manifest, flags);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
}
}
@@ -3339,13 +3339,13 @@ PHP_METHOD(Phar, decompressFiles)
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
- if (!pharobj_cancompress(&phar_obj->archive->manifest TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (!pharobj_cancompress(&phar_obj->archive->manifest)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress all files, some are compressed as bzip2 or gzip and cannot be decompressed");
return;
}
@@ -3353,18 +3353,18 @@ PHP_METHOD(Phar, decompressFiles)
if (phar_obj->archive->is_tar) {
RETURN_TRUE;
} else {
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE TSRMLS_CC);
+ pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE);
}
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
}
@@ -3385,39 +3385,39 @@ PHP_METHOD(Phar, copy)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot copy \"%s\" to \"%s\", phar is read-only", oldfile, newfile);
RETURN_FALSE;
}
if (oldfile_len >= sizeof(".phar")-1 && !memcmp(oldfile, ".phar", sizeof(".phar")-1)) {
/* can't copy a meta file */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", cannot copy Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (newfile_len >= sizeof(".phar")-1 && !memcmp(newfile, ".phar", sizeof(".phar")-1)) {
/* can't copy a meta file */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", cannot copy to Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (!zend_hash_str_exists(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len) || NULL == (oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len)) || oldentry->is_deleted) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", file does not exist in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) {
if (NULL != (temp = zend_hash_str_find_ptr(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) || !temp->is_deleted) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", file must not already exist in phar %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -3425,15 +3425,15 @@ PHP_METHOD(Phar, copy)
tmp_len = (int)newfile_len;
if (phar_path_check(&newfile, &tmp_len, &pcr_error) > pcr_is_ok) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname);
RETURN_FALSE;
}
newfile_len = tmp_len;
if (phar_obj->archive->is_persistent) {
- if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
/* re-populate with copied-on-write entry */
@@ -3452,10 +3452,10 @@ PHP_METHOD(Phar, copy)
newentry.fp_refcount = 0;
if (oldentry->fp_type != PHAR_FP) {
- if (FAILURE == phar_copy_entry_fp(oldentry, &newentry, &error TSRMLS_CC)) {
+ if (FAILURE == phar_copy_entry_fp(oldentry, &newentry, &error)) {
efree(newentry.filename);
php_stream_close(newentry.fp);
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
return;
}
@@ -3463,10 +3463,10 @@ PHP_METHOD(Phar, copy)
zend_hash_str_add_mem(&oldentry->phar->manifest, newfile, newfile_len, &newentry, sizeof(phar_entry_info));
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -3485,7 +3485,7 @@ PHP_METHOD(Phar, offsetExists)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
@@ -3523,26 +3523,26 @@ PHP_METHOD(Phar, offsetGet)
zend_string *sfname;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
/* security is 0 here so that we can get a better error message than "entry doesn't exist" */
- if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist%s%s", fname, error?", ":"", error?error:"");
+ if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", fname, error?", ":"", error?error:"");
} else {
if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname);
return;
}
if (fname_len == sizeof(".phar/alias.txt")-1 && !memcmp(fname, ".phar/alias.txt", sizeof(".phar/alias.txt")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname);
return;
}
if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot directly get any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot directly get any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
return;
}
@@ -3553,7 +3553,7 @@ PHP_METHOD(Phar, offsetGet)
sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, fname);
ZVAL_NEW_STR(&zfname, sfname);
- spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname TSRMLS_CC);
+ spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname);
zval_ptr_dtor(&zfname);
}
}
@@ -3561,7 +3561,7 @@ PHP_METHOD(Phar, offsetGet)
/* {{{ add a file within the phar archive from a string or resource
*/
-static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, size_t cont_len, zval *zresource TSRMLS_DC)
+static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, size_t cont_len, zval *zresource)
{
char *error;
size_t contents_len;
@@ -3569,16 +3569,16 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
php_stream *contents_file;
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
return;
}
- if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, 1 TSRMLS_CC))) {
+ if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, 1))) {
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be created: %s", filename, error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created: %s", filename, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be created", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created", filename);
}
return;
} else {
@@ -3590,12 +3590,12 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
if (cont_str) {
contents_len = php_stream_write(data->fp, cont_str, cont_len);
if (contents_len != cont_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s could not be written to", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename);
return;
}
} else {
if (!(php_stream_from_zval_no_verify(contents_file, zresource))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s could not be written to", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename);
return;
}
php_stream_copy_to_stream_ex(contents_file, data->fp, PHP_STREAM_COPY_ALL, &contents_len);
@@ -3608,11 +3608,11 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
if (pphar[0] != data->phar) {
*pphar = data->phar;
}
- phar_entry_delref(data TSRMLS_CC);
- phar_flush(*pphar, 0, 0, 0, &error TSRMLS_CC);
+ phar_entry_delref(data);
+ phar_flush(*pphar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -3621,17 +3621,17 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
/* {{{ create a directory within the phar archive
*/
-static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len TSRMLS_DC)
+static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len)
{
char *error;
phar_entry_data *data;
- if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1 TSRMLS_CC))) {
+ if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1))) {
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Directory %s does not exist and cannot be created: %s", dirname, error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", dirname, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Directory %s does not exist and cannot be created", dirname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created", dirname);
}
return;
@@ -3644,11 +3644,11 @@ static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len
if (data->phar != *pphar) {
*pphar = data->phar;
}
- phar_entry_delref(data TSRMLS_CC);
- phar_flush(*pphar, 0, 0, 0, &error TSRMLS_CC);
+ phar_entry_delref(data);
+ phar_flush(*pphar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -3666,31 +3666,31 @@ PHP_METHOD(Phar, offsetSet)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sr", &fname, &fname_len, &zresource) == FAILURE
- && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sr", &fname, &fname_len, &zresource) == FAILURE
+ && zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {
return;
}
if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname);
return;
}
if (fname_len == sizeof(".phar/alias.txt")-1 && !memcmp(fname, ".phar/alias.txt", sizeof(".phar/alias.txt")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname);
return;
}
if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
return;
}
- phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource);
}
/* }}} */
@@ -3705,11 +3705,11 @@ PHP_METHOD(Phar, offsetUnset)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
@@ -3721,8 +3721,8 @@ PHP_METHOD(Phar, offsetUnset)
}
if (phar_obj->archive->is_persistent) {
- if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
/* re-populate entry after copy on write */
@@ -3731,10 +3731,10 @@ PHP_METHOD(Phar, offsetUnset)
entry->is_modified = 0;
entry->is_deleted = 1;
/* we need to "flush" the stream to save the newly deleted file on disk */
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -3756,16 +3756,16 @@ PHP_METHOD(Phar, addEmptyDir)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dirname, &dirname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &dirname, &dirname_len) == FAILURE) {
return;
}
if (dirname_len >= sizeof(".phar")-1 && !memcmp(dirname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create a directory in magic \".phar\" directory");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create a directory in magic \".phar\" directory");
return;
}
- phar_mkdir(&phar_obj->archive, dirname, dirname_len TSRMLS_CC);
+ phar_mkdir(&phar_obj->archive, dirname, dirname_len);
}
/* }}} */
@@ -3781,24 +3781,24 @@ PHP_METHOD(Phar, addFile)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
return;
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive, safe_mode restrictions prevent this", fname);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, safe_mode restrictions prevent this", fname);
return;
}
#endif
- if (!strstr(fname, "://") && php_check_open_basedir(fname TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", fname);
+ if (!strstr(fname, "://") && php_check_open_basedir(fname)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", fname);
return;
}
if (!(resource = php_stream_open_wrapper(fname, "rb", 0, NULL))) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive", fname);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive", fname);
return;
}
@@ -3808,7 +3808,7 @@ PHP_METHOD(Phar, addFile)
}
php_stream_to_zval(resource, &zresource);
- phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource);
zval_ptr_dtor(&zresource);
}
/* }}} */
@@ -3823,11 +3823,11 @@ PHP_METHOD(Phar, addFromString)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) {
return;
}
- phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL);
}
/* }}} */
@@ -3855,19 +3855,19 @@ PHP_METHOD(Phar, getStub)
fp = phar_obj->archive->fp;
} else {
if (!(fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL))) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname);
return;
}
if (stub->flags & PHAR_ENT_COMPRESSION_MASK) {
char *filter_name;
if ((filter_name = phar_decompress_filter(stub, 0)) != NULL) {
- filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp));
} else {
filter = NULL;
}
if (!filter) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, 1));
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, 1));
return;
}
php_stream_filter_append(&fp->readfilters, filter);
@@ -3875,7 +3875,7 @@ PHP_METHOD(Phar, getStub)
}
if (!fp) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
return;
}
@@ -3896,7 +3896,7 @@ PHP_METHOD(Phar, getStub)
}
if (!fp) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
return;
}
@@ -3909,7 +3909,7 @@ carry_on:
if (fp != phar_obj->archive->fp) {
php_stream_close(fp);
}
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
zend_string_release(buf);
return;
@@ -3917,7 +3917,7 @@ carry_on:
if (filter) {
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
}
if (fp != phar_obj->archive->fp) {
@@ -3957,7 +3957,7 @@ PHP_METHOD(Phar, getMetadata)
zval ret;
char *buf = estrndup((char *) Z_PTR(phar_obj->archive->metadata), phar_obj->archive->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata(&buf, &ret, phar_obj->archive->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &ret, phar_obj->archive->metadata_len);
efree(buf);
RETURN_ZVAL(&ret, 0, 1);
}
@@ -3977,16 +3977,16 @@ PHP_METHOD(Phar, setMetadata)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &metadata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &metadata) == FAILURE) {
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (Z_TYPE(phar_obj->archive->metadata) != IS_UNDEF) {
@@ -3996,10 +3996,10 @@ PHP_METHOD(Phar, setMetadata)
ZVAL_ZVAL(&phar_obj->archive->metadata, metadata, 1, 0);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4015,7 +4015,7 @@ PHP_METHOD(Phar, delMetadata)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
@@ -4023,10 +4023,10 @@ PHP_METHOD(Phar, delMetadata)
zval_ptr_dtor(&phar_obj->archive->metadata);
ZVAL_UNDEF(&phar_obj->archive->metadata);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
} else {
@@ -4040,13 +4040,13 @@ PHP_METHOD(Phar, delMetadata)
/* }}} */
#if PHP_API_VERSION < 20100412
#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
-static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error TSRMLS_DC) /* {{{ */
+static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */
{
php_stream_statbuf ssb;
int len;
@@ -4149,8 +4149,8 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
return FAILURE;
}
- if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (!phar_get_efp(entry, 0)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
if (error) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", entry->filename, fullpath, *error);
} else {
@@ -4162,14 +4162,14 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
}
}
- if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to seek internal file pointer", entry->filename, fullpath);
efree(fullpath);
php_stream_close(fp);
return FAILURE;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp, entry->uncompressed_filesize, NULL)) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", entry->filename, fullpath);
efree(fullpath);
php_stream_close(fp);
@@ -4208,14 +4208,14 @@ PHP_METHOD(Phar, extractTo)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z!b", &pathto, &pathto_len, &zval_files, &overwrite) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z!b", &pathto, &pathto_len, &zval_files, &overwrite) == FAILURE) {
return;
}
fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual);
if (!fp) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, %s cannot be found", phar_obj->archive->fname);
return;
}
@@ -4224,7 +4224,7 @@ PHP_METHOD(Phar, extractTo)
php_stream_close(fp);
if (pathto_len < 1) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, extraction path must be non-zero length");
return;
}
@@ -4232,7 +4232,7 @@ PHP_METHOD(Phar, extractTo)
if (pathto_len >= MAXPATHLEN) {
char *tmp = estrndup(pathto, 50);
/* truncate for error message */
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp);
efree(tmp);
return;
}
@@ -4240,12 +4240,12 @@ PHP_METHOD(Phar, extractTo)
if (php_stream_stat_path(pathto, &ssb) < 0) {
ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
if (!ret) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to create path \"%s\" for extraction", pathto);
return;
}
} else if (!(ssb.sb.st_mode & S_IFDIR)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to use path \"%s\" for extraction, it is a file, must be a directory", pathto);
return;
}
@@ -4270,16 +4270,16 @@ PHP_METHOD(Phar, extractTo)
case IS_STRING:
break;
default:
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, array of filenames to extract contains non-string value");
return;
}
if (NULL == (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, Z_STR_P(zval_file)))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", Z_STRVAL_P(zval_file), phar_obj->archive->fname);
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
return;
@@ -4288,19 +4288,19 @@ PHP_METHOD(Phar, extractTo)
}
RETURN_TRUE;
default:
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, expected a filename (string) or array of filenames");
return;
}
if (NULL == (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, filename, filename_len))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", filename, phar_obj->archive->fname);
return;
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
return;
@@ -4315,8 +4315,8 @@ all_files:
}
ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar->fname, error);
efree(error);
return;
@@ -4341,39 +4341,39 @@ PHP_METHOD(PharFileInfo, __construct)
phar_archive_data *phar_data;
zval *zobj = getThis(), arg1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
if (entry_obj->entry) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot call constructor twice");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice");
return;
}
- if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0) == FAILURE) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"'%s' is not a valid phar archive URL (must have at least phar://filename.phar)", fname);
return;
}
- if (phar_open_from_filename(arch, arch_len, NULL, 0, REPORT_ERRORS, &phar_data, &error TSRMLS_CC) == FAILURE) {
+ if (phar_open_from_filename(arch, arch_len, NULL, 0, REPORT_ERRORS, &phar_data, &error) == FAILURE) {
efree(arch);
efree(entry);
if (error) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot open phar file '%s': %s", fname, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot open phar file '%s'", fname);
}
return;
}
- if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1 TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1)) == NULL) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? error : "");
efree(arch);
efree(entry);
@@ -4398,7 +4398,7 @@ PHP_METHOD(PharFileInfo, __construct)
zval *zobj = getThis(); \
phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!entry_obj->entry) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Cannot call method on an uninitialized PharFileInfo object"); \
return; \
}
@@ -4447,7 +4447,7 @@ PHP_METHOD(PharFileInfo, isCompressed)
zend_long method = 9021976;
PHAR_ENTRY_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &method) == FAILURE) {
return;
}
@@ -4459,7 +4459,7 @@ PHP_METHOD(PharFileInfo, isCompressed)
case PHAR_ENT_COMPRESSED_BZ2:
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2);
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
}
}
@@ -4477,7 +4477,7 @@ PHP_METHOD(PharFileInfo, getCRC32)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, does not have a CRC"); \
return;
}
@@ -4485,7 +4485,7 @@ PHP_METHOD(PharFileInfo, getCRC32)
if (entry_obj->entry->is_crc_checked) {
RETURN_LONG(entry_obj->entry->crc32);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry was not CRC checked"); \
}
}
@@ -4531,25 +4531,25 @@ PHP_METHOD(PharFileInfo, chmod)
PHAR_ENTRY_OBJECT();
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry \"%s\" is a temporary directory (not an actual entry in the archive), cannot chmod", entry_obj->entry->filename); \
return;
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &perms) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &perms) == FAILURE) {
return;
}
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4575,10 +4575,10 @@ PHP_METHOD(PharFileInfo, chmod)
BG(CurrentLStatFile) = NULL;
BG(CurrentStatFile) = NULL;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4615,7 +4615,7 @@ PHP_METHOD(PharFileInfo, getMetadata)
zval ret;
char *buf = estrndup((char *) Z_PTR(entry_obj->entry->metadata), entry_obj->entry->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata(&buf, &ret, entry_obj->entry->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &ret, entry_obj->entry->metadata_len);
efree(buf);
RETURN_ZVAL(&ret, 0, 1);
}
@@ -4635,25 +4635,25 @@ PHP_METHOD(PharFileInfo, setMetadata)
PHAR_ENTRY_OBJECT();
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata"); \
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &metadata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &metadata) == FAILURE) {
return;
}
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4668,10 +4668,10 @@ PHP_METHOD(PharFileInfo, setMetadata)
entry_obj->entry->is_modified = 1;
entry_obj->entry->phar->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4691,12 +4691,12 @@ PHP_METHOD(PharFileInfo, delMetadata)
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata"); \
return;
}
@@ -4705,8 +4705,8 @@ PHP_METHOD(PharFileInfo, delMetadata)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4717,10 +4717,10 @@ PHP_METHOD(PharFileInfo, delMetadata)
entry_obj->entry->is_modified = 1;
entry_obj->entry->phar->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
} else {
@@ -4750,31 +4750,31 @@ PHP_METHOD(PharFileInfo, getContent)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\" is a directory", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- link = phar_get_link_source(entry_obj->entry TSRMLS_CC);
+ link = phar_get_link_source(entry_obj->entry);
if (!link) {
link = entry_obj->entry;
}
- if (SUCCESS != phar_open_entry_fp(link, &error, 0 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(link, &error, 0)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\": %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
}
- if (!(fp = phar_get_efp(link, 0 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (!(fp = phar_get_efp(link, 0))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- phar_seek_efp(link, 0, SEEK_SET, 0, 0 TSRMLS_CC);
+ phar_seek_efp(link, 0, SEEK_SET, 0, 0);
str = php_stream_copy_to_mem(fp, link->uncompressed_filesize, 0);
if (str) {
RETURN_STR(str);
@@ -4793,30 +4793,30 @@ PHP_METHOD(PharFileInfo, compress)
char *error;
PHAR_ENTRY_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
return;
}
if (entry_obj->entry->is_tar) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with Gzip compression, not possible with tar-based phar archives");
return;
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, cannot set compression"); \
return;
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
if (entry_obj->entry->is_deleted) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress deleted file");
return;
}
@@ -4824,8 +4824,8 @@ PHP_METHOD(PharFileInfo, compress)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4839,14 +4839,14 @@ PHP_METHOD(PharFileInfo, compress)
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0) {
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with gzip compression, file is already compressed with bzip2 compression and bz2 extension is not enabled, cannot decompress");
return;
}
/* decompress this file indirectly */
- if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot decompress bzip2-compressed file \"%s\" in phar \"%s\" in order to compress with gzip: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
@@ -4854,7 +4854,7 @@ PHP_METHOD(PharFileInfo, compress)
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with gzip compression, zlib extension is not enabled");
return;
}
@@ -4870,14 +4870,14 @@ PHP_METHOD(PharFileInfo, compress)
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0) {
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with bzip2 compression, file is already compressed with gzip compression and zlib extension is not enabled, cannot decompress");
return;
}
/* decompress this file indirectly */
- if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot decompress gzip-compressed file \"%s\" in phar \"%s\" in order to compress with bzip2: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
@@ -4885,7 +4885,7 @@ PHP_METHOD(PharFileInfo, compress)
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with bzip2 compression, bz2 extension is not enabled");
return;
}
@@ -4894,16 +4894,16 @@ PHP_METHOD(PharFileInfo, compress)
entry_obj->entry->flags |= PHAR_ENT_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
}
entry_obj->entry->phar->is_modified = 1;
entry_obj->entry->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -4924,7 +4924,7 @@ PHP_METHOD(PharFileInfo, decompress)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, cannot set compression"); \
return;
}
@@ -4934,25 +4934,25 @@ PHP_METHOD(PharFileInfo, decompress)
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot decompress");
return;
}
if (entry_obj->entry->is_deleted) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress deleted file");
return;
}
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0 && !PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress Gzip-compressed file, zlib extension is not enabled");
return;
}
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0 && !PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress Bzip2-compressed file, bz2 extension is not enabled");
return;
}
@@ -4960,16 +4960,16 @@ PHP_METHOD(PharFileInfo, decompress)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
}
if (!entry_obj->entry->fp) {
- if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
+ if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
entry_obj->entry->fp_type = PHAR_FP;
@@ -4979,10 +4979,10 @@ PHP_METHOD(PharFileInfo, decompress)
entry_obj->entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
entry_obj->entry->phar->is_modified = 1;
entry_obj->entry->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
RETURN_TRUE;
@@ -5282,37 +5282,37 @@ zend_function_entry phar_exception_methods[] = {
/* }}} */
#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
-#define phar_exception_get_default() zend_exception_get_default(TSRMLS_C)
+#define phar_exception_get_default() zend_exception_get_default()
-void phar_object_init(TSRMLS_D) /* {{{ */
+void phar_object_init(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PharException", phar_exception_methods);
- phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default() TSRMLS_CC);
+ phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default());
#if HAVE_SPL
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
- phar_ce_archive = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC);
+ phar_ce_archive = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
- zend_class_implements(phar_ce_archive TSRMLS_CC, 2, spl_ce_Countable, zend_ce_arrayaccess);
+ zend_class_implements(phar_ce_archive, 2, spl_ce_Countable, zend_ce_arrayaccess);
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
- phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC);
+ phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
- zend_class_implements(phar_ce_data TSRMLS_CC, 2, spl_ce_Countable, zend_ce_arrayaccess);
+ zend_class_implements(phar_ce_data, 2, spl_ce_Countable, zend_ce_arrayaccess);
INIT_CLASS_ENTRY(ce, "PharFileInfo", php_entry_methods);
- phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo TSRMLS_CC);
+ phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo);
#else
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
- phar_ce_archive = zend_register_internal_class(&ce TSRMLS_CC);
+ phar_ce_archive = zend_register_internal_class(&ce);
phar_ce_archive->ce_flags |= ZEND_ACC_FINAL;
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
- phar_ce_data = zend_register_internal_class(&ce TSRMLS_CC);
+ phar_ce_data = zend_register_internal_class(&ce);
phar_ce_data->ce_flags |= ZEND_ACC_FINAL;
#endif
diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h
index 41c379bfa9..cb1a08d83b 100644
--- a/ext/phar/php_phar.h
+++ b/ext/phar/php_phar.h
@@ -34,7 +34,7 @@ extern zend_module_entry phar_module_entry;
#define PHP_PHAR_API PHPAPI
#endif
-PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC);
+PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len);
#endif /* PHP_PHAR_H */
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index eb2fa607ee..5fb72522ad 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -56,7 +56,7 @@ php_stream_wrapper php_stream_phar_wrapper = {
/**
* Open a phar file for streams API
*/
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC) /* {{{ */
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options) /* {{{ */
{
php_url *resource;
char *arch = NULL, *entry = NULL, *error;
@@ -67,17 +67,17 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
}
if (mode[0] == 'a') {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: open mode append not supported");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: open mode append not supported");
}
return NULL;
}
- if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len, 2, (mode[0] == 'w' ? 2 : 0) TSRMLS_CC) == FAILURE) {
+ if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len, 2, (mode[0] == 'w' ? 2 : 0)) == FAILURE) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
if (arch && !entry) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch);
arch = NULL;
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url or non-existent phar \"%s\"", filename);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url or non-existent phar \"%s\"", filename);
}
}
return NULL;
@@ -108,27 +108,27 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
}
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: write operations disabled by the php.ini setting phar.readonly");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: write operations disabled by the php.ini setting phar.readonly");
}
php_url_free(resource);
return NULL;
}
- if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error TSRMLS_CC) == FAILURE)
+ if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
php_url_free(resource);
return NULL;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(&error, 0, "Cannot open cached phar '%s' as writeable, copy on write failed", resource->host);
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
@@ -136,11 +136,11 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
return NULL;
}
} else {
- if (phar_open_from_filename(resource->host, arch_len, NULL, 0, options, NULL, &error TSRMLS_CC) == FAILURE)
+ if (phar_open_from_filename(resource->host, arch_len, NULL, 0, options, NULL, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
@@ -155,7 +155,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
/**
* used for fopen('phar://...') and company
*/
-static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
phar_archive_data *phar;
phar_entry_data *idata;
@@ -167,35 +167,35 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
zval *pzoption, *metadata;
uint host_len;
- if ((resource = phar_parse_url(wrapper, path, mode, options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) {
return NULL;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", path);
return NULL;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", path);
return NULL;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
/* strip leading "/" */
internal_file = estrdup(resource->path + 1);
if (mode[0] == 'w' || (mode[0] == 'r' && mode[1] == '+')) {
- if (NULL == (idata = phar_get_or_create_entry_data(resource->host, host_len, internal_file, strlen(internal_file), mode, 0, &error, 1 TSRMLS_CC))) {
+ if (NULL == (idata = phar_get_or_create_entry_data(resource->host, host_len, internal_file, strlen(internal_file), mode, 0, &error, 1))) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, resource->host);
}
efree(internal_file);
php_url_free(resource);
@@ -237,14 +237,14 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
} else {
if (!*internal_file && (options & STREAM_OPEN_FOR_INCLUDE)) {
/* retrieve the stub */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "file %s is not a valid phar archive", resource->host);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL)) {
+ php_stream_wrapper_log_error(wrapper, options, "file %s is not a valid phar archive", resource->host);
efree(internal_file);
php_url_free(resource);
return NULL;
}
if (phar->is_tar || phar->is_zip) {
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0 TSRMLS_CC)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0)) || !idata) {
goto idata_error;
}
efree(internal_file);
@@ -266,7 +266,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
entry->is_crc_checked = 1;
idata = (phar_entry_data *) ecalloc(1, sizeof(phar_entry_data));
- idata->fp = phar_get_pharfp(phar TSRMLS_CC);
+ idata->fp = phar_get_pharfp(phar);
idata->phar = phar;
idata->internal_file = entry;
if (!phar->is_persistent) {
@@ -282,13 +282,13 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
}
}
/* read-only access is allowed to magic files in .phar directory */
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, strlen(internal_file), "r", 0, &error, 0 TSRMLS_CC)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, strlen(internal_file), "r", 0, &error, 0)) || !idata) {
idata_error:
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, resource->host);
}
efree(internal_file);
php_url_free(resource);
@@ -307,10 +307,10 @@ idata_error:
#endif
/* check length, crc32 */
- if (!idata->internal_file->is_crc_checked && phar_postprocess_file(idata, idata->internal_file->crc32, &error, 2 TSRMLS_CC) != SUCCESS) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ if (!idata->internal_file->is_crc_checked && phar_postprocess_file(idata, idata->internal_file->crc32, &error, 2) != SUCCESS) {
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
efree(internal_file);
return NULL;
}
@@ -344,9 +344,9 @@ phar_stub:
/**
* Used for fclose($fp) where $fp is a phar archive
*/
-static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int phar_stream_close(php_stream *stream, int close_handle) /* {{{ */
{
- phar_entry_delref((phar_entry_data *)stream->abstract TSRMLS_CC);
+ phar_entry_delref((phar_entry_data *)stream->abstract);
return 0;
}
@@ -355,14 +355,14 @@ static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /*
/**
* used for fread($fp) and company on a fopen()ed phar file handle
*/
-static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_stream_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
size_t got;
phar_entry_info *entry;
if (data->internal_file->link) {
- entry = phar_get_link_source(data->internal_file TSRMLS_CC);
+ entry = phar_get_link_source(data->internal_file);
} else {
entry = data->internal_file;
}
@@ -386,7 +386,7 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML
/**
* Used for fseek($fp) on a phar file handle
*/
-static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
phar_entry_info *entry;
@@ -394,7 +394,7 @@ static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, z
zend_off_t temp;
if (data->internal_file->link) {
- entry = phar_get_link_source(data->internal_file TSRMLS_CC);
+ entry = phar_get_link_source(data->internal_file);
} else {
entry = data->internal_file;
}
@@ -430,13 +430,13 @@ static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, z
/**
* Used for writing to a phar file
*/
-static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *) stream->abstract;
php_stream_seek(data->fp, data->position, SEEK_SET);
if (count != php_stream_write(data->fp, buf, count)) {
- php_stream_wrapper_log_error(stream->wrapper, stream->flags TSRMLS_CC, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, data->internal_file->filename, data->phar->fname);
+ php_stream_wrapper_log_error(stream->wrapper, stream->flags, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, data->internal_file->filename, data->phar->fname);
return -1;
}
data->position = php_stream_tell(data->fp);
@@ -453,7 +453,7 @@ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t coun
/**
* Used to save work done on a writeable phar
*/
-static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int phar_stream_flush(php_stream *stream) /* {{{ */
{
char *error;
int ret;
@@ -461,9 +461,9 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
if (data->internal_file->is_modified) {
data->internal_file->timestamp = time(0);
- ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC);
+ ret = phar_flush(data->phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS, "%s", error);
efree(error);
}
return ret;
@@ -477,7 +477,7 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
/**
* stat an opened phar file handle stream, used by phar_stat()
*/
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir TSRMLS_DC)
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir)
{
memset(ssb, 0, sizeof(php_stream_statbuf));
@@ -545,7 +545,7 @@ void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_stat
/**
* Stat an opened phar file handle
*/
-static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
@@ -554,7 +554,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
return -1;
}
- phar_dostat(data->phar, data->internal_file, ssb, 0 TSRMLS_CC);
+ phar_dostat(data->phar, data->internal_file, ssb, 0);
return 0;
}
/* }}} */
@@ -563,7 +563,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
* Stream wrapper stat implementation of stat()
*/
static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags,
- php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) /* {{{ */
+ php_stream_statbuf *ssb, php_stream_context *context) /* {{{ */
{
php_url *resource = NULL;
char *internal_file, *error;
@@ -572,7 +572,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
uint host_len;
int internal_file_len;
- if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
return FAILURE;
}
@@ -588,11 +588,11 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
internal_file = resource->path + 1; /* strip leading "/" */
/* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
php_url_free(resource);
if (error) {
efree(error);
@@ -604,7 +604,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
}
if (*internal_file == '\0') {
/* root directory requested */
- phar_dostat(phar, NULL, ssb, 1 TSRMLS_CC);
+ phar_dostat(phar, NULL, ssb, 1);
php_url_free(resource);
return SUCCESS;
}
@@ -615,12 +615,12 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
internal_file_len = strlen(internal_file);
/* search through the manifest of files, and if we have an exact match, it's a file */
if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
- phar_dostat(phar, entry, ssb, 0 TSRMLS_CC);
+ phar_dostat(phar, entry, ssb, 0);
php_url_free(resource);
return SUCCESS;
}
if (zend_hash_str_exists(&(phar->virtual_dirs), internal_file, internal_file_len)) {
- phar_dostat(phar, NULL, ssb, 1 TSRMLS_CC);
+ phar_dostat(phar, NULL, ssb, 1);
php_url_free(resource);
return SUCCESS;
}
@@ -648,7 +648,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
continue;
}
/* mount the file/directory just in time */
- if (SUCCESS != phar_mount_entry(phar, test, test_len, internal_file, internal_file_len TSRMLS_CC)) {
+ if (SUCCESS != phar_mount_entry(phar, test, test_len, internal_file, internal_file_len)) {
efree(test);
goto free_resource;
}
@@ -656,7 +656,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
goto free_resource;
}
- phar_dostat(phar, entry, ssb, 0 TSRMLS_CC);
+ phar_dostat(phar, entry, ssb, 0);
php_url_free(resource);
return SUCCESS;
}
@@ -671,7 +671,7 @@ free_resource:
/**
* Unlink a file within a phar archive
*/
-static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */
{
php_url *resource;
char *internal_file, *error;
@@ -680,44 +680,44 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
phar_archive_data *pphar;
uint host_len;
- if ((resource = phar_parse_url(wrapper, url, "rb", options TSRMLS_CC)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: unlink failed");
+ if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: unlink failed");
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), resource->host, host_len);
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: write operations disabled by the php.ini setting phar.readonly");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: write operations disabled by the php.ini setting phar.readonly");
return 0;
}
/* need to copy to strip leading "/", will get touched again */
internal_file = estrdup(resource->path + 1);
internal_file_len = strlen(internal_file);
- if (FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, internal_file_len, "r", 0, &error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, internal_file_len, "r", 0, &error, 1)) {
/* constraints of fp refcount were not met */
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "unlink of \"%s\" failed: %s", url, error);
+ php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed: %s", url, error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "unlink of \"%s\" failed, file does not exist", url);
+ php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed, file does not exist", url);
}
efree(internal_file);
php_url_free(resource);
@@ -728,24 +728,24 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
}
if (idata->internal_file->fp_refcount > 1) {
/* more than just our fp resource is open for this file */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);
efree(internal_file);
php_url_free(resource);
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
return 0;
}
php_url_free(resource);
efree(internal_file);
- phar_entry_remove(idata, &error TSRMLS_CC);
+ phar_entry_remove(idata, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
}
return 1;
}
/* }}} */
-static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context) /* {{{ */
{
php_url *resource_from, *resource_to;
char *error;
@@ -757,11 +757,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
error = NULL;
- if ((resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from);
+ if ((resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from);
return 0;
}
- if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error)) {
pfrom = NULL;
if (error) {
efree(error);
@@ -769,16 +769,16 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (PHAR_G(readonly) && (!pfrom || !pfrom->is_data)) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
+ php_error_docref(NULL, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
return 0;
}
- if ((resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
+ if ((resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to);
return 0;
}
- if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error)) {
if (error) {
efree(error);
}
@@ -786,14 +786,14 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (PHAR_G(readonly) && (!pto || !pto->is_data)) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
+ php_error_docref(NULL, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
return 0;
}
if (strcmp(resource_from->host, resource_to->host)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\", not within the same phar archive", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\", not within the same phar archive", url_from, url_to);
return 0;
}
@@ -801,45 +801,45 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
if (!resource_from->scheme || !resource_from->host || !resource_from->path) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_from);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_from);
return 0;
}
if (!resource_to->scheme || !resource_to->host || !resource_to->path) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_to);
return 0;
}
if (strcasecmp("phar", resource_from->scheme)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_from);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_from);
return 0;
}
if (strcasecmp("phar", resource_to->scheme)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_to);
return 0;
}
host_len = strlen(resource_from->host);
- if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
return 0;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": could not make cached phar writeable", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": could not make cached phar writeable", url_from, url_to);
return 0;
}
@@ -850,7 +850,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
if (entry->is_deleted) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source has been deleted", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source has been deleted", url_from, url_to);
return 0;
}
/* transfer all data over to the new entry */
@@ -866,10 +866,10 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
entry = zend_hash_str_add_mem(&(phar->manifest), resource_to->path+1, strlen(resource_to->path)-1, (void **)&new, sizeof(phar_entry_info));
entry->filename = estrdup(resource_to->path+1);
- if (FAILURE == phar_copy_entry_fp(source, entry, &error TSRMLS_CC)) {
+ if (FAILURE == phar_copy_entry_fp(source, entry, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
zend_hash_str_del(&(phar->manifest), entry->filename, strlen(entry->filename));
return 0;
@@ -884,7 +884,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
/* file does not exist */
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source does not exist", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source does not exist", url_from, url_to);
return 0;
}
@@ -963,11 +963,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (is_modified) {
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
return 0;
}
diff --git a/ext/phar/stream.h b/ext/phar/stream.h
index 0171010179..16156f08fb 100644
--- a/ext/phar/stream.h
+++ b/ext/phar/stream.h
@@ -21,21 +21,21 @@
BEGIN_EXTERN_C()
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC);
-void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC);
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
+void phar_entry_remove(phar_entry_data *idata, char **error);
-static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC);
-static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
-static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
+static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context);
+static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
+static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context);
/* file/stream handlers */
-static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t phar_stream_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int phar_stream_flush(php_stream *stream TSRMLS_DC);
-static int phar_stream_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
-static int phar_stream_stat( php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
+static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count);
+static size_t phar_stream_read( php_stream *stream, char *buf, size_t count);
+static int phar_stream_close(php_stream *stream, int close_handle);
+static int phar_stream_flush(php_stream *stream);
+static int phar_stream_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset);
+static int phar_stream_stat( php_stream *stream, php_stream_statbuf *ssb);
END_EXTERN_C()
/*
diff --git a/ext/phar/stub.h b/ext/phar/stub.h
index 6d524c69d1..5a42883426 100644
--- a/ext/phar/stub.h
+++ b/ext/phar/stub.h
@@ -18,7 +18,7 @@
/* $Id$ */
-static inline void phar_get_stub(const char *index_php, const char *web, size_t *len, char **stub, const int name_len, const int web_len TSRMLS_DC)
+static inline void phar_get_stub(const char *index_php, const char *web, size_t *len, char **stub, const int name_len, const int web_len)
{
static const char newstub0[] = "<?php\n\n$web = '";
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 76862f7cdb..2d55e347f3 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -121,10 +121,10 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
}
/* }}} */
-int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
- int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error TSRMLS_CC);
+ int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
if (FAILURE == ret) {
return FAILURE;
@@ -155,7 +155,7 @@ int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_l
}
/* }}} */
-static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */
+static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp) /* {{{ */
{
char *metadata;
size_t save = php_stream_tell(fp), read;
@@ -170,7 +170,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
return FAILURE;
}
- if (phar_parse_metadata(&metadata, &entry->metadata, entry->uncompressed_filesize TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&metadata, &entry->metadata, entry->uncompressed_filesize) == FAILURE) {
/* if not valid serialized data, it is a regular string */
efree(metadata);
php_stream_seek(fp, save, SEEK_SET);
@@ -192,7 +192,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
}
/* }}} */
-int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
+int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error) /* {{{ */
{
char buf[512], *actual_alias = NULL, *p;
phar_entry_info entry = {0};
@@ -264,7 +264,7 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
}
bail:
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
curloc = php_stream_tell(fp);
@@ -285,7 +285,7 @@ bail:
# define PHAR_GET_32(buffer) (php_uint32) *(buffer)
#endif
myphar->sig_flags = PHAR_GET_32(buf);
- if (FAILURE == phar_verify_signature(fp, php_stream_tell(fp) - size - 512, myphar->sig_flags, buf + 8, size - 8, fname, &myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, php_stream_tell(fp) - size - 512, myphar->sig_flags, buf + 8, size - 8, fname, &myphar->signature, &myphar->sig_len, error)) {
if (error) {
char *save = *error;
spprintf(error, 4096, "phar error: tar-based phar \"%s\" signature cannot be verified: %s", fname, save);
@@ -303,7 +303,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -315,7 +315,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -344,7 +344,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
@@ -356,7 +356,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.filename[entry.filename_len] = '\0';
@@ -372,7 +372,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -384,7 +384,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
continue;
@@ -433,7 +433,7 @@ bail:
}
last_was_longlink = 0;
- phar_add_virtual_dirs(myphar, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(myphar, entry.filename, entry.filename_len);
if (sum1 != sum2) {
if (error) {
@@ -441,7 +441,7 @@ bail:
}
pefree(entry.filename, myphar->is_persistent);
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -473,14 +473,14 @@ bail:
}
pefree(entry.filename, entry.is_persistent);
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.link = estrdup(hdr->linkname);
} else if (entry.tar_type == TAR_SYMLINK) {
entry.link = estrdup(hdr->linkname);
}
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
newentry = zend_hash_str_add_mem(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
if (entry.is_persistent) {
@@ -488,12 +488,12 @@ bail:
}
if (entry.filename_len >= sizeof(".phar/.metadata")-1 && !memcmp(entry.filename, ".phar/.metadata", sizeof(".phar/.metadata")-1)) {
- if (FAILURE == phar_tar_process_metadata(newentry, fp TSRMLS_CC)) {
+ if (FAILURE == phar_tar_process_metadata(newentry, fp)) {
if (error) {
spprintf(error, 4096, "phar error: tar-based phar \"%s\" has invalid metadata in magic file \"%s\"", fname, entry.filename);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -505,7 +505,7 @@ bail:
spprintf(error, 4096, "phar error: tar-based phar \"%s\" has alias that is larger than 511 bytes, cannot process", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -526,7 +526,7 @@ bail:
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -540,7 +540,7 @@ bail:
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -555,7 +555,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -567,7 +567,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
} while (!php_stream_eof(fp));
@@ -581,7 +581,7 @@ bail:
/* ensure signature set */
if (!myphar->is_data && PHAR_G(require_hash) && !myphar->signature) {
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
if (error) {
spprintf(error, 0, "tar-based phar \"%s\" does not have a signature", fname);
}
@@ -606,14 +606,14 @@ bail:
}
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (NULL == (actual = zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_fname_map), myphar->fname, fname_len, myphar))) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\" to phar registry", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -625,7 +625,7 @@ bail:
myphar->is_temporary_alias = 0;
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), actual_alias, myphar->alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, myphar->alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, myphar->alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname);
}
@@ -640,7 +640,7 @@ bail:
if (alias_len) {
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname);
}
@@ -675,7 +675,7 @@ struct _phar_pass_tar_info {
char **error;
};
-static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* {{{ */
{
tar_header header;
size_t pos;
@@ -695,7 +695,7 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
}
}
- phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
memset((char *) &header, 0, sizeof(header));
if (entry->filename_len > 100) {
@@ -771,18 +771,18 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
/* write contents */
if (entry->uncompressed_filesize) {
- if (FAILURE == phar_open_entry_fp(entry, fp->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, fp->error, 0)) {
return ZEND_HASH_APPLY_STOP;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (fp->error) {
spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written, seek failed", entry->phar->fname, entry->filename);
}
return ZEND_HASH_APPLY_STOP;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp->new, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp->new, entry->uncompressed_filesize, NULL)) {
if (fp->error) {
spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, entry->filename);
}
@@ -823,13 +823,13 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
}
/* }}} */
-static int phar_tar_writeheaders(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_writeheaders(zval *zv, void *argument) /* {{{ */
{
- return phar_tar_writeheaders_int(Z_PTR_P(zv), argument TSRMLS_CC);
+ return phar_tar_writeheaders_int(Z_PTR_P(zv), argument);
}
/* }}} */
-int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error) /* {{{ */
{
php_serialize_data_t metadata_hash;
@@ -839,7 +839,7 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
entry->uncompressed_filesize = entry->compressed_filesize = entry->metadata_str.s ? entry->metadata_str.s->len : 0;
@@ -865,7 +865,7 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS
}
/* }}} */
-static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */
{
int lookfor_len;
struct _phar_pass_tar_info *i = (struct _phar_pass_tar_info *)argument;
@@ -874,7 +874,7 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
if (entry->filename_len >= sizeof(".phar/.metadata") && !memcmp(entry->filename, ".phar/.metadata", sizeof(".phar/.metadata")-1)) {
if (entry->filename_len == sizeof(".phar/.metadata.bin")-1 && !memcmp(entry->filename, ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1)) {
- return phar_tar_setmetadata(&entry->phar->metadata, entry, error TSRMLS_CC);
+ return phar_tar_setmetadata(&entry->phar->metadata, entry, error);
}
/* search for the file this metadata entry references */
if (entry->filename_len >= sizeof(".phar/.metadata/") + sizeof("/.metadata.bin") - 1 && !zend_hash_str_exists(&(entry->phar->manifest), entry->filename + sizeof(".phar/.metadata/") - 1, entry->filename_len - (sizeof("/.metadata.bin") - 1 + sizeof(".phar/.metadata/") - 1))) {
@@ -900,7 +900,7 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
if (NULL != (metadata = zend_hash_str_find_ptr(&(entry->phar->manifest), lookfor, lookfor_len))) {
int ret;
- ret = phar_tar_setmetadata(&entry->metadata, metadata, error TSRMLS_CC);
+ ret = phar_tar_setmetadata(&entry->metadata, metadata, error);
efree(lookfor);
return ret;
}
@@ -917,11 +917,11 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
return ZEND_HASH_APPLY_STOP;
}
- return phar_tar_setmetadata(&entry->metadata, metadata, error TSRMLS_CC);
+ return phar_tar_setmetadata(&entry->metadata, metadata, error);
}
/* }}} */
-int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC) /* {{{ */
+int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
{
phar_entry_info entry = {0};
static const char newstub[] = "<?php // tar-based phar archive stub file\n__HALT_COMPILER();";
@@ -1137,7 +1137,7 @@ nostub:
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar_entry_info *mentry;
if (NULL != (mentry = zend_hash_str_find_ptr(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1))) {
- if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error TSRMLS_CC)) {
+ if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -1160,7 +1160,7 @@ nostub:
return EOF;
}
- if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error TSRMLS_CC)) {
+ if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
zend_hash_str_del(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1);
if (closeoldfile) {
php_stream_close(oldfile);
@@ -1170,7 +1170,7 @@ nostub:
}
}
- zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass);
if (error && *error) {
if (closeoldfile) {
@@ -1182,11 +1182,11 @@ nostub:
return EOF;
}
- zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass);
/* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */
if (!phar->is_data || phar->sig_flags) {
- if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error)) {
if (error) {
char *save = *error;
spprintf(error, 0, "phar error: unable to write signature to tar-based phar: %s", save);
@@ -1236,7 +1236,7 @@ nostub:
efree(signature);
entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8;
/* throw out return value and write the signature */
- entry.filename_len = phar_tar_writeheaders_int(&entry, (void *)&pass TSRMLS_CC);
+ entry.filename_len = phar_tar_writeheaders_int(&entry, (void *)&pass);
if (error && *error) {
if (closeoldfile) {
@@ -1301,7 +1301,7 @@ nostub:
#define MAX_WBITS 15
#endif
add_assoc_long(&filterparams, "window", MAX_WBITS + 16);
- filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -1317,18 +1317,18 @@ nostub:
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
php_stream_filter *filter;
- filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
diff --git a/ext/phar/util.c b/ext/phar/util.c
index f131aa99a2..56d168b072 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -38,11 +38,11 @@
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#else
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC);
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len);
#endif
/* for links to relative location, prepend cwd of the entry */
-static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+static char *phar_get_link_location(phar_entry_info *entry) /* {{{ */
{
char *p, *ret = NULL;
if (!entry->link) {
@@ -61,7 +61,7 @@ static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
}
/* }}} */
-phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_link_source(phar_entry_info *entry) /* {{{ */
{
phar_entry_info *link_entry;
char *link;
@@ -70,13 +70,13 @@ phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ *
return entry;
}
- link = phar_get_link_location(entry TSRMLS_CC);
+ link = phar_get_link_location(entry);
if (NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->link, strlen(entry->link))) ||
NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), link, strlen(link)))) {
if (link != entry->link) {
efree(link);
}
- return phar_get_link_source(link_entry TSRMLS_CC);
+ return phar_get_link_source(link_entry);
} else {
if (link != entry->link) {
efree(link);
@@ -87,24 +87,24 @@ phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ *
/* }}} */
/* retrieve a phar_entry_info's current file pointer for reading contents */
-php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /* {{{ */
+php_stream *phar_get_efp(phar_entry_info *entry, int follow_links) /* {{{ */
{
if (follow_links && entry->link) {
- phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
+ phar_entry_info *link_entry = phar_get_link_source(entry);
if (link_entry && link_entry != entry) {
- return phar_get_efp(link_entry, 1 TSRMLS_CC);
+ return phar_get_efp(link_entry, 1);
}
}
- if (phar_get_fp_type(entry TSRMLS_CC) == PHAR_FP) {
- if (!phar_get_entrypfp(entry TSRMLS_CC)) {
+ if (phar_get_fp_type(entry) == PHAR_FP) {
+ if (!phar_get_entrypfp(entry)) {
/* re-open just in time for cases where our refcount reached 0 on the phar archive */
- phar_open_archive_fp(entry->phar TSRMLS_CC);
+ phar_open_archive_fp(entry->phar);
}
- return phar_get_entrypfp(entry TSRMLS_CC);
- } else if (phar_get_fp_type(entry TSRMLS_CC) == PHAR_UFP) {
- return phar_get_entrypufp(entry TSRMLS_CC);
+ return phar_get_entrypfp(entry);
+ } else if (phar_get_fp_type(entry) == PHAR_UFP) {
+ return phar_get_entrypufp(entry);
} else if (entry->fp_type == PHAR_MOD) {
return entry->fp;
} else {
@@ -117,9 +117,9 @@ php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /*
}
/* }}} */
-int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC) /* {{{ */
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links) /* {{{ */
{
- php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
+ php_stream *fp = phar_get_efp(entry, follow_links);
zend_off_t temp, eoffset;
if (!fp) {
@@ -128,7 +128,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
if (follow_links) {
phar_entry_info *t;
- t = phar_get_link_source(entry TSRMLS_CC);
+ t = phar_get_link_source(entry);
if (t) {
entry = t;
}
@@ -138,7 +138,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
return 0;
}
- eoffset = phar_get_fp_offset(entry TSRMLS_CC);
+ eoffset = phar_get_fp_offset(entry);
switch (whence) {
case SEEK_END:
@@ -167,7 +167,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
/* }}} */
/* mount an absolute path or uri to a path internal to the phar archive */
-int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len TSRMLS_DC) /* {{{ */
+int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len) /* {{{ */
{
phar_entry_info entry = {0};
php_stream_statbuf ssb;
@@ -194,7 +194,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
if (is_phar) {
entry.tmp = estrndup(filename, filename_len);
} else {
- entry.tmp = expand_filepath(filename, NULL TSRMLS_CC);
+ entry.tmp = expand_filepath(filename, NULL);
if (!entry.tmp) {
entry.tmp = estrndup(filename, filename_len);
}
@@ -209,7 +209,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
filename = entry.tmp;
/* only check openbasedir for files, not for phar streams */
- if (!is_phar && php_check_open_basedir(filename TSRMLS_CC)) {
+ if (!is_phar && php_check_open_basedir(filename)) {
efree(entry.tmp);
efree(entry.filename);
return FAILURE;
@@ -250,7 +250,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
}
/* }}} */
-char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_data **pphar) /* {{{ */
{
char *path, *fname, *arch, *entry, *ret, *test;
int arch_len, entry_len, fname_len, ret_len;
@@ -262,11 +262,11 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
pphar = &phar;
}
- if (!zend_is_executing(TSRMLS_C) || !PHAR_G(cwd)) {
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ if (!zend_is_executing() || !PHAR_G(cwd)) {
+ return phar_save_resolve_path(filename, filename_len);
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
if (PHAR_G(last_phar) && !memcmp(fname, "phar://", 7) && fname_len - 7 >= PHAR_G(last_phar_name_len) && !memcmp(fname + 7, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len))) {
@@ -276,8 +276,8 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
goto splitted;
}
- if (fname_len < 7 || memcmp(fname, "phar://", 7) || SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) {
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ if (fname_len < 7 || memcmp(fname, "phar://", 7) || SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0)) {
+ return phar_save_resolve_path(filename, filename_len);
}
efree(entry);
@@ -285,9 +285,9 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
if (*filename == '.') {
int try_len;
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ return phar_save_resolve_path(filename, filename_len);
}
splitted:
if (pphar) {
@@ -295,7 +295,7 @@ splitted:
}
try_len = filename_len;
- test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1 TSRMLS_CC);
+ test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1);
if (*test == '/') {
if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) {
@@ -317,14 +317,14 @@ splitted:
spprintf(&path, MAXPATHLEN, "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
efree(arch);
- ret = php_resolve_path(filename, filename_len, path TSRMLS_CC);
+ ret = php_resolve_path(filename, filename_len, path);
efree(path);
if (ret && strlen(ret) > 8 && !strncmp(ret, "phar://", 7)) {
ret_len = strlen(ret);
/* found phar:// */
- if (SUCCESS != phar_split_fname(ret, ret_len, &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) {
+ if (SUCCESS != phar_split_fname(ret, ret_len, &arch, &arch_len, &entry, &entry_len, 1, 0)) {
return ret;
}
@@ -350,7 +350,7 @@ splitted:
* appended, truncated, or read. For read, if the entry is marked unmodified, it is
* assumed that the file pointer, if present, is opened for reading
*/
-int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
+int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry;
@@ -369,7 +369,7 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char
*error = NULL;
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
return FAILURE;
}
@@ -388,14 +388,14 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char
}
really_get_entry:
if (allow_dir) {
- if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security TSRMLS_CC)) == NULL) {
+ if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
return SUCCESS;
}
return FAILURE;
}
} else {
- if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security TSRMLS_CC)) == NULL) {
+ if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
return SUCCESS;
}
@@ -404,7 +404,7 @@ really_get_entry:
}
if (for_write && phar->is_persistent) {
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, could not make cached phar writeable", path, fname);
}
@@ -455,11 +455,11 @@ really_get_entry:
if (entry->fp_type == PHAR_MOD) {
if (for_trunc) {
- if (FAILURE == phar_create_writeable_entry(phar, entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
return FAILURE;
}
} else if (for_append) {
- phar_seek_efp(entry, 0, SEEK_END, 0, 0 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_END, 0, 0);
}
} else {
if (for_write) {
@@ -470,16 +470,16 @@ really_get_entry:
}
if (for_trunc) {
- if (FAILURE == phar_create_writeable_entry(phar, entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
return FAILURE;
}
} else {
- if (FAILURE == phar_separate_entry_fp(entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_separate_entry_fp(entry, error)) {
return FAILURE;
}
}
} else {
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return FAILURE;
}
}
@@ -492,11 +492,11 @@ really_get_entry:
(*ret)->internal_file = entry;
(*ret)->is_zip = entry->is_zip;
(*ret)->is_tar = entry->is_tar;
- (*ret)->fp = phar_get_efp(entry, 1 TSRMLS_CC);
+ (*ret)->fp = phar_get_efp(entry, 1);
if (entry->link) {
- (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry TSRMLS_CC) TSRMLS_CC);
+ (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry));
} else {
- (*ret)->zero = phar_get_fp_offset(entry TSRMLS_CC);
+ (*ret)->zero = phar_get_fp_offset(entry);
}
if (!phar->is_persistent) {
@@ -511,7 +511,7 @@ really_get_entry:
/**
* Create a new dummy file slot within a writeable phar for a newly created file
*/
-phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry, etemp;
@@ -525,11 +525,11 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
is_dir = (path_len && path[path_len - 1] == '/') ? 1 : 0;
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
return NULL;
}
- if (FAILURE == phar_get_entry_data(&ret, fname, fname_len, path, path_len, mode, allow_dir, error, security TSRMLS_CC)) {
+ if (FAILURE == phar_get_entry_data(&ret, fname, fname_len, path, path_len, mode, allow_dir, error, security)) {
return NULL;
} else if (ret) {
return ret;
@@ -542,7 +542,7 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
return NULL;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be created, could not make cached phar writeable", path, fname);
}
@@ -579,7 +579,7 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
path_len--;
}
- phar_add_virtual_dirs(phar, path, path_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, path, path_len);
etemp.is_modified = 1;
etemp.timestamp = time(0);
etemp.is_crc_checked = 1;
@@ -623,19 +623,19 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
/* }}} */
/* initialize a phar_archive_data's read-only fp for existing phar data */
-int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+int phar_open_archive_fp(phar_archive_data *phar) /* {{{ */
{
- if (phar_get_pharfp(phar TSRMLS_CC)) {
+ if (phar_get_pharfp(phar)) {
return SUCCESS;
}
- if (php_check_open_basedir(phar->fname TSRMLS_CC)) {
+ if (php_check_open_basedir(phar->fname)) {
return FAILURE;
}
- phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL) TSRMLS_CC);
+ phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL));
- if (!phar_get_pharfp(phar TSRMLS_CC)) {
+ if (!phar_get_pharfp(phar)) {
return FAILURE;
}
@@ -644,11 +644,11 @@ int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/* }}} */
/* copy file data from an existing to a new phar_entry_info that is not in the manifest */
-int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC) /* {{{ */
+int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error) /* {{{ */
{
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(source, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(source, error, 1)) {
return FAILURE;
}
@@ -666,14 +666,14 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er
spprintf(error, 0, "phar error: unable to create temporary file");
return EOF;
}
- phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC);
- link = phar_get_link_source(source TSRMLS_CC);
+ phar_seek_efp(source, 0, SEEK_SET, 0, 1);
+ link = phar_get_link_source(source);
if (!link) {
link = source;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), dest->fp, link->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), dest->fp, link->uncompressed_filesize, NULL)) {
php_stream_close(dest->fp);
dest->fp_type = PHAR_FP;
if (error) {
@@ -688,7 +688,7 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er
/* open and decompress a compressed phar entry
*/
-int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TSRMLS_DC) /* {{{ */
+int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links) /* {{{ */
{
php_stream_filter *filter;
phar_archive_data *phar = entry->phar;
@@ -698,9 +698,9 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
phar_entry_data dummy;
if (follow_links && entry->link) {
- phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
+ phar_entry_info *link_entry = phar_get_link_source(entry);
if (link_entry && link_entry != entry) {
- return phar_open_entry_fp(link_entry, error, 1 TSRMLS_CC);
+ return phar_open_entry_fp(link_entry, error, 1);
}
}
@@ -720,8 +720,8 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
return SUCCESS;
}
- if (!phar_get_pharfp(phar TSRMLS_CC)) {
- if (FAILURE == phar_open_archive_fp(phar TSRMLS_CC)) {
+ if (!phar_get_pharfp(phar)) {
+ if (FAILURE == phar_open_archive_fp(phar)) {
spprintf(error, 4096, "phar error: Cannot open phar archive \"%s\" for reading", phar->fname);
return FAILURE;
}
@@ -731,16 +731,16 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
dummy.internal_file = entry;
dummy.phar = phar;
dummy.zero = entry->offset;
- dummy.fp = phar_get_pharfp(phar TSRMLS_CC);
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1 TSRMLS_CC)) {
+ dummy.fp = phar_get_pharfp(phar);
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1)) {
return FAILURE;
}
return SUCCESS;
}
- if (!phar_get_entrypufp(entry TSRMLS_CC)) {
- phar_set_entrypufp(entry, php_stream_fopen_tmpfile() TSRMLS_CC);
- if (!phar_get_entrypufp(entry TSRMLS_CC)) {
+ if (!phar_get_entrypufp(entry)) {
+ phar_set_entrypufp(entry, php_stream_fopen_tmpfile());
+ if (!phar_get_entrypufp(entry)) {
spprintf(error, 4096, "phar error: Cannot open temporary file for decompressing phar archive \"%s\" file \"%s\"", phar->fname, entry->filename);
return FAILURE;
}
@@ -749,15 +749,15 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
dummy.internal_file = entry;
dummy.phar = phar;
dummy.zero = entry->offset;
- dummy.fp = phar_get_pharfp(phar TSRMLS_CC);
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1 TSRMLS_CC)) {
+ dummy.fp = phar_get_pharfp(phar);
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1)) {
return FAILURE;
}
- ufp = phar_get_entrypufp(entry TSRMLS_CC);
+ ufp = phar_get_entrypufp(entry);
if ((filtername = phar_decompress_filter(entry, 0)) != NULL) {
- filter = php_stream_filter_create(filtername, NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, NULL, 0);
} else {
filter = NULL;
}
@@ -772,19 +772,19 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
php_stream_seek(ufp, 0, SEEK_END);
loc = php_stream_tell(ufp);
php_stream_filter_append(&ufp->writefilters, filter);
- php_stream_seek(phar_get_entrypfp(entry TSRMLS_CC), phar_get_fp_offset(entry TSRMLS_CC), SEEK_SET);
+ php_stream_seek(phar_get_entrypfp(entry), phar_get_fp_offset(entry), SEEK_SET);
if (entry->uncompressed_filesize) {
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_entrypfp(entry TSRMLS_CC), ufp, entry->compressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_entrypfp(entry), ufp, entry->compressed_filesize, NULL)) {
spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
return FAILURE;
}
}
php_stream_filter_flush(filter, 1);
php_stream_flush(ufp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
if (php_stream_tell(ufp) - loc != (zend_off_t) entry->uncompressed_filesize) {
spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
@@ -794,17 +794,17 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
entry->old_flags = entry->flags;
/* this is now the new location of the file contents within this fp */
- phar_set_fp_type(entry, PHAR_UFP, loc TSRMLS_CC);
+ phar_set_fp_type(entry, PHAR_UFP, loc);
dummy.zero = entry->offset;
dummy.fp = ufp;
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 0)) {
return FAILURE;
}
return SUCCESS;
}
/* }}} */
-int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
{
if (entry->fp_type == PHAR_MOD) {
/* already newly created, truncate */
@@ -857,12 +857,12 @@ int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry,
}
/* }}} */
-int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_separate_entry_fp(phar_entry_info *entry, char **error) /* {{{ */
{
php_stream *fp;
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return FAILURE;
}
@@ -875,14 +875,14 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{
spprintf(error, 0, "phar error: unable to create temporary file");
return FAILURE;
}
- phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
- link = phar_get_link_source(entry TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 1);
+ link = phar_get_link_source(entry);
if (!link) {
link = entry;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), fp, link->uncompressed_filesize, NULL)) {
if (error) {
spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname);
}
@@ -906,16 +906,16 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{
/**
* helper function to open an internal file's fp just-in-time
*/
-phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
{
if (error) {
*error = NULL;
}
/* seek to start of internal file and read it */
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return NULL;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
spprintf(error, 4096, "phar error: cannot seek to start of file \"%s\" in phar \"%s\"", entry->filename, phar->fname);
return NULL;
}
@@ -923,7 +923,7 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry,
}
/* }}} */
-PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC) /* {{{ */ {
+PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len) /* {{{ */ {
phar_archive_data *fd_ptr;
if (PHAR_GLOBALS->phar_alias_map.arHash
&& NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
@@ -935,7 +935,7 @@ PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename,
}
/* }}} */
-int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */
+int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len) /* {{{ */
{
if (phar->refcount || phar->is_persistent) {
return FAILURE;
@@ -958,13 +958,13 @@ int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_D
* Looks up a phar archive in the filename map, connecting it to the alias
* (if any) or returns null
*/
-int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
+int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error) /* {{{ */
{
phar_archive_data *fd, *fd_ptr;
char *my_realpath, *save;
int save_len;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (error) {
*error = NULL;
@@ -1009,7 +1009,7 @@ alias_success:
if (error) {
spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, fd_ptr->fname, fname);
}
- if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
efree(*error);
*error = NULL;
@@ -1116,7 +1116,7 @@ alias_success:
}
/* not found, try converting \ to / */
- my_realpath = expand_filepath(fname, my_realpath TSRMLS_CC);
+ my_realpath = expand_filepath(fname, my_realpath);
if (my_realpath) {
fname_len = strlen(my_realpath);
@@ -1202,9 +1202,9 @@ char * phar_decompress_filter(phar_entry_info * entry, int return_unknown) /* {{
/**
* retrieve information on a file contained within a phar, or null if it ain't there
*/
-phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security) /* {{{ */
{
- return phar_get_entry_info_dir(phar, path, path_len, 0, error, security TSRMLS_CC);
+ return phar_get_entry_info_dir(phar, path, path_len, 0, error, security);
}
/* }}} */
/**
@@ -1212,7 +1212,7 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int pa
* allow_dir is 0 for none, 1 for both empty directories in the phar and temp directories, and 2 for only
* valid pre-existing empty directory entries
*/
-phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security) /* {{{ */
{
const char *pcr_error;
phar_entry_info *entry;
@@ -1344,7 +1344,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in
}
/* mount the file just in time */
- if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len TSRMLS_CC)) {
+ if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len)) {
efree(test);
if (error) {
spprintf(error, 4096, "phar error: path \"%s\" exists as file \"%s\" and could not be mounted", path, test);
@@ -1371,7 +1371,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in
static const char hexChars[] = "0123456789ABCDEF";
-static int phar_hex_str(const char *digest, size_t digest_len, char **signature TSRMLS_DC) /* {{{ */
+static int phar_hex_str(const char *digest, size_t digest_len, char **signature) /* {{{ */
{
int pos = -1;
size_t len = 0;
@@ -1388,7 +1388,7 @@ static int phar_hex_str(const char *digest, size_t digest_len, char **signature
/* }}} */
#ifndef PHAR_HAVE_OPENSSL
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC) /* {{{ */
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len) /* {{{ */
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
@@ -1414,7 +1414,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
return FAILURE;
}
- if (FAILURE == zend_fcall_info_init(&openssl, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) {
+ if (FAILURE == zend_fcall_info_init(&openssl, 0, &fci, &fcc, NULL, NULL)) {
zval_dtor(&zp[0]);
zval_dtor(&zp[1]);
zval_dtor(&zp[2]);
@@ -1434,7 +1434,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
fci.retval = &retval;
- if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) {
+ if (FAILURE == zend_call_function(&fci, &fcc)) {
zval_dtor(&zp[0]);
zval_dtor(&zp[1]);
zval_dtor(&zp[2]);
@@ -1476,7 +1476,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
/* }}} */
#endif /* #ifndef PHAR_HAVE_OPENSSL */
-int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error TSRMLS_DC) /* {{{ */
+int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error) /* {{{ */
{
int read_size, len;
zend_off_t read_len;
@@ -1524,7 +1524,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
#ifndef PHAR_HAVE_OPENSSL
tempsig = sig_len;
- if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, pubkey ? pubkey->val : NULL, pubkey ? pubkey->len : 0, &sig, &tempsig TSRMLS_CC)) {
+ if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, pubkey ? pubkey->val : NULL, pubkey ? pubkey->len : 0, &sig, &tempsig)) {
if (pubkey) {
zend_string_release(pubkey);
}
@@ -1597,7 +1597,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
EVP_MD_CTX_cleanup(&md_ctx);
#endif
- *signature_len = phar_hex_str((const char*)sig, sig_len, signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)sig, sig_len, signature);
}
break;
#ifdef PHAR_HASH_OK
@@ -1631,7 +1631,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
case PHAR_SIG_SHA256: {
@@ -1664,7 +1664,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
#else
@@ -1705,7 +1705,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
case PHAR_SIG_MD5: {
@@ -1738,7 +1738,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
default:
@@ -1751,7 +1751,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
}
/* }}} */
-int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC) /* {{{ */
+int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error) /* {{{ */
{
unsigned char buf[1024];
int sig_len;
@@ -1869,7 +1869,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat
siglen = 0;
php_stream_seek(fp, 0, SEEK_END);
- if (FAILURE == phar_call_openssl_signverify(1, fp, php_stream_tell(fp), PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len), (char **)&sigbuf, &siglen TSRMLS_CC)) {
+ if (FAILURE == phar_call_openssl_signverify(1, fp, php_stream_tell(fp), PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len), (char **)&sigbuf, &siglen)) {
if (error) {
spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
}
@@ -1914,12 +1914,12 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat
}
}
- phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature TSRMLS_CC);
+ phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature);
return SUCCESS;
}
/* }}} */
-void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC) /* {{{ */
+void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len) /* {{{ */
{
const char *s;
@@ -1932,7 +1932,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
}
/* }}} */
-static int phar_update_cached_entry(zval *data, void *argument TSRMLS_DC) /* {{{ */
+static int phar_update_cached_entry(zval *data, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(data);
@@ -1954,7 +1954,7 @@ static int phar_update_cached_entry(zval *data, void *argument TSRMLS_DC) /* {{{
if (entry->metadata_len) {
char *buf = estrndup((char *) Z_PTR(entry->metadata), entry->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata((char **) &buf, &entry->metadata, entry->metadata_len TSRMLS_CC);
+ phar_parse_metadata((char **) &buf, &entry->metadata, entry->metadata_len);
efree(buf);
} else {
zval_copy_ctor(&entry->metadata);
@@ -1973,7 +1973,7 @@ static void phar_manifest_copy_ctor(zval *zv) /* {{{ */
}
/* }}} */
-static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+static void phar_copy_cached_phar(phar_archive_data **pphar) /* {{{ */
{
phar_archive_data *phar;
HashTable newmanifest;
@@ -1999,7 +1999,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
/* assume success, we would have failed before */
if (phar->metadata_len) {
char *buf = estrndup((char *) Z_PTR(phar->metadata), phar->metadata_len);
- phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len);
efree(buf);
} else {
zval_copy_ctor(&phar->metadata);
@@ -2009,7 +2009,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
zend_hash_init(&newmanifest, sizeof(phar_entry_info),
zend_get_hash_value, destroy_phar_manifest_entry, 0);
zend_hash_copy(&newmanifest, &(*pphar)->manifest, phar_manifest_copy_ctor);
- zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar TSRMLS_CC);
+ zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar);
phar->manifest = newmanifest;
zend_hash_init(&phar->mounted_dirs, sizeof(char *),
zend_get_hash_value, NULL, 0);
@@ -2027,7 +2027,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
}
/* }}} */
-int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+int phar_copy_on_write(phar_archive_data **pphar) /* {{{ */
{
zval zv, *pzv;
phar_archive_data *newpphar;
@@ -2037,7 +2037,7 @@ int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
return FAILURE;
}
- phar_copy_cached_phar((phar_archive_data **)&Z_PTR_P(pzv) TSRMLS_CC);
+ phar_copy_cached_phar((phar_archive_data **)&Z_PTR_P(pzv));
newpphar = Z_PTR_P(pzv);
/* invalidate phar cache */
PHAR_G(last_phar) = NULL;
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 4fe0bf05c8..d5316452ab 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -39,7 +39,7 @@ static inline void phar_write_16(char buffer[2], php_uint32 value)
# define PHAR_SET_32(var, value) phar_write_32(var, (php_uint32) (value));
# define PHAR_SET_16(var, value) phar_write_16(var, (php_uint16) (value));
-static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len TSRMLS_DC) /* {{{ */
+static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len) /* {{{ */
{
union {
phar_zip_extra_field_header header;
@@ -163,7 +163,7 @@ static void phar_zip_u2d_time(time_t time, char *dtime, char *ddate) /* {{{ */
* This is used by phar_open_from_fp to process a zip-based phar, but can be called
* directly.
*/
-int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
@@ -237,7 +237,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
mydata->metadata_len = PHAR_GET_16(locator.comment_len);
- if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len) TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len)) == FAILURE) {
mydata->metadata_len = 0;
/* if not valid serialized data, it is a regular string */
@@ -422,7 +422,7 @@ foundit:
PHAR_ZIP_FAIL("signature cannot be read");
}
mydata->sig_flags = PHAR_GET_32(sig);
- if (FAILURE == phar_verify_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_filesize - 8, fname, &mydata->signature, &mydata->sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_filesize - 8, fname, &mydata->signature, &mydata->sig_len, error)) {
efree(sig);
if (error) {
char *save;
@@ -445,11 +445,11 @@ foundit:
continue;
}
- phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len);
if (PHAR_GET_16(zipentry.extra_len)) {
zend_off_t loc = php_stream_tell(fp);
- if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len) TSRMLS_CC)) {
+ if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) {
pefree(entry.filename, entry.is_persistent);
PHAR_ZIP_FAIL("Unable to process extra field header for file in central directory");
}
@@ -525,7 +525,7 @@ foundit:
p = buf;
entry.metadata_len = PHAR_GET_16(zipentry.comment_len);
- if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len) TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len)) == FAILURE) {
entry.metadata_len = 0;
/* if not valid serialized data, it is a regular string */
@@ -570,7 +570,7 @@ foundit:
mydata->alias_len = entry.uncompressed_filesize;
if (entry.flags & PHAR_ENT_COMPRESSED_GZ) {
- filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp));
if (!filter) {
pefree(entry.filename, entry.is_persistent);
@@ -599,10 +599,10 @@ foundit:
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
} else if (entry.flags & PHAR_ENT_COMPRESSED_BZ2) {
- filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
if (!filter) {
pefree(entry.filename, entry.is_persistent);
@@ -631,7 +631,7 @@ foundit:
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
} else {
// TODO: refactor to avoid reallocation ???
//??? entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)
@@ -657,7 +657,7 @@ foundit:
php_stream_seek(fp, saveloc, SEEK_SET);
}
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void *)&entry, sizeof(phar_entry_info));
}
@@ -686,7 +686,7 @@ foundit:
mydata->is_temporary_alias = 0;
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), actual_alias, mydata->alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, mydata->alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, mydata->alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with implicit alias, alias is already in use", fname);
}
@@ -708,7 +708,7 @@ foundit:
if (alias_len) {
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with explicit alias, alias is already in use", fname);
}
@@ -739,10 +739,10 @@ foundit:
/**
* Create or open a zip-based phar for writing
*/
-int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
- int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error TSRMLS_CC);
+ int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
if (FAILURE == ret) {
return FAILURE;
@@ -783,7 +783,7 @@ struct _phar_zip_pass {
char **error;
};
/* perform final modification of zip contents for each file in the manifest before saving */
-static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_DC) /* {{{ */
+static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ */
{
phar_zip_file_header local;
phar_zip_unix3 perms;
@@ -807,7 +807,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
}
}
- phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
memset(&local, 0, sizeof(local));
memset(&central, 0, sizeof(central));
memset(&perms, 0, sizeof(perms));
@@ -860,7 +860,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto continue_dir;
}
- if (FAILURE == phar_open_entry_fp(entry, p->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) {
spprintf(p->error, 0, "unable to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -871,12 +871,12 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto is_compressed;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
- efp = phar_get_efp(entry, 0 TSRMLS_CC);
+ efp = phar_get_efp(entry, 0);
newcrc32 = ~0;
for (loc = 0;loc < entry->uncompressed_filesize; ++loc) {
@@ -895,7 +895,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto not_compressed;
}
- filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
if (!filter) {
if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
@@ -918,7 +918,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
php_stream_flush(efp);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -932,7 +932,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
php_stream_filter_flush(filter, 1);
php_stream_flush(entry->cfp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_seek(entry->cfp, 0, SEEK_END);
entry->compressed_filesize = (php_uint32) php_stream_tell(entry->cfp);
PHAR_SET_32(central.compsize, entry->compressed_filesize);
@@ -967,7 +967,7 @@ continue_dir:
}
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
PHAR_SET_16(central.comment_len, entry->metadata_str.s->len);
}
@@ -1037,13 +1037,13 @@ continue_dir:
php_stream_close(entry->cfp);
entry->cfp = NULL;
} else {
- if (FAILURE == phar_open_entry_fp(entry, p->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) {
return ZEND_HASH_APPLY_STOP;
}
- phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 0);
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), p->filefp, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed_filesize, NULL)) {
spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -1093,14 +1093,14 @@ continue_dir:
}
/* }}} */
-static int phar_zip_changed_apply(zval *zv, void *arg TSRMLS_DC) /* {{{ */
+static int phar_zip_changed_apply(zval *zv, void *arg) /* {{{ */
{
- return phar_zip_changed_apply_int(Z_PTR_P(zv), arg TSRMLS_CC);
+ return phar_zip_changed_apply_int(Z_PTR_P(zv), arg);
}
/* }}} */
static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pass *pass,
- smart_str *metadata TSRMLS_DC) /* {{{ */
+ smart_str *metadata) /* {{{ */
{
/* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */
if (!phar->is_data || phar->sig_flags) {
@@ -1126,7 +1126,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
php_stream_write(newfile, metadata->s->val, metadata->s->len);
}
- if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error)) {
if (pass->error) {
char *save = *(pass->error);
spprintf(pass->error, 0, "phar error: unable to write signature to zip-based phar: %s", save);
@@ -1164,7 +1164,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8;
entry.phar = phar;
/* throw out return value and write the signature */
- phar_zip_changed_apply_int(&entry, (void *)pass TSRMLS_CC);
+ phar_zip_changed_apply_int(&entry, (void *)pass);
php_stream_close(newfile);
if (pass->error && *(pass->error)) {
@@ -1177,7 +1177,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
}
/* }}} */
-int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC) /* {{{ */
+int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
{
char *pos;
smart_str main_metadata_str = {0};
@@ -1243,7 +1243,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
/* register alias */
if (phar->alias_len) {
- if (FAILURE == phar_get_archive(&phar, phar->fname, phar->fname_len, phar->alias, phar->alias_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, phar->fname, phar->fname_len, phar->alias, phar->alias_len, error)) {
return EOF;
}
}
@@ -1431,12 +1431,12 @@ fperror:
PHAR_SET_16(eocd.counthere, zend_hash_num_elements(&phar->manifest));
PHAR_SET_16(eocd.count, zend_hash_num_elements(&phar->manifest));
}
- zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass);
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
/* set phar metadata */
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
}
if (temperr) {
@@ -1457,7 +1457,7 @@ nocentralerror:
return EOF;
}
- if (FAILURE == phar_zip_applysignature(phar, &pass, &main_metadata_str TSRMLS_CC)) {
+ if (FAILURE == phar_zip_applysignature(phar, &pass, &main_metadata_str)) {
goto temperror;
}
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index ca7d34c645..7cd4b56dd7 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -381,7 +381,7 @@ ZEND_GET_MODULE(posix)
#define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \
zend_long val; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) RETURN_FALSE; \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) RETURN_FALSE; \
if (func_name(val) < 0) { \
POSIX_G(last_error) = errno; \
RETURN_FALSE; \
@@ -395,7 +395,7 @@ PHP_FUNCTION(posix_kill)
{
zend_long pid, sig;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &pid, &sig) == FAILURE) {
RETURN_FALSE;
}
@@ -560,7 +560,7 @@ PHP_FUNCTION(posix_setpgid)
{
zend_long pid, pgid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &pid, &pgid) == FAILURE) {
RETURN_FALSE;
}
@@ -579,7 +579,7 @@ PHP_FUNCTION(posix_setpgid)
PHP_FUNCTION(posix_getpgid)
{
zend_long val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) {
RETURN_FALSE;
}
@@ -598,7 +598,7 @@ PHP_FUNCTION(posix_getpgid)
PHP_FUNCTION(posix_getsid)
{
zend_long val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) {
RETURN_FALSE;
}
@@ -693,14 +693,14 @@ PHP_FUNCTION(posix_ctermid)
/* }}} */
/* Checks if the provides resource is a stream and if it provides a file descriptor */
-static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) /* {{{ */
+static int php_posix_stream_get_fd(zval *zfp, int *fd) /* {{{ */
{
php_stream *stream;
php_stream_from_zval_no_verify(stream, zfp);
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 1 to be a valid stream resource");
+ php_error_docref(NULL, E_WARNING, "expects argument 1 to be a valid stream resource");
return 0;
}
if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) {
@@ -708,7 +708,7 @@ static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) /* {{{ */
} else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) {
php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not use stream of type '%s'",
+ php_error_docref(NULL, E_WARNING, "could not use stream of type '%s'",
stream->ops->label);
return 0;
}
@@ -727,13 +727,13 @@ PHP_FUNCTION(posix_ttyname)
zend_long buflen;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ if (!php_posix_stream_get_fd(z_fd, &fd)) {
RETURN_FALSE;
}
break;
@@ -772,13 +772,13 @@ PHP_FUNCTION(posix_isatty)
zval *z_fd;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ if (!php_posix_stream_get_fd(z_fd, &fd)) {
RETURN_FALSE;
}
break;
@@ -839,11 +839,11 @@ PHP_FUNCTION(posix_mkfifo)
zend_long mode;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &path, &path_len, &mode) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
RETURN_FALSE;
}
@@ -872,29 +872,29 @@ PHP_FUNCTION(posix_mknod)
php_dev = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl|ll", &path, &path_len,
&mode, &major, &minor) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
RETURN_FALSE;
}
if ((mode & S_IFCHR) || (mode & S_IFBLK)) {
if (ZEND_NUM_ARGS() == 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
+ php_error_docref(NULL, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
RETURN_FALSE;
}
if (major == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expects argument 3 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK");
RETURN_FALSE;
} else {
#if defined(HAVE_MAKEDEV) || defined(makedev)
php_dev = makedev(major, minor);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create a block or character device, creating a normal file instead");
+ php_error_docref(NULL, E_WARNING, "Cannot create a block or character device, creating a normal file instead");
#endif
}
}
@@ -951,17 +951,17 @@ PHP_FUNCTION(posix_access)
size_t filename_len, ret;
char *filename, *path;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &mode) == FAILURE) {
RETURN_FALSE;
}
- path = expand_filepath(filename, NULL TSRMLS_CC);
+ path = expand_filepath(filename, NULL);
if (!path) {
POSIX_G(last_error) = EIO;
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
efree(path);
POSIX_G(last_error) = EPERM;
RETURN_FALSE;
@@ -999,7 +999,7 @@ PHP_FUNCTION(posix_getgrnam)
char *buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1026,7 +1026,7 @@ PHP_FUNCTION(posix_getgrnam)
if (!php_posix_group_to_array(g, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix group to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(posix_getgrgid)
#endif
struct group *g;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &gid) == FAILURE) {
RETURN_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1078,7 +1078,7 @@ PHP_FUNCTION(posix_getgrgid)
if (!php_posix_group_to_array(g, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix group struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1118,7 +1118,7 @@ PHP_FUNCTION(posix_getpwnam)
char *buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(posix_getpwnam)
if (!php_posix_passwd_to_array(pw, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
@@ -1168,7 +1168,7 @@ PHP_FUNCTION(posix_getpwuid)
#endif
struct passwd *pw;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &uid) == FAILURE) {
RETURN_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
@@ -1195,7 +1195,7 @@ PHP_FUNCTION(posix_getpwuid)
if (!php_posix_passwd_to_array(pw, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
@@ -1211,7 +1211,7 @@ PHP_FUNCTION(posix_getpwuid)
/* {{{ posix_addlimit
*/
-static int posix_addlimit(int limit, char *name, zval *return_value TSRMLS_DC) {
+static int posix_addlimit(int limit, char *name, zval *return_value) {
int result;
struct rlimit rl;
char hard[80];
@@ -1312,7 +1312,7 @@ PHP_FUNCTION(posix_getrlimit)
array_init(return_value);
for (l=limits; l->name; l++) {
- if (posix_addlimit(l->limit, l->name, return_value TSRMLS_CC) == FAILURE) {
+ if (posix_addlimit(l->limit, l->name, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1338,7 +1338,7 @@ PHP_FUNCTION(posix_strerror)
{
zend_long error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &error) == FAILURE) {
RETURN_FALSE;
}
@@ -1357,7 +1357,7 @@ PHP_FUNCTION(posix_initgroups)
char *name;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &name, &name_len, &basegid) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index 72165ae78e..d9fad750fb 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -213,14 +213,14 @@ zend_module_entry pspell_module_entry = {
ZEND_GET_MODULE(pspell)
#endif
-static void php_pspell_close(zend_resource *rsrc TSRMLS_DC)
+static void php_pspell_close(zend_resource *rsrc)
{
PspellManager *manager = (PspellManager *)rsrc->ptr;
delete_pspell_manager(manager);
}
-static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
+static void php_pspell_close_config(zend_resource *rsrc)
{
PspellConfig *config = (PspellConfig *)rsrc->ptr;
@@ -230,7 +230,7 @@ static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
#define PSPELL_FETCH_CONFIG do { \
zval *res = zend_hash_index_find(&EG(regular_list), conf); \
if (res == NULL || Z_RES_P(res)->type != le_pspell_config) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", conf); \
+ php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL config index", conf); \
RETURN_FALSE; \
} \
config = (PspellConfig *)Z_RES_P(res)->ptr; \
@@ -239,7 +239,7 @@ static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
#define PSPELL_FETCH_MANAGER do { \
zval *res = zend_hash_index_find(&EG(regular_list), scin); \
if (res == NULL || Z_RES_P(res)->type != le_pspell) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", scin); \
+ php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL result index", scin); \
RETURN_FALSE; \
} \
manager = (PspellManager *)Z_RES_P(res)->ptr; \
@@ -281,7 +281,7 @@ static PHP_FUNCTION(pspell_new)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|sssl", &language, &language_len, &spelling, &spelling_len,
+ if (zend_parse_parameters(argc, "s|sssl", &language, &language_len, &spelling, &spelling_len,
&jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
return;
}
@@ -345,13 +345,13 @@ static PHP_FUNCTION(pspell_new)
delete_pspell_config(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -378,7 +378,7 @@ static PHP_FUNCTION(pspell_new_personal)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(argc TSRMLS_CC, "ps|sssl", &personal, &personal_len, &language, &language_len,
+ if (zend_parse_parameters(argc, "ps|sssl", &personal, &personal_len, &language, &language_len,
&spelling, &spelling_len, &jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
return;
}
@@ -406,7 +406,7 @@ static PHP_FUNCTION(pspell_new_personal)
}
#endif
- if (php_check_open_basedir(personal TSRMLS_CC)) {
+ if (php_check_open_basedir(personal)) {
delete_pspell_config(config);
RETURN_FALSE;
}
@@ -450,13 +450,13 @@ static PHP_FUNCTION(pspell_new_personal)
delete_pspell_config(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -471,7 +471,7 @@ static PHP_FUNCTION(pspell_new_config)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &conf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &conf) == FAILURE) {
return;
}
@@ -480,13 +480,13 @@ static PHP_FUNCTION(pspell_new_config)
ret = new_pspell_manager(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -500,7 +500,7 @@ static PHP_FUNCTION(pspell_check)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -525,7 +525,7 @@ static PHP_FUNCTION(pspell_suggest)
const PspellWordList *wl;
const char *sug;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -541,7 +541,7 @@ static PHP_FUNCTION(pspell_suggest)
}
delete_pspell_string_emulation(els);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL had a problem. details: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "PSPELL had a problem. details: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -556,7 +556,7 @@ static PHP_FUNCTION(pspell_store_replacement)
char *miss, *corr;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lss", &scin, &miss, &miss_len, &corr, &corr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lss", &scin, &miss, &miss_len, &corr, &corr_len) == FAILURE) {
return;
}
@@ -566,7 +566,7 @@ static PHP_FUNCTION(pspell_store_replacement)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -581,7 +581,7 @@ static PHP_FUNCTION(pspell_add_to_personal)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -596,7 +596,7 @@ static PHP_FUNCTION(pspell_add_to_personal)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -611,7 +611,7 @@ static PHP_FUNCTION(pspell_add_to_session)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -626,7 +626,7 @@ static PHP_FUNCTION(pspell_add_to_session)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -639,7 +639,7 @@ static PHP_FUNCTION(pspell_clear_session)
zend_long scin;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scin) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &scin) == FAILURE) {
return;
}
@@ -649,7 +649,7 @@ static PHP_FUNCTION(pspell_clear_session)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -662,7 +662,7 @@ static PHP_FUNCTION(pspell_save_wordlist)
zend_long scin;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scin) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &scin) == FAILURE) {
return;
}
@@ -673,7 +673,7 @@ static PHP_FUNCTION(pspell_save_wordlist)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
@@ -697,7 +697,7 @@ static PHP_FUNCTION(pspell_config_create)
DWORD dwType,dwLen;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss", &language, &language_len, &spelling, &spelling_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sss", &language, &language_len, &spelling, &spelling_len,
&jargon, &jargon_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -743,7 +743,7 @@ static PHP_FUNCTION(pspell_config_create)
which is not what we want */
pspell_config_replace(config, "save-repl", "false");
- ind = zend_list_insert(config, le_pspell_config TSRMLS_CC);
+ ind = zend_list_insert(config, le_pspell_config);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -756,7 +756,7 @@ static PHP_FUNCTION(pspell_config_runtogether)
zend_bool runtogether;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &conf, &runtogether) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &conf, &runtogether) == FAILURE) {
return;
}
@@ -775,7 +775,7 @@ static PHP_FUNCTION(pspell_config_mode)
zend_long conf, mode;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &conf, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &conf, &mode) == FAILURE) {
return;
}
@@ -802,7 +802,7 @@ static PHP_FUNCTION(pspell_config_ignore)
zend_long conf, ignore = 0L;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &conf, &ignore) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &conf, &ignore) == FAILURE) {
return;
}
@@ -822,13 +822,13 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
size_t value_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lp", &conf, &value, &value_len) == FAILURE) {
return;
}
PSPELL_FETCH_CONFIG;
- if (php_check_open_basedir(value TSRMLS_CC)) {
+ if (php_check_open_basedir(value)) {
RETURN_FALSE;
}
@@ -870,7 +870,7 @@ static PHP_FUNCTION(pspell_config_repl)
size_t repl_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &repl, &repl_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lp", &conf, &repl, &repl_len) == FAILURE) {
return;
}
@@ -878,7 +878,7 @@ static PHP_FUNCTION(pspell_config_repl)
pspell_config_replace(config, "save-repl", "true");
- if (php_check_open_basedir(repl TSRMLS_CC)) {
+ if (php_check_open_basedir(repl)) {
RETURN_FALSE;
}
@@ -896,7 +896,7 @@ static PHP_FUNCTION(pspell_config_save_repl)
zend_bool save;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &conf, &save) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &conf, &save) == FAILURE) {
return;
}
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0e7b146174..b12a1e1504 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -216,7 +216,7 @@ PHP_FUNCTION(readline)
size_t prompt_len;
char *result;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &prompt, &prompt_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &prompt, &prompt_len)) {
RETURN_FALSE;
}
@@ -243,7 +243,7 @@ PHP_FUNCTION(readline_info)
size_t what_len, oldval;
char *oldstr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sz", &what, &what_len, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sz", &what, &what_len, &value) == FAILURE) {
return;
}
@@ -338,7 +338,7 @@ PHP_FUNCTION(readline_add_history)
char *arg;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -398,11 +398,11 @@ PHP_FUNCTION(readline_read_history)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &arg, &arg_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(arg TSRMLS_CC)) {
+ if (php_check_open_basedir(arg)) {
RETURN_FALSE;
}
@@ -422,11 +422,11 @@ PHP_FUNCTION(readline_write_history)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &arg, &arg_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(arg TSRMLS_CC)) {
+ if (php_check_open_basedir(arg)) {
RETURN_FALSE;
}
@@ -481,13 +481,12 @@ static char **_readline_completion_cb(const char *text, int start, int end)
zval params[3];
int i;
char **matches = NULL;
- TSRMLS_FETCH();
_readline_string_zval(&params[0], text);
_readline_long_zval(&params[1], start);
_readline_long_zval(&params[2], end);
- if (call_user_function(CG(function_table), NULL, &_readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
+ if (call_user_function(CG(function_table), NULL, &_readline_completion, &_readline_array, 3, params) == SUCCESS) {
if (Z_TYPE(_readline_array) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
matches = rl_completion_matches(text,_readline_command_generator);
@@ -515,12 +514,12 @@ PHP_FUNCTION(readline_completion_function)
zval *arg = NULL;
zend_string *name = NULL;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg)) {
RETURN_FALSE;
}
- if (!zend_is_callable(arg, 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name->val);
+ if (!zend_is_callable(arg, 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "%s is not callable", name->val);
zend_string_release(name);
RETURN_FALSE;
}
@@ -544,13 +543,12 @@ static void php_rl_callback_handler(char *the_line)
{
zval params[1];
zval dummy;
- TSRMLS_FETCH();
ZVAL_NULL(&dummy);
_readline_string_zval(&params[0], the_line);
- call_user_function(CG(function_table), NULL, &_prepped_callback, &dummy, 1, params TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &_prepped_callback, &dummy, 1, params);
zval_ptr_dtor(&params[0]);
zval_dtor(&dummy);
@@ -565,12 +563,12 @@ PHP_FUNCTION(readline_callback_handler_install)
char *prompt;
size_t prompt_len;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &prompt, &prompt_len, &callback)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz", &prompt, &prompt_len, &callback)) {
return;
}
- if (!zend_is_callable(callback, 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name->val);
+ if (!zend_is_callable(callback, 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "%s is not callable", name->val);
zend_string_release(name);
RETURN_FALSE;
}
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
index 48ab488763..b739fbfd4b 100644
--- a/ext/readline/readline_cli.c
+++ b/ext/readline/readline_cli.c
@@ -79,7 +79,7 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_readline);
static char php_last_char = '\0';
static FILE *pager_pipe = NULL;
-static size_t readline_shell_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_write(const char *str, size_t str_length) /* {{{ */
{
if (CLIR_G(prompt_str)) {
smart_str_appendl(CLIR_G(prompt_str), str, str_length);
@@ -97,7 +97,7 @@ static size_t readline_shell_write(const char *str, size_t str_length TSRMLS_DC)
}
/* }}} */
-static size_t readline_shell_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_ub_write(const char *str, size_t str_length) /* {{{ */
{
/* We just store the last char here and then pass back to the
caller (sapi_cli_single_write in sapi/cli) which will actually
@@ -107,7 +107,7 @@ static size_t readline_shell_ub_write(const char *str, size_t str_length TSRMLS_
}
/* }}} */
-static void cli_readline_init_globals(zend_cli_readline_globals *rg TSRMLS_DC)
+static void cli_readline_init_globals(zend_cli_readline_globals *rg)
{
rg->pager = NULL;
rg->prompt = NULL;
@@ -134,7 +134,7 @@ typedef enum {
outside,
} php_code_type;
-static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
+static zend_string *cli_get_prompt(char *block, char prompt) /* {{{ */
{
smart_str retval = {0};
char *prompt_spec = CLIR_G(prompt) ? CLIR_G(prompt) : DEFAULT_PROMPT;
@@ -189,7 +189,7 @@ static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
CLIR_G(prompt_str) = &retval;
zend_try {
- zend_eval_stringl(code, prompt_end - prompt_spec - 1, NULL, "php prompt code" TSRMLS_CC);
+ zend_eval_stringl(code, prompt_end - prompt_spec - 1, NULL, "php prompt code");
} zend_end_try();
CLIR_G(prompt_str) = NULL;
efree(code);
@@ -204,7 +204,7 @@ static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC) /* {{{ */
+static int cli_is_valid_code(char *code, int len, zend_string **prompt) /* {{{ */
{
int valid_end = 1, last_valid_end;
int brackets_count = 0;
@@ -365,29 +365,29 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
switch (code_type) {
default:
if (brace_count) {
- *prompt = cli_get_prompt("php", '(' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '(');
} else if (brackets_count) {
- *prompt = cli_get_prompt("php", '{' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '{');
} else {
- *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '>');
}
break;
case sstring:
case sstring_esc:
- *prompt = cli_get_prompt("php", '\'' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '\'');
break;
case dstring:
case dstring_esc:
- *prompt = cli_get_prompt("php", '"' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '"');
break;
case comment_block:
- *prompt = cli_get_prompt("/* ", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("/* ", '>');
break;
case heredoc:
- *prompt = cli_get_prompt("<<<", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("<<<", '>');
break;
case outside:
- *prompt = cli_get_prompt(" ", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt(" ", '>');
break;
}
@@ -399,7 +399,7 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
}
/* }}} */
-static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData) /* {{{ */
{
zend_string *name;
zend_ulong number;
@@ -425,12 +425,12 @@ static char *cli_completion_generator_ht(const char *text, int textlen, int *sta
return NULL;
} /* }}} */
-static char *cli_completion_generator_var(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_var(const char *text, int textlen, int *state) /* {{{ */
{
char *retval, *tmp;
zend_array *symbol_table = &EG(symbol_table);
- tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, symbol_table ? &symbol_table->ht : NULL, NULL TSRMLS_CC);
+ tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, symbol_table ? &symbol_table->ht : NULL, NULL);
if (retval) {
retval = malloc(strlen(tmp) + 2);
retval[0] = '$';
@@ -440,11 +440,11 @@ static char *cli_completion_generator_var(const char *text, int textlen, int *st
return retval;
} /* }}} */
-static char *cli_completion_generator_ini(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_ini(const char *text, int textlen, int *state) /* {{{ */
{
char *retval, *tmp;
- tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(ini_directives), NULL TSRMLS_CC);
+ tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(ini_directives), NULL);
if (retval) {
retval = malloc(strlen(tmp) + 2);
retval[0] = '#';
@@ -454,10 +454,10 @@ static char *cli_completion_generator_ini(const char *text, int textlen, int *st
return retval;
} /* }}} */
-static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht) /* {{{ */
{
zend_function *func;
- char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func);
if (retval) {
rl_completion_append_character = '(';
retval = strdup(func->common.function_name->val);
@@ -466,10 +466,10 @@ static char *cli_completion_generator_func(const char *text, int textlen, int *s
return retval;
} /* }}} */
-static char *cli_completion_generator_class(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_class(const char *text, int textlen, int *state) /* {{{ */
{
zend_class_entry *ce;
- char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&ce TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&ce);
if (retval) {
rl_completion_append_character = '\0';
retval = strdup(ce->name->val);
@@ -478,10 +478,10 @@ static char *cli_completion_generator_class(const char *text, int textlen, int *
return retval;
} /* }}} */
-static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht) /* {{{ */
{
zend_class_entry **pce;
- char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce);
if (retval) {
rl_completion_append_character = '\0';
retval = strdup(retval);
@@ -505,15 +505,14 @@ TODO:
*/
char *retval = NULL;
int textlen = strlen(text);
- TSRMLS_FETCH();
if (!index) {
cli_completion_state = 0;
}
if (text[0] == '$') {
- retval = cli_completion_generator_var(text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_var(text, textlen, &cli_completion_state);
} else if (text[0] == '#') {
- retval = cli_completion_generator_ini(text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_ini(text, textlen, &cli_completion_state);
} else {
char *lc_text, *class_name_end;
int class_name_len;
@@ -525,7 +524,7 @@ TODO:
class_name_len = class_name_end - text;
class_name = zend_string_alloc(class_name_len, 0);
zend_str_tolower_copy(class_name->val, text, class_name_len);
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
zend_string_release(class_name);
return NULL;
}
@@ -538,19 +537,19 @@ TODO:
switch (cli_completion_state) {
case 0:
case 1:
- retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, ce ? &ce->function_table : EG(function_table) TSRMLS_CC);
+ retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, ce ? &ce->function_table : EG(function_table));
if (retval) {
break;
}
case 2:
case 3:
- retval = cli_completion_generator_define(text, textlen, &cli_completion_state, ce ? &ce->constants_table : EG(zend_constants) TSRMLS_CC);
+ retval = cli_completion_generator_define(text, textlen, &cli_completion_state, ce ? &ce->constants_table : EG(zend_constants));
if (retval || ce) {
break;
}
case 4:
case 5:
- retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state);
break;
default:
break;
@@ -578,12 +577,12 @@ static char **cli_code_completion(const char *text, int start, int end) /* {{{ *
}
/* }}} */
-static int readline_shell_run(TSRMLS_D) /* {{{ */
+static int readline_shell_run(void) /* {{{ */
{
char *line;
size_t size = 4096, pos = 0, len;
char *code = emalloc(size);
- zend_string *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ zend_string *prompt = cli_get_prompt("php", '>');
char *history_file;
int history_lines_to_write = 0;
@@ -597,7 +596,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
prepend_file.type = ZEND_HANDLE_FILENAME;
prepend_file_p = &prepend_file;
- zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p);
+ zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p);
}
history_file = tilde_expand("~/.php_history");
@@ -626,13 +625,13 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
param++;
cmd = zend_string_init(&line[1], param - &line[1] - 1, 0);
- zend_alter_ini_entry_chars_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_chars_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(cmd);
add_history(line);
zend_string_release(prompt);
/* TODO: This might be wrong! */
- prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ prompt = cli_get_prompt("php", '>');
continue;
}
}
@@ -654,7 +653,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
free(line);
zend_string_release(prompt);
- if (!cli_is_valid_code(code, pos, &prompt TSRMLS_CC)) {
+ if (!cli_is_valid_code(code, pos, &prompt)) {
continue;
}
@@ -668,17 +667,17 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
}
zend_try {
- zend_eval_stringl(code, pos, NULL, "php shell code" TSRMLS_CC);
+ zend_eval_stringl(code, pos, NULL, "php shell code");
} zend_end_try();
pos = 0;
if (!pager_pipe && php_last_char != '\0' && php_last_char != '\n') {
- php_write("\n", 1 TSRMLS_CC);
+ php_write("\n", 1);
}
if (EG(exception)) {
- zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+ zend_exception_error(EG(exception), E_WARNING);
}
if (pager_pipe) {
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index a70a4fcb2c..ea2374556f 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -149,25 +149,25 @@ PHP_FUNCTION(recode_string)
size_t req_len, str_len;
char *req, *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &req, &req_len, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &req, &req_len, &str, &str_len) == FAILURE) {
return;
}
request = recode_new_request(ReSG(outer));
if (request == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
+ php_error_docref(NULL, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
if (!recode_scan_request(request, req)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req);
+ php_error_docref(NULL, E_WARNING, "Illegal recode request '%s'", req);
goto error_exit;
}
recode_buffer_to_buffer(request, str, str_len, &r, &r_len, &r_alen);
if (!r) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
+ php_error_docref(NULL, E_WARNING, "Recoding failed.");
error_exit:
RETVAL_FALSE;
} else {
@@ -192,7 +192,7 @@ PHP_FUNCTION(recode_file)
php_stream *instream, *outstream;
FILE *in_fp, *out_fp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srr", &req, &req_len, &input, &output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "srr", &req, &req_len, &input, &output) == FAILURE) {
return;
}
@@ -209,17 +209,17 @@ PHP_FUNCTION(recode_file)
request = recode_new_request(ReSG(outer));
if (request == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
+ php_error_docref(NULL, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
if (!recode_scan_request(request, req)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req);
+ php_error_docref(NULL, E_WARNING, "Illegal recode request '%s'", req);
goto error_exit;
}
if (!recode_file_to_file(request, in_fp, out_fp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
+ php_error_docref(NULL, E_WARNING, "Recoding failed.");
goto error_exit;
}
diff --git a/ext/reflection/config.m4 b/ext/reflection/config.m4
index 702663677b..08f8e1ef5d 100755
--- a/ext/reflection/config.m4
+++ b/ext/reflection/config.m4
@@ -2,4 +2,4 @@ dnl $Id$
dnl config.m4 for extension reflection
AC_DEFINE(HAVE_REFLECTION, 1, [Whether Reflection is enabled])
-PHP_NEW_EXTENSION(reflection, php_reflection.c, no)
+PHP_NEW_EXTENSION(reflection, php_reflection.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
diff --git a/ext/reflection/config.w32 b/ext/reflection/config.w32
index 724bf7bde4..2eb33c66ee 100755
--- a/ext/reflection/config.w32
+++ b/ext/reflection/config.w32
@@ -1,6 +1,6 @@
// $Id$
// vim:ft=javascript
-EXTENSION("reflection", "php_reflection.c", false /* never shared */);
+EXTENSION("reflection", "php_reflection.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_REFLECTION', 1, 'Reflection support enabled');
-PHP_REFLECTION="yes"; \ No newline at end of file
+PHP_REFLECTION="yes";
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 026680cd6d..6a59a5ce37 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -44,7 +44,7 @@
#define reflection_update_property(object, name, value) do { \
zval member; \
ZVAL_STRINGL(&member, name, sizeof(name)-1); \
- zend_std_write_property(object, &member, value, NULL TSRMLS_CC); \
+ zend_std_write_property(object, &member, value, NULL); \
if (Z_REFCOUNTED_P(value)) Z_DELREF_P(value); \
zval_ptr_dtor(&member); \
} while (0)
@@ -70,7 +70,7 @@ ZEND_END_MODULE_GLOBALS(reflection)
#ifdef ZTS
# define REFLECTION_G(v) \
- TSRMG(reflection_globals_id, zend_reflection_globals*, v)
+ ZEND_TSRMG(reflection_globals_id, zend_reflection_globals*, v)
extern int reflection_globals_id;
#else
# define REFLECTION_G(v) (reflection_globals.v)
@@ -83,14 +83,14 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Method macros */
#define METHOD_NOTSTATIC(ce) \
- if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C)); \
+ if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce)) { \
+ php_error_docref(NULL, E_ERROR, "%s() cannot be called statically", get_active_function_name()); \
return; \
} \
/* Exception throwing macro */
#define _DO_THROW(msg) \
- zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC); \
+ zend_throw_exception(reflection_exception_ptr, msg, 0); \
return; \
#define RETURN_ON_EXCEPTION \
@@ -102,7 +102,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
intern = Z_REFLECTION_P(getThis()); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
} \
#define GET_REFLECTION_OBJECT_PTR(target) \
@@ -111,7 +111,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Class constants */
#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value);
/* {{{ Smart string functions */
typedef struct _string {
@@ -226,7 +226,7 @@ static inline reflection_object *reflection_object_from_obj(zend_object *obj) /*
static zend_object_handlers reflection_object_handlers;
-static zval *_default_load_entry(zval *object, char *name, size_t name_len TSRMLS_DC) /* {{{ */
+static zval *_default_load_entry(zval *object, char *name, size_t name_len) /* {{{ */
{
zval *value;
@@ -236,11 +236,11 @@ static zval *_default_load_entry(zval *object, char *name, size_t name_len TSRML
return value;
}
-static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */
+static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value) /* {{{ */
{
zval *value;
- if ((value = _default_load_entry(object, name, name_len TSRMLS_CC)) == NULL) {
+ if ((value = _default_load_entry(object, name, name_len)) == NULL) {
RETURN_FALSE;
}
ZVAL_DUP(return_value, value);
@@ -248,7 +248,7 @@ static void _default_get_entry(zval *object, char *name, int name_len, zval *ret
/* }}} */
#ifdef ilia_0
-static void _default_lookup_entry(zval *object, char *name, int name_len, zval **return_value TSRMLS_DC) /* {{{ */
+static void _default_lookup_entry(zval *object, char *name, int name_len, zval **return_value) /* {{{ */
{
zval **value;
@@ -261,7 +261,7 @@ static void _default_lookup_entry(zval *object, char *name, int name_len, zval *
/* }}} */
#endif
-static zend_function *_copy_function(zend_function *fptr TSRMLS_DC) /* {{{ */
+static zend_function *_copy_function(zend_function *fptr) /* {{{ */
{
if (fptr
&& fptr->type == ZEND_INTERNAL_FUNCTION
@@ -279,7 +279,7 @@ static zend_function *_copy_function(zend_function *fptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _free_function(zend_function *fptr TSRMLS_DC) /* {{{ */
+static void _free_function(zend_function *fptr) /* {{{ */
{
if (fptr
&& fptr->type == ZEND_INTERNAL_FUNCTION
@@ -291,7 +291,7 @@ static void _free_function(zend_function *fptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void reflection_free_objects_storage(zend_object *object) /* {{{ */
{
reflection_object *intern = reflection_object_from_obj(object);
parameter_reference *reference;
@@ -301,11 +301,11 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{
switch (intern->ref_type) {
case REF_TYPE_PARAMETER:
reference = (parameter_reference*)intern->ptr;
- _free_function(reference->fptr TSRMLS_CC);
+ _free_function(reference->fptr);
efree(intern->ptr);
break;
case REF_TYPE_FUNCTION:
- _free_function(intern->ptr TSRMLS_CC);
+ _free_function(intern->ptr);
break;
case REF_TYPE_PROPERTY:
efree(intern->ptr);
@@ -321,40 +321,40 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{
}
intern->ptr = NULL;
zval_ptr_dtor(&intern->obj);
- zend_object_std_dtor(object TSRMLS_CC);
+ zend_object_std_dtor(object);
}
/* }}} */
-static zend_object *reflection_objects_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ */
{
reflection_object *intern;
intern = ecalloc(1, sizeof(reflection_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->zo.ce = class_type;
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &reflection_object_handlers;
return &intern->zo;
}
/* }}} */
-static zval *reflection_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* {{{ */
+static zval *reflection_instantiate(zend_class_entry *pce, zval *object) /* {{{ */
{
object_init_ex(object, pce);
return object;
}
/* }}} */
-static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC);
-static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC);
-static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC);
-static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC);
-static void _zend_extension_string(string *str, zend_extension *extension, char *indent TSRMLS_DC);
+static void _const_string(string *str, char *name, zval *value, char *indent);
+static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent);
+static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent);
+static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent);
+static void _extension_string(string *str, zend_module_entry *module, char *indent);
+static void _zend_extension_string(string *str, zend_extension *extension, char *indent);
/* {{{ _class_string */
-static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC)
+static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent)
{
int count, count_static_props = 0, count_static_funcs = 0, count_shadow_props = 0;
string sub_indent;
@@ -427,7 +427,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* Constants */
if (&ce->constants_table) {
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1);
string_printf(str, "\n");
count = zend_hash_num_elements(&ce->constants_table);
string_printf(str, "%s - Constants [%d] {\n", indent, count);
@@ -442,7 +442,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((value = zend_hash_get_current_data_ex(&ce->constants_table, &pos)) != NULL) {
zend_hash_get_current_key_ex(&ce->constants_table, &key, &num_index, 0, &pos);
- _const_string(str, key->val, value, indent TSRMLS_CC);
+ _const_string(str, key->val, value, indent);
zend_hash_move_forward_ex(&ce->constants_table, &pos);
}
}
@@ -479,7 +479,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((prop = zend_hash_get_current_data_ptr_ex(&ce->properties_info, &pos)) != NULL) {
if ((prop->flags & ZEND_ACC_STATIC) && !(prop->flags & ZEND_ACC_SHADOW)) {
- _property_string(str, prop, NULL, sub_indent.buf->val TSRMLS_CC);
+ _property_string(str, prop, NULL, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
@@ -521,7 +521,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
{
string_printf(str, "\n");
- _function_string(str, mptr, ce, sub_indent.buf->val TSRMLS_CC);
+ _function_string(str, mptr, ce, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
@@ -543,7 +543,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((prop = zend_hash_get_current_data_ptr_ex(&ce->properties_info, &pos)) != NULL) {
if (!(prop->flags & (ZEND_ACC_STATIC|ZEND_ACC_SHADOW))) {
- _property_string(str, prop, NULL, sub_indent.buf->val TSRMLS_CC);
+ _property_string(str, prop, NULL, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
}
@@ -553,7 +553,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_properties) {
string dyn;
- HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj TSRMLS_CC);
+ HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj);
HashPosition pos;
zval **prop;
@@ -571,7 +571,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
if (prop_name->len && prop_name->val[0]) { /* skip all private and protected properties */
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
count++;
- _property_string(&dyn, NULL, prop_name->val, sub_indent.buf->val TSRMLS_CC);
+ _property_string(&dyn, NULL, prop_name->val, sub_indent.buf->val);
}
}
}
@@ -615,16 +615,16 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* see if this is a closure */
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(mptr->common.function_name->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj) TSRMLS_CC)) != NULL)
+ && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
{
mptr = closure;
} else {
closure = NULL;
}
string_printf(&dyn, "\n");
- _function_string(&dyn, mptr, ce, sub_indent.buf->val TSRMLS_CC);
+ _function_string(&dyn, mptr, ce, sub_indent.buf->val);
count++;
- _free_function(closure TSRMLS_CC);
+ _free_function(closure);
}
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
@@ -647,7 +647,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* }}} */
/* {{{ _const_string */
-static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC)
+static void _const_string(string *str, char *name, zval *value, char *indent)
{
char *type = zend_zval_type_name(value);
zend_string *value_str = zval_get_string(value);
@@ -679,7 +679,7 @@ static zend_op* _get_recv_op(zend_op_array *op_array, uint32_t offset)
/* }}} */
/* {{{ _parameter_string */
-static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, char* indent TSRMLS_DC)
+static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, char* indent)
{
string_printf(str, "Parameter #%d [ ", offset);
if (offset >= required) {
@@ -725,7 +725,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
old_scope = EG(scope);
EG(scope) = fptr->common.scope;
- zval_update_constant_ex(&zv, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(&zv, 1, NULL);
EG(scope) = old_scope;
if (Z_TYPE(zv) == IS_TRUE) {
string_write(str, "true", sizeof("true")-1);
@@ -755,7 +755,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
/* }}} */
/* {{{ _function_parameter_string */
-static void _function_parameter_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)
+static void _function_parameter_string(string *str, zend_function *fptr, char* indent)
{
struct _zend_arg_info *arg_info = fptr->common.arg_info;
uint32_t i, required = fptr->common.required_num_args;
@@ -768,7 +768,7 @@ static void _function_parameter_string(string *str, zend_function *fptr, char* i
string_printf(str, "%s- Parameters [%d] {\n", indent, fptr->common.num_args);
for (i = 0; i < fptr->common.num_args; i++) {
string_printf(str, "%s ", indent);
- _parameter_string(str, fptr, arg_info, i, required, indent TSRMLS_CC);
+ _parameter_string(str, fptr, arg_info, i, required, indent);
string_write(str, "\n", sizeof("\n")-1);
arg_info++;
}
@@ -777,7 +777,7 @@ static void _function_parameter_string(string *str, zend_function *fptr, char* i
/* }}} */
/* {{{ _function_closure_string */
-static void _function_closure_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)
+static void _function_closure_string(string *str, zend_function *fptr, char* indent)
{
uint32_t i, count;
zend_ulong num_index;
@@ -810,7 +810,7 @@ static void _function_closure_string(string *str, zend_function *fptr, char* ind
/* }}} */
/* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent)
{
string param_indent;
zend_function *overwrites;
@@ -906,16 +906,16 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
string_init(&param_indent);
string_printf(&param_indent, "%s ", indent);
if (fptr->common.fn_flags & ZEND_ACC_CLOSURE) {
- _function_closure_string(str, fptr, param_indent.buf->val TSRMLS_CC);
+ _function_closure_string(str, fptr, param_indent.buf->val);
}
- _function_parameter_string(str, fptr, param_indent.buf->val TSRMLS_CC);
+ _function_parameter_string(str, fptr, param_indent.buf->val);
string_free(&param_indent);
string_printf(str, "%s}\n", indent);
}
/* }}} */
/* {{{ _property_string */
-static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC)
+static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent)
{
const char *class_name;
@@ -955,7 +955,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
}
/* }}} */
-static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_ini_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -992,7 +992,7 @@ static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args,
}
/* }}} */
-static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_class_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_class_entry *ce = (zend_class_entry*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -1004,7 +1004,7 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg
/* dump class if it is not an alias */
if (!zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) {
string_printf(str, "\n");
- _class_string(str, ce, NULL, indent TSRMLS_CC);
+ _class_string(str, ce, NULL, indent);
(*num_classes)++;
}
}
@@ -1012,7 +1012,7 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg
}
/* }}} */
-static int _extension_const_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_const_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_constant *constant = (zend_constant*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -1021,14 +1021,14 @@ static int _extension_const_string(zval *el TSRMLS_DC, int num_args, va_list arg
int *num_classes = va_arg(args, int*);
if (constant->module_number == module->module_number) {
- _const_string(str, constant->name->val, &constant->value, indent TSRMLS_CC);
+ _const_string(str, constant->name->val, &constant->value, indent);
(*num_classes)++;
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC) /* {{{ */
+static void _extension_string(string *str, zend_module_entry *module, char *indent) /* {{{ */
{
string_printf(str, "%sExtension [ ", indent);
if (module->type == MODULE_PERSISTENT) {
@@ -1079,7 +1079,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
{
string str_ini;
string_init(&str_ini);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number);
+ zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number);
if (str_ini.buf->len > 0) {
string_printf(str, "\n - INI {\n");
string_append(str, &str_ini);
@@ -1093,7 +1093,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
int num_constants = 0;
string_init(&str_constants);
- zend_hash_apply_with_arguments(EG(zend_constants) TSRMLS_CC, (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants);
+ zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants);
if (num_constants) {
string_printf(str, "\n - Constants [%d] {\n", num_constants);
string_append(str, &str_constants);
@@ -1115,7 +1115,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_printf(str, "\n - Functions {\n");
first = 0;
}
- _function_string(str, fptr, NULL, " " TSRMLS_CC);
+ _function_string(str, fptr, NULL, " ");
}
zend_hash_move_forward_ex(CG(function_table), &iterator);
}
@@ -1132,7 +1132,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_init(&sub_indent);
string_printf(&sub_indent, "%s ", indent);
string_init(&str_classes);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.buf->val, module, &num_classes);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.buf->val, module, &num_classes);
if (num_classes) {
string_printf(str, "\n - Classes [%d] {", num_classes);
string_append(str, &str_classes);
@@ -1146,7 +1146,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
}
/* }}} */
-static void _zend_extension_string(string *str, zend_extension *extension, char *indent TSRMLS_DC) /* {{{ */
+static void _zend_extension_string(string *str, zend_extension *extension, char *indent) /* {{{ */
{
string_printf(str, "%sZend Extension [ %s ", indent, extension->name);
@@ -1182,13 +1182,13 @@ static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask)
/* }}} */
/* {{{ zend_reflection_class_factory */
-PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC)
+PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object)
{
reflection_object *intern;
zval name;
ZVAL_STR_COPY(&name, ce->name);
- reflection_instantiate(reflection_class_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_class_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = ce;
intern->ref_type = REF_TYPE_OTHER;
@@ -1198,7 +1198,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR
/* }}} */
/* {{{ reflection_extension_factory */
-static void reflection_extension_factory(zval *object, const char *name_str TSRMLS_DC)
+static void reflection_extension_factory(zval *object, const char *name_str)
{
reflection_object *intern;
zval name;
@@ -1214,7 +1214,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM
return;
}
- reflection_instantiate(reflection_extension_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_extension_ptr, object);
intern = Z_REFLECTION_P(object);
ZVAL_STRINGL(&name, module->name, name_len);
intern->ptr = module;
@@ -1225,7 +1225,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM
/* }}} */
/* {{{ reflection_parameter_factory */
-static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, zval *object TSRMLS_DC)
+static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, zval *object)
{
reflection_object *intern;
parameter_reference *reference;
@@ -1240,7 +1240,7 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
} else {
ZVAL_NULL(&name);
}
- reflection_instantiate(reflection_parameter_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_parameter_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (parameter_reference*) emalloc(sizeof(parameter_reference));
reference->arg_info = arg_info;
@@ -1259,14 +1259,14 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
/* }}} */
/* {{{ reflection_function_factory */
-static void reflection_function_factory(zend_function *function, zval *closure_object, zval *object TSRMLS_DC)
+static void reflection_function_factory(zend_function *function, zval *closure_object, zval *object)
{
reflection_object *intern;
zval name;
ZVAL_STR_COPY(&name, function->common.function_name);
- reflection_instantiate(reflection_function_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_function_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = function;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -1280,7 +1280,7 @@ static void reflection_function_factory(zend_function *function, zval *closure_o
/* }}} */
/* {{{ reflection_method_factory */
-static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_object, zval *object TSRMLS_DC)
+static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_object, zval *object)
{
reflection_object *intern;
zval name;
@@ -1289,7 +1289,7 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
ZVAL_STR_COPY(&name, (method->common.scope && method->common.scope->trait_aliases)?
zend_resolve_method_name(ce, method) : method->common.function_name);
ZVAL_STR_COPY(&classname, method->common.scope->name);
- reflection_instantiate(reflection_method_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_method_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = method;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -1304,7 +1304,7 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
/* }}} */
/* {{{ reflection_property_factory */
-static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object TSRMLS_DC)
+static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object)
{
reflection_object *intern;
zval name;
@@ -1335,7 +1335,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
ZVAL_STRINGL(&name, prop_name, prop_name_len);
ZVAL_STR_COPY(&classname, prop->ce->name);
- reflection_instantiate(reflection_property_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_property_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (property_reference*) emalloc(sizeof(property_reference));
reference->ce = ce;
@@ -1362,13 +1362,13 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
zend_fcall_info_cache fcc;
if (ctor_argc == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &argument_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &argument_ptr, &return_output) == FAILURE) {
return;
}
ZVAL_COPY_VALUE(&params[0], argument_ptr);
ZVAL_NULL(&params[1]);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) {
return;
}
ZVAL_COPY_VALUE(&params[0], argument_ptr);
@@ -1398,7 +1398,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
fcc.called_scope = Z_OBJCE(reflector);
fcc.object = Z_OBJ(reflector);
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
@@ -1424,7 +1424,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
fci.params = params;
fci.no_separation = 1;
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
zval_ptr_dtor(&fci.function_name);
@@ -1456,12 +1456,12 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) {
return NULL;
}
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object");
}
param = intern->ptr;
if (param->fptr->type != ZEND_USER_FUNCTION) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Cannot determine default value for internal functions");
return NULL;
}
@@ -1480,7 +1480,7 @@ static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value");
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Internal error: Failed to retrieve the default value");
return NULL;
}
@@ -1505,7 +1505,7 @@ ZEND_METHOD(reflection, export)
zend_bool return_output = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
return;
}
#else
@@ -1518,7 +1518,7 @@ ZEND_METHOD(reflection, export)
/* Invoke the __toString() method */
ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1);
- result= call_user_function_ex(NULL, object, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC);
+ result= call_user_function_ex(NULL, object, &fname, &retval, 0, NULL, 0, NULL);
zval_dtor(&fname);
if (result == FAILURE) {
@@ -1527,7 +1527,7 @@ ZEND_METHOD(reflection, export)
}
if (Z_TYPE(retval) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name->val);
+ php_error_docref(NULL, E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name->val);
RETURN_FALSE;
}
@@ -1535,7 +1535,7 @@ ZEND_METHOD(reflection, export)
ZVAL_COPY_VALUE(return_value, &retval);
} else {
/* No need for _r variant, return of __toString should always be a string */
- zend_print_zval(&retval, 0 TSRMLS_CC);
+ zend_print_zval(&retval, 0);
zend_printf("\n");
zval_ptr_dtor(&retval);
}
@@ -1548,7 +1548,7 @@ ZEND_METHOD(reflection, getModifierNames)
{
zend_long modifiers;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &modifiers) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &modifiers) == FAILURE) {
return;
}
@@ -1610,10 +1610,10 @@ ZEND_METHOD(reflection_function, __construct)
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &closure, zend_ce_closure) == SUCCESS) {
- fptr = (zend_function*)zend_get_closure_method_def(closure TSRMLS_CC);
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &closure, zend_ce_closure) == SUCCESS) {
+ fptr = (zend_function*)zend_get_closure_method_def(closure);
Z_ADDREF_P(closure);
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == SUCCESS) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == SUCCESS) {
char *nsname;
lcname = zend_str_tolower_dup(name_str, name_len);
@@ -1627,7 +1627,7 @@ ZEND_METHOD(reflection_function, __construct)
if ((fptr = zend_hash_str_find_ptr(EG(function_table), nsname, name_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Function %s() does not exist", name_str);
return;
}
@@ -1662,7 +1662,7 @@ ZEND_METHOD(reflection_function, __toString)
}
GET_REFLECTION_OBJECT_PTR(fptr);
string_init(&str);
- _function_string(&str, fptr, intern->ce, "" TSRMLS_CC);
+ _function_string(&str, fptr, intern->ce, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -1674,7 +1674,7 @@ ZEND_METHOD(reflection_function, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -1705,7 +1705,7 @@ ZEND_METHOD(reflection_function, getClosureThis)
}
GET_REFLECTION_OBJECT();
if (!Z_ISUNDEF(intern->obj)) {
- closure_this = zend_get_closure_this_ptr(&intern->obj TSRMLS_CC);
+ closure_this = zend_get_closure_this_ptr(&intern->obj);
if (!Z_ISUNDEF_P(closure_this)) {
RETURN_ZVAL(closure_this, 1, 0);
}
@@ -1725,9 +1725,9 @@ ZEND_METHOD(reflection_function, getClosureScopeClass)
}
GET_REFLECTION_OBJECT();
if (!Z_ISUNDEF(intern->obj)) {
- closure_func = zend_get_closure_method_def(&intern->obj TSRMLS_CC);
+ closure_func = zend_get_closure_method_def(&intern->obj);
if (closure_func && closure_func->common.scope) {
- zend_reflection_class_factory(closure_func->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(closure_func->common.scope, return_value);
}
}
}
@@ -1745,7 +1745,7 @@ ZEND_METHOD(reflection_function, getClosure)
}
GET_REFLECTION_OBJECT_PTR(fptr);
- zend_create_closure(return_value, fptr, NULL, NULL TSRMLS_CC);
+ zend_create_closure(return_value, fptr, NULL, NULL);
}
/* }}} */
@@ -1879,7 +1879,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
- zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC);
+ zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope);
zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, zval_add_ref);
}
}
@@ -1900,7 +1900,7 @@ ZEND_METHOD(reflection_function, invoke)
METHOD_NOTSTATIC(reflection_function_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &params, &num_args) == FAILURE) {
return;
}
@@ -1920,10 +1920,10 @@ ZEND_METHOD(reflection_function, invoke)
fcc.called_scope = NULL;
fcc.object = NULL;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of function %s() failed", fptr->common.function_name->val);
return;
}
@@ -1951,7 +1951,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
METHOD_NOTSTATIC(reflection_function_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &param_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &param_array) == FAILURE) {
return;
}
@@ -1980,7 +1980,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
fcc.called_scope = NULL;
fcc.object = NULL;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
for (i = 0; i < argc; i++) {
zval_ptr_dtor(&params[i]);
@@ -1988,7 +1988,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
efree(params);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of function %s() failed", fptr->common.function_name->val);
return;
}
@@ -2059,7 +2059,7 @@ ZEND_METHOD(reflection_function, getParameters)
for (i = 0; i < fptr->common.num_args; i++) {
zval parameter;
- reflection_parameter_factory(_copy_function(fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, arg_info, i, fptr->common.required_num_args, &parameter TSRMLS_CC);
+ reflection_parameter_factory(_copy_function(fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, arg_info, i, fptr->common.required_num_args, &parameter);
add_next_index_zval(return_value, &parameter);
arg_info++;
@@ -2084,7 +2084,7 @@ ZEND_METHOD(reflection_function, getExtension)
internal = (zend_internal_function *)fptr;
if (internal->module) {
- reflection_extension_factory(return_value, internal->module->name TSRMLS_CC);
+ reflection_extension_factory(return_value, internal->module->name);
} else {
RETURN_NULL();
}
@@ -2139,7 +2139,7 @@ ZEND_METHOD(reflection_parameter, __construct)
zend_bool is_closure = 0;
zend_bool is_invoke = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, &parameter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &reference, &parameter) == FAILURE) {
return;
}
@@ -2159,7 +2159,7 @@ ZEND_METHOD(reflection_parameter, __construct)
lcname = zend_str_tolower_dup(Z_STRVAL_P(reference), lcname_len);
if ((fptr = zend_hash_str_find_ptr(EG(function_table), lcname, lcname_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Function %s() does not exist", Z_STRVAL_P(reference));
return;
}
@@ -2185,8 +2185,8 @@ ZEND_METHOD(reflection_parameter, __construct)
ce = Z_OBJCE_P(classref);
} else {
convert_to_string_ex(classref);
- if ((ce = zend_lookup_class(Z_STR_P(classref) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classref))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classref));
return;
}
@@ -2198,14 +2198,14 @@ ZEND_METHOD(reflection_parameter, __construct)
if (ce == zend_ce_closure && Z_TYPE_P(classref) == IS_OBJECT
&& (lcname_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (fptr = zend_get_closure_invoke_method(Z_OBJ_P(classref) TSRMLS_CC)) != NULL)
+ && (fptr = zend_get_closure_invoke_method(Z_OBJ_P(classref))) != NULL)
{
/* nothing to do. don't set is_closure since is the invoke handler,
not the closure itself */
is_invoke = 1;
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, lcname, lcname_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, Z_STRVAL_P(method));
return;
}
@@ -2216,12 +2216,12 @@ ZEND_METHOD(reflection_parameter, __construct)
case IS_OBJECT: {
ce = Z_OBJCE_P(reference);
- if (instanceof_function(ce, zend_ce_closure TSRMLS_CC)) {
- fptr = (zend_function *)zend_get_closure_method_def(reference TSRMLS_CC);
+ if (instanceof_function(ce, zend_ce_closure)) {
+ fptr = (zend_function *)zend_get_closure_method_def(reference);
Z_ADDREF_P(reference);
is_closure = 1;
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME))) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, ZEND_INVOKE_FUNC_NAME);
return;
}
@@ -2329,7 +2329,7 @@ ZEND_METHOD(reflection_parameter, __toString)
}
GET_REFLECTION_OBJECT_PTR(param);
string_init(&str);
- _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "" TSRMLS_CC);
+ _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -2341,7 +2341,7 @@ ZEND_METHOD(reflection_parameter, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -2358,9 +2358,9 @@ ZEND_METHOD(reflection_parameter, getDeclaringFunction)
GET_REFLECTION_OBJECT_PTR(param);
if (!param->fptr->common.scope) {
- reflection_function_factory(_copy_function(param->fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value TSRMLS_CC);
+ reflection_function_factory(_copy_function(param->fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value);
} else {
- reflection_method_factory(param->fptr->common.scope, _copy_function(param->fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value TSRMLS_CC);
+ reflection_method_factory(param->fptr->common.scope, _copy_function(param->fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value);
}
}
/* }}} */
@@ -2378,7 +2378,7 @@ ZEND_METHOD(reflection_parameter, getDeclaringClass)
GET_REFLECTION_OBJECT_PTR(param);
if (param->fptr->common.scope) {
- zend_reflection_class_factory(param->fptr->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(param->fptr->common.scope, return_value);
}
}
/* }}} */
@@ -2422,19 +2422,19 @@ ZEND_METHOD(reflection_parameter, getClass)
if (0 == zend_binary_strcasecmp(class_name, class_name_len, "self", sizeof("self")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'self' as type hint but function is not a class member!");
return;
}
} else if (0 == zend_binary_strcasecmp(class_name, class_name_len, "parent", sizeof("parent")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'parent' as type hint but function is not a class member!");
return;
}
if (!ce->parent) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'parent' as type hint although class does not have a parent!");
return;
}
@@ -2442,18 +2442,18 @@ ZEND_METHOD(reflection_parameter, getClass)
} else {
if (param->fptr->type == ZEND_INTERNAL_FUNCTION) {
zend_string *name = zend_string_init(class_name, class_name_len, 0);
- ce = zend_lookup_class(name TSRMLS_CC);
+ ce = zend_lookup_class(name);
zend_string_release(name);
} else {
- ce = zend_lookup_class(param->arg_info->class_name TSRMLS_CC);
+ ce = zend_lookup_class(param->arg_info->class_name);
}
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", class_name);
return;
}
}
- zend_reflection_class_factory(ce, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce, return_value);
}
}
/* }}} */
@@ -2623,7 +2623,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
zend_class_entry *old_scope = EG(scope);
EG(scope) = param->fptr->common.scope;
- zval_update_constant_ex(return_value, 0, NULL TSRMLS_CC);
+ zval_update_constant_ex(return_value, 0, NULL);
EG(scope) = old_scope;
} else {
zval_copy_ctor(return_value);
@@ -2717,12 +2717,12 @@ ZEND_METHOD(reflection_method, __construct)
size_t name_len, tmp_len;
zval ztmp;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "zs", &classname, &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
if ((tmp = strstr(name_str, "::")) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Invalid method name %s", name_str);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Invalid method name %s", name_str);
return;
}
classname = &ztmp;
@@ -2746,8 +2746,8 @@ ZEND_METHOD(reflection_method, __construct)
/* Find the class entry */
switch (Z_TYPE_P(classname)) {
case IS_STRING:
- if ((ce = zend_lookup_class(Z_STR_P(classname) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classname));
if (classname == &ztmp) {
zval_dtor(&ztmp);
@@ -2776,12 +2776,12 @@ ZEND_METHOD(reflection_method, __construct)
if (ce == zend_ce_closure && orig_obj && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj) TSRMLS_CC)) != NULL)
+ && (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj))) != NULL)
{
/* do nothing, mptr already set */
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, name_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, name_str);
return;
}
@@ -2810,7 +2810,7 @@ ZEND_METHOD(reflection_method, __toString)
}
GET_REFLECTION_OBJECT_PTR(mptr);
string_init(&str);
- _function_string(&str, mptr, intern->ce, "" TSRMLS_CC);
+ _function_string(&str, mptr, intern->ce, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -2827,13 +2827,13 @@ ZEND_METHOD(reflection_method, getClosure)
GET_REFLECTION_OBJECT_PTR(mptr);
if (mptr->common.fn_flags & ZEND_ACC_STATIC) {
- zend_create_closure(return_value, mptr, mptr->common.scope, NULL TSRMLS_CC);
+ zend_create_closure(return_value, mptr, mptr->common.scope, NULL);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
@@ -2844,7 +2844,7 @@ ZEND_METHOD(reflection_method, getClosure)
{
RETURN_ZVAL(obj, 1, 0);
} else {
- zend_create_closure(return_value, mptr, mptr->common.scope, obj TSRMLS_CC);
+ zend_create_closure(return_value, mptr, mptr->common.scope, obj);
}
}
}
@@ -2873,11 +2873,11 @@ ZEND_METHOD(reflection_method, invoke)
&& intern->ignore_visibility == 0)
{
if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke abstract method %s::%s()",
mptr->common.scope->name->val, mptr->common.function_name->val);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke %s method %s::%s() from scope %s",
mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
mptr->common.scope->name->val, mptr->common.function_name->val,
@@ -2886,7 +2886,7 @@ ZEND_METHOD(reflection_method, invoke)
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &params, &num_args) == FAILURE) {
return;
}
@@ -2907,7 +2907,7 @@ ZEND_METHOD(reflection_method, invoke)
obj_ce = Z_OBJCE(params[0]);
- if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(obj_ce, mptr->common.scope)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
@@ -2931,10 +2931,10 @@ ZEND_METHOD(reflection_method, invoke)
fcc.called_scope = intern->ce;
fcc.object = object;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of method %s::%s() failed", mptr->common.scope->name->val, mptr->common.function_name->val);
return;
}
@@ -2964,7 +2964,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
GET_REFLECTION_OBJECT_PTR(mptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, &param_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a", &object, &param_array) == FAILURE) {
return;
}
@@ -2973,11 +2973,11 @@ ZEND_METHOD(reflection_method, invokeArgs)
&& intern->ignore_visibility == 0)
{
if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke abstract method %s::%s()",
mptr->common.scope->name->val, mptr->common.function_name->val);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke %s method %s::%s() from scope %s",
mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
mptr->common.scope->name->val, mptr->common.function_name->val,
@@ -3007,7 +3007,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
} else {
if (!object) {
efree(params);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke non static method %s::%s() without an object",
mptr->common.scope->name->val, mptr->common.function_name->val);
return;
@@ -3015,7 +3015,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
obj_ce = Z_OBJCE_P(object);
- if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(obj_ce, mptr->common.scope)) {
efree(params);
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
@@ -3043,10 +3043,10 @@ ZEND_METHOD(reflection_method, invokeArgs)
*/
if (mptr->type == ZEND_INTERNAL_FUNCTION &&
(mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
- fcc.function_handler = _copy_function(mptr TSRMLS_CC);
+ fcc.function_handler = _copy_function(mptr);
}
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
for (i = 0; i < argc; i++) {
zval_ptr_dtor(&params[i]);
@@ -3054,7 +3054,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
efree(params);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of method %s::%s() failed", mptr->common.scope->name->val, mptr->common.function_name->val);
return;
}
@@ -3147,7 +3147,7 @@ ZEND_METHOD(reflection_function, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3170,7 +3170,7 @@ ZEND_METHOD(reflection_function, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3193,7 +3193,7 @@ ZEND_METHOD(reflection_function, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3269,7 +3269,7 @@ ZEND_METHOD(reflection_method, getDeclaringClass)
return;
}
- zend_reflection_class_factory(mptr->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(mptr->common.scope, return_value);
}
/* }}} */
@@ -3288,12 +3288,12 @@ ZEND_METHOD(reflection_method, getPrototype)
}
if (!mptr->common.prototype) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s does not have a prototype", intern->ce->name->val, mptr->common.function_name->val);
return;
}
- reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, NULL, return_value);
}
/* }}} */
@@ -3304,7 +3304,7 @@ ZEND_METHOD(reflection_method, setAccessible)
reflection_object *intern;
zend_bool visible;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &visible) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
return;
}
@@ -3336,11 +3336,11 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
zend_class_entry *ce;
if (is_object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &argument) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &argument) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &argument) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &argument) == FAILURE) {
return;
}
}
@@ -3361,9 +3361,9 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
}
} else {
convert_to_string_ex(argument);
- if ((ce = zend_lookup_class(Z_STR_P(argument) TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class(Z_STR_P(argument))) == NULL) {
if (!EG(exception)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument));
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Class %s does not exist", Z_STRVAL_P(argument));
}
return;
}
@@ -3386,7 +3386,7 @@ ZEND_METHOD(reflection_class, __construct)
/* }}} */
/* {{{ add_class_vars */
-static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC)
+static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value)
{
zend_property_info *prop_info;
zval *prop, prop_copy;
@@ -3418,7 +3418,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
/* this is necessary to make it able to work with default array
* properties, returned to user */
if (Z_CONSTANT(prop_copy)) {
- zval_update_constant(&prop_copy, 1 TSRMLS_CC);
+ zval_update_constant(&prop_copy, 1);
}
zend_hash_update(Z_ARRVAL_P(return_value), key, &prop_copy);
@@ -3439,10 +3439,10 @@ ZEND_METHOD(reflection_class, getStaticProperties)
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
array_init(return_value);
- add_class_vars(ce, 1, return_value TSRMLS_CC);
+ add_class_vars(ce, 1, return_value);
}
/* }}} */
@@ -3455,19 +3455,19 @@ ZEND_METHOD(reflection_class, getStaticPropertyValue)
zend_string *name;
zval *prop, *def_value = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|z", &name, &def_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &name, &def_value) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
- prop = zend_std_get_static_property(ce, name, 1, NULL TSRMLS_CC);
+ zend_update_class_constants(ce);
+ prop = zend_std_get_static_property(ce, name, 1, NULL);
if (!prop) {
if (def_value) {
RETURN_ZVAL(def_value, 1, 0);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not have a property named %s", ce->name->val, name->val);
}
return;
@@ -3486,16 +3486,16 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
zend_string *name;
zval *variable_ptr, *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &name, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &name, &value) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
- variable_ptr = zend_std_get_static_property(ce, name, 1, NULL TSRMLS_CC);
+ zend_update_class_constants(ce);
+ variable_ptr = zend_std_get_static_property(ce, name, 1, NULL);
if (!variable_ptr) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not have a property named %s", ce->name->val, name->val);
return;
}
@@ -3516,9 +3516,9 @@ ZEND_METHOD(reflection_class, getDefaultProperties)
}
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_update_class_constants(ce TSRMLS_CC);
- add_class_vars(ce, 1, return_value TSRMLS_CC);
- add_class_vars(ce, 0, return_value TSRMLS_CC);
+ zend_update_class_constants(ce);
+ add_class_vars(ce, 1, return_value);
+ add_class_vars(ce, 0, return_value);
}
/* }}} */
@@ -3535,7 +3535,7 @@ ZEND_METHOD(reflection_class, __toString)
}
GET_REFLECTION_OBJECT_PTR(ce);
string_init(&str);
- _class_string(&str, ce, &intern->obj, "" TSRMLS_CC);
+ _class_string(&str, ce, &intern->obj, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -3547,7 +3547,7 @@ ZEND_METHOD(reflection_class, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -3666,7 +3666,7 @@ ZEND_METHOD(reflection_class, getConstructor)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->constructor) {
- reflection_method_factory(ce, ce->constructor, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, ce->constructor, NULL, return_value);
} else {
RETURN_NULL();
}
@@ -3683,7 +3683,7 @@ ZEND_METHOD(reflection_class, hasMethod)
size_t name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -3713,7 +3713,7 @@ ZEND_METHOD(reflection_class, getMethod)
size_t name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -3721,26 +3721,26 @@ ZEND_METHOD(reflection_class, getMethod)
lc_name = zend_str_tolower_dup(name, name_len);
if (ce == zend_ce_closure && !Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj) TSRMLS_CC)) != NULL)
+ && (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj))) != NULL)
{
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself */
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
efree(lc_name);
} else if (ce == zend_ce_closure && Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp) TSRMLS_CC)) != NULL) {
+ && object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp))) != NULL) {
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself */
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
zval_dtor(&obj_tmp);
efree(lc_name);
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) {
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
efree(lc_name);
} else {
efree(lc_name);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s does not exist", name);
return;
}
@@ -3748,7 +3748,7 @@ ZEND_METHOD(reflection_class, getMethod)
/* }}} */
/* {{{ _addmethod */
-static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj TSRMLS_DC)
+static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj)
{
zval method;
size_t len = mptr->common.function_name->len;
@@ -3756,21 +3756,21 @@ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval,
if (mptr->common.fn_flags & filter) {
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(mptr->common.function_name->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj) TSRMLS_CC)) != NULL)
+ && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
{
mptr = closure;
}
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself, even if we have a
closure */
- reflection_method_factory(ce, mptr, NULL, &method TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, &method);
add_next_index_zval(retval, &method);
}
}
/* }}} */
/* {{{ _addmethod */
-static int _addmethod_va(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addmethod_va(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_function *mptr = (zend_function*)Z_PTR_P(el);
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -3778,7 +3778,7 @@ static int _addmethod_va(zval *el TSRMLS_DC, int num_args, va_list args, zend_ha
long filter = va_arg(args, long);
zval *obj = va_arg(args, zval *);
- _addmethod(mptr, ce, retval, filter, obj TSRMLS_CC);
+ _addmethod(mptr, ce, retval, filter, obj);
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -3794,7 +3794,7 @@ ZEND_METHOD(reflection_class, getMethods)
METHOD_NOTSTATIC(reflection_class_ptr);
if (argc) {
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) {
return;
}
} else {
@@ -3805,12 +3805,12 @@ ZEND_METHOD(reflection_class, getMethods)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_arguments(&ce->function_table TSRMLS_CC, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter, intern->obj);
- if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure TSRMLS_CC)) {
- zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj) TSRMLS_CC);
+ zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter, intern->obj);
+ if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure)) {
+ zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj));
if (closure) {
- _addmethod(closure, ce, return_value, filter, &intern->obj TSRMLS_CC);
- _free_function(closure TSRMLS_CC);
+ _addmethod(closure, ce, return_value, filter, &intern->obj);
+ _free_function(closure);
}
}
}
@@ -3827,7 +3827,7 @@ ZEND_METHOD(reflection_class, hasProperty)
zval property;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
@@ -3840,7 +3840,7 @@ ZEND_METHOD(reflection_class, hasProperty)
} else {
if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) {
ZVAL_STR_COPY(&property, name);
- if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL TSRMLS_CC)) {
+ if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL)) {
zval_ptr_dtor(&property);
RETURN_TRUE;
}
@@ -3863,26 +3863,26 @@ ZEND_METHOD(reflection_class, getProperty)
size_t classname_len, str_name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) {
if ((property_info->flags & ZEND_ACC_SHADOW) == 0) {
- reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
+ reflection_property_factory(ce, property_info, return_value);
return;
}
} else if (Z_TYPE(intern->obj) != IS_UNDEF) {
/* Check for dynamic properties */
- if (zend_hash_exists(Z_OBJ_HT(intern->obj)->get_properties(&intern->obj TSRMLS_CC), name)) {
+ if (zend_hash_exists(Z_OBJ_HT(intern->obj)->get_properties(&intern->obj), name)) {
zend_property_info property_info_tmp;
property_info_tmp.flags = ZEND_ACC_IMPLICIT_PUBLIC;
property_info_tmp.name = zend_string_copy(name);
property_info_tmp.doc_comment = NULL;
property_info_tmp.ce = ce;
- reflection_property_factory(ce, &property_info_tmp, return_value TSRMLS_CC);
+ reflection_property_factory(ce, &property_info_tmp, return_value);
intern = Z_REFLECTION_P(return_value);
intern->ref_type = REF_TYPE_DYNAMIC_PROPERTY;
return;
@@ -3898,34 +3898,34 @@ ZEND_METHOD(reflection_class, getProperty)
str_name_len = name->len - (classname_len + 2);
str_name = tmp + 2;
- ce2 = zend_lookup_class(classname TSRMLS_CC);
+ ce2 = zend_lookup_class(classname);
if (!ce2) {
if (!EG(exception)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", classname->val);
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Class %s does not exist", classname->val);
}
zend_string_release(classname);
return;
}
zend_string_release(classname);
- if (!instanceof_function(ce, ce2 TSRMLS_CC)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Fully qualified property name %s::%s does not specify a base class of %s", ce2->name->val, str_name, ce->name->val);
+ if (!instanceof_function(ce, ce2)) {
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Fully qualified property name %s::%s does not specify a base class of %s", ce2->name->val, str_name, ce->name->val);
return;
}
ce = ce2;
if ((property_info = zend_hash_str_find_ptr(&ce->properties_info, str_name, str_name_len)) != NULL && (property_info->flags & ZEND_ACC_SHADOW) == 0) {
- reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
+ reflection_property_factory(ce, property_info, return_value);
return;
}
}
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Property %s does not exist", str_name);
}
/* }}} */
/* {{{ _addproperty */
-static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addproperty(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zval property;
zend_property_info *pptr = (zend_property_info*)Z_PTR_P(el);
@@ -3938,7 +3938,7 @@ static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_has
}
if (pptr->flags & filter) {
- reflection_property_factory(ce, pptr, &property TSRMLS_CC);
+ reflection_property_factory(ce, pptr, &property);
add_next_index_zval(retval, &property);
}
return 0;
@@ -3946,7 +3946,7 @@ static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_has
/* }}} */
/* {{{ _adddynproperty */
-static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _adddynproperty(zval *ptr, int num_args, va_list args, zend_hash_key *hash_key)
{
zval property;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -3963,14 +3963,14 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
return 0; /* non public cannot be dynamic */
}
- if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == NULL) {
+ if (zend_get_property_info(ce, hash_key->key, 1) == NULL) {
zend_property_info property_info;
property_info.flags = ZEND_ACC_IMPLICIT_PUBLIC;
property_info.name = hash_key->key;
property_info.ce = ce;
property_info.offset = -1;
- reflection_property_factory(ce, &property_info, &property TSRMLS_CC);
+ reflection_property_factory(ce, &property_info, &property);
add_next_index_zval(retval, &property);
}
return 0;
@@ -3988,7 +3988,7 @@ ZEND_METHOD(reflection_class, getProperties)
METHOD_NOTSTATIC(reflection_class_ptr);
if (argc) {
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) {
return;
}
} else {
@@ -3999,11 +3999,11 @@ ZEND_METHOD(reflection_class, getProperties)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_arguments(&ce->properties_info TSRMLS_CC, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter);
+ zend_hash_apply_with_arguments(&ce->properties_info, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter);
if (Z_TYPE(intern->obj) != IS_UNDEF && (filter & ZEND_ACC_PUBLIC) != 0 && Z_OBJ_HT(intern->obj)->get_properties) {
- HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(&intern->obj TSRMLS_CC);
- zend_hash_apply_with_arguments(properties TSRMLS_CC, (apply_func_args_t) _adddynproperty, 2, &ce, return_value);
+ HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(&intern->obj);
+ zend_hash_apply_with_arguments(properties, (apply_func_args_t) _adddynproperty, 2, &ce, return_value);
}
}
/* }}} */
@@ -4017,7 +4017,7 @@ ZEND_METHOD(reflection_class, hasConstant)
zend_string *name;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
@@ -4042,7 +4042,7 @@ ZEND_METHOD(reflection_class, getConstants)
}
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce);
zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, zval_add_ref_unref);
}
/* }}} */
@@ -4057,12 +4057,12 @@ ZEND_METHOD(reflection_class, getConstant)
zend_string *name;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce);
if ((value = zend_hash_find(&ce->constants_table, name)) == NULL) {
RETURN_FALSE;
}
@@ -4199,11 +4199,11 @@ ZEND_METHOD(reflection_class, isInstance)
zval *object;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC));
+ RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce));
}
/* }}} */
@@ -4223,7 +4223,7 @@ ZEND_METHOD(reflection_class, newInstance)
old_scope = EG(scope);
EG(scope) = ce;
- constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value) TSRMLS_CC);
+ constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value));
EG(scope) = old_scope;
/* Run the constructor if there is one */
@@ -4234,12 +4234,12 @@ ZEND_METHOD(reflection_class, newInstance)
zend_fcall_info_cache fcc;
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &params, &num_args) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -4264,18 +4264,18 @@ ZEND_METHOD(reflection_class, newInstance)
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- ret = zend_call_function(&fci, &fcc TSRMLS_CC);
+ ret = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
for (i = 0; i < num_args; i++) {
zval_ptr_dtor(&params[i]);
}
if (ret == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
} else if (ZEND_NUM_ARGS()) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
}
}
/* }}} */
@@ -4291,7 +4291,7 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
}
object_init_ex(return_value, ce);
@@ -4313,7 +4313,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|h", &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|h", &args) == FAILURE) {
return;
}
@@ -4325,7 +4325,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
old_scope = EG(scope);
EG(scope) = ce;
- constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value) TSRMLS_CC);
+ constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value));
EG(scope) = old_scope;
/* Run the constructor if there is one */
@@ -4335,7 +4335,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
zend_fcall_info_cache fcc;
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
@@ -4365,7 +4365,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- ret = zend_call_function(&fci, &fcc TSRMLS_CC);
+ ret = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
if (params) {
for (i = 0; i < argc; i++) {
@@ -4375,12 +4375,12 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
}
if (ret == FAILURE) {
zval_ptr_dtor(&retval);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
} else if (argc) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
}
}
/* }}} */
@@ -4405,7 +4405,7 @@ ZEND_METHOD(reflection_class, getInterfaces)
for (i=0; i < ce->num_interfaces; i++) {
zval interface;
- zend_reflection_class_factory(ce->interfaces[i], &interface TSRMLS_CC);
+ zend_reflection_class_factory(ce->interfaces[i], &interface);
zend_hash_update(Z_ARRVAL_P(return_value), ce->interfaces[i]->name, &interface);
}
}
@@ -4451,7 +4451,7 @@ ZEND_METHOD(reflection_class, getTraits)
for (i=0; i < ce->num_traits; i++) {
zval trait;
- zend_reflection_class_factory(ce->traits[i], &trait TSRMLS_CC);
+ zend_reflection_class_factory(ce->traits[i], &trait);
zend_hash_update(Z_ARRVAL_P(return_value), ce->traits[i]->name, &trait);
}
}
@@ -4523,7 +4523,7 @@ ZEND_METHOD(reflection_class, getParentClass)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->parent) {
- zend_reflection_class_factory(ce->parent, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce->parent, return_value);
} else {
RETURN_FALSE;
}
@@ -4541,23 +4541,23 @@ ZEND_METHOD(reflection_class, isSubclassOf)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &class_name) == FAILURE) {
return;
}
switch (Z_TYPE_P(class_name)) {
case IS_STRING:
- if ((class_ce = zend_lookup_class(Z_STR_P(class_name) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((class_ce = zend_lookup_class(Z_STR_P(class_name))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(class_name));
return;
}
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) {
argument = Z_REFLECTION_P(class_name);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
class_ce = argument->ptr;
@@ -4565,12 +4565,12 @@ ZEND_METHOD(reflection_class, isSubclassOf)
}
/* no break */
default:
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter one must either be a string or a ReflectionClass object");
return;
}
- RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce TSRMLS_CC)));
+ RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce)));
}
/* }}} */
@@ -4585,23 +4585,23 @@ ZEND_METHOD(reflection_class, implementsInterface)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &interface) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &interface) == FAILURE) {
return;
}
switch (Z_TYPE_P(interface)) {
case IS_STRING:
- if ((interface_ce = zend_lookup_class(Z_STR_P(interface) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((interface_ce = zend_lookup_class(Z_STR_P(interface))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Interface %s does not exist", Z_STRVAL_P(interface));
return;
}
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) {
argument = Z_REFLECTION_P(interface);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
interface_ce = argument->ptr;
@@ -4609,17 +4609,17 @@ ZEND_METHOD(reflection_class, implementsInterface)
}
/* no break */
default:
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter one must either be a string or a ReflectionClass object");
return;
}
if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Interface %s is a Class", interface_ce->name->val);
return;
}
- RETURN_BOOL(instanceof_function(ce, interface_ce TSRMLS_CC));
+ RETURN_BOOL(instanceof_function(ce, interface_ce));
}
/* }}} */
@@ -4656,7 +4656,7 @@ ZEND_METHOD(reflection_class, getExtension)
GET_REFLECTION_OBJECT_PTR(ce);
if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) {
- reflection_extension_factory(return_value, ce->info.internal.module->name TSRMLS_CC);
+ reflection_extension_factory(return_value, ce->info.internal.module->name);
}
}
/* }}} */
@@ -4693,7 +4693,7 @@ ZEND_METHOD(reflection_class, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4716,7 +4716,7 @@ ZEND_METHOD(reflection_class, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4739,7 +4739,7 @@ ZEND_METHOD(reflection_class, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4790,7 +4790,7 @@ ZEND_METHOD(reflection_property, __construct)
zend_property_info *property_info = NULL;
property_reference *reference;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &classname, &name_str, &name_len) == FAILURE) {
return;
}
@@ -4803,8 +4803,8 @@ ZEND_METHOD(reflection_property, __construct)
/* Find the class entry */
switch (Z_TYPE_P(classname)) {
case IS_STRING:
- if ((ce = zend_lookup_class(Z_STR_P(classname) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classname));
return;
}
@@ -4822,12 +4822,12 @@ ZEND_METHOD(reflection_property, __construct)
if ((property_info = zend_hash_str_find_ptr(&ce->properties_info, name_str, name_len)) == NULL || (property_info->flags & ZEND_ACC_SHADOW)) {
/* Check for dynamic properties */
if (property_info == NULL && Z_TYPE_P(classname) == IS_OBJECT && Z_OBJ_HT_P(classname)->get_properties) {
- if (zend_hash_str_exists(Z_OBJ_HT_P(classname)->get_properties(classname TSRMLS_CC), name_str, name_len)) {
+ if (zend_hash_str_exists(Z_OBJ_HT_P(classname)->get_properties(classname), name_str, name_len)) {
dynam_prop = 1;
}
}
if (dynam_prop == 0) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Property %s::$%s does not exist", ce->name->val, name_str);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ce->name->val, name_str);
return;
}
}
@@ -4887,7 +4887,7 @@ ZEND_METHOD(reflection_property, __toString)
}
GET_REFLECTION_OBJECT_PTR(ref);
string_init(&str);
- _property_string(&str, &ref->prop, NULL, "" TSRMLS_CC);
+ _property_string(&str, &ref->prop, NULL, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -4899,7 +4899,7 @@ ZEND_METHOD(reflection_property, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -4985,16 +4985,16 @@ ZEND_METHOD(reflection_property, getValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & (ZEND_ACC_PUBLIC | ZEND_ACC_IMPLICIT_PUBLIC)) && intern->ignore_visibility == 0) {
- name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ name = _default_load_entry(getThis(), "name", sizeof("name")-1);
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::%s", intern->ce->name->val, Z_STRVAL_P(name));
return;
}
if ((ref->prop.flags & ZEND_ACC_STATIC)) {
- zend_update_class_constants(intern->ce TSRMLS_CC);
+ zend_update_class_constants(intern->ce);
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
+ php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
/* Bails out */
}
ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]);
@@ -5002,12 +5002,12 @@ ZEND_METHOD(reflection_property, getValue)
const char *class_name, *prop_name;
size_t prop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object) == FAILURE) {
return;
}
zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
- member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1 TSRMLS_CC);
+ member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1);
ZVAL_DUP(return_value, member_p);
}
}
@@ -5028,22 +5028,22 @@ ZEND_METHOD(reflection_property, setValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & ZEND_ACC_PUBLIC) && intern->ignore_visibility == 0) {
- name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ name = _default_load_entry(getThis(), "name", sizeof("name")-1);
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::%s", intern->ce->name->val, Z_STRVAL_P(name));
return;
}
if ((ref->prop.flags & ZEND_ACC_STATIC)) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &tmp, &value) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &tmp, &value) == FAILURE) {
return;
}
}
- zend_update_class_constants(intern->ce TSRMLS_CC);
+ zend_update_class_constants(intern->ce);
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
+ php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
/* Bails out */
}
variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
@@ -5078,12 +5078,12 @@ ZEND_METHOD(reflection_property, setValue)
const char *class_name, *prop_name;
size_t prop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "oz", &object, &value) == FAILURE) {
return;
}
zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
- zend_update_property(ref->ce, object, prop_name, prop_name_len, value TSRMLS_CC);
+ zend_update_property(ref->ce, object, prop_name, prop_name_len, value);
}
}
/* }}} */
@@ -5122,7 +5122,7 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
tmp_ce = tmp_ce->parent;
}
- zend_reflection_class_factory(ce, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce, return_value);
}
/* }}} */
@@ -5151,7 +5151,7 @@ ZEND_METHOD(reflection_property, setAccessible)
reflection_object *intern;
zend_bool visible;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &visible) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
return;
}
@@ -5186,7 +5186,7 @@ ZEND_METHOD(reflection_extension, __construct)
size_t name_len;
ALLOCA_FLAG(use_heap)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
@@ -5199,7 +5199,7 @@ ZEND_METHOD(reflection_extension, __construct)
zend_str_tolower_copy(lcname, name_str, name_len);
if ((module = zend_hash_str_find_ptr(&module_registry, lcname, name_len)) == NULL) {
free_alloca(lcname, use_heap);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Extension %s does not exist", name_str);
return;
}
@@ -5225,7 +5225,7 @@ ZEND_METHOD(reflection_extension, __toString)
}
GET_REFLECTION_OBJECT_PTR(module);
string_init(&str);
- _extension_string(&str, module, "" TSRMLS_CC);
+ _extension_string(&str, module, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -5237,7 +5237,7 @@ ZEND_METHOD(reflection_extension, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -5282,7 +5282,7 @@ ZEND_METHOD(reflection_extension, getFunctions)
while ((fptr = zend_hash_get_current_data_ptr_ex(CG(function_table), &iterator)) != NULL) {
if (fptr->common.type==ZEND_INTERNAL_FUNCTION
&& fptr->internal_function.module == module) {
- reflection_function_factory(fptr, NULL, &function TSRMLS_CC);
+ reflection_function_factory(fptr, NULL, &function);
zend_hash_update(Z_ARRVAL_P(return_value), fptr->common.function_name, &function);
}
zend_hash_move_forward_ex(CG(function_table), &iterator);
@@ -5290,7 +5290,7 @@ ZEND_METHOD(reflection_extension, getFunctions)
}
/* }}} */
-static int _addconstant(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _addconstant(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zval const_val;
zend_constant *constant = (zend_constant*)Z_PTR_P(el);
@@ -5318,12 +5318,12 @@ ZEND_METHOD(reflection_extension, getConstants)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(zend_constants) TSRMLS_CC, (apply_func_args_t) _addconstant, 2, return_value, module->module_number);
+ zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _addconstant, 2, return_value, module->module_number);
}
/* }}} */
/* {{{ _addinientry */
-static int _addinientry(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addinientry(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el);
zval *retval = va_arg(args, zval*);
@@ -5356,12 +5356,12 @@ ZEND_METHOD(reflection_extension, getINIEntries)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) _addinientry, 2, return_value, module->module_number);
+ zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _addinientry, 2, return_value, module->module_number);
}
/* }}} */
/* {{{ add_extension_class */
-static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int add_extension_class(zval *zv, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_class_entry *ce = Z_PTR_P(zv);
zval *class_array = va_arg(args, zval*), zclass;
@@ -5379,7 +5379,7 @@ static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, z
name = ce->name;
}
if (add_reflection_class) {
- zend_reflection_class_factory(ce, &zclass TSRMLS_CC);
+ zend_reflection_class_factory(ce, &zclass);
zend_hash_update(Z_ARRVAL_P(class_array), name, &zclass);
} else {
add_next_index_str(class_array, zend_string_copy(name));
@@ -5402,7 +5402,7 @@ ZEND_METHOD(reflection_extension, getClasses)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) add_extension_class, 3, return_value, module, 1);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 1);
}
/* }}} */
@@ -5419,7 +5419,7 @@ ZEND_METHOD(reflection_extension, getClassNames)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) add_extension_class, 3, return_value, module, 0);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 0);
}
/* }}} */
@@ -5502,7 +5502,7 @@ ZEND_METHOD(reflection_extension, info)
}
GET_REFLECTION_OBJECT_PTR(module);
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
/* }}} */
@@ -5557,7 +5557,7 @@ ZEND_METHOD(reflection_zend_extension, __construct)
char *name_str;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
@@ -5569,7 +5569,7 @@ ZEND_METHOD(reflection_zend_extension, __construct)
extension = zend_get_extension(name_str);
if (!extension) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Zend Extension %s does not exist", name_str);
return;
}
@@ -5594,7 +5594,7 @@ ZEND_METHOD(reflection_zend_extension, __toString)
}
GET_REFLECTION_OBJECT_PTR(extension);
string_init(&str);
- _zend_extension_string(&str, extension, "" TSRMLS_CC);
+ _zend_extension_string(&str, extension, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -6110,19 +6110,19 @@ const zend_function_entry reflection_ext_functions[] = { /* {{{ */
static zend_object_handlers *zend_std_obj_handlers;
/* {{{ _reflection_write_property */
-static void _reflection_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void _reflection_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
if ((Z_TYPE_P(member) == IS_STRING)
&& zend_hash_exists(&Z_OBJCE_P(object)->properties_info, Z_STR_P(member))
&& ((Z_STRLEN_P(member) == sizeof("name") - 1 && !memcmp(Z_STRVAL_P(member), "name", sizeof("name")))
|| (Z_STRLEN_P(member) == sizeof("class") - 1 && !memcmp(Z_STRVAL_P(member), "class", sizeof("class")))))
{
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot set read-only property %s::$%s", Z_OBJCE_P(object)->name->val, Z_STRVAL_P(member));
}
else
{
- zend_std_obj_handlers->write_property(object, member, value, cache_slot TSRMLS_CC);
+ zend_std_obj_handlers->write_property(object, member, value, cache_slot);
}
}
/* }}} */
@@ -6139,38 +6139,38 @@ 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(TSRMLS_C) TSRMLS_CC);
+ reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default());
INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions);
- reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
+ reflection_ptr = zend_register_internal_class(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "Reflector", reflector_functions);
- reflector_ptr = zend_register_internal_interface(&_reflection_entry TSRMLS_CC);
+ reflector_ptr = zend_register_internal_interface(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunctionAbstract", reflection_function_abstract_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_function_abstract_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT TSRMLS_CC);
+ reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_function_abstract_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr TSRMLS_CC);
- zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
+ zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_parameter_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_parameter_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr TSRMLS_CC);
- zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
+ zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_STATIC", ZEND_ACC_STATIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_PUBLIC", ZEND_ACC_PUBLIC);
@@ -6181,9 +6181,9 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_class_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_class_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_class_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
@@ -6191,14 +6191,14 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr TSRMLS_CC);
+ reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_property_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_property_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_property_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_property_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_STATIC", ZEND_ACC_STATIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_PUBLIC", ZEND_ACC_PUBLIC);
@@ -6207,15 +6207,15 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_extension_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_extension_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_extension_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionZendExtension", reflection_zend_extension_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_zend_extension_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_zend_extension_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
return SUCCESS;
} /* }}} */
diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h
index 1c436d7dcc..bf8a5d2854 100644
--- a/ext/reflection/php_reflection.h
+++ b/ext/reflection/php_reflection.h
@@ -42,7 +42,7 @@ extern PHPAPI zend_class_entry *reflection_property_ptr;
extern PHPAPI zend_class_entry *reflection_extension_ptr;
extern PHPAPI zend_class_entry *reflection_zend_extension_ptr;
-PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC);
+PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object);
END_EXTERN_C()
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 1c3ba78368..949306c026 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -11,7 +11,7 @@ PHP_ARG_WITH(mm,for mm support,
if test "$PHP_SESSION" != "no"; then
PHP_PWRITE_TEST
PHP_PREAD_TEST
- PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
+ PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_EXTENSION_DEP(session, hash, true)
PHP_ADD_EXTENSION_DEP(session, spl)
PHP_SUBST(SESSION_SHARED_LIBADD)
diff --git a/ext/session/config.w32 b/ext/session/config.w32
index c8b217aad9..942f595da1 100644
--- a/ext/session/config.w32
+++ b/ext/session/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("session", "session support", "yes");
if (PHP_SESSION == "yes") {
- EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
+ EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h php_session.h mod_files.h mod_user.h");
}
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index cb61c8a221..64aa0ce145 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -118,7 +118,7 @@ static void ps_files_close(ps_files *data)
}
}
-static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
+static void ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
#if !defined(O_NOFOLLOW) || !defined(PHP_WIN32)
@@ -134,7 +134,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
ps_files_close(data);
if (php_session_valid_key(key) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
+ php_error_docref(NULL, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
return;
}
@@ -150,7 +150,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
#else
/* Check to make sure that the opened file is not outside of allowable dirs.
This is not 100% safe but it's hard to do something better without O_NOFOLLOW */
- if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
+ if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf)) {
return;
}
data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode);
@@ -173,16 +173,16 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
# define FD_CLOEXEC 1
# endif
if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno);
}
}
}
-static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
+static int ps_files_cleanup_dir(const char *dirname, int maxlifetime)
{
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
@@ -195,7 +195,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
dir = opendir(dirname);
if (!dir) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
+ php_error_docref(NULL, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
return (0);
}
@@ -235,7 +235,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
return (nrdels);
}
-static int ps_files_key_exists(ps_files *data, const char *key TSRMLS_DC)
+static int ps_files_key_exists(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
zend_stat_t sbuf;
@@ -263,9 +263,9 @@ PS_OPEN_FUNC(files)
if (*save_path == '\0') {
/* if save path is an empty string, determine the temporary dir */
- save_path = php_get_temporary_directory(TSRMLS_C);
+ save_path = php_get_temporary_directory();
- if (php_check_open_basedir(save_path TSRMLS_CC)) {
+ if (php_check_open_basedir(save_path)) {
return FAILURE;
}
}
@@ -309,7 +309,7 @@ PS_OPEN_FUNC(files)
data->basedir = estrndup(save_path, data->basedir_len);
if (PS_GET_MOD_DATA()) {
- ps_close_files(mod_data TSRMLS_CC);
+ ps_close_files(mod_data);
}
PS_SET_MOD_DATA(data);
@@ -341,24 +341,24 @@ PS_READ_FUNC(files)
/* If strict mode, check session id existence */
if (PS(use_strict_mode) &&
- ps_files_key_exists(data, key? key->val : NULL TSRMLS_CC) == FAILURE) {
+ ps_files_key_exists(data, key? key->val : NULL) == FAILURE) {
/* key points to PS(id), but cannot change here. */
if (key) {
zend_string_release(PS(id));
PS(id) = NULL;
}
- PS(id) = PS(mod)->s_create_sid((void **)&data TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid((void **)&data);
if (!PS(id)) {
return FAILURE;
}
if (PS(use_cookies)) {
PS(send_cookie) = 1;
}
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
- ps_files_open(data, PS(id)->val TSRMLS_CC);
+ ps_files_open(data, PS(id)->val);
if (data->fd < 0) {
return FAILURE;
}
@@ -385,9 +385,9 @@ PS_READ_FUNC(files)
if (n != sbuf.st_size) {
if (n == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested");
+ php_error_docref(NULL, E_WARNING, "read returned less bytes than requested");
}
zend_string_release(*val);
return FAILURE;
@@ -401,7 +401,7 @@ PS_WRITE_FUNC(files)
zend_long n;
PS_FILES_DATA;
- ps_files_open(data, key->val TSRMLS_CC);
+ ps_files_open(data, key->val);
if (data->fd < 0) {
return FAILURE;
}
@@ -421,9 +421,9 @@ PS_WRITE_FUNC(files)
if (n != val->len) {
if (n == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested");
+ php_error_docref(NULL, E_WARNING, "write wrote less bytes than requested");
}
return FAILURE;
}
@@ -464,7 +464,7 @@ PS_GC_FUNC(files)
an external entity (i.e. find -ctime x | xargs rm) */
if (data->dirdepth == 0) {
- *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime TSRMLS_CC);
+ *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime);
}
return SUCCESS;
@@ -477,9 +477,9 @@ PS_CREATE_SID_FUNC(files)
PS_FILES_DATA;
do {
- sid = php_session_create_id((void**)&data TSRMLS_CC);
+ sid = php_session_create_id((void**)&data);
/* Check collision */
- if (data && ps_files_key_exists(data, sid? sid->val : NULL TSRMLS_CC) == SUCCESS) {
+ if (data && ps_files_key_exists(data, sid? sid->val : NULL) == SUCCESS) {
if (sid) {
zend_string_release(sid);
sid = NULL;
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index bf48436a7e..d267dd0e1f 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -122,9 +122,8 @@ static ps_sd *ps_sd_new(ps_mm *data, const char *key)
sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen);
if (!sd) {
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %ld, err %s", mm_available(data->mm), mm_error());
+
+ php_error_docref(NULL, E_WARNING, "mm_malloc failed, avail %ld, err %s", mm_available(data->mm), mm_error());
return NULL;
}
@@ -208,7 +207,7 @@ static ps_sd *ps_sd_lookup(ps_mm *data, const char *key, int rw)
return ret;
}
-static int ps_mm_key_exists(ps_mm *data, const char *key TSRMLS_DC)
+static int ps_mm_key_exists(ps_mm *data, const char *key)
{
ps_sd *sd;
@@ -357,20 +356,20 @@ PS_READ_FUNC(mm)
/* If there is an ID and strict mode, verify existence */
if (PS(use_strict_mode)
- && ps_mm_key_exists(data, key TSRMLS_CC) == FAILURE) {
+ && ps_mm_key_exists(data, key) == FAILURE) {
/* key points to PS(id), but cannot change here. */
if (key) {
efree(PS(id));
PS(id) = NULL;
}
- PS(id) = PS(mod)->s_create_sid((void **)&data, NULL TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid((void **)&data, NULL);
if (!PS(id)) {
return FAILURE;
}
if (PS(use_cookies)) {
PS(send_cookie) = 1;
}
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
@@ -411,7 +410,7 @@ PS_WRITE_FUNC(mm)
if (!sd->data) {
ps_sd_destroy(data, sd);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot allocate new data segment");
+ php_error_docref(NULL, E_WARNING, "cannot allocate new data segment");
sd = NULL;
}
}
@@ -484,9 +483,9 @@ PS_CREATE_SID_FUNC(mm)
PS_MM_DATA;
do {
- sid = php_session_create_id((void **)&data, newlen TSRMLS_CC);
+ sid = php_session_create_id((void **)&data, newlen);
/* Check collision */
- if (ps_mm_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
+ if (ps_mm_key_exists(data, sid) == SUCCESS) {
if (sid) {
efree(sid);
sid = NULL;
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index 5d474deab5..0e6e00eb32 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -47,10 +47,10 @@ ps_module ps_mod_user = {
ZVAL_STR_COPY(a, vl); \
}
-static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC)
+static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval)
{
int i;
- if (call_user_function(EG(function_table), NULL, func, retval, argc, argv TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, func, retval, argc, argv) == FAILURE) {
zval_ptr_dtor(retval);
ZVAL_UNDEF(retval);
} else if (Z_ISUNDEF_P(retval)) {
@@ -81,7 +81,7 @@ static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRML
ret = SUCCESS; \
} else { \
if (!EG(exception)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, \
+ php_error_docref(NULL, E_WARNING, \
"Session callback expects true/false return value"); \
} \
ret = FAILURE; \
@@ -96,7 +96,7 @@ PS_OPEN_FUNC(user)
STDVARS;
if (Z_ISUNDEF(PSF(open))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"user session functions not defined");
return FAILURE;
@@ -105,7 +105,7 @@ PS_OPEN_FUNC(user)
SESS_ZVAL_STRING((char*)save_path, &args[0]);
SESS_ZVAL_STRING((char*)session_name, &args[1]);
- ps_call_handler(&PSF(open), 2, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(open), 2, args, &retval);
PS(mod_user_implemented) = 1;
FINISH;
@@ -122,7 +122,7 @@ PS_CLOSE_FUNC(user)
}
zend_try {
- ps_call_handler(&PSF(close), 0, NULL, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(close), 0, NULL, &retval);
} zend_catch {
bailout = 1;
} zend_end_try();
@@ -146,7 +146,7 @@ PS_READ_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
- ps_call_handler(&PSF(read), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(read), 1, args, &retval);
if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) == IS_STRING) {
@@ -167,7 +167,7 @@ PS_WRITE_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
SESS_ZVAL_STR(val, &args[1]);
- ps_call_handler(&PSF(write), 2, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(write), 2, args, &retval);
FINISH;
}
@@ -179,7 +179,7 @@ PS_DESTROY_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
- ps_call_handler(&PSF(destroy), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(destroy), 1, args, &retval);
FINISH;
}
@@ -191,7 +191,7 @@ PS_GC_FUNC(user)
SESS_ZVAL_LONG(maxlifetime, &args[0]);
- ps_call_handler(&PSF(gc), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(gc), 1, args, &retval);
FINISH;
}
@@ -203,7 +203,7 @@ PS_CREATE_SID_FUNC(user)
zend_string *id = NULL;
zval retval;
- ps_call_handler(&PSF(create_sid), 0, NULL, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(create_sid), 0, NULL, &retval);
if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) == IS_STRING) {
@@ -211,12 +211,12 @@ PS_CREATE_SID_FUNC(user)
}
zval_ptr_dtor(&retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "No session id returned by function");
+ php_error_docref(NULL, E_ERROR, "No session id returned by function");
return NULL;
}
if (!id) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Session id must be a string");
+ php_error_docref(NULL, E_ERROR, "Session id must be a string");
return NULL;
}
@@ -224,7 +224,7 @@ PS_CREATE_SID_FUNC(user)
}
/* function as defined by PS_MOD */
- return php_session_create_id(mod_data TSRMLS_CC);
+ return php_session_create_id(mod_data);
}
/*
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 7e2960cc32..0c8fb2c701 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -23,14 +23,14 @@
#define PS_SANITY_CHECK \
if (PS(default_mod) == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Cannot call default session handler"); \
+ php_error_docref(NULL, E_CORE_ERROR, "Cannot call default session handler"); \
RETURN_FALSE; \
}
#define PS_SANITY_CHECK_IS_OPEN \
PS_SANITY_CHECK; \
if (!PS(mod_user_is_open)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parent session handler is not open"); \
+ php_error_docref(NULL, E_WARNING, "Parent session handler is not open"); \
RETURN_FALSE; \
}
@@ -43,12 +43,12 @@ PHP_METHOD(SessionHandler, open)
PS_SANITY_CHECK;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &save_path, &save_path_len, &session_name, &session_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &save_path, &save_path_len, &session_name, &session_name_len) == FAILURE) {
return;
}
PS(mod_user_is_open) = 1;
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_open(&PS(mod_data), save_path, session_name TSRMLS_CC));
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_open(&PS(mod_data), save_path, session_name));
}
/* }}} */
@@ -63,7 +63,7 @@ PHP_METHOD(SessionHandler, close)
zend_parse_parameters_none();
PS(mod_user_is_open) = 0;
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_close(&PS(mod_data) TSRMLS_CC));
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_close(&PS(mod_data)));
}
/* }}} */
@@ -76,11 +76,11 @@ PHP_METHOD(SessionHandler, read)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
- if (PS(default_mod)->s_read(&PS(mod_data), key, &val TSRMLS_CC) == FAILURE) {
+ if (PS(default_mod)->s_read(&PS(mod_data), key, &val) == FAILURE) {
RETVAL_FALSE;
return;
}
@@ -97,11 +97,11 @@ PHP_METHOD(SessionHandler, write)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &key, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &key, &val) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val));
}
/* }}} */
@@ -113,11 +113,11 @@ PHP_METHOD(SessionHandler, destroy)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key));
}
/* }}} */
@@ -130,11 +130,11 @@ PHP_METHOD(SessionHandler, gc)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &maxlifetime) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &maxlifetime) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels));
}
/* }}} */
@@ -150,7 +150,7 @@ PHP_METHOD(SessionHandler, create_sid)
return;
}
- id = PS(default_mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ id = PS(default_mod)->s_create_sid(&PS(mod_data));
RETURN_STR(id);
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 9fb6477056..f47938cab5 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -32,13 +32,13 @@
/* To check php_session_valid_key()/php_session_reset_id() */
#define PHP_SESSION_STRICT 1
-#define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name TSRMLS_DC
-#define PS_CLOSE_ARGS void **mod_data TSRMLS_DC
-#define PS_READ_ARGS void **mod_data, zend_string *key, zend_string **val TSRMLS_DC
-#define PS_WRITE_ARGS void **mod_data, zend_string *key, zend_string *val TSRMLS_DC
-#define PS_DESTROY_ARGS void **mod_data, zend_string *key TSRMLS_DC
-#define PS_GC_ARGS void **mod_data, int maxlifetime, int *nrdels TSRMLS_DC
-#define PS_CREATE_SID_ARGS void **mod_data TSRMLS_DC
+#define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name
+#define PS_CLOSE_ARGS void **mod_data
+#define PS_READ_ARGS void **mod_data, zend_string *key, zend_string **val
+#define PS_WRITE_ARGS void **mod_data, zend_string *key, zend_string *val
+#define PS_DESTROY_ARGS void **mod_data, zend_string *key
+#define PS_GC_ARGS void **mod_data, int maxlifetime, int *nrdels
+#define PS_CREATE_SID_ARGS void **mod_data
/* default create id function */
PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS);
@@ -189,13 +189,16 @@ extern zend_module_entry session_module_entry;
#define phpext_session_ptr &session_module_entry
#ifdef ZTS
-#define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v)
+#define PS(v) ZEND_TSRMG(ps_globals_id, php_ps_globals *, v)
+#ifdef COMPILE_DL_SESSION
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define PS(v) (ps_globals.v)
#endif
-#define PS_SERIALIZER_ENCODE_ARGS TSRMLS_D
-#define PS_SERIALIZER_DECODE_ARGS const char *val, int vallen TSRMLS_DC
+#define PS_SERIALIZER_ENCODE_ARGS void
+#define PS_SERIALIZER_DECODE_ARGS const char *val, int vallen
typedef struct ps_serializer_struct {
const char *name;
@@ -218,11 +221,11 @@ typedef struct ps_serializer_struct {
#define PS_SERIALIZER_ENTRY(x) \
{ #x, PS_SERIALIZER_ENCODE_NAME(x), PS_SERIALIZER_DECODE_NAME(x) }
-PHPAPI void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC);
+PHPAPI void session_adapt_url(const char *, size_t, char **, size_t *);
-PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC);
-PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI zval *php_get_session_var(zend_string *name TSRMLS_DC);
+PHPAPI void php_add_session_var(zend_string *name);
+PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash);
+PHPAPI zval *php_get_session_var(zend_string *name);
PHPAPI int php_session_register_module(ps_module *);
@@ -230,17 +233,17 @@ PHPAPI int php_session_register_serializer(const char *name,
zend_string *(*encode)(PS_SERIALIZER_ENCODE_ARGS),
int (*decode)(PS_SERIALIZER_DECODE_ARGS));
-PHPAPI void php_session_set_id(char *id TSRMLS_DC);
-PHPAPI void php_session_start(TSRMLS_D);
+PHPAPI void php_session_set_id(char *id);
+PHPAPI void php_session_start(void);
-PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC);
-PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC);
+PHPAPI ps_module *_php_find_ps_module(char *name);
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name);
PHPAPI int php_session_valid_key(const char *key);
-PHPAPI void php_session_reset_id(TSRMLS_D);
+PHPAPI void php_session_reset_id(void);
#define PS_ADD_VARL(name) do { \
- php_add_session_var(name TSRMLS_CC); \
+ php_add_session_var(name); \
} while (0)
#define PS_ADD_VAR(name) PS_ADD_VARL(name)
@@ -261,11 +264,11 @@ PHPAPI void php_session_reset_id(TSRMLS_D);
HashTable *_ht = Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))); \
ZEND_HASH_FOREACH_KEY(_ht, num_key, key) { \
if (key == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Skipping numeric key %pd", num_key); \
continue; \
} \
- if ((struc = php_get_session_var(key TSRMLS_CC))) { \
+ if ((struc = php_get_session_var(key))) { \
code; \
} \
} ZEND_HASH_FOREACH_END(); \
diff --git a/ext/session/session.c b/ext/session/session.c
index 8d112c3a18..31f944df69 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -62,8 +62,8 @@
PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps)
-static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC);
-static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
+static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra);
+static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra);
/* SessionHandler class */
zend_class_entry *php_session_class_entry;
@@ -83,14 +83,14 @@ zend_class_entry *php_session_id_iface_entry;
#define SESSION_CHECK_ACTIVE_STATE \
if (PS(session_status) == php_session_active) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time"); \
+ php_error_docref(NULL, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time"); \
return FAILURE; \
}
-static void php_session_send_cookie(TSRMLS_D);
+static void php_session_send_cookie(void);
/* Dispatched by RINIT and by php_session_destroy */
-static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */
+static inline void php_rinit_session_globals(void) /* {{{ */
{
PS(id) = NULL;
PS(session_status) = php_session_none;
@@ -102,7 +102,7 @@ static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */
/* }}} */
/* Dispatched by RSHUTDOWN and by php_session_destroy */
-static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
+static inline void php_rshutdown_session_globals(void) /* {{{ */
{
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -111,7 +111,7 @@ static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
/* Do NOT destroy PS(mod_user_names) here! */
if (PS(mod_data) || PS(mod_user_implemented)) {
zend_try {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
} zend_end_try();
}
if (PS(id)) {
@@ -120,28 +120,28 @@ static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
}
/* }}} */
-static int php_session_destroy(TSRMLS_D) /* {{{ */
+static int php_session_destroy(void) /* {{{ */
{
int retval = SUCCESS;
if (PS(session_status) != php_session_active) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session");
+ php_error_docref(NULL, E_WARNING, "Trying to destroy uninitialized session");
return FAILURE;
}
- if (PS(id) && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
+ if (PS(id) && PS(mod)->s_destroy(&PS(mod_data), PS(id)) == FAILURE) {
retval = FAILURE;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
+ php_error_docref(NULL, E_WARNING, "Session object destruction failed");
}
- php_rshutdown_session_globals(TSRMLS_C);
- php_rinit_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
+ php_rinit_session_globals();
return retval;
}
/* }}} */
-PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC) /* {{{ */
+PHPAPI void php_add_session_var(zend_string *name) /* {{{ */
{
zval *sym_track = NULL;
@@ -160,7 +160,7 @@ PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC) /* {{{ */
+PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash) /* {{{ */
{
IF_SESSION_VARS() {
return zend_hash_update(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), name, state_val);
@@ -169,7 +169,7 @@ PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unseria
}
/* }}} */
-PHPAPI zval* php_get_session_var(zend_string *name TSRMLS_DC) /* {{{ */
+PHPAPI zval* php_get_session_var(zend_string *name) /* {{{ */
{
IF_SESSION_VARS() {
return zend_hash_find(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), name);
@@ -178,12 +178,12 @@ PHPAPI zval* php_get_session_var(zend_string *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_session_track_init(TSRMLS_D) /* {{{ */
+static void php_session_track_init(void) /* {{{ */
{
zval session_vars;
zend_string *var_name = zend_string_init("_SESSION", sizeof("_SESSION") - 1, 0);
/* Unconditionally destroy existing array -- possible dirty data */
- zend_delete_global_variable(var_name TSRMLS_CC);
+ zend_delete_global_variable(var_name);
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -197,30 +197,30 @@ static void php_session_track_init(TSRMLS_D) /* {{{ */
}
/* }}} */
-static zend_string *php_session_encode(TSRMLS_D) /* {{{ */
+static zend_string *php_session_encode(void) /* {{{ */
{
IF_SESSION_VARS() {
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object");
+ php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object");
return NULL;
}
- return PS(serializer)->encode(TSRMLS_C);
+ return PS(serializer)->encode();
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session");
+ php_error_docref(NULL, E_WARNING, "Cannot encode non-existent session");
}
return NULL;
}
/* }}} */
-static void php_session_decode(const char *val, int vallen TSRMLS_DC) /* {{{ */
+static void php_session_decode(const char *val, int vallen) /* {{{ */
{
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
+ php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
return;
}
- if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
- php_session_destroy(TSRMLS_C);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed");
+ if (PS(serializer)->decode(val, vallen) == FAILURE) {
+ php_session_destroy();
+ php_error_docref(NULL, E_WARNING, "Failed to decode session object. Session has been destroyed");
}
}
/* }}} */
@@ -305,7 +305,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
}
/* maximum 15+19+19+10 bytes */
- spprintf(&buf, 0, "%.15s%ld" ZEND_LONG_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
+ spprintf(&buf, 0, "%.15s%ld" ZEND_LONG_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg() * 10);
switch (PS(hash_func)) {
case PS_HASH_FUNC_MD5:
@@ -321,7 +321,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
case PS_HASH_FUNC_OTHER:
if (!PS(hash_ops)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
+ php_error_docref(NULL, E_ERROR, "Invalid session hash function");
efree(buf);
return NULL;
}
@@ -333,7 +333,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
break;
#endif /* HAVE_HASH_EXT */
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
+ php_error_docref(NULL, E_ERROR, "Invalid session hash function");
efree(buf);
return NULL;
}
@@ -413,7 +413,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
|| PS(hash_bits_per_character) > 6) {
PS(hash_bits_per_character) = 4;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
+ php_error_docref(NULL, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
}
outid = zend_string_alloc((digest_len + 2) * ((8.0f / PS(hash_bits_per_character) + 0.5)), 0);
@@ -458,26 +458,26 @@ PHPAPI int php_session_valid_key(const char *key) /* {{{ */
}
/* }}} */
-static void php_session_initialize(TSRMLS_D) /* {{{ */
+static void php_session_initialize(void) /* {{{ */
{
zend_string *val = NULL;
if (!PS(mod)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "No storage module chosen - failed to initialize session");
+ php_error_docref(NULL, E_ERROR, "No storage module chosen - failed to initialize session");
return;
}
/* Open session handler first */
- if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
/* If there is no ID, use session module to create one */
if (!PS(id)) {
- PS(id) = PS(mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ php_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
if (PS(use_cookies)) {
@@ -487,26 +487,26 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
/* Set session ID for compatibility for older/3rd party save handlers */
if (!PS(use_strict_mode)) {
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
/* Read data */
- php_session_track_init(TSRMLS_C);
- if (PS(mod)->s_read(&PS(mod_data), PS(id), &val TSRMLS_CC) == FAILURE) {
+ php_session_track_init();
+ if (PS(mod)->s_read(&PS(mod_data), PS(id), &val) == FAILURE) {
/* Some broken save handler implementation returns FAILURE for non-existent session ID */
/* It's better to raise error for this, but disabled error for better compatibility */
/*
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ php_error_docref(NULL, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
*/
}
/* Set session ID if session read didn't activated session */
if (PS(use_strict_mode) && PS(session_status) != php_session_active) {
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
if (val) {
- php_session_decode(val->val, val->len TSRMLS_CC);
+ php_session_decode(val->val, val->len);
zend_string_release(val);
}
@@ -519,7 +519,7 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void php_session_save_current_state(TSRMLS_D) /* {{{ */
+static void php_session_save_current_state(void) /* {{{ */
{
int ret = FAILURE;
@@ -527,17 +527,17 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
if (PS(mod_data) || PS(mod_user_implemented)) {
zend_string *val;
- val = php_session_encode(TSRMLS_C);
+ val = php_session_encode();
if (val) {
- ret = PS(mod)->s_write(&PS(mod_data), PS(id), val TSRMLS_CC);
+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), val);
zend_string_release(val);
} else {
- ret = PS(mod)->s_write(&PS(mod_data), PS(id), STR_EMPTY_ALLOC() TSRMLS_CC);
+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), STR_EMPTY_ALLOC());
}
}
if ((ret == FAILURE) && !EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please "
+ php_error_docref(NULL, E_WARNING, "Failed to write session data (%s). Please "
"verify that the current setting of session.save_path "
"is correct (%s)",
PS(mod)->s_name,
@@ -546,7 +546,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
}
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
}
/* }}} */
@@ -560,7 +560,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
ps_module *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_module(new_value->val TSRMLS_CC);
+ tmp = _php_find_ps_module(new_value->val);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -573,7 +573,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find save handler '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "Cannot find save handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -590,7 +590,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_serializer(new_value->val TSRMLS_CC);
+ tmp = _php_find_ps_serializer(new_value->val);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -603,7 +603,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "Cannot find serialization handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -648,12 +648,12 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
p = new_value->val;
}
- if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
+ if (PG(open_basedir) && *p && php_check_open_basedir(p)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -672,12 +672,12 @@ static PHP_INI_MH(OnUpdateName) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "session.name cannot be a numeric or empty '%s'", new_value->val);
}
return FAILURE;
}
- OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -726,7 +726,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
}
#endif /* HAVE_HASH_EXT }}} */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value->val);
+ php_error_docref(NULL, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value->val);
return FAILURE;
}
/* }}} */
@@ -736,12 +736,12 @@ static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
int tmp;
tmp = zend_atoi(new_value->val, new_value->len);
if(tmp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
return FAILURE;
}
if(new_value->len > 0 && new_value->val[new_value->len-1] == '%') {
if(tmp > 100) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq cannot be over 100%%");
+ php_error_docref(NULL, E_WARNING, "session.upload_progress.freq cannot be over 100%%");
return FAILURE;
}
PS(rfc1867_freq) = -tmp;
@@ -814,7 +814,7 @@ PS_SERIALIZER_ENCODE_FUNC(php_serialize) /* {{{ */
php_serialize_data_t var_hash;
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, Z_REFVAL(PS(http_session_vars)), &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, Z_REFVAL(PS(http_session_vars)), &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
return buf.s;
}
@@ -829,7 +829,7 @@ PS_SERIALIZER_DECODE_FUNC(php_serialize) /* {{{ */
ZVAL_NULL(&session_vars);
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- php_var_unserialize(&session_vars, (const unsigned char **)&val, endptr, &var_hash TSRMLS_CC);
+ php_var_unserialize(&session_vars, (const unsigned char **)&val, endptr, &var_hash);
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -861,7 +861,7 @@ PS_SERIALIZER_ENCODE_FUNC(php_binary) /* {{{ */
if (key->len > PS_BIN_MAX) continue;
smart_str_appendc(&buf, (unsigned char)key->len);
smart_str_appendl(&buf, key->val, key->len);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
} else {
if (key->len > PS_BIN_MAX) continue;
smart_str_appendc(&buf, (unsigned char) (key->len & PS_BIN_UNDEF));
@@ -910,8 +910,8 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
if (has_value) {
ZVAL_UNDEF(&current);
- if (php_var_unserialize(&current, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
- zval *zv = php_set_session_var(name, &current, &var_hash TSRMLS_CC);
+ if (php_var_unserialize(&current, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash)) {
+ zval *zv = php_set_session_var(name, &current, &var_hash );
var_replace(&var_hash, &current, zv);
} else {
zval_ptr_dtor(&current);
@@ -947,7 +947,7 @@ PS_SERIALIZER_ENCODE_FUNC(php) /* {{{ */
}
smart_str_appendc(&buf, PS_DELIMITER);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
} else {
smart_str_appendc(&buf, PS_UNDEF_MARKER);
smart_str_appendl(&buf, key->val, key->len);
@@ -1000,8 +1000,8 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */
if (has_value) {
ZVAL_UNDEF(&current);
- if (php_var_unserialize(&current, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
- zval *zv = php_set_session_var(name, &current, &var_hash TSRMLS_CC);
+ if (php_var_unserialize(&current, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash)) {
+ zval *zv = php_set_session_var(name, &current, &var_hash);
var_replace(&var_hash, &current, zv);
} else {
zval_ptr_dtor(&current);
@@ -1083,11 +1083,11 @@ PHPAPI int php_session_register_module(ps_module *ptr) /* {{{ */
typedef struct {
char *name;
- void (*func)(TSRMLS_D);
+ void (*func)(void);
} php_session_cache_limiter_t;
#define CACHE_LIMITER(name) _php_cache_limiter_##name
-#define CACHE_LIMITER_FUNC(name) static void CACHE_LIMITER(name)(TSRMLS_D)
+#define CACHE_LIMITER_FUNC(name) static void CACHE_LIMITER(name)(void)
#define CACHE_LIMITER_ENTRY(name) { #name, CACHE_LIMITER(name) },
#define ADD_HEADER(a) sapi_add_header(a, strlen(a), 1);
#define MAX_STR 512
@@ -1124,7 +1124,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */
}
/* }}} */
-static inline void last_modified(TSRMLS_D) /* {{{ */
+static inline void last_modified(void) /* {{{ */
{
const char *path;
zend_stat_t sb;
@@ -1160,7 +1160,7 @@ CACHE_LIMITER_FUNC(public) /* {{{ */
snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_LONG_FMT, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
- last_modified(TSRMLS_C);
+ last_modified();
}
/* }}} */
@@ -1171,14 +1171,14 @@ CACHE_LIMITER_FUNC(private_no_expire) /* {{{ */
snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=" ZEND_LONG_FMT ", pre-check=" ZEND_LONG_FMT, PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
- last_modified(TSRMLS_C);
+ last_modified();
}
/* }}} */
CACHE_LIMITER_FUNC(private) /* {{{ */
{
ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
- CACHE_LIMITER(private_no_expire)(TSRMLS_C);
+ CACHE_LIMITER(private_no_expire)();
}
/* }}} */
@@ -1202,27 +1202,27 @@ static php_session_cache_limiter_t php_session_cache_limiters[] = {
{0}
};
-static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
+static int php_session_cache_limiter(void) /* {{{ */
{
php_session_cache_limiter_t *lim;
if (PS(cache_limiter)[0] == '\0') return 0;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
- int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
if (output_start_filename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno);
+ php_error_docref(NULL, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot send session cache limiter - headers already sent");
}
return -2;
}
for (lim = php_session_cache_limiters; lim->name; lim++) {
if (!strcasecmp(lim->name, PS(cache_limiter))) {
- lim->func(TSRMLS_C);
+ lim->func();
return 0;
}
}
@@ -1240,7 +1240,7 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
* It must be directly removed from SG(sapi_header) because sapi_add_header_ex()
* removes all of matching cookie. i.e. It deletes all of Set-Cookie headers.
*/
-static void php_session_remove_cookie(TSRMLS_D) {
+static void php_session_remove_cookie(void) {
sapi_header_struct *header;
zend_llist *l = &SG(sapi_headers).headers;
zend_llist_element *next;
@@ -1280,20 +1280,20 @@ static void php_session_remove_cookie(TSRMLS_D) {
efree(session_cookie);
}
-static void php_session_send_cookie(TSRMLS_D) /* {{{ */
+static void php_session_send_cookie(void) /* {{{ */
{
smart_str ncookie = {0};
zend_string *date_fmt = NULL;
zend_string *e_session_name, *e_id;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
- int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
if (output_start_filename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", output_start_filename, output_start_lineno);
+ php_error_docref(NULL, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", output_start_filename, output_start_lineno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot send session cookie - headers already sent");
}
return;
}
@@ -1318,7 +1318,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
t = tv.tv_sec + PS(cookie_lifetime);
if (t > 0) {
- date_fmt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0 TSRMLS_CC);
+ date_fmt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0);
smart_str_appends(&ncookie, COOKIE_EXPIRES);
smart_str_appendl(&ncookie, date_fmt->val, date_fmt->len);
zend_string_release(date_fmt);
@@ -1348,15 +1348,15 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
smart_str_0(&ncookie);
- php_session_remove_cookie(TSRMLS_C); /* remove already sent session ID cookie */
+ php_session_remove_cookie(); /* remove already sent session ID cookie */
/* 'replace' must be 0 here, else a previous Set-Cookie
header, probably sent with setcookie() will be replaced! */
- sapi_add_header_ex(estrndup(ncookie.s->val, ncookie.s->len), ncookie.s->len, 0, 0 TSRMLS_CC);
+ sapi_add_header_ex(estrndup(ncookie.s->val, ncookie.s->len), ncookie.s->len, 0, 0);
smart_str_free(&ncookie);
}
/* }}} */
-PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
+PHPAPI ps_module *_php_find_ps_module(char *name) /* {{{ */
{
ps_module *ret = NULL;
ps_module **mod;
@@ -1372,7 +1372,7 @@ PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{ */
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name) /* {{{ */
{
const ps_serializer *ret = NULL;
const ps_serializer *mod;
@@ -1387,7 +1387,7 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{
}
/* }}} */
-static void ppid2sid(zval *ppid TSRMLS_DC) {
+static void ppid2sid(zval *ppid) {
if (Z_TYPE_P(ppid) != IS_STRING) {
PS(id) = NULL;
PS(send_cookie) = 1;
@@ -1398,17 +1398,17 @@ static void ppid2sid(zval *ppid TSRMLS_DC) {
}
}
-PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
+PHPAPI void php_session_reset_id(void) /* {{{ */
{
int module_number = PS(module_number);
if (!PS(id)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set session ID - session ID is not initialized");
+ php_error_docref(NULL, E_WARNING, "Cannot set session ID - session ID is not initialized");
return;
}
if (PS(use_cookies) && PS(send_cookie)) {
- php_session_send_cookie(TSRMLS_C);
+ php_session_send_cookie();
PS(send_cookie) = 0;
}
@@ -1429,13 +1429,13 @@ PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
}
if (PS(apply_trans_sid)) {
- php_url_scanner_reset_vars(TSRMLS_C);
- php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id)->val, PS(id)->len, 1 TSRMLS_CC);
+ php_url_scanner_reset_vars();
+ php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id)->val, PS(id)->len, 1);
}
}
/* }}} */
-PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
+PHPAPI void php_session_start(void) /* {{{ */
{
zval *ppid;
zval *data;
@@ -1458,17 +1458,17 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
case php_session_disabled:
value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0);
if (!PS(mod) && value) {
- PS(mod) = _php_find_ps_module(value TSRMLS_CC);
+ PS(mod) = _php_find_ps_module(value);
if (!PS(mod)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler '%s' - session startup failed", value);
+ php_error_docref(NULL, E_WARNING, "Cannot find save handler '%s' - session startup failed", value);
return;
}
}
value = zend_ini_string("session.serialize_handler", sizeof("session.serialize_handler") - 1, 0);
if (!PS(serializer) && value) {
- PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
+ PS(serializer) = _php_find_ps_serializer(value);
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find serialization handler '%s' - session startup failed", value);
+ php_error_docref(NULL, E_WARNING, "Cannot find serialization handler '%s' - session startup failed", value);
return;
}
}
@@ -1491,7 +1491,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
PS(apply_trans_sid) = 0;
PS(define_sid) = 0;
}
@@ -1501,7 +1501,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
}
if (!PS(use_only_cookies) && !PS(id) &&
@@ -1509,7 +1509,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
}
}
@@ -1558,18 +1558,18 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
PS(id) = NULL;
}
- php_session_initialize(TSRMLS_C);
- php_session_cache_limiter(TSRMLS_C);
+ php_session_initialize();
+ php_session_cache_limiter();
if ((PS(mod_data) || PS(mod_user_implemented)) && PS(gc_probability) > 0) {
int nrdels = -1;
- nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C));
+ nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg());
if (nrand < PS(gc_probability)) {
- PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC);
+ PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels);
#ifdef SESSION_DEBUG
if (nrdels != -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects", nrdels);
+ php_error_docref(NULL, E_NOTICE, "purged %d expired session objects", nrdels);
}
#endif
}
@@ -1577,39 +1577,39 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void php_session_flush(TSRMLS_D) /* {{{ */
+static void php_session_flush(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
- php_session_save_current_state(TSRMLS_C);
+ php_session_save_current_state();
}
}
/* }}} */
-static void php_session_abort(TSRMLS_D) /* {{{ */
+static void php_session_abort(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
}
}
/* }}} */
-static void php_session_reset(TSRMLS_D) /* {{{ */
+static void php_session_reset(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
}
}
/* }}} */
-PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) /* {{{ */
+PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen) /* {{{ */
{
if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) {
- *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id)->val, newlen TSRMLS_CC);
+ *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id)->val, newlen);
}
}
/* }}} */
@@ -1629,7 +1629,7 @@ static PHP_FUNCTION(session_set_cookie_params)
zend_string *ini_name;
if (!PS(use_cookies) ||
- zend_parse_parameters(argc TSRMLS_CC, "z|SSbb", &lifetime, &path, &domain, &secure, &httponly) == FAILURE) {
+ zend_parse_parameters(argc, "z|SSbb", &lifetime, &path, &domain, &secure, &httponly) == FAILURE) {
return;
}
@@ -1688,7 +1688,7 @@ static PHP_FUNCTION(session_name)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1709,7 +1709,7 @@ static PHP_FUNCTION(session_module_name)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1721,14 +1721,14 @@ static PHP_FUNCTION(session_module_name)
}
if (name) {
- if (!_php_find_ps_module(name->val TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module (%s)", name->val);
+ if (!_php_find_ps_module(name->val)) {
+ php_error_docref(NULL, E_WARNING, "Cannot find named PHP session module (%s)", name->val);
zval_dtor(return_value);
RETURN_FALSE;
}
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
PS(mod_data) = NULL;
@@ -1758,7 +1758,7 @@ static PHP_FUNCTION(session_set_save_handler)
zend_function *current_mptr;
zend_bool register_shutdown = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &obj, php_session_iface_entry, &register_shutdown) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, php_session_iface_entry, &register_shutdown) == FAILURE) {
RETURN_FALSE;
}
@@ -1775,7 +1775,7 @@ static PHP_FUNCTION(session_set_save_handler)
add_next_index_zval(&PS(mod_user_names).names[i], obj);
add_next_index_str(&PS(mod_user_names).names[i], zend_string_copy(func_name));
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Session handler's function table is corrupt");
+ php_error_docref(NULL, E_ERROR, "Session handler's function table is corrupt");
RETURN_FALSE;
}
@@ -1807,15 +1807,15 @@ static PHP_FUNCTION(session_set_save_handler)
ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_register_shutdown");
/* add shutdown function, removing the old one if it exists */
- if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry TSRMLS_CC)) {
+ if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry)) {
zval_ptr_dtor(&shutdown_function_entry.arguments[0]);
efree(shutdown_function_entry.arguments);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to register session shutdown function");
+ php_error_docref(NULL, E_WARNING, "Unable to register session shutdown function");
RETURN_FALSE;
}
} else {
/* remove shutdown function */
- remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1 TSRMLS_CC);
+ remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1);
}
if (PS(mod) && PS(session_status) == php_session_none && PS(mod) != &ps_mod_user) {
@@ -1833,17 +1833,17 @@ static PHP_FUNCTION(session_set_save_handler)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(argc TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(argc, "+", &args, &num_args) == FAILURE) {
return;
}
/* remove shutdown function */
- remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1 TSRMLS_CC);
+ remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1);
/* at this point argc can only be 6 or 7 */
for (i = 0; i < argc; i++) {
- if (!zend_is_callable(&args[i], 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1);
+ if (!zend_is_callable(&args[i], 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "Argument %d is not a valid callback", i+1);
zend_string_release(name);
RETURN_FALSE;
}
@@ -1876,7 +1876,7 @@ static PHP_FUNCTION(session_save_path)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1884,7 +1884,7 @@ static PHP_FUNCTION(session_save_path)
if (name) {
if (memchr(name->val, '\0', name->len) != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The save_path cannot contain NULL characters");
+ php_error_docref(NULL, E_WARNING, "The save_path cannot contain NULL characters");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1902,7 +1902,7 @@ static PHP_FUNCTION(session_id)
zend_string *name = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(argc, "|S", &name) == FAILURE) {
return;
}
@@ -1934,28 +1934,28 @@ static PHP_FUNCTION(session_regenerate_id)
{
zend_bool del_ses = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &del_ses) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &del_ses) == FAILURE) {
return;
}
if (SG(headers_sent) && PS(use_cookies)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot regenerate session id - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - headers already sent");
RETURN_FALSE;
}
if (PS(session_status) == php_session_active) {
if (PS(id)) {
- if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
+ if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Session object destruction failed");
RETURN_FALSE;
}
zend_string_release(PS(id));
}
- PS(id) = PS(mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (PS(id)) {
PS(send_cookie) = 1;
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
RETURN_TRUE;
} else {
PS(id) = STR_EMPTY_ALLOC();
@@ -1972,7 +1972,7 @@ static PHP_FUNCTION(session_cache_limiter)
zend_string *limiter = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &limiter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &limiter) == FAILURE) {
return;
}
@@ -1993,7 +1993,7 @@ static PHP_FUNCTION(session_cache_expire)
zval *expires = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &expires) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &expires) == FAILURE) {
return;
}
@@ -2018,7 +2018,7 @@ static PHP_FUNCTION(session_encode)
return;
}
- enc = php_session_encode(TSRMLS_C);
+ enc = php_session_encode();
if (enc == NULL) {
RETURN_FALSE;
}
@@ -2038,11 +2038,11 @@ static PHP_FUNCTION(session_decode)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
- php_session_decode(str, str_len TSRMLS_CC);
+ php_session_decode(str, str_len);
RETURN_TRUE;
}
@@ -2053,7 +2053,7 @@ static PHP_FUNCTION(session_decode)
static PHP_FUNCTION(session_start)
{
/* skipping check for non-zero args for performance reasons here ?*/
- php_session_start(TSRMLS_C);
+ php_session_start();
if (PS(session_status) != php_session_active) {
RETURN_FALSE;
@@ -2070,7 +2070,7 @@ static PHP_FUNCTION(session_destroy)
return;
}
- RETURN_BOOL(php_session_destroy(TSRMLS_C) == SUCCESS);
+ RETURN_BOOL(php_session_destroy() == SUCCESS);
}
/* }}} */
@@ -2095,7 +2095,7 @@ static PHP_FUNCTION(session_unset)
Write session data and end session */
static PHP_FUNCTION(session_write_close)
{
- php_session_flush(TSRMLS_C);
+ php_session_flush();
}
/* }}} */
@@ -2103,7 +2103,7 @@ static PHP_FUNCTION(session_write_close)
Abort session and end session. Session data will not be written */
static PHP_FUNCTION(session_abort)
{
- php_session_abort(TSRMLS_C);
+ php_session_abort();
}
/* }}} */
@@ -2111,7 +2111,7 @@ static PHP_FUNCTION(session_abort)
Reset session data from saved session data */
static PHP_FUNCTION(session_reset)
{
- php_session_reset(TSRMLS_C);
+ php_session_reset();
}
/* }}} */
@@ -2145,7 +2145,7 @@ static PHP_FUNCTION(session_register_shutdown)
ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_write_close");
- if (!append_user_shutdown_function(shutdown_function_entry TSRMLS_CC)) {
+ if (!append_user_shutdown_function(shutdown_function_entry)) {
zval_ptr_dtor(&shutdown_function_entry.arguments[0]);
efree(shutdown_function_entry.arguments);
@@ -2155,8 +2155,8 @@ static PHP_FUNCTION(session_register_shutdown)
* If the user does have a later shutdown function which needs the
* session then tough luck.
*/
- php_session_flush(TSRMLS_C);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to register session flush function");
+ php_session_flush();
+ php_error_docref(NULL, E_WARNING, "Unable to register session flush function");
}
}
/* }}} */
@@ -2311,16 +2311,16 @@ static const zend_function_entry php_session_class_functions[] = {
* Module Setup and Destruction *
******************************** */
-static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
+static int php_rinit_session(zend_bool auto_start) /* {{{ */
{
- php_rinit_session_globals(TSRMLS_C);
+ php_rinit_session_globals();
if (PS(mod) == NULL) {
char *value;
value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0);
if (value) {
- PS(mod) = _php_find_ps_module(value TSRMLS_CC);
+ PS(mod) = _php_find_ps_module(value);
}
}
@@ -2329,7 +2329,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
value = zend_ini_string("session.serialize_handler", sizeof("session.serialize_handler") - 1, 0);
if (value) {
- PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
+ PS(serializer) = _php_find_ps_serializer(value);
}
}
@@ -2340,7 +2340,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
}
if (auto_start) {
- php_session_start(TSRMLS_C);
+ php_session_start();
}
return SUCCESS;
@@ -2348,7 +2348,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
static PHP_RINIT_FUNCTION(session) /* {{{ */
{
- return php_rinit_session(PS(auto_start) TSRMLS_CC);
+ return php_rinit_session(PS(auto_start));
}
/* }}} */
@@ -2357,9 +2357,9 @@ static PHP_RSHUTDOWN_FUNCTION(session) /* {{{ */
int i;
zend_try {
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} zend_end_try();
- php_rshutdown_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
/* this should NOT be done in php_rshutdown_session_globals() */
for (i = 0; i < 7; i++) {
@@ -2377,6 +2377,10 @@ static PHP_GINIT_FUNCTION(ps) /* {{{ */
{
int i;
+#if defined(COMPILE_DL_SESSION) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
ps_globals->save_path = NULL;
ps_globals->session_name = NULL;
ps_globals->id = NULL;
@@ -2398,7 +2402,7 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
{
zend_class_entry ce;
- zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL TSRMLS_CC);
+ zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL);
PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */
@@ -2413,18 +2417,18 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
/* Register interfaces */
INIT_CLASS_ENTRY(ce, PS_IFACE_NAME, php_session_iface_functions);
- php_session_iface_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_session_iface_entry = zend_register_internal_class(&ce);
php_session_iface_entry->ce_flags |= ZEND_ACC_INTERFACE;
INIT_CLASS_ENTRY(ce, PS_SID_IFACE_NAME, php_session_id_iface_functions);
- php_session_id_iface_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_session_id_iface_entry = zend_register_internal_class(&ce);
php_session_id_iface_entry->ce_flags |= ZEND_ACC_INTERFACE;
/* Register base class */
INIT_CLASS_ENTRY(ce, PS_CLASS_NAME, php_session_class_functions);
- php_session_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
- zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_iface_entry);
- zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_id_iface_entry);
+ php_session_class_entry = zend_register_internal_class(&ce);
+ zend_class_implements(php_session_class_entry, 1, php_session_iface_entry);
+ zend_class_implements(php_session_class_entry, 1, php_session_id_iface_entry);
REGISTER_LONG_CONSTANT("PHP_SESSION_DISABLED", php_session_disabled, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_SESSION_NONE", php_session_none, CONST_CS | CONST_PERSISTENT);
@@ -2515,7 +2519,7 @@ static const zend_module_dep session_deps[] = { /* {{{ */
* Upload hook handling *
************************ */
-static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress) /* {{{ */
{
zval *ppid;
@@ -2533,12 +2537,12 @@ static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_pr
return 0;
} /* }}} */
-static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress) /* {{{ */
{
if (PS(use_cookies)) {
- sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);
- if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress TSRMLS_CC)) {
+ sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
+ if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress)) {
progress->apply_trans_sid = 0;
return;
}
@@ -2546,11 +2550,11 @@ static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *pro
if (PS(use_only_cookies)) {
return;
}
- sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);
- early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress TSRMLS_CC);
+ sapi_module.treat_data(PARSE_GET, NULL, NULL);
+ early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress);
} /* }}} */
-static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress) /* {{{ */
{
zval *progress_ary, *cancel_upload;
@@ -2566,7 +2570,7 @@ static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress
return Z_TYPE_P(cancel_upload) == IS_TRUE;
} /* }}} */
-static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update) /* {{{ */
{
if (!force_update) {
if (Z_LVAL_P(progress->post_bytes_processed) < progress->next_update) {
@@ -2587,33 +2591,33 @@ static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, i
progress->next_update = Z_LVAL_P(progress->post_bytes_processed) + progress->update_step;
}
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
PS(session_status) = php_session_active;
IF_SESSION_VARS() {
- progress->cancel_upload |= php_check_cancel_upload(progress TSRMLS_CC);
+ progress->cancel_upload |= php_check_cancel_upload(progress);
if (Z_REFCOUNTED(progress->data)) Z_ADDREF(progress->data);
zend_hash_update(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.s, &progress->data);
}
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} /* }}} */
-static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress) /* {{{ */
{
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
PS(session_status) = php_session_active;
IF_SESSION_VARS() {
zend_hash_del(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.s);
}
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} /* }}} */
-static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC) /* {{{ */
+static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra) /* {{{ */
{
php_session_rfc1867_progress *progress;
int retval = SUCCESS;
if (php_session_rfc1867_orig_callback) {
- retval = php_session_rfc1867_orig_callback(event, event_data, extra TSRMLS_CC);
+ retval = php_session_rfc1867_orig_callback(event, event_data, extra);
}
if (!PS(rfc1867_enabled)) {
return retval;
@@ -2658,7 +2662,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
smart_str_0(&progress->key);
progress->apply_trans_sid = PS(use_trans_sid);
- php_session_rfc1867_early_find_sid(progress TSRMLS_CC);
+ php_session_rfc1867_early_find_sid(progress);
}
}
}
@@ -2686,7 +2690,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
array_init(&progress->data);
array_init(&progress->files);
- add_assoc_long_ex(&progress->data, "start_time", sizeof("start_time") - 1, (zend_long)sapi_get_request_time(TSRMLS_C));
+ add_assoc_long_ex(&progress->data, "start_time", sizeof("start_time") - 1, (zend_long)sapi_get_request_time());
add_assoc_long_ex(&progress->data, "content_length", sizeof("content_length") - 1, progress->content_length);
add_assoc_long_ex(&progress->data, "bytes_processed", sizeof("bytes_processed") - 1, data->post_bytes_processed);
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 0);
@@ -2694,7 +2698,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
progress->post_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->data), "bytes_processed", sizeof("bytes_processed") - 1);
- php_rinit_session(0 TSRMLS_CC);
+ php_rinit_session(0);
PS(id) = zend_string_init(Z_STRVAL(progress->sid), Z_STRLEN(progress->sid), 0);
PS(apply_trans_sid) = progress->apply_trans_sid;
PS(send_cookie) = 0;
@@ -2717,7 +2721,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
progress->current_file_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->current_file), "bytes_processed", sizeof("bytes_processed") - 1);
Z_LVAL_P(progress->current_file_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_FILE_DATA: {
@@ -2730,7 +2734,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
Z_LVAL_P(progress->current_file_bytes_processed) = data->offset + data->length;
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_FILE_END: {
@@ -2749,7 +2753,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_END: {
@@ -2757,13 +2761,13 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
if (Z_TYPE(progress->sid) && progress->key.s) {
if (PS(rfc1867_cleanup)) {
- php_session_rfc1867_cleanup(progress TSRMLS_CC);
+ php_session_rfc1867_cleanup(progress);
} else {
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 1);
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 1 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 1);
}
- php_rshutdown_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
}
if (!Z_ISUNDEF(progress->data)) {
@@ -2803,6 +2807,9 @@ zend_module_entry session_module_entry = {
};
#ifdef COMPILE_DL_SESSION
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(session)
#endif
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index 4bf9d7dedf..276fbed533 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -113,7 +113,7 @@ ZEND_GET_MODULE(shmop)
/* {{{ rsclean
*/
-static void rsclean(zend_resource *rsrc TSRMLS_DC)
+static void rsclean(zend_resource *rsrc)
{
struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr;
@@ -152,12 +152,12 @@ PHP_FUNCTION(shmop_open)
char *flags;
size_t flags_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) {
return;
}
if (flags_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid flag", flags);
+ php_error_docref(NULL, E_WARNING, "%s is not a valid flag", flags);
RETURN_FALSE;
}
@@ -187,29 +187,29 @@ PHP_FUNCTION(shmop_open)
*/
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid access mode");
+ php_error_docref(NULL, E_WARNING, "invalid access mode");
goto err;
}
if (shmop->shmflg & IPC_CREAT && shmop->size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shared memory segment size must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Shared memory segment size must be greater than zero");
goto err;
}
shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg);
if (shmop->shmid == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach or create shared memory segment '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to attach or create shared memory segment '%s'", strerror(errno));
goto err;
}
if (shmctl(shmop->shmid, IPC_STAT, &shm)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get shared memory segment information '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to get shared memory segment information '%s'", strerror(errno));
goto err;
}
shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg);
if (shmop->addr == (char*) -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach to shared memory segment '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to attach to shared memory segment '%s'", strerror(errno));
goto err;
}
@@ -233,19 +233,19 @@ PHP_FUNCTION(shmop_read)
int bytes;
zend_string *return_string;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &shmid, &start, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &shmid, &start, &count) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if (start < 0 || start > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "start is out of range");
+ php_error_docref(NULL, E_WARNING, "start is out of range");
RETURN_FALSE;
}
if (count < 0 || start > (INT_MAX - count) || start + count > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "count is out of range");
+ php_error_docref(NULL, E_WARNING, "count is out of range");
RETURN_FALSE;
}
@@ -265,7 +265,7 @@ PHP_FUNCTION(shmop_close)
zend_long shmid;
zval *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
@@ -283,7 +283,7 @@ PHP_FUNCTION(shmop_size)
zend_long shmid;
struct php_shmop *shmop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
@@ -302,19 +302,19 @@ PHP_FUNCTION(shmop_write)
zend_long shmid, offset;
zend_string *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lSl", &shmid, &data, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lSl", &shmid, &data, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "trying to write to a read only segment");
+ php_error_docref(NULL, E_WARNING, "trying to write to a read only segment");
RETURN_FALSE;
}
if (offset < 0 || offset > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "offset out of range");
+ php_error_docref(NULL, E_WARNING, "offset out of range");
RETURN_FALSE;
}
@@ -332,14 +332,14 @@ PHP_FUNCTION(shmop_delete)
zend_long shmid;
struct php_shmop *shmop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if (shmctl(shmop->shmid, IPC_RMID, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't mark segment for deletion (are you the owner?)");
+ php_error_docref(NULL, E_WARNING, "can't mark segment for deletion (are you the owner?)");
RETURN_FALSE;
}
diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h
index 82e5aff9e4..f531ba2fa5 100644
--- a/ext/simplexml/php_simplexml_exports.h
+++ b/ext/simplexml/php_simplexml_exports.h
@@ -35,11 +35,11 @@
__n = (__s)->node->node; \
} else { \
__n = NULL; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \
+ php_error_docref(NULL, E_WARNING, "Node no longer exists"); \
} \
}
-PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce TSRMLS_DC);
+PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce);
static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ {
return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo));
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 361b0824eb..692b5d368a 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -51,24 +51,24 @@ PHP_SXE_API zend_class_entry *sxe_get_element_class_entry() /* {{{ */
#define SXE_METHOD(func) PHP_METHOD(simplexml_element, func)
-static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC);
-static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRMLS_DC);
-static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data TSRMLS_DC);
-static zval *sxe_get_value(zval *z, zval *rv TSRMLS_DC);
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
-static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC);
-static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC);
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
+static php_sxe_object* php_sxe_object_new(zend_class_entry *ce);
+static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data);
+static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data);
+static zval *sxe_get_value(zval *z, zval *rv);
+static void php_sxe_iterator_dtor(zend_object_iterator *iter);
+static int php_sxe_iterator_valid(zend_object_iterator *iter);
+static zval *php_sxe_iterator_current_data(zend_object_iterator *iter);
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key);
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter);
+static void php_sxe_iterator_rewind(zend_object_iterator *iter);
/* {{{ _node_as_zval()
*/
-static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, const xmlChar *nsprefix, int isprefix TSRMLS_DC)
+static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, const xmlChar *nsprefix, int isprefix)
{
php_sxe_object *subnode;
- subnode = php_sxe_object_new(sxe->zo.ce TSRMLS_CC);
+ subnode = php_sxe_object_new(sxe->zo.ce);
subnode->document = sxe->document;
subnode->document->refcount++;
subnode->iter.type = itertype;
@@ -80,7 +80,7 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
subnode->iter.isprefix = isprefix;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL);
ZVAL_OBJ(value, &subnode->zo);
}
@@ -102,17 +102,17 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
__n = (__s)->node->node; \
} else { \
__n = NULL; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \
+ php_error_docref(NULL, E_WARNING, "Node no longer exists"); \
} \
}
-static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) /* {{{ */
{
php_sxe_object *intern;
xmlNodePtr retnode = NULL;
if (sxe && sxe->iter.type != SXE_ITER_NONE) {
- php_sxe_reset_iterator(sxe, 1 TSRMLS_CC);
+ php_sxe_reset_iterator(sxe, 1);
if (!Z_ISUNDEF(sxe->iter.data)) {
intern = Z_SXEOBJ_P(&sxe->iter.data);
GET_NODE(intern, retnode)
@@ -175,7 +175,7 @@ next_iter:
}
/* }}} */
-static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name TSRMLS_DC) /* {{{ */
+static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) /* {{{ */
{
while (node) {
SKIP_TEXT(node)
@@ -190,7 +190,7 @@ next_iter:
return NULL;
} /* }}} */
-static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char **name, SXE_ITER *type TSRMLS_DC) /* {{{ */
+static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char **name, SXE_ITER *type) /* {{{ */
{
int orgtype;
xmlNodePtr orgnode = node;
@@ -202,12 +202,12 @@ static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node,
if (sxe->iter.type == SXE_ITER_NONE) {
sxe->iter.type = SXE_ITER_CHILD;
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
sxe->iter.type = orgtype;
}
if (sxe->iter.type == SXE_ITER_ELEMENT) {
- orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name TSRMLS_CC);
+ orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name);
if (!orgnode) {
return NULL;
}
@@ -243,7 +243,7 @@ next_iter:
/* {{{ sxe_prop_dim_read()
*/
-static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, zend_bool attribs, int type, zval *rv TSRMLS_DC)
+static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, zend_bool attribs, int type, zval *rv)
{
php_sxe_object *sxe;
char *name;
@@ -261,7 +261,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
elements = 1;
} else if (!member) {
/* This happens when the user did: $sxe[]->foo = $value */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return NULL;
}
name = NULL;
@@ -278,17 +278,17 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
if (!member && node && node->parent &&
node->parent->type == XML_DOCUMENT_NODE) {
/* This happens when the user did: $sxe[]->foo = $value */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return NULL;
}
}
@@ -302,7 +302,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
while (attr && nodendx <= Z_LVAL_P(member)) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
- _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
break;
}
nodendx++;
@@ -312,7 +312,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
} else {
while (attr) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
- _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
break;
}
attr = attr->next;
@@ -323,18 +323,18 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
if (elements) {
if (!sxe->node) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL);
}
if (!member || Z_TYPE_P(member) == IS_LONG) {
zend_long cnt = 0;
xmlNodePtr mynode = node;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
if (sxe->iter.type == SXE_ITER_NONE) {
if (member && Z_LVAL_P(member) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
}
} else if (member) {
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt);
@@ -342,25 +342,25 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
node = NULL;
}
if (node) {
- _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
} else if (type == BP_VAR_W || type == BP_VAR_RW) {
if (member && cnt < Z_LVAL_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
}
node = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, NULL);
- _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
}
} else {
#if SXE_ELEMENT_BY_NAME
int newtype;
GET_NODE(sxe, node);
- node = sxe_get_element_by_name(sxe, node, &name, &newtype TSRMLS_CC);
+ node = sxe_get_element_by_name(sxe, node, &name, &newtype);
if (node) {
- _node_as_zval(sxe, node, rv, newtype, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, newtype, name, sxe->iter.nsprefix, sxe->iter.isprefix);
}
#else
- _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix);
#endif
}
}
@@ -380,23 +380,23 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
/* {{{ sxe_property_read()
*/
-static zval *sxe_property_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *sxe_property_read(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
- return sxe_prop_dim_read(object, member, 1, 0, type, rv TSRMLS_CC);
+ return sxe_prop_dim_read(object, member, 1, 0, type, rv);
}
/* }}} */
/* {{{ sxe_dimension_read()
*/
-static zval *sxe_dimension_read(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *sxe_dimension_read(zval *object, zval *offset, int type, zval *rv)
{
- return sxe_prop_dim_read(object, offset, 0, 1, type, rv TSRMLS_CC);
+ return sxe_prop_dim_read(object, offset, 0, 1, type, rv);
}
/* }}} */
/* {{{ change_node_zval()
*/
-static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
+static void change_node_zval(xmlNodePtr node, zval *value)
{
zval value_copy;
xmlChar *buffer;
@@ -433,7 +433,7 @@ static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not possible to assign complex types to nodes");
+ php_error_docref(NULL, E_WARNING, "It is not possible to assign complex types to nodes");
break;
}
}
@@ -441,7 +441,7 @@ static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
/* {{{ sxe_property_write()
*/
-static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode TSRMLS_DC)
+static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -469,19 +469,19 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return FAILURE;
}
} else {
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_STR(&trim_zv, zval_get_string(member));
- php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, &tmp_zv, 3 TSRMLS_CC);
+ php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, &tmp_zv, 3);
zval_dtor(&trim_zv);
member = &tmp_zv;
}
if (!Z_STRLEN_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element");
+ php_error_docref(NULL, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element");
if (member == &tmp_zv) {
zval_dtor(&tmp_zv);
}
@@ -494,12 +494,12 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
mynode = node;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
if (!member && node && node->parent &&
@@ -508,7 +508,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return FAILURE;
}
if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) {
@@ -538,7 +538,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
case IS_OBJECT:
if (Z_OBJCE_P(value) == sxe_class_entry) {
//???
- value = sxe_get_value(value, &zval_copy TSRMLS_CC);
+ value = sxe_get_value(value, &zval_copy);
//INIT_PZVAL(value);
new_value = 1;
break;
@@ -583,7 +583,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
if (elements) {
if (!member || Z_TYPE_P(member) == IS_LONG) {
if (node->type == XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create duplicate attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create duplicate attribute");
return FAILURE;
}
@@ -591,7 +591,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
newnode = node;
++counter;
if (member && Z_LVAL_P(member) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
retval = FAILURE;
}
} else if (member) {
@@ -623,12 +623,12 @@ next_iter:
if (value) {
while ((tempnode = (xmlNodePtr) newnode->children)) {
xmlUnlinkNode(tempnode);
- php_libxml_node_free_resource((xmlNodePtr) tempnode TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) tempnode);
}
- change_node_zval(newnode, value TSRMLS_CC);
+ change_node_zval(newnode, value);
}
} else if (counter > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
+ php_error_docref(NULL, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
retval = FAILURE;
} else if (elements) {
if (!node) {
@@ -639,14 +639,14 @@ next_iter:
}
} else if (!member || Z_TYPE_P(member) == IS_LONG) {
if (member && cnt < Z_LVAL_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
retval = FAILURE;
}
newnode = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
}
} else if (attribs) {
if (Z_TYPE_P(member) == IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot change attribute number %pd when only %d attributes exist", Z_LVAL_P(member), nodendx);
+ php_error_docref(NULL, E_WARNING, "Cannot change attribute number %pd when only %d attributes exist", Z_LVAL_P(member), nodendx);
retval = FAILURE;
} else {
newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)Z_STRVAL_P(member), value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
@@ -669,21 +669,21 @@ next_iter:
/* {{{ sxe_property_write()
*/
-static void sxe_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void sxe_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- sxe_prop_dim_write(object, member, value, 1, 0, NULL TSRMLS_CC);
+ sxe_prop_dim_write(object, member, value, 1, 0, NULL);
}
/* }}} */
/* {{{ sxe_dimension_write()
*/
-static void sxe_dimension_write(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void sxe_dimension_write(zval *object, zval *offset, zval *value)
{
- sxe_prop_dim_write(object, offset, value, 0, 1, NULL TSRMLS_CC);
+ sxe_prop_dim_write(object, offset, value, 0, 1, NULL);
}
/* }}} */
-static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, void **cache_slot) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -696,17 +696,17 @@ static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, vo
GET_NODE(sxe, node);
convert_to_string(member);
name = Z_STRVAL_P(member);
- node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC);
+ node = sxe_get_element_by_name(sxe, node, &name, &type);
if (node) {
return NULL;
}
- if (sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC) != SUCCESS) {
+ if (sxe_prop_dim_write(object, member, NULL, 1, 0, &node) != SUCCESS) {
return NULL;
}
type = SXE_ITER_NONE;
name = NULL;
- _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix);
sxe = Z_SXEOBJ_P(&ret);
if (!Z_ISUNDEF(sxe->tmp)) {
@@ -722,7 +722,7 @@ static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, vo
/* {{{ sxe_prop_dim_exists()
*/
-static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs TSRMLS_DC)
+static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -745,7 +745,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
attribs = 0;
elements = 1;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
}
}
@@ -753,11 +753,11 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
}
@@ -797,7 +797,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
if (elements) {
if (Z_TYPE_P(member) == IS_LONG) {
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL);
}
@@ -833,23 +833,23 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
/* {{{ sxe_property_exists()
*/
-static int sxe_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int sxe_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
- return sxe_prop_dim_exists(object, member, check_empty, 1, 0 TSRMLS_CC);
+ return sxe_prop_dim_exists(object, member, check_empty, 1, 0);
}
/* }}} */
/* {{{ sxe_property_exists()
*/
-static int sxe_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int sxe_dimension_exists(zval *object, zval *member, int check_empty)
{
- return sxe_prop_dim_exists(object, member, check_empty, 0, 1 TSRMLS_CC);
+ return sxe_prop_dim_exists(object, member, check_empty, 0, 1);
}
/* }}} */
/* {{{ sxe_prop_dim_delete()
*/
-static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, zend_bool attribs TSRMLS_DC)
+static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, zend_bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -873,7 +873,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
attribs = 0;
elements = 1;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
}
}
@@ -881,11 +881,11 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
}
@@ -899,7 +899,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
xmlUnlinkNode((xmlNodePtr) attr);
- php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) attr);
break;
}
nodendx++;
@@ -911,7 +911,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
anext = attr->next;
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
xmlUnlinkNode((xmlNodePtr) attr);
- php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) attr);
break;
}
attr = anext;
@@ -922,12 +922,12 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (elements) {
if (Z_TYPE_P(member) == IS_LONG) {
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL);
if (node) {
xmlUnlinkNode(node);
- php_libxml_node_free_resource(node TSRMLS_CC);
+ php_libxml_node_free_resource(node);
}
} else {
node = node->children;
@@ -938,7 +938,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (!xmlStrcmp(node->name, (xmlChar *)Z_STRVAL_P(member))) {
xmlUnlinkNode(node);
- php_libxml_node_free_resource(node TSRMLS_CC);
+ php_libxml_node_free_resource(node);
}
next_iter:
@@ -956,21 +956,21 @@ next_iter:
/* {{{ sxe_property_delete()
*/
-static void sxe_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void sxe_property_delete(zval *object, zval *member, void **cache_slot)
{
- sxe_prop_dim_delete(object, member, 1, 0 TSRMLS_CC);
+ sxe_prop_dim_delete(object, member, 1, 0);
}
/* }}} */
/* {{{ sxe_dimension_unset()
*/
-static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void sxe_dimension_delete(zval *object, zval *offset)
{
- sxe_prop_dim_delete(object, offset, 0, 1 TSRMLS_CC);
+ sxe_prop_dim_delete(object, offset, 0, 1);
}
/* }}} */
-static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine TSRMLS_DC) /* {{{ */
+static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine) /* {{{ */
{
xmlChar *tmp = xmlNodeListGetString(doc, list, inLine);
zend_string *res;
@@ -988,7 +988,7 @@ static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr li
/* {{{ _get_base_node_value()
*/
-static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, xmlChar *nsprefix, int isprefix TSRMLS_DC)
+static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, xmlChar *nsprefix, int isprefix)
{
php_sxe_object *subnode;
xmlChar *contents;
@@ -1000,14 +1000,14 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
xmlFree(contents);
}
} else {
- subnode = php_sxe_object_new(sxe_ref->zo.ce TSRMLS_CC);
+ subnode = php_sxe_object_new(sxe_ref->zo.ce);
subnode->document = sxe_ref->document;
subnode->document->refcount++;
if (nsprefix && *nsprefix) {
subnode->iter.nsprefix = xmlStrdup((xmlChar *)nsprefix);
subnode->iter.isprefix = isprefix;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL);
ZVAL_OBJ(value, &subnode->zo);
/*zval_add_ref(value);*/
@@ -1015,7 +1015,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
}
/* }}} */
-static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *value TSRMLS_DC) /* {{{ */
+static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *value) /* {{{ */
{
zval *data_ptr;
zval newptr;
@@ -1040,7 +1040,7 @@ static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *val
}
/* }}} */
-static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ */
+static HashTable *sxe_get_prop_hash(zval *object, int is_debug) /* {{{ */
{
zval value;
zval zattr;
@@ -1076,7 +1076,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
}
if (is_debug || sxe->iter.type != SXE_ITER_CHILD) {
if (sxe->iter.type == SXE_ITER_ELEMENT) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
if (!node || node->type != XML_ENTITY_DECL) {
attr = node ? (xmlAttrPtr)node->properties : NULL;
@@ -1084,11 +1084,11 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
while (attr) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1));
namelen = xmlStrlen(attr->name);
if (Z_ISUNDEF(zattr)) {
array_init(&zattr);
- sxe_properties_add(rv, "@attributes", sizeof("@attributes") - 1, &zattr TSRMLS_CC);
+ sxe_properties_add(rv, "@attributes", sizeof("@attributes") - 1, &zattr);
}
add_assoc_zval_ex(&zattr, (char*)attr->name, namelen, &value);
}
@@ -1098,11 +1098,11 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
}
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node && sxe->iter.type != SXE_ITER_ATTRLIST) {
if (node->type == XML_ATTRIBUTE_NODE) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1));
zend_hash_next_index_insert(rv, &value);
node = NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
@@ -1113,7 +1113,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data);
ZVAL_UNDEF(&sxe->iter.data);
- node = php_sxe_reset_iterator(sxe, 0 TSRMLS_CC);
+ node = php_sxe_reset_iterator(sxe, 0);
use_iter = 1;
}
@@ -1127,7 +1127,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
const xmlChar *cur = node->content;
if (*cur != 0) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1));
zend_hash_next_index_insert(rv, &value);
}
goto next_iter;
@@ -1145,16 +1145,16 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
namelen = xmlStrlen(node->name);
}
- _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix);
if ( use_iter ) {
zend_hash_next_index_insert(rv, &value);
} else {
- sxe_properties_add(rv, name, namelen, &value TSRMLS_CC);
+ sxe_properties_add(rv, name, namelen, &value);
}
next_iter:
if (use_iter) {
- node = php_sxe_iterator_fetch(sxe, node->next, 0 TSRMLS_CC);
+ node = php_sxe_iterator_fetch(sxe, node->next, 0);
} else {
node = node->next;
}
@@ -1172,7 +1172,7 @@ next_iter:
}
/* }}} */
-static HashTable *sxe_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ {
+static HashTable *sxe_get_gc(zval *object, zval **table, int *n) /* {{{ */ {
php_sxe_object *sxe;
sxe = Z_SXEOBJ_P(object);
@@ -1182,20 +1182,20 @@ static HashTable *sxe_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{
}
/* }}} */
-static HashTable *sxe_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *sxe_get_properties(zval *object) /* {{{ */
{
- return sxe_get_prop_hash(object, 0 TSRMLS_CC);
+ return sxe_get_prop_hash(object, 0);
}
/* }}} */
-static HashTable * sxe_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable * sxe_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
*is_temp = 1;
- return sxe_get_prop_hash(object, 1 TSRMLS_CC);
+ return sxe_get_prop_hash(object, 1);
}
/* }}} */
-static int sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */
+static int sxe_objects_compare(zval *object1, zval *object2) /* {{{ */
{
php_sxe_object *sxe1;
php_sxe_object *sxe2;
@@ -1231,7 +1231,7 @@ SXE_METHOD(xpath)
xmlNodeSetPtr result;
xmlNodePtr nodeptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
@@ -1245,13 +1245,13 @@ SXE_METHOD(xpath)
sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
}
if (!sxe->node) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL);
if (!sxe->node) {
RETURN_FALSE;
}
}
- nodeptr = php_sxe_get_first_node(sxe, sxe->node->node TSRMLS_CC);
+ nodeptr = php_sxe_get_first_node(sxe, sxe->node->node);
sxe->xpath->node = nodeptr;
@@ -1290,11 +1290,11 @@ SXE_METHOD(xpath)
* to the parent node.
*/
if (nodeptr->type == XML_TEXT_NODE) {
- _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_NONE, NULL, NULL, 0);
} else if (nodeptr->type == XML_ATTRIBUTE_NODE) {
- _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, nodeptr->ns ? (xmlChar *)nodeptr->ns->href : NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, nodeptr->ns ? (xmlChar *)nodeptr->ns->href : NULL, 0);
} else {
- _node_as_zval(sxe, nodeptr, &value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr, &value, SXE_ITER_NONE, NULL, NULL, 0);
}
add_next_index_zval(return_value, &value);
@@ -1314,7 +1314,7 @@ SXE_METHOD(registerXPathNamespace)
size_t prefix_len, ns_uri_len;
char *prefix, *ns_uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
@@ -1348,13 +1348,13 @@ SXE_METHOD(asXML)
}
if (ZEND_NUM_ARGS() == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
@@ -1383,7 +1383,7 @@ SXE_METHOD(asXML)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
@@ -1424,7 +1424,7 @@ static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns) /* {{
}
/* }}} */
-static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value TSRMLS_DC) /* {{{ */
+static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
{
xmlAttrPtr attr;
@@ -1444,7 +1444,7 @@ static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool r
node = node->children;
while (node) {
if (node->type == XML_ELEMENT_NODE) {
- sxe_add_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_namespaces(sxe, node, recursive, return_value);
}
node = node->next;
}
@@ -1459,7 +1459,7 @@ SXE_METHOD(getNamespaces)
php_sxe_object *sxe;
xmlNodePtr node;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &recursive) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) {
return;
}
@@ -1467,11 +1467,11 @@ SXE_METHOD(getNamespaces)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->type == XML_ELEMENT_NODE) {
- sxe_add_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_namespaces(sxe, node, recursive, return_value);
} else if (node->type == XML_ATTRIBUTE_NODE && node->ns) {
sxe_add_namespace_name(return_value, node->ns);
}
@@ -1479,7 +1479,7 @@ SXE_METHOD(getNamespaces)
}
/* }}} */
-static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value TSRMLS_DC) /* {{{ */
+static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
{
xmlNsPtr ns;
@@ -1492,7 +1492,7 @@ static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node,
if (recursive) {
node = node->children;
while (node) {
- sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_registered_namespaces(sxe, node, recursive, return_value);
node = node->next;
}
}
@@ -1508,7 +1508,7 @@ SXE_METHOD(getDocNamespaces)
php_sxe_object *sxe;
xmlNodePtr node;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &recursive, &from_root) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bb", &recursive, &from_root) == FAILURE) {
return;
}
@@ -1524,7 +1524,7 @@ SXE_METHOD(getDocNamespaces)
}
array_init(return_value);
- sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_registered_namespaces(sxe, node, recursive, return_value);
}
/* }}} */
@@ -1538,7 +1538,7 @@ SXE_METHOD(children)
xmlNodePtr node;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1549,9 +1549,9 @@ SXE_METHOD(children)
}
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
- _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix);
}
/* }}} */
@@ -1567,7 +1567,7 @@ SXE_METHOD(getName)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
namelen = xmlStrlen(node->name);
RETURN_STRINGL((char*)node->name, namelen);
@@ -1587,7 +1587,7 @@ SXE_METHOD(attributes)
xmlNodePtr node;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1598,9 +1598,9 @@ SXE_METHOD(attributes)
return; /* attributes don't have attributes */
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
- _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix);
}
/* }}} */
@@ -1615,13 +1615,13 @@ SXE_METHOD(addChild)
xmlNsPtr nsptr = NULL;
xmlChar *localname, *prefix = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
return;
}
if (qname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
+ php_error_docref(NULL, E_WARNING, "Element name is required");
return;
}
@@ -1629,14 +1629,14 @@ SXE_METHOD(addChild)
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to attributes");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to attributes");
return;
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree");
+ php_error_docref(NULL, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree");
return;
}
@@ -1660,7 +1660,7 @@ SXE_METHOD(addChild)
}
}
- _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char *)localname, prefix, 0 TSRMLS_CC);
+ _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char *)localname, prefix, 0);
xmlFree(localname);
if (prefix != NULL) {
@@ -1681,27 +1681,27 @@ SXE_METHOD(addAttribute)
xmlNsPtr nsptr = NULL;
xmlChar *localname, *prefix = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
return;
}
if (qname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute name is required");
return;
}
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node && node->type != XML_ELEMENT_NODE) {
node = node->parent;
}
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate parent Element");
+ php_error_docref(NULL, E_WARNING, "Unable to locate parent Element");
return;
}
@@ -1711,7 +1711,7 @@ SXE_METHOD(addAttribute)
if (prefix != NULL) {
xmlFree(prefix);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute requires prefix for namespace");
+ php_error_docref(NULL, E_WARNING, "Attribute requires prefix for namespace");
return;
}
localname = xmlStrdup((xmlChar *)qname);
@@ -1723,7 +1723,7 @@ SXE_METHOD(addAttribute)
if (prefix != NULL) {
xmlFree(prefix);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute already exists");
+ php_error_docref(NULL, E_WARNING, "Attribute already exists");
return;
}
@@ -1745,7 +1745,7 @@ SXE_METHOD(addAttribute)
/* {{{ cast_object()
*/
-static int cast_object(zval *object, int type, char *contents TSRMLS_DC)
+static int cast_object(zval *object, int type, char *contents)
{
if (contents) {
ZVAL_STRINGL(object, contents, strlen(contents));
@@ -1777,7 +1777,7 @@ static int cast_object(zval *object, int type, char *contents TSRMLS_DC)
/* {{{ sxe_object_cast()
*/
-static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type)
{
php_sxe_object *sxe;
xmlChar *contents = NULL;
@@ -1788,8 +1788,8 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
sxe = Z_SXEOBJ_P(readobj);
if (type == _IS_BOOL) {
- node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
- prop_hash = sxe_get_prop_hash(readobj, 1 TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, NULL);
+ prop_hash = sxe_get_prop_hash(readobj, 1);
ZVAL_BOOL(writeobj, node != NULL || zend_hash_num_elements(prop_hash) > 0);
zend_hash_destroy(prop_hash);
efree(prop_hash);
@@ -1797,14 +1797,14 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
}
if (sxe->iter.type != SXE_ITER_NONE) {
- node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, NULL);
if (node) {
contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1);
}
} else {
if (!sxe->node) {
if (sxe->document) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL);
}
}
@@ -1819,7 +1819,7 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
zval_ptr_dtor(readobj);
}
- rv = cast_object(writeobj, type, (char *)contents TSRMLS_CC);
+ rv = cast_object(writeobj, type, (char *)contents);
if (contents) {
xmlFree(contents);
@@ -1830,15 +1830,15 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
/* }}} */
/* Variant of sxe_object_cast_ex that handles overwritten __toString() method */
-static int sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int sxe_object_cast(zval *readobj, zval *writeobj, int type)
{
if (type == IS_STRING
- && zend_std_cast_object_tostring(readobj, writeobj, IS_STRING TSRMLS_CC) == SUCCESS
+ && zend_std_cast_object_tostring(readobj, writeobj, IS_STRING) == SUCCESS
) {
return SUCCESS;
}
- return sxe_object_cast_ex(readobj, writeobj, type TSRMLS_CC);
+ return sxe_object_cast_ex(readobj, writeobj, type);
}
/* {{{ proto object SimpleXMLElement::__toString() U
@@ -1847,7 +1847,7 @@ SXE_METHOD(__toString)
{
zval result;
- if (sxe_object_cast_ex(getThis(), &result, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (sxe_object_cast_ex(getThis(), &result, IS_STRING) == SUCCESS) {
RETURN_ZVAL(&result, 0, 0);
} else {
zval_ptr_dtor(&result);
@@ -1856,7 +1856,7 @@ SXE_METHOD(__toString)
}
/* }}} */
-static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count TSRMLS_DC) /* {{{ */
+static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count) /* {{{ */
{
xmlNodePtr node;
zval data;
@@ -1866,12 +1866,12 @@ static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count T
ZVAL_COPY_VALUE(&data, &sxe->iter.data);
ZVAL_UNDEF(&sxe->iter.data);
- node = php_sxe_reset_iterator(sxe, 0 TSRMLS_CC);
+ node = php_sxe_reset_iterator(sxe, 0);
while (node)
{
(*count)++;
- node = php_sxe_iterator_fetch(sxe, node->next, 0 TSRMLS_CC);
+ node = php_sxe_iterator_fetch(sxe, node->next, 0);
}
if (!Z_ISUNDEF(sxe->iter.data)) {
@@ -1883,7 +1883,7 @@ static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count T
}
/* }}} */
-static int sxe_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int sxe_count_elements(zval *object, zend_long *count) /* {{{ */
{
php_sxe_object *intern;
intern = Z_SXEOBJ_P(object);
@@ -1901,7 +1901,7 @@ static int sxe_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ *
}
return FAILURE;
}
- return php_sxe_count_elements_helper(intern, count TSRMLS_CC);
+ return php_sxe_count_elements_helper(intern, count);
}
/* }}} */
@@ -1916,15 +1916,15 @@ SXE_METHOD(count)
return;
}
- php_sxe_count_elements_helper(sxe, &count TSRMLS_CC);
+ php_sxe_count_elements_helper(sxe, &count);
RETURN_LONG(count);
}
/* }}} */
-static zval *sxe_get_value(zval *z, zval *rv TSRMLS_DC) /* {{{ */
+static zval *sxe_get_value(zval *z, zval *rv) /* {{{ */
{
- if (sxe_object_cast_ex(z, rv, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (sxe_object_cast_ex(z, rv, IS_STRING) == FAILURE) {
zend_error(E_ERROR, "Unable to cast node to string");
/* FIXME: Should not be fatal */
}
@@ -1963,14 +1963,14 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */
/* {{{ sxe_object_clone()
*/
static zend_object *
-sxe_object_clone(zval *object TSRMLS_DC)
+sxe_object_clone(zval *object)
{
php_sxe_object *sxe = Z_SXEOBJ_P(object);
php_sxe_object *clone;
xmlNodePtr nodep = NULL;
xmlDocPtr docp = NULL;
- clone = php_sxe_object_new(sxe->zo.ce TSRMLS_CC);
+ clone = php_sxe_object_new(sxe->zo.ce);
clone->document = sxe->document;
if (clone->document) {
clone->document->refcount++;
@@ -1990,7 +1990,7 @@ sxe_object_clone(zval *object TSRMLS_DC)
nodep = xmlDocCopyNode(sxe->node->node, docp, 1);
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, NULL);
return &clone->zo;
}
@@ -1998,7 +1998,7 @@ sxe_object_clone(zval *object TSRMLS_DC)
/* {{{ sxe_object_dtor()
*/
-static void sxe_object_dtor(zend_object *object TSRMLS_DC)
+static void sxe_object_dtor(zend_object *object)
{
/* dtor required to cleanup iterator related data properly */
php_sxe_object *sxe;
@@ -2027,15 +2027,15 @@ static void sxe_object_dtor(zend_object *object TSRMLS_DC)
/* {{{ sxe_object_free_storage()
*/
-static void sxe_object_free_storage(zend_object *object TSRMLS_DC)
+static void sxe_object_free_storage(zend_object *object)
{
php_sxe_object *sxe;
sxe = php_sxe_fetch_object(object);
- zend_object_std_dtor(&sxe->zo TSRMLS_CC);
+ zend_object_std_dtor(&sxe->zo);
- php_libxml_node_decrement_resource((php_libxml_node_object *)sxe TSRMLS_CC);
+ php_libxml_node_decrement_resource((php_libxml_node_object *)sxe);
if (sxe->xpath) {
xmlXPathFreeContext(sxe->xpath);
@@ -2050,7 +2050,7 @@ static void sxe_object_free_storage(zend_object *object TSRMLS_DC)
/* {{{ php_sxe_object_new()
*/
-static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
+static php_sxe_object* php_sxe_object_new(zend_class_entry *ce)
{
php_sxe_object *intern;
zend_class_entry *parent = ce;
@@ -2063,7 +2063,7 @@ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
intern->iter.name = NULL;
intern->fptr_count = NULL;
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &sxe_object_handlers;
@@ -2090,11 +2090,11 @@ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
/* {{{ sxe_object_new()
*/
PHP_SXE_API zend_object *
-sxe_object_new(zend_class_entry *ce TSRMLS_DC)
+sxe_object_new(zend_class_entry *ce)
{
php_sxe_object *intern;
- intern = php_sxe_object_new(ce TSRMLS_CC);
+ intern = php_sxe_object_new(ce);
return &intern->zo;
}
/* }}} */
@@ -2113,7 +2113,7 @@ PHP_FUNCTION(simplexml_load_file)
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -2126,11 +2126,11 @@ PHP_FUNCTION(simplexml_load_file)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
ZVAL_OBJ(return_value, &sxe->zo);
}
@@ -2150,7 +2150,7 @@ PHP_FUNCTION(simplexml_load_string)
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -2163,11 +2163,11 @@ PHP_FUNCTION(simplexml_load_string)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
ZVAL_OBJ(return_value, &sxe->zo);
}
@@ -2185,26 +2185,26 @@ SXE_METHOD(__construct)
zend_bool is_url = 0, isprefix = 0;
zend_error_handling error_handling;
- 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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
docp = is_url ? xmlReadFile(data, NULL, options) : xmlReadMemory(data, data_len, NULL, NULL, options);
if (!docp) {
((php_libxml_node_object *)sxe)->document = NULL;
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "String could not be parsed as XML", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0);
return;
}
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
}
/* }}} */
@@ -2218,7 +2218,7 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */
};
/* }}} */
-static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data) /* {{{ */
{
xmlChar *prefix = sxe->iter.nsprefix;
int isprefix = sxe->iter.isprefix;
@@ -2241,14 +2241,14 @@ next_iter:
}
if (node && use_data) {
- _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix);
}
return node;
}
/* }}} */
-static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data) /* {{{ */
{
xmlNodePtr node;
@@ -2269,13 +2269,13 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRML
case SXE_ITER_ATTRLIST:
node = (xmlNodePtr) node->properties;
}
- return php_sxe_iterator_fetch(sxe, node, use_data TSRMLS_CC);
+ return php_sxe_iterator_fetch(sxe, node, use_data);
}
return NULL;
}
/* }}} */
-zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
php_sxe_iterator *iterator;
@@ -2283,7 +2283,7 @@ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, i
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = emalloc(sizeof(php_sxe_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_sxe_iterator_funcs;
@@ -2293,7 +2293,7 @@ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, i
}
/* }}} */
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_dtor(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2304,7 +2304,7 @@ static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int php_sxe_iterator_valid(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2312,7 +2312,7 @@ static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *php_sxe_iterator_current_data(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2320,7 +2320,7 @@ static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
zval *curobj = &iterator->sxe->iter.data;
@@ -2339,7 +2339,7 @@ static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /* {{{ */
+PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe) /* {{{ */
{
xmlNodePtr node = NULL;
php_sxe_object *intern;
@@ -2352,37 +2352,37 @@ PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /*
}
if (node) {
- php_sxe_iterator_fetch(sxe, node->next, 1 TSRMLS_CC);
+ php_sxe_iterator_fetch(sxe, node->next, 1);
}
}
/* }}} */
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
- php_sxe_move_forward_iterator(iterator->sxe TSRMLS_CC);
+ php_sxe_move_forward_iterator(iterator->sxe);
}
/* }}} */
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_rewind(zend_object_iterator *iter) /* {{{ */
{
php_sxe_object *sxe;
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
sxe = iterator->sxe;
- php_sxe_reset_iterator(sxe, 1 TSRMLS_CC);
+ php_sxe_reset_iterator(sxe, 1);
}
/* }}} */
-void *simplexml_export_node(zval *object TSRMLS_DC) /* {{{ */
+void *simplexml_export_node(zval *object) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
sxe = Z_SXEOBJ_P(object);
GET_NODE(sxe, node);
- return php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ return php_sxe_get_first_node(sxe, node);
}
/* }}} */
@@ -2396,17 +2396,17 @@ PHP_FUNCTION(simplexml_import_dom)
xmlNodePtr nodep = NULL;
zend_class_entry *ce = sxe_class_entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|C!", &node, &ce) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|C!", &node, &ce) == FAILURE) {
return;
}
object = Z_LIBXML_NODE_P(node);
- nodep = php_libxml_import_node(node TSRMLS_CC);
+ nodep = php_libxml_import_node(node);
if (nodep) {
if (nodep->doc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Imported Node must have associated Document");
+ php_error_docref(NULL, E_WARNING, "Imported Node must have associated Document");
RETURN_NULL();
}
if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) {
@@ -2418,14 +2418,14 @@ PHP_FUNCTION(simplexml_import_dom)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->document = object->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep->doc TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, nodep, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep->doc);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, nodep, NULL);
ZVAL_OBJ(return_value, &sxe->zo);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
+ php_error_docref(NULL, E_WARNING, "Invalid Nodetype to import");
RETVAL_NULL();
}
}
@@ -2561,10 +2561,10 @@ PHP_MINIT_FUNCTION(simplexml)
INIT_CLASS_ENTRY(sxe, "SimpleXMLElement", sxe_functions);
sxe.create_object = sxe_object_new;
- sxe_class_entry = zend_register_internal_class(&sxe TSRMLS_CC);
+ sxe_class_entry = zend_register_internal_class(&sxe);
sxe_class_entry->get_iterator = php_sxe_get_iterator;
sxe_class_entry->iterator_funcs.funcs = &php_sxe_iterator_funcs;
- zend_class_implements(sxe_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(sxe_class_entry, 1, zend_ce_traversable);
sxe_object_handlers.offset = XtOffsetOf(php_sxe_object, zo);
sxe_object_handlers.dtor_obj = sxe_object_dtor;
sxe_object_handlers.free_obj = sxe_object_free_storage;
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index 27d1e9b0f2..19ef49a785 100644
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -47,7 +47,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
}
iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter TSRMLS_CC);
+ ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter);
}
/* }}} */
@@ -120,7 +120,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
}
iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter TSRMLS_CC);
+ ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter);
}
/* }}} */
@@ -199,11 +199,11 @@ PHP_MINIT_FUNCTION(sxe) /* {{{ */
ce_SimpleXMLElement = pce;
INIT_CLASS_ENTRY_EX(sxi, "SimpleXMLIterator", sizeof("SimpleXMLIterator") - 1, funcs_SimpleXMLIterator);
- ce_SimpleXMLIterator = zend_register_internal_class_ex(&sxi, ce_SimpleXMLElement TSRMLS_CC);
+ ce_SimpleXMLIterator = zend_register_internal_class_ex(&sxi, ce_SimpleXMLElement);
ce_SimpleXMLIterator->create_object = ce_SimpleXMLElement->create_object;
- zend_class_implements(ce_SimpleXMLIterator TSRMLS_CC, 1, spl_ce_RecursiveIterator);
- zend_class_implements(ce_SimpleXMLIterator TSRMLS_CC, 1, spl_ce_Countable);
+ zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_RecursiveIterator);
+ zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_Countable);
return SUCCESS;
}
diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h
index bf73bfcc9b..3d23493b68 100644
--- a/ext/skeleton/php_skeleton.h
+++ b/ext/skeleton/php_skeleton.h
@@ -30,18 +30,16 @@ ZEND_BEGIN_MODULE_GLOBALS(extname)
ZEND_END_MODULE_GLOBALS(extname)
*/
-/* In every utility function you add that needs to use variables
- in php_extname_globals, call TSRMLS_FETCH(); after declaring other
- variables used by that function, or better yet, pass in TSRMLS_CC
- after the last function argument and declare your utility function
- with TSRMLS_DC after the last declared argument. Always refer to
- the globals in your function as EXTNAME_G(variable). You are
- encouraged to rename these macros something shorter, see
+/* Always refer to the globals in your function as EXTNAME_G(variable).
+ You are encouraged to rename these macros something shorter, see
examples in any other php module directory.
*/
#ifdef ZTS
-#define EXTNAME_G(v) TSRMG(extname_globals_id, zend_extname_globals *, v)
+#define EXTNAME_G(v) ZEND_TSRMG(extname_globals_id, zend_extname_globals *, v)
+#ifdef COMPILE_DL_EXTNAME
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define EXTNAME_G(v) (extname_globals.v)
#endif
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index 5103ba82fc..d432f1c3df 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -39,7 +39,7 @@ PHP_FUNCTION(confirm_extname_compiled)
size_t arg_len, len;
char *strg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -95,6 +95,9 @@ PHP_MSHUTDOWN_FUNCTION(extname)
*/
PHP_RINIT_FUNCTION(extname)
{
+#if defined(COMPILE_DL_EXTNAME) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
return SUCCESS;
}
/* }}} */
@@ -150,6 +153,9 @@ zend_module_entry extname_module_entry = {
/* }}} */
#ifdef COMPILE_DL_EXTNAME
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(extname)
#endif
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index 610fff11c7..f9315a825f 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -104,8 +104,8 @@ static inline php_snmp_object *php_snmp_fetch_object(zend_object *obj) {
#define Z_SNMP_P(zv) php_snmp_fetch_object(Z_OBJ_P((zv)))
-typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval *retval TSRMLS_DC);
-typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object, zval *newval TSRMLS_DC);
+typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval *retval);
+typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object, zval *newval);
typedef struct _ptp_snmp_prop_handler {
const char *name;
@@ -133,7 +133,7 @@ ZEND_END_MODULE_GLOBALS(snmp)
#endif
#define REGISTER_SNMP_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(php_snmp_ce, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_snmp_ce, const_name, sizeof(const_name)-1, (zend_long)value);
#else
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 90c1bff951..4f42cac2d0 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -103,7 +103,7 @@ typedef struct snmp_session php_snmp_session;
int i = 0; \
while (b[i].name != NULL) { \
php_snmp_add_property((a), (b)[i].name, (b)[i].name_length, \
- (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func TSRMLS_CC); \
+ (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func); \
i++; \
} \
}
@@ -467,14 +467,14 @@ static void netsnmp_session_free(php_snmp_session **session) /* {{{ */
}
/* }}} */
-static void php_snmp_session_destructor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_snmp_session_destructor(zend_resource *rsrc) /* {{{ */
{
php_snmp_session *session = (php_snmp_session *)rsrc->ptr;
netsnmp_session_free(&session);
}
/* }}} */
-static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_snmp_object_free_storage(zend_object *object) /* {{{ */
{
php_snmp_object *intern = php_snmp_fetch_object(object);
@@ -484,18 +484,18 @@ static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
netsnmp_session_free(&(intern->session));
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_snmp_object_new(zend_class_entry *class_type) /* {{{ */
{
php_snmp_object *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_snmp_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &php_snmp_object_handlers;
@@ -510,7 +510,7 @@ static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC)
* Record last SNMP-related error in object
*
*/
-static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...)
+static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object = NULL;
@@ -532,10 +532,10 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type,
}
if (object && (snmp_object->exceptions_enabled & type)) {
- zend_throw_exception_ex(php_snmp_exception_ce, type TSRMLS_CC, snmp_object->snmp_errstr);
+ zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr);
} else {
va_start(args, format);
- php_verror(docref, "", E_WARNING, format, args TSRMLS_CC);
+ php_verror(docref, "", E_WARNING, format, args);
va_end(args);
}
}
@@ -547,7 +547,7 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type,
* SNMP value to zval converter
*
*/
-static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC, int valueretrieval)
+static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval)
{
zval val;
char sbuf[512];
@@ -565,7 +565,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
*buf = '\0';
if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) {
if (val_len > 512*1024) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?");
+ php_error_docref(NULL, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?");
break;
}
/* buffer is not long enough to hold full output, double it */
@@ -581,7 +581,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
}
if (!dbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
buf = &(sbuf[0]);
buflen = sizeof(sbuf) - 1;
break;
@@ -596,7 +596,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
buf = dbuf;
buflen = val_len;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
}
}
@@ -670,7 +670,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
default:
ZVAL_STRING(&val, "Unknown value type");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value type: %u", vars->type);
+ php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type);
break;
}
} else /* use Net-SNMP value translation */ {
@@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
RETVAL_FALSE;
/* reset errno and errstr */
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_NOERROR, "");
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_NOERROR, "");
if (st & SNMP_CMD_WALK) { /* remember root OID */
memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * sizeof(oid));
@@ -729,14 +729,14 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
if ((ss = snmp_open(session)) == NULL) {
snmp_error(session, NULL, NULL, &err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open snmp connection: %s", err);
+ php_error_docref(NULL, E_WARNING, "Could not open snmp connection: %s", err);
free(err);
RETVAL_FALSE;
return;
}
if ((st & SNMP_CMD_SET) && objid_query->count > objid_query->step) {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries");
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries");
}
while (keepwalking) {
@@ -759,7 +759,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
pdu = snmp_pdu_create(SNMP_MSG_SET);
} else {
snmp_close(ss);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown SNMP command (internals)");
+ php_error_docref(NULL, E_ERROR, "Unknown SNMP command (internals)");
RETVAL_FALSE;
return;
}
@@ -767,7 +767,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
if (st & SNMP_CMD_SET) {
if ((snmp_errno = snmp_add_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value))) {
snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno));
snmp_free_pdu(pdu);
snmp_close(ss);
RETVAL_FALSE;
@@ -809,7 +809,7 @@ retry:
}
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2);
continue;
}
@@ -828,7 +828,7 @@ retry:
}
ZVAL_NULL(&snmpval);
- php_snmp_getvalue(vars, &snmpval TSRMLS_CC, objid_query->valueretrieval);
+ php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval);
if (objid_query->array_output) {
if (Z_TYPE_P(return_value) == IS_TRUE || Z_TYPE_P(return_value) == IS_FALSE) {
@@ -849,7 +849,7 @@ retry:
add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval);
} else {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find original OID name for '%s'", buf2);
+ php_error_docref(NULL, E_WARNING, "Could not find original OID name for '%s'", buf2);
}
} else if (st & SNMP_USE_SUFFIX_AS_KEYS && st & SNMP_CMD_WALK) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
@@ -877,7 +877,7 @@ retry:
if (st & SNMP_CMD_WALK) {
if (objid_query->oid_increasing_check == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->name, vars->name_length) >= 0) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
keepwalking = 0;
} else {
memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid));
@@ -910,9 +910,9 @@ retry:
}
if (vars) {
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat));
} else {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat));
}
if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT)) { /* cut out bogus OID and retry */
if ((pdu = snmp_fix_pdu(response, ((st & SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT) )) != NULL) {
@@ -930,7 +930,7 @@ retry:
}
}
} else if (status == STAT_TIMEOUT) {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
}
@@ -939,7 +939,7 @@ retry:
return;
} else { /* status == STAT_ERROR */
snmp_error(ss, NULL, NULL, &err);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err);
free(err);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
@@ -961,7 +961,7 @@ retry:
* OID parser (and type, value for SNMP_SET command)
*/
-static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value TSRMLS_DC)
+static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value)
{
char *pptr;
HashPosition pos_oid, pos_type, pos_value;
@@ -1007,7 +1007,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if (Z_TYPE_P(oid) == IS_STRING) {
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
if (objid_query->vars == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
@@ -1015,7 +1015,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
if (Z_STRLEN_P(type) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type));
+ php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type));
efree(objid_query->vars);
return FALSE;
}
@@ -1023,7 +1023,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].type = *pptr;
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Single objid and multiple type or values are not supported");
+ php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported");
efree(objid_query->vars);
return FALSE;
}
@@ -1031,12 +1031,12 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->count++;
} else if (Z_TYPE_P(oid) == IS_ARRAY) { /* we got objid array */
if (zend_hash_num_elements(Z_ARRVAL_P(oid)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got empty OID array");
+ php_error_docref(NULL, E_WARNING, "Got empty OID array");
return FALSE;
}
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_P(oid)));
if (objid_query->vars == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
@@ -1055,7 +1055,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if ((tmp_type = zend_hash_get_current_data_ex(Z_ARRVAL_P(type), &pos_type)) != NULL) {
convert_to_string_ex(tmp_type);
if (Z_STRLEN_P(tmp_type) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
+ php_error_docref(NULL, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
efree(objid_query->vars);
return FALSE;
}
@@ -1063,7 +1063,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].type = *pptr;
zend_hash_move_forward_ex(Z_ARRVAL_P(type), &pos_type);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid));
+ php_error_docref(NULL, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
@@ -1077,7 +1077,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value);
zend_hash_move_forward_ex(Z_ARRVAL_P(value), &pos_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid));
+ php_error_docref(NULL, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
@@ -1090,14 +1090,14 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
/* now parse all OIDs */
if (st & SNMP_CMD_WALK) {
if (objid_query->count > 1) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!");
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!");
efree(objid_query->vars);
return FALSE;
}
objid_query->vars[0].name_length = MAX_NAME_LEN;
if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error */
if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].name_length))) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid);
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid);
efree(objid_query->vars);
return FALSE;
}
@@ -1109,7 +1109,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
for (objid_query->offset = 0; objid_query->offset < objid_query->count; objid_query->offset++) {
objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN;
if (!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset].name, &(objid_query->vars[objid_query->offset].name_length))) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid);
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid);
efree(objid_query->vars);
return FALSE;
}
@@ -1124,7 +1124,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
/* {{{ netsnmp_session_init
allocates memory for session and session->peername, caller should free it manually using netsnmp_session_free() and efree()
*/
-static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries TSRMLS_DC)
+static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries)
{
php_snmp_session *session;
char *pptr, *host_ptr;
@@ -1136,7 +1136,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
*session_p = (php_snmp_session *)emalloc(sizeof(php_snmp_session));
session = *session_p;
if (session == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed allocating session");
+ php_error_docref(NULL, E_WARNING, "emalloc() failed allocating session");
return (-1);
}
memset(session, 0, sizeof(php_snmp_session));
@@ -1148,7 +1148,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
session->peername = emalloc(MAX_NAME_LEN);
if (session->peername == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while copying hostname");
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while copying hostname");
return (-1);
}
/* we copy original hostname for further processing */
@@ -1165,7 +1165,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
}
*pptr = '\0';
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "malformed IPv6 address, closing square bracket missing");
+ php_error_docref(NULL, E_WARNING, "malformed IPv6 address, closing square bracket missing");
return (-1);
}
} else { /* IPv4 address */
@@ -1177,7 +1177,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
/* since Net-SNMP library requires 'udp6:' prefix for all IPv6 addresses (in FQDN form too) we need to
perform possible name resolution before running any SNMP queries */
- if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL TSRMLS_CC)) == 0) { /* some resolver error */
+ if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL)) == 0) { /* some resolver error */
/* warnings sent, bailing out */
return (-1);
}
@@ -1214,7 +1214,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
}
if (strlen(session->peername) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown failure while resolving '%s'", hostname);
+ php_error_docref(NULL, E_WARNING, "Unknown failure while resolving '%s'", hostname);
return (-1);
}
/* XXX FIXME
@@ -1264,7 +1264,7 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
/* {{{ int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
Set the authentication protocol in the snmpv3 session */
-static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
+static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "MD5")) {
s->securityAuthProto = usmHMACMD5AuthProtocol;
@@ -1273,7 +1273,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot
s->securityAuthProto = usmHMACSHA1AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown authentication protocol '%s'", prot);
+ php_error_docref(NULL, E_WARNING, "Unknown authentication protocol '%s'", prot);
return (-1);
}
return (0);
@@ -1282,7 +1282,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot
/* {{{ int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
Set the security protocol in the snmpv3 session */
-static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
+static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "DES")) {
s->securityPrivProto = usmDESPrivProtocol;
@@ -1293,7 +1293,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
s->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown security protocol '%s'", prot);
+ php_error_docref(NULL, E_WARNING, "Unknown security protocol '%s'", prot);
return (-1);
}
return (0);
@@ -1302,14 +1302,14 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
/* {{{ int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
Make key from pass phrase in the snmpv3 session */
-static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRMLS_DC)
+static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *) pass, strlen(pass),
s->securityAuthKey, &(s->securityAuthKeyLen)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
+ php_error_docref(NULL, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-1);
}
return (0);
@@ -1318,7 +1318,7 @@ static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRML
/* {{{ int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
Make key from pass phrase in the snmpv3 session */
-static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS_DC)
+static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
@@ -1326,7 +1326,7 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *)pass, strlen(pass),
s->securityPrivKey, &(s->securityPrivKeyLen)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
+ php_error_docref(NULL, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-2);
}
return (0);
@@ -1335,17 +1335,17 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS
/* {{{ in netsnmp_session_set_contextEngineID(struct snmp_session *s, u_char * contextEngineID)
Set context Engine Id in the snmpv3 session */
-static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID TSRMLS_DC)
+static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID)
{
size_t ebuf_len = 32, eout_len = 0;
u_char *ebuf = (u_char *) emalloc(ebuf_len);
if (ebuf == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "malloc failure setting contextEngineID");
+ php_error_docref(NULL, E_WARNING, "malloc failure setting contextEngineID");
return (-1);
}
if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, contextEngineID)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad engine ID value '%s'", contextEngineID);
+ php_error_docref(NULL, E_WARNING, "Bad engine ID value '%s'", contextEngineID);
efree(ebuf);
return (-1);
}
@@ -1362,38 +1362,38 @@ static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * co
/* {{{ php_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
Set all snmpv3-related security options */
-static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID TSRMLS_DC)
+static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
{
/* Setting the security level. */
if (netsnmp_session_set_sec_level(session, sec_level)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level '%s'", sec_level);
+ php_error_docref(NULL, E_WARNING, "Invalid security level '%s'", sec_level);
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHNOPRIV || session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the authentication protocol. */
- if (netsnmp_session_set_auth_protocol(session, auth_protocol TSRMLS_CC)) {
+ if (netsnmp_session_set_auth_protocol(session, auth_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the authentication passphrase. */
- if (netsnmp_session_gen_auth_key(session, auth_passphrase TSRMLS_CC)) {
+ if (netsnmp_session_gen_auth_key(session, auth_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the security protocol. */
- if (netsnmp_session_set_sec_protocol(session, priv_protocol TSRMLS_CC)) {
+ if (netsnmp_session_set_sec_protocol(session, priv_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the security protocol passphrase. */
- if (netsnmp_session_gen_sec_key(session, priv_passphrase TSRMLS_CC)) {
+ if (netsnmp_session_gen_sec_key(session, priv_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
@@ -1407,7 +1407,7 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_
}
/* Setting contextEngineIS if specified */
- if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID TSRMLS_CC)) {
+ if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID)) {
/* Warning message sent already, just bail out */
return (-1);
}
@@ -1446,7 +1446,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
if (session_less_mode) {
if (version == SNMP_VERSION_3) {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
@@ -1455,14 +1455,14 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
+ if (zend_parse_parameters(argc, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
} else {
@@ -1470,25 +1470,25 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
+ if (zend_parse_parameters(argc, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "zzz", &oid, &type, &value) == FAILURE) {
+ if (zend_parse_parameters(argc, "zzz", &oid, &type, &value) == FAILURE) {
RETURN_FALSE;
}
} else if (st & SNMP_CMD_WALK) {
- if (zend_parse_parameters(argc TSRMLS_CC, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
RETURN_FALSE;
}
if (suffix_keys) {
st |= SNMP_USE_SUFFIX_AS_KEYS;
}
} else if (st & SNMP_CMD_GET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "z|b", &oid, &use_orignames) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|b", &oid, &use_orignames) == FAILURE) {
RETURN_FALSE;
}
if (use_orignames) {
@@ -1497,23 +1497,23 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
} else {
/* SNMP_CMD_GETNEXT
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "z", &oid) == FAILURE) {
+ if (zend_parse_parameters(argc, "z", &oid) == FAILURE) {
RETURN_FALSE;
}
}
}
- if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value TSRMLS_CC)) {
+ if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value)) {
RETURN_FALSE;
}
if (session_less_mode) {
- if (netsnmp_session_init(&session, version, a1, a2, timeout, retries TSRMLS_CC)) {
+ if (netsnmp_session_init(&session, version, a1, a2, timeout, retries)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
RETURN_FALSE;
}
- if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL TSRMLS_CC)) {
+ if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
/* Warning message sent already, just bail out */
@@ -1524,7 +1524,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
snmp_object = Z_SNMP_P(object);
session = snmp_object->session;
if (!session) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or uninitialized SNMP object");
+ php_error_docref(NULL, E_WARNING, "Invalid or uninitialized SNMP object");
efree(objid_query.vars);
RETURN_FALSE;
}
@@ -1621,7 +1621,7 @@ PHP_FUNCTION(snmp_set_quick_print)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1636,7 +1636,7 @@ PHP_FUNCTION(snmp_set_enum_print)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1651,7 +1651,7 @@ PHP_FUNCTION(snmp_set_oid_output_format)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1666,7 +1666,7 @@ PHP_FUNCTION(snmp_set_oid_output_format)
RETURN_TRUE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1);
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1);
RETURN_FALSE;
break;
}
@@ -1759,7 +1759,7 @@ PHP_FUNCTION(snmp_set_valueretrieval)
{
zend_long method;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
RETURN_FALSE;
}
@@ -1767,7 +1767,7 @@ PHP_FUNCTION(snmp_set_valueretrieval)
SNMP_G(valueretrieval) = method;
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
RETURN_FALSE;
}
}
@@ -1792,13 +1792,13 @@ PHP_FUNCTION(snmp_read_mib)
char *filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
if (!read_mib(filename)) {
char *error = strerror(errno);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading MIB file '%s': %s", filename, error);
+ php_error_docref(NULL, E_WARNING, "Error while reading MIB file '%s': %s", filename, error);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1820,14 +1820,14 @@ PHP_METHOD(snmp, __construct)
zend_error_handling error_handling;
snmp_object = Z_SNMP_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (zend_parse_parameters(argc TSRMLS_CC, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(argc, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
switch(version) {
case SNMP_VERSION_1:
@@ -1835,7 +1835,7 @@ PHP_METHOD(snmp, __construct)
case SNMP_VERSION_3:
break;
default:
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown SNMP protocol version", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Unknown SNMP protocol version", 0);
return;
}
@@ -1844,7 +1844,7 @@ PHP_METHOD(snmp, __construct)
netsnmp_session_free(&(snmp_object->session));
}
- if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries TSRMLS_CC)) {
+ if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries)) {
return;
}
snmp_object->max_oids = 0;
@@ -1920,12 +1920,12 @@ PHP_METHOD(snmp, setSecurity)
snmp_object = Z_SNMP_P(object);
- if (zend_parse_parameters(argc TSRMLS_CC, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len) == FAILURE) {
RETURN_FALSE;
}
- if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7 TSRMLS_CC)) {
+ if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7)) {
/* Warning message sent already, just bail out */
RETURN_FALSE;
}
@@ -1961,7 +1961,7 @@ PHP_METHOD(snmp, getError)
/* }}} */
/* {{{ */
-void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func TSRMLS_DC)
+void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func)
{
php_snmp_prop_handler p;
@@ -1975,7 +1975,7 @@ void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, p
/* {{{ php_snmp_read_property(zval *object, zval *member, int type[, const zend_literal *key])
Generic object property reader */
-zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval tmp_member;
zval *retval;
@@ -1994,7 +1994,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->read_func) {
- ret = hnd->read_func(obj, rv TSRMLS_CC);
+ ret = hnd->read_func(obj, rv);
if (ret == SUCCESS) {
retval = rv;
} else {
@@ -2002,7 +2002,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
}
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -2015,7 +2015,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
/* {{{ php_snmp_write_property(zval *object, zval *member, zval *value[, const zend_literal *key])
Generic object property writer */
-void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
php_snmp_object *obj;
@@ -2032,7 +2032,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->write_func) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
/*
if (!PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
Z_ADDREF_P(value);
@@ -2041,7 +2041,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
*/
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -2052,7 +2052,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
/* {{{ php_snmp_has_property(zval *object, zval *member, int has_set_exists[, const zend_literal *key])
Generic object property checker */
-static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC)
+static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot)
{
zval rv;
php_snmp_prop_handler *hnd;
@@ -2064,7 +2064,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
ret = 1;
break;
case 0: {
- zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
zval_ptr_dtor(value);
@@ -2072,7 +2072,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
break;
}
default: {
- zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
convert_to_boolean(value);
ret = Z_TYPE_P(value) == IS_TRUE? 1:0;
@@ -2082,7 +2082,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- ret = std_hnd->has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ ret = std_hnd->has_property(object, member, has_set_exists, cache_slot);
}
return ret;
}
@@ -2090,7 +2090,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
/* {{{ php_snmp_get_properties(zval *object)
Returns all object properties. Injects SNMP properties into object on first call */
-static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
+static HashTable *php_snmp_get_properties(zval *object)
{
php_snmp_object *obj;
php_snmp_prop_handler *hnd;
@@ -2100,10 +2100,10 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
zend_ulong num_key;
obj = Z_SNMP_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) {
- if (!hnd->read_func || hnd->read_func(obj, &rv TSRMLS_CC) != SUCCESS) {
+ if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) {
ZVAL_NULL(&rv);
}
zend_hash_update(props, key, &rv);
@@ -2114,7 +2114,7 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
/* }}} */
/* {{{ */
-static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_DC)
+static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval)
{
zval val;
@@ -2141,7 +2141,7 @@ static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_
/* }}} */
/* {{{ */
-static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSRMLS_DC)
+static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval)
{
if (snmp_object->max_oids > 0) {
ZVAL_LONG(retval, snmp_object->max_oids);
@@ -2153,7 +2153,7 @@ static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSR
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(name) \
- static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \
+ static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_BOOL(retval, snmp_object->name); \
return SUCCESS; \
@@ -2164,7 +2164,7 @@ PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(quick_print)
PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(enum_print)
#define PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(name) \
- static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \
+ static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_LONG(retval, snmp_object->name); \
return SUCCESS; \
@@ -2175,15 +2175,15 @@ PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(oid_output_format)
PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(exceptions_enabled)
/* {{{ */
-static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "info property is read-only");
+ php_error_docref(NULL, E_WARNING, "info property is read-only");
return FAILURE;
}
/* }}} */
/* {{{ */
-static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2203,7 +2203,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS
if (Z_LVAL_P(newval) > 0) {
snmp_object->max_oids = Z_LVAL_P(newval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
}
if (newval == &ztmp) {
@@ -2215,7 +2215,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS
/* }}} */
/* {{{ */
-static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2230,7 +2230,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new
if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) {
snmp_object->valueretrieval = Z_LVAL_P(newval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
}
@@ -2243,7 +2243,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(name) \
-static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) \
+static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval) \
{ \
zval ztmp; \
ZVAL_COPY(&ztmp, newval); \
@@ -2260,7 +2260,7 @@ PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(enum_print)
PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(oid_increasing_check)
/* {{{ */
-static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2280,7 +2280,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *
snmp_object->oid_output_format = Z_LVAL_P(newval);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
break;
}
@@ -2293,7 +2293,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *
/* }}} */
/* {{{ */
-static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2385,7 +2385,7 @@ PHP_MINIT_FUNCTION(snmp)
php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo);
php_snmp_object_handlers.clone_obj = NULL;
php_snmp_object_handlers.free_obj = php_snmp_object_free_storage;
- php_snmp_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ php_snmp_ce = zend_register_internal_class(&ce);
/* Register SNMP Class properties */
zend_hash_init(&php_snmp_properties, 0, NULL, free_php_snmp_properties, 1);
@@ -2432,9 +2432,9 @@ PHP_MINIT_FUNCTION(snmp)
/* Register SNMPException class */
INIT_CLASS_ENTRY(cex, "SNMPException", NULL);
#ifdef HAVE_SPL
- php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException TSRMLS_CC);
+ php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default());
#endif
return SUCCESS;
diff --git a/ext/soap/config.m4 b/ext/soap/config.m4
index 7fa8c6f0ec..5fcb8bd447 100644
--- a/ext/soap/config.m4
+++ b/ext/soap/config.m4
@@ -17,7 +17,7 @@ if test "$PHP_SOAP" != "no"; then
PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [
AC_DEFINE(HAVE_SOAP,1,[ ])
- PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
+ PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(SOAP_SHARED_LIBADD)
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
diff --git a/ext/soap/config.w32 b/ext/soap/config.w32
index 7aa73b5838..bb26a90471 100644
--- a/ext/soap/config.w32
+++ b/ext/soap/config.w32
@@ -5,7 +5,7 @@ ARG_ENABLE("soap", "SOAP support", "no");
if (PHP_SOAP != "no") {
if (PHP_LIBXML == "yes" && ADD_EXTENSION_DEP('soap', 'libxml')) {
- EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c');
+ EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c', null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
if (!PHP_SOAP_SHARED) {
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 9e554a9f5a..d147d5ac2f 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -29,63 +29,63 @@
#include "zend_interfaces.h"
/* zval type decode */
-static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_bool(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_string(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_stringr(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_stringc(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_map(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_null(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_base64(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_hexbin(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-
-static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_bool(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_string(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_stringr(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_stringc(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_map(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_null(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_base64(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_hexbin(zval* ret, encodeTypePtr type, xmlNodePtr data);
+
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* String encode */
-static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Null encode */
-static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Array encode */
-static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
-static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent);
/* Datetime encode/decode */
-static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-
-static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-
-static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-
-static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+
+static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data);
+
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+
+static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Try and guess for non-wsdl clients and servers */
-static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
static int is_map(zval *array);
-static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type TSRMLS_DC);
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type);
static xmlNodePtr check_and_resolve_href(xmlNodePtr data);
@@ -283,7 +283,7 @@ static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type)
return NULL;
}
-static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
+static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
xmlNodePtr node_ptr;
if (SOAP_GLOBAL(ref_map)) {
@@ -350,7 +350,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
return 0;
}
-static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
+static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node)
{
zval *data_ptr;
@@ -368,14 +368,14 @@ static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
return 0;
}
-static void soap_add_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
+static void soap_add_xml_ref(zval *data, xmlNodePtr node)
{
if (SOAP_GLOBAL(ref_map)) {
zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)node, data);
}
}
-static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map TSRMLS_DC)
+static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map)
{
xmlNodePtr node = NULL;
int add_type = 0;
@@ -420,7 +420,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
}
zdata = zend_hash_str_find(ht, "enc_value", sizeof("enc_value")-1);
- node = master_to_xml(enc, zdata, style, parent TSRMLS_CC);
+ node = master_to_xml(enc, zdata, style, parent);
if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
if ((ztype = zend_hash_str_find(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL) {
@@ -491,7 +491,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
smart_str_free(&nscat);
}
if (encode->to_xml) {
- node = encode->to_xml(&encode->details, data, style, parent TSRMLS_CC);
+ node = encode->to_xml(&encode->details, data, style, parent);
if (add_type) {
set_ns_and_type(node, &encode->details);
}
@@ -500,12 +500,12 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
return node;
}
-xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent)
{
- return master_to_xml_int(encode, data, style, parent, 1 TSRMLS_CC);
+ return master_to_xml_int(encode, data, style, parent, 1);
}
-static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
+static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data)
{
if (SOAP_GLOBAL(typemap)) {
if (encode->details.type_str) {
@@ -549,12 +549,12 @@ static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data TSR
}
}
if (encode->to_zval) {
- ret = encode->to_zval(ret, &encode->details, data TSRMLS_CC);
+ ret = encode->to_zval(ret, &encode->details, data);
}
return ret;
}
-zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
+zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data)
{
data = check_and_resolve_href(data);
@@ -585,10 +585,10 @@ zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
}
}
}
- return master_to_zval_int(ret, encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, encode, data);
}
-xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret = NULL;
zval return_value;
@@ -596,7 +596,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par
if (type && type->map && Z_TYPE(type->map->to_xml) != IS_UNDEF) {
ZVAL_NULL(&return_value);
- if (call_user_function(EG(function_table), NULL, &type->map->to_xml, &return_value, 1, data TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, &type->map->to_xml, &return_value, 1, data) == FAILURE) {
soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
}
if (Z_TYPE(return_value) == IS_STRING) {
@@ -619,7 +619,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par
return ret;
}
-zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
+zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node)
{
if (type && type->map && Z_TYPE(type->map->to_zval) != IS_UNDEF) {
xmlBufferPtr buf;
@@ -633,7 +633,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
xmlBufferFree(buf);
xmlFreeNode(copy);
- if (call_user_function(EG(function_table), NULL, &type->map->to_zval, ret, 1, &data TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, &type->map->to_zval, ret, 1, &data) == FAILURE) {
soap_error0(E_ERROR, "Encoding: Error calling from_xml callback");
} else if (EG(exception)) {
ZVAL_NULL(ret);
@@ -647,7 +647,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
/* TODO: get rid of "bogus".. ither by passing in the already created xmlnode or passing in the node name */
/* String encode/decode */
-static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -679,7 +679,7 @@ static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -712,7 +712,7 @@ static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data TSRM
return ret;
}
-static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -745,7 +745,7 @@ static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data TSRM
return ret;
}
-static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zend_string *str;
@@ -774,7 +774,7 @@ static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zend_string *str;
int i, j;
@@ -820,7 +820,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret, text;
char *str;
@@ -905,7 +905,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret, text;
zend_string *str;
@@ -937,7 +937,7 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
static char hexconvtab[] = "0123456789ABCDEF";
xmlNodePtr ret, text;
@@ -974,7 +974,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1012,7 +1012,7 @@ static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1044,7 +1044,7 @@ static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_
return ret;
}
-static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1075,7 +1075,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
return ret;
}
-static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
zval tmp;
@@ -1098,7 +1098,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1127,7 +1127,7 @@ static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_
return ret;
}
-static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1135,7 +1135,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
- if (zend_is_true(data TSRMLS_CC)) {
+ if (zend_is_true(data)) {
xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
xmlNodeSetContent(ret, BAD_CAST("false"));
@@ -1148,13 +1148,13 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
}
/* Null encode/decode */
-static zval *to_zval_null(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_null(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
return ret;
}
-static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1166,7 +1166,7 @@ static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNode
return ret;
}
-static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
+static void set_zval_property(zval* object, char* name, zval* val)
{
zend_class_entry *old_scope;
@@ -1177,7 +1177,7 @@ static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
EG(scope) = old_scope;
}
-static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
+static zval* get_zval_property(zval* object, char* name, zval *rv)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
zval member;
@@ -1187,12 +1187,12 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
ZVAL_STRING(&member, name);
old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(object);
- data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS, NULL, rv TSRMLS_CC);
+ data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS, NULL, rv);
if (data == &EG(uninitialized_zval)) {
/* Hack for bug #32455 */
zend_property_info *property_info;
- property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
+ property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1);
EG(scope) = old_scope;
if (property_info != ZEND_WRONG_PROPERTY_INFO && property_info &&
zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
@@ -1215,7 +1215,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
return NULL;
}
-static void unset_zval_property(zval* object, char* name TSRMLS_DC)
+static void unset_zval_property(zval* object, char* name)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
zval member;
@@ -1224,7 +1224,7 @@ static void unset_zval_property(zval* object, char* name TSRMLS_DC)
ZVAL_STRING(&member, name);
old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(object);
- Z_OBJ_HT_P(object)->unset_property(object, &member, NULL TSRMLS_CC);
+ Z_OBJ_HT_P(object)->unset_property(object, &member, NULL);
EG(scope) = old_scope;
zval_ptr_dtor(&member);
} else if (Z_TYPE_P(object) == IS_ARRAY) {
@@ -1232,17 +1232,17 @@ static void unset_zval_property(zval* object, char* name TSRMLS_DC)
}
}
-static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
+static void model_to_zval_any(zval *ret, xmlNodePtr node)
{
zval rv, arr, val;
zval* any = NULL;
char* name = NULL;
while (node != NULL) {
- if (get_zval_property(ret, (char*)node->name, &rv TSRMLS_CC) == NULL) {
+ if (get_zval_property(ret, (char*)node->name, &rv) == NULL) {
ZVAL_NULL(&val);
- master_to_zval(&val, get_conversion(XSD_ANYXML), node TSRMLS_CC);
+ master_to_zval(&val, get_conversion(XSD_ANYXML), node);
if (any && Z_TYPE_P(any) != IS_ARRAY) {
/* Convert into array */
@@ -1261,7 +1261,7 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
zval val2;
ZVAL_NULL(&val2);
- master_to_zval(&val2, get_conversion(XSD_ANYXML), node->next TSRMLS_CC);
+ master_to_zval(&val2, get_conversion(XSD_ANYXML), node->next);
if (Z_TYPE(val2) != IS_STRING || *Z_STRVAL(val) != '<') {
break;
}
@@ -1307,11 +1307,11 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
node = node->next;
}
if (any) {
- set_zval_property(ret, name ? name : "any", any TSRMLS_CC);
+ set_zval_property(ret, name ? name : "any", any);
}
}
-static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl TSRMLS_DC)
+static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl)
{
switch (model->kind) {
case XSD_CONTENT_ELEMENT:
@@ -1328,19 +1328,19 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)r_node->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content);
}
- master_to_zval(&val, model->u.element->encode, r_node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, r_node);
} else if (model->u.element->fixed) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
- master_to_zval(&val, model->u.element->encode, r_node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, r_node);
}
if ((node = get_node(node->next, model->u.element->name)) != NULL) {
zval array;
@@ -1352,19 +1352,19 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
}
- master_to_zval(&val, model->u.element->encode, node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, node);
} else if (model->u.element->fixed) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
- master_to_zval(&val, model->u.element->encode, node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, node);
}
add_next_index_zval(&array, &val);
} while ((node = get_node(node->next, model->u.element->name)) != NULL);
@@ -1378,7 +1378,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
add_next_index_zval(&array, &val);
ZVAL_COPY_VALUE(&val, &array);
}
- set_zval_property(ret, model->u.element->name, &val TSRMLS_CC);
+ set_zval_property(ret, model->u.element->name, &val);
}
}
break;
@@ -1392,16 +1392,16 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (tmp->kind == XSD_CONTENT_ANY) {
any = tmp;
} else {
- model_to_zval_object(ret, tmp, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, tmp, data, sdl);
}
} ZEND_HASH_FOREACH_END();
if (any) {
- model_to_zval_any(ret, data->children TSRMLS_CC);
+ model_to_zval_any(ret, data->children);
}
break;
}
case XSD_CONTENT_GROUP:
- model_to_zval_object(ret, model->u.group->model, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, model->u.group->model, data, sdl);
break;
default:
break;
@@ -1409,7 +1409,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
}
/* Struct encode/decode */
-static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, zend_class_entry *pce TSRMLS_DC)
+static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, zend_class_entry *pce)
{
xmlNodePtr trav;
sdlPtr sdl;
@@ -1425,7 +1425,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
if ((classname = zend_hash_str_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL &&
Z_TYPE_P(classname) == IS_STRING &&
- (tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) {
+ (tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO)) != NULL) {
ce = tmp;
}
}
@@ -1446,21 +1446,21 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval base;
ZVAL_NULL(ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- master_to_zval_int(&base, enc, data TSRMLS_CC);
- set_zval_property(ret, "_", &base TSRMLS_CC);
+ master_to_zval_int(&base, enc, data);
+ set_zval_property(ret, "_", &base);
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
}
} else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
sdlType->encode &&
@@ -1471,7 +1471,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
CHECK_XML_NULL(data);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
@@ -1484,14 +1484,14 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
(sdlType->encode->details.sdl_type->encode == NULL ||
(sdlType->encode->details.sdl_type->encode->details.type != IS_ARRAY &&
sdlType->encode->details.sdl_type->encode->details.type != SOAP_ENC_ARRAY))) {
- to_zval_object_ex(ret, &sdlType->encode->details, data, ce TSRMLS_CC);
+ to_zval_object_ex(ret, &sdlType->encode->details, data, ce);
} else {
- master_to_zval_int(ret, sdlType->encode, data TSRMLS_CC);
+ master_to_zval_int(ret, sdlType->encode, data);
}
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
- redo_any = get_zval_property(ret, "any", &rv TSRMLS_CC);
+ redo_any = get_zval_property(ret, "any", &rv);
if (Z_TYPE_P(ret) == IS_OBJECT && ce != ZEND_STANDARD_CLASS_DEF_PTR) {
zend_object *zobj = Z_OBJ_P(ret);
zobj->ce = ce;
@@ -1500,32 +1500,32 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval base;
ZVAL_NULL(ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
- master_to_zval_int(&base, sdlType->encode, data TSRMLS_CC);
- set_zval_property(ret, "_", &base TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
+ master_to_zval_int(&base, sdlType->encode, data);
+ set_zval_property(ret, "_", &base);
}
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
}
if (sdlType->model) {
- model_to_zval_object(ret, sdlType->model, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, sdlType->model, data, sdl);
if (redo_any) {
- if (!get_zval_property(ret, "any", &rv TSRMLS_CC)) {
- model_to_zval_any(ret, data->children TSRMLS_CC);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ if (!get_zval_property(ret, "any", &rv)) {
+ model_to_zval_any(ret, data->children);
+ soap_add_xml_ref(ret, data);
} else {
- unset_zval_property(ret, "any" TSRMLS_CC);
+ unset_zval_property(ret, "any");
}
}
}
@@ -1555,9 +1555,9 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
text = xmlNewText(BAD_CAST(str_val));
xmlAddChild(dummy, text);
ZVAL_NULL(&data);
- master_to_zval(&data, attr->encode, dummy TSRMLS_CC);
+ master_to_zval(&data, attr->encode, dummy);
xmlFreeNode(dummy);
- set_zval_property(ret, attr->name, &data TSRMLS_CC);
+ set_zval_property(ret, attr->name, &data);
}
}
} ZEND_HASH_FOREACH_END();
@@ -1565,12 +1565,12 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
trav = data->children;
while (trav != NULL) {
@@ -1579,18 +1579,18 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval *prop;
ZVAL_NULL(&tmpVal);
- master_to_zval(&tmpVal, NULL, trav TSRMLS_CC);
+ master_to_zval(&tmpVal, NULL, trav);
- prop = get_zval_property(ret, (char*)trav->name, &rv TSRMLS_CC);
+ prop = get_zval_property(ret, (char*)trav->name, &rv);
if (!prop) {
if (!trav->next || !get_node(trav->next, (char*)trav->name)) {
- set_zval_property(ret, (char*)trav->name, &tmpVal TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &tmpVal);
} else {
zval arr;
array_init(&arr);
add_next_index_zval(&arr, &tmpVal);
- set_zval_property(ret, (char*)trav->name, &arr TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &arr);
}
} else {
/* Property already exist - make array */
@@ -1599,7 +1599,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
array_init(&arr);
Z_ADDREF_P(prop);
add_next_index_zval(&arr, prop);
- set_zval_property(ret, (char*)trav->name, &arr TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &arr);
prop = &arr;
}
/* Add array element */
@@ -1612,13 +1612,13 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
return ret;
}
-static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
- return to_zval_object_ex(ret, type, data, NULL TSRMLS_CC);
+ return to_zval_object_ex(ret, type, data, NULL);
}
-static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict TSRMLS_DC)
+static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict)
{
switch (model->kind) {
case XSD_CONTENT_ELEMENT: {
@@ -1627,7 +1627,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
encodePtr enc;
zval rv;
- data = get_zval_property(object, model->u.element->name, &rv TSRMLS_CC);
+ data = get_zval_property(object, model->u.element->name, &rv);
if (data &&
Z_TYPE_P(data) == IS_NULL &&
!model->u.element->nillable &&
@@ -1649,7 +1649,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
xmlAddChild(node, property);
set_xsi_nil(property);
} else {
- property = master_to_xml(enc, val, style, node TSRMLS_CC);
+ property = master_to_xml(enc, val, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
@@ -1671,7 +1671,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
} else if (Z_TYPE_P(data) == IS_NULL && model->min_occurs == 0) {
return 1;
} else {
- property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ property = master_to_xml(enc, data, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
@@ -1712,7 +1712,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
encodePtr enc;
zval rv;
- data = get_zval_property(object, "any", &rv TSRMLS_CC);
+ data = get_zval_property(object, "any", &rv);
if (data) {
enc = get_conversion(XSD_ANYXML);
if ((model->max_occurs == -1 || model->max_occurs > 1) &&
@@ -1722,10 +1722,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zval *val;
ZEND_HASH_FOREACH_VAL(ht, val) {
- master_to_xml(enc, val, style, node TSRMLS_CC);
+ master_to_xml(enc, val, style, node);
} ZEND_HASH_FOREACH_END();
} else {
- master_to_xml(enc, data, style, node TSRMLS_CC);
+ master_to_xml(enc, data, style, node);
}
return 1;
} else if (model->min_occurs == 0) {
@@ -1743,7 +1743,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
sdlContentModelPtr tmp;
ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
- if (!model_to_xml_object(node, tmp, object, style, strict && (tmp->min_occurs > 0) TSRMLS_CC)) {
+ if (!model_to_xml_object(node, tmp, object, style, strict && (tmp->min_occurs > 0))) {
if (!strict || tmp->min_occurs > 0) {
return 0;
}
@@ -1757,7 +1757,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
int ret = 0;
ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
- int tmp_ret = model_to_xml_object(node, tmp, object, style, 0 TSRMLS_CC);
+ int tmp_ret = model_to_xml_object(node, tmp, object, style, 0);
if (tmp_ret == 1) {
return 1;
} else if (tmp_ret != 0) {
@@ -1767,7 +1767,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
return ret;
}
case XSD_CONTENT_GROUP: {
- return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
+ return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0);
}
default:
break;
@@ -1806,7 +1806,7 @@ static sdlTypePtr model_array_element(sdlContentModelPtr model)
return NULL;
}
-static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr xmlParam;
HashTable *prop = NULL;
@@ -1842,11 +1842,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
if (enc) {
zval rv;
- zval *tmp = get_zval_property(data, "_", &rv TSRMLS_CC);
+ zval *tmp = get_zval_property(data, "_", &rv);
if (tmp) {
- xmlParam = master_to_xml(enc, tmp, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, tmp, style, parent);
} else if (prop == NULL) {
- xmlParam = master_to_xml(enc, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, data, style, parent);
} else {
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
@@ -1863,16 +1863,16 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
if (prop) ZEND_HASH_INC_APPLY_COUNT(prop);
- xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent);
if (prop) ZEND_HASH_DEC_APPLY_COUNT(prop);
} else {
zval rv;
- zval *tmp = get_zval_property(data, "_", &rv TSRMLS_CC);
+ zval *tmp = get_zval_property(data, "_", &rv);
if (tmp) {
- xmlParam = master_to_xml(sdlType->encode, tmp, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, tmp, style, parent);
} else if (prop == NULL) {
- xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent);
} else {
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
@@ -1883,7 +1883,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlAddChild(parent, xmlParam);
}
- if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ if (soap_check_zval_ref(data, xmlParam)) {
return xmlParam;
}
if (prop != NULL) {
@@ -1903,7 +1903,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlAddChild(xmlParam, property);
set_xsi_nil(property);
} else {
- property = master_to_xml(array_el->encode, val, style, xmlParam TSRMLS_CC);
+ property = master_to_xml(array_el->encode, val, style, xmlParam);
}
xmlNodeSetName(property, BAD_CAST(array_el->name));
if (style == SOAP_LITERAL &&
@@ -1914,7 +1914,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
} ZEND_HASH_FOREACH_END();
} else if (sdlType->model) {
- model_to_xml_object(xmlParam, sdlType->model, data, style, 1 TSRMLS_CC);
+ model_to_xml_object(xmlParam, sdlType->model, data, style, 1);
}
if (sdlType->attributes) {
sdlAttributePtr attr;
@@ -1922,11 +1922,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
ZEND_HASH_FOREACH_PTR(sdlType->attributes, attr) {
if (attr->name) {
- zattr = get_zval_property(data, attr->name, &rv TSRMLS_CC);
+ zattr = get_zval_property(data, attr->name, &rv);
if (zattr) {
xmlNodePtr dummy;
- dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam TSRMLS_CC);
+ dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam);
if (dummy->children && dummy->children->content) {
if (attr->fixed && strcmp(attr->fixed, (char*)dummy->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content);
@@ -1958,7 +1958,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
- if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ if (soap_check_zval_ref(data, xmlParam)) {
return xmlParam;
}
if (prop != NULL) {
@@ -1968,7 +1968,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(prop, str_key, zprop) {
- property = master_to_xml(get_conversion(Z_TYPE_P(zprop)), zprop, style, xmlParam TSRMLS_CC);
+ property = master_to_xml(get_conversion(Z_TYPE_P(zprop)), zprop, style, xmlParam);
if (str_key) {
const char *prop_name;
@@ -1994,7 +1994,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
/* Array encode/decode */
-static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
encodePtr enc = NULL;
@@ -2009,7 +2009,7 @@ static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xml
enc = get_conversion(IS_NULL);
}
- return master_to_xml(enc, data, style, parent TSRMLS_CC);
+ return master_to_xml(enc, data, style, parent);
}
static int calc_dimension_12(const char* str)
@@ -2113,7 +2113,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
int* dims,
zval* data,
int style
- TSRMLS_DC)
+ )
{
int j = 0;
zval *zdata;
@@ -2126,9 +2126,9 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
}
if (dimension == 1) {
if (enc == NULL) {
- xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam TSRMLS_CC);
+ xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam);
} else {
- xparam = master_to_xml(enc, zdata, style, xmlParam TSRMLS_CC);
+ xparam = master_to_xml(enc, zdata, style, xmlParam);
}
if (type) {
@@ -2140,7 +2140,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style);
}
j++;
} ZEND_HASH_FOREACH_END();
@@ -2163,7 +2163,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
}
} else {
while (j < dims[0]) {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
j++;
}
}
@@ -2183,7 +2183,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
}
}
}
@@ -2200,7 +2200,7 @@ static inline int array_num_elements(HashTable* ht)
return 0;
}
-static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
sdlTypePtr sdl_type = type->sdl_type;
sdlTypePtr element_type = NULL;
@@ -2231,42 +2231,42 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
return xmlParam;
}
- if (Z_TYPE_P(data) == IS_OBJECT && instanceof_function(Z_OBJCE_P(data), zend_ce_traversable TSRMLS_CC)) {
+ if (Z_TYPE_P(data) == IS_OBJECT && instanceof_function(Z_OBJCE_P(data), zend_ce_traversable)) {
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(data);
zval *val;
array_init(&array_copy);
- iter = ce->get_iterator(ce, data, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, data, 0);
if (EG(exception)) {
goto iterator_done;
}
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (EG(exception)) {
goto iterator_done;
}
}
- while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ while (iter->funcs->valid(iter) == SUCCESS) {
if (EG(exception)) {
goto iterator_done;
}
- val = iter->funcs->get_current_data(iter TSRMLS_CC);
+ val = iter->funcs->get_current_data(iter);
if (EG(exception)) {
goto iterator_done;
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
goto iterator_done;
}
- array_set_zval_key(Z_ARRVAL(array_copy), &key, val TSRMLS_CC);
+ array_set_zval_key(Z_ARRVAL(array_copy), &key, val);
zval_ptr_dtor(val);
zval_dtor(&key);
} else {
@@ -2274,7 +2274,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
}
Z_ADDREF_P(val);
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (EG(exception)) {
goto iterator_done;
}
@@ -2401,7 +2401,7 @@ iterator_done:
enc = elementType->encode;
get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type);
} else {
- enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ enc = get_array_type(xmlParam, data, &array_type);
}
} else if (sdl_type && sdl_type->elements &&
zend_hash_num_elements(sdl_type->elements) == 1 &&
@@ -2419,7 +2419,7 @@ iterator_done:
dims[0] = i;
} else {
- enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ enc = get_array_type(xmlParam, data, &array_type);
smart_str_append_long(&array_size, i);
dims = safe_emalloc(sizeof(int), dimension, 0);
dims[0] = i;
@@ -2452,7 +2452,7 @@ iterator_done:
smart_str_free(&array_type);
smart_str_free(&array_size);
- add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style);
efree(dims);
}
if (style == SOAP_ENCODED) {
@@ -2468,7 +2468,7 @@ iterator_done:
return xmlParam;
}
-static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
xmlNodePtr trav;
encodePtr enc = NULL;
@@ -2625,7 +2625,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
xmlAttrPtr position = get_attribute(trav->properties,"position");
ZVAL_NULL(&tmpVal);
- master_to_zval(&tmpVal, enc, trav TSRMLS_CC);
+ master_to_zval(&tmpVal, enc, trav);
if (position != NULL && position->children && position->children->content) {
char* tmp = strrchr((char*)position->children->content, '[');
if (tmp == NULL) {
@@ -2674,7 +2674,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
}
/* Map encode/decode */
-static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
zval *temp_data;
zend_string *key_val;
@@ -2712,7 +2712,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
smart_str_free(&tmp);
}
- xparam = master_to_xml(get_conversion(Z_TYPE_P(temp_data)), temp_data, style, item TSRMLS_CC);
+ xparam = master_to_xml(get_conversion(Z_TYPE_P(temp_data)), temp_data, style, item);
xmlNodeSetName(xparam, BAD_CAST("value"));
} ZEND_HASH_FOREACH_END();
}
@@ -2723,7 +2723,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
return xmlParam;
}
-static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zval key, value;
xmlNodePtr trav, item, xmlKey, xmlValue;
@@ -2748,9 +2748,9 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
}
ZVAL_NULL(&key);
- master_to_zval(&key, NULL, xmlKey TSRMLS_CC);
+ master_to_zval(&key, NULL, xmlKey);
ZVAL_NULL(&value);
- master_to_zval(&value, NULL, xmlValue TSRMLS_CC);
+ master_to_zval(&value, NULL, xmlValue);
if (Z_TYPE(key) == IS_STRING) {
zend_symtable_update(Z_ARRVAL_P(ret), Z_STR(key), &value);
@@ -2769,7 +2769,7 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
}
/* Unknown encode/decode */
-static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
encodePtr enc;
xmlNodePtr ret;
@@ -2779,7 +2779,7 @@ static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, x
} else {
enc = get_conversion(IS_NULL);
}
- ret = master_to_xml_int(enc, data, style, parent, 0 TSRMLS_CC);
+ ret = master_to_xml_int(enc, data, style, parent, 0);
/*
if (style == SOAP_LITERAL && SOAP_GLOBAL(sdl)) {
set_ns_and_type(ret, &enc->details);
@@ -2788,7 +2788,7 @@ static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, x
return ret;
}
-static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
encodePtr enc = NULL;
xmlAttrPtr tmpattr;
@@ -2845,7 +2845,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data T
}
}
}
- master_to_zval_int(ret, enc, data TSRMLS_CC);
+ master_to_zval_int(ret, enc, data);
if (SOAP_GLOBAL(sdl) && type_name && enc->details.sdl_type) {
zval soapvar;
char *ns, *cptype;
@@ -2869,7 +2869,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data T
}
/* Time encode/decode */
-static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent)
{
/* logic hacked from ext/standard/datetime.c */
struct tm *ta, tmbuf;
@@ -2933,59 +2933,59 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
return xmlParam;
}
-static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
/* TODO: '-'?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?T([0-9]+H)?([0-9]+M)?([0-9]+S)? */
- return to_xml_string(type, data, style, parent TSRMLS_CC);
+ return to_xml_string(type, data, style, parent);
}
-static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent);
}
-static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
/* TODO: microsecconds */
- return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent);
}
-static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent);
}
-static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m", style, parent);
}
-static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y", style, parent);
}
-static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "--%m-%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "--%m-%d", style, parent);
}
-static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "---%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "---%d", style, parent);
}
-static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "--%m--", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "--%m--", style, parent);
}
-static zval* to_zval_list(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+static zval* to_zval_list(zval *ret, encodeTypePtr enc, xmlNodePtr data) {
/*FIXME*/
- return to_zval_stringc(ret, enc, data TSRMLS_CC);
+ return to_zval_stringc(ret, enc, data);
}
-static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
xmlNodePtr ret;
encodePtr list_enc = NULL;
@@ -3007,7 +3007,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
HashTable *ht = Z_ARRVAL_P(data);
ZEND_HASH_FOREACH_VAL(ht, tmp) {
- xmlNodePtr dummy = master_to_xml(list_enc, tmp, SOAP_LITERAL, ret TSRMLS_CC);
+ xmlNodePtr dummy = master_to_xml(list_enc, tmp, SOAP_LITERAL, ret);
if (dummy && dummy->children && dummy->children->content) {
if (list.s && list.s->len != 0) {
smart_str_appendc(&list, ' ');
@@ -3044,7 +3044,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
next++;
}
ZVAL_STRING(&dummy_zval, start);
- dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret TSRMLS_CC);
+ dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret);
zval_ptr_dtor(&dummy_zval);
if (dummy && dummy->children && dummy->children->content) {
if (list.s && list.s->len != 0) {
@@ -3068,22 +3068,22 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
return ret;
}
-static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
/*FIXME: minLength=1 */
- return to_xml_list(enc,data,style, parent TSRMLS_CC);
+ return to_xml_list(enc,data,style, parent);
}
-static zval* to_zval_union(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+static zval* to_zval_union(zval *ret, encodeTypePtr enc, xmlNodePtr data) {
/*FIXME*/
- return to_zval_list(ret, enc, data TSRMLS_CC);
+ return to_zval_list(ret, enc, data);
}
-static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
/*FIXME*/
- return to_xml_list(enc,data,style, parent TSRMLS_CC);
+ return to_xml_list(enc,data,style, parent);
}
-static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
xmlBufferPtr buf;
@@ -3101,7 +3101,7 @@ static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
if ((sdl_type = zend_hash_find_ptr(SOAP_GLOBAL(sdl)->elements, nscat.s)) != NULL &&
sdl_type->encode) {
smart_str_free(&nscat);
- return master_to_zval_int(ret, sdl_type->encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, sdl_type->encode, data);
}
smart_str_free(&nscat);
}
@@ -3113,7 +3113,7 @@ static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
return ret;
}
-static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret = NULL;
@@ -3123,7 +3123,7 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
zend_string *name;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(data), name, el) {
- ret = master_to_xml(enc, el, style, parent TSRMLS_CC);
+ ret = master_to_xml(enc, el, style, parent);
if (ret &&
ret->name != xmlStringTextNoenc) {
xmlNodeSetName(ret, BAD_CAST(name->val));
@@ -3154,13 +3154,13 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
return ret;
}
-zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC)
+zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data)
{
sdlTypePtr type;
type = enc->sdl_type;
if (type == NULL) {
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
/*FIXME: restriction support
if (type && type->restrictions &&
@@ -3194,31 +3194,31 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRML
switch (type->kind) {
case XSD_TYPEKIND_SIMPLE:
if (type->encode && enc != &type->encode->details) {
- return master_to_zval_int(ret, type->encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, type->encode, data);
} else {
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
break;
case XSD_TYPEKIND_LIST:
- return to_zval_list(ret, enc, data TSRMLS_CC);
+ return to_zval_list(ret, enc, data);
case XSD_TYPEKIND_UNION:
- return to_zval_union(ret, enc, data TSRMLS_CC);
+ return to_zval_union(ret, enc, data);
case XSD_TYPEKIND_COMPLEX:
case XSD_TYPEKIND_RESTRICTION:
case XSD_TYPEKIND_EXTENSION:
if (type->encode &&
(type->encode->details.type == IS_ARRAY ||
type->encode->details.type == SOAP_ENC_ARRAY)) {
- return to_zval_array(ret, enc, data TSRMLS_CC);
+ return to_zval_array(ret, enc, data);
}
- return to_zval_object(ret, enc, data TSRMLS_CC);
+ return to_zval_object(ret, enc, data);
default:
soap_error0(E_ERROR, "Encoding: Internal Error");
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
}
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent)
{
sdlTypePtr type;
xmlNodePtr ret = NULL;
@@ -3226,7 +3226,7 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
type = enc->sdl_type;
if (type == NULL) {
- ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ ret = guess_xml_convert(enc, data, style, parent);
if (style == SOAP_ENCODED) {
set_ns_and_type(ret, enc);
}
@@ -3258,16 +3258,16 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
switch(type->kind) {
case XSD_TYPEKIND_SIMPLE:
if (type->encode && enc != &type->encode->details) {
- ret = master_to_xml(type->encode, data, style, parent TSRMLS_CC);
+ ret = master_to_xml(type->encode, data, style, parent);
} else {
- ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ ret = guess_xml_convert(enc, data, style, parent);
}
break;
case XSD_TYPEKIND_LIST:
- ret = to_xml_list(enc, data, style, parent TSRMLS_CC);
+ ret = to_xml_list(enc, data, style, parent);
break;
case XSD_TYPEKIND_UNION:
- ret = to_xml_union(enc, data, style, parent TSRMLS_CC);
+ ret = to_xml_union(enc, data, style, parent);
break;
case XSD_TYPEKIND_COMPLEX:
case XSD_TYPEKIND_RESTRICTION:
@@ -3275,9 +3275,9 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
if (type->encode &&
(type->encode->details.type == IS_ARRAY ||
type->encode->details.type == SOAP_ENC_ARRAY)) {
- return to_xml_array(enc, data, style, parent TSRMLS_CC);
+ return to_xml_array(enc, data, style, parent);
} else {
- return to_xml_object(enc, data, style, parent TSRMLS_CC);
+ return to_xml_object(enc, data, style, parent);
}
break;
default:
@@ -3401,8 +3401,7 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
}
if (xmlns == NULL) {
xmlChar* prefix;
- TSRMLS_FETCH();
-
+
if ((prefix = zend_hash_str_find_ptr(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns))) != NULL) {
xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), prefix);
} else {
@@ -3445,7 +3444,6 @@ static void set_xsi_type(xmlNodePtr node, char *type)
void encode_reset_ns()
{
- TSRMLS_FETCH();
SOAP_GLOBAL(cur_uniq_ns) = 0;
SOAP_GLOBAL(cur_uniq_ref) = 0;
if (SOAP_GLOBAL(ref_map)) {
@@ -3458,7 +3456,6 @@ void encode_reset_ns()
void encode_finish()
{
- TSRMLS_FETCH();
SOAP_GLOBAL(cur_uniq_ns) = 0;
SOAP_GLOBAL(cur_uniq_ref) = 0;
if (SOAP_GLOBAL(ref_map)) {
@@ -3471,7 +3468,6 @@ void encode_finish()
encodePtr get_conversion(int encode)
{
encodePtr enc;
- TSRMLS_FETCH();
if ((enc = zend_hash_index_find_ptr(&SOAP_GLOBAL(defEncIndex), encode)) == NULL) {
soap_error0(E_ERROR, "Encoding: Cannot find encoding");
@@ -3496,7 +3492,7 @@ static int is_map(zval *array)
return FALSE;
}
-static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TSRMLS_DC)
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type)
{
HashTable *ht;
int i, cur_type, prev_type, different;
@@ -3598,7 +3594,6 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret)
{
- TSRMLS_FETCH();
if (ns) {
xmlNsPtr xmlns;
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index 4424116524..a8cc71a6f1 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -183,23 +183,23 @@ struct _encodeType {
struct _encode {
encodeType details;
- zval *(*to_zval)(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
- xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+ zval *(*to_zval)(zval *ret, encodeTypePtr type, xmlNodePtr data);
+ xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
};
/* Master functions all encode/decode should be called thur these functions */
-xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC);
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent);
+zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data);
/* user defined mapping */
-xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC);
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node);
void whiteSpace_replace(xmlChar* str);
void whiteSpace_collapse(xmlChar* str);
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC);
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent);
+zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data);
void encode_finish();
void encode_reset_ns();
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index a1cee555a8..1bf0c8fe0f 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -25,14 +25,14 @@
#include "ext/standard/php_rand.h"
static char *get_http_header_value(char *headers, char *type);
-static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC);
-static zend_string *get_http_headers(php_stream *socketd TSRMLS_DC);
+static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size);
+static zend_string *get_http_headers(php_stream *socketd);
#define smart_str_append_const(str, const) \
smart_str_appendl(str,const,sizeof(const)-1)
/* Proxy HTTP Authentication */
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login, *password;
@@ -58,7 +58,7 @@ int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
}
/* HTTP Authentication */
-int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+int basic_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login, *password;
@@ -89,7 +89,7 @@ void http_context_headers(php_stream_context* context,
zend_bool has_authorization,
zend_bool has_proxy_authorization,
zend_bool has_cookies,
- smart_str* soap_headers TSRMLS_DC)
+ smart_str* soap_headers)
{
zval *tmp;
@@ -154,7 +154,7 @@ void http_context_headers(php_stream_context* context,
}
}
-static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, php_stream_context *context, int *use_proxy TSRMLS_DC)
+static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, php_stream_context *context, int *use_proxy)
{
php_stream *stream;
zval *proxy_host, *proxy_port, *tmp;
@@ -249,7 +249,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str_append_unsigned(&soap_headers, phpurl->port);
}
smart_str_append_const(&soap_headers, "\r\n");
- proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ proxy_authentication(this_ptr, &soap_headers);
smart_str_append_const(&soap_headers, "\r\n");
if (php_stream_write(stream, soap_headers.s->val, soap_headers.s->len) != soap_headers.s->len) {
php_stream_close(stream);
@@ -258,7 +258,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str_free(&soap_headers);
if (stream) {
- zend_string *http_headers = get_http_headers(stream TSRMLS_CC);
+ zend_string *http_headers = get_http_headers(stream);
if (http_headers) {
zend_string_free(http_headers);
} else {
@@ -295,8 +295,8 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
break;
}
}
- if (php_stream_xport_crypto_setup(stream, crypto_method, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
+ if (php_stream_xport_crypto_setup(stream, crypto_method, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
php_stream_close(stream);
stream = NULL;
}
@@ -328,7 +328,7 @@ int make_http_soap_request(zval *this_ptr,
char *location,
char *soapaction,
int soap_version,
- zval *return_value TSRMLS_DC)
+ zval *return_value)
{
char *request;
smart_str soap_headers = {0};
@@ -389,7 +389,7 @@ int make_http_soap_request(zval *this_ptr,
smart_str_append_const(&soap_headers_z,"Content-Encoding: gzip\r\n");
ZVAL_LONG(&params[2], 0x1f);
}
- if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS &&
+ if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, n, params) == SUCCESS &&
Z_TYPE(retval) == IS_STRING) {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
@@ -436,7 +436,7 @@ try_again:
if (phpurl == NULL || phpurl->host == NULL) {
if (phpurl != NULL) {php_url_free(phpurl);}
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -447,17 +447,17 @@ try_again:
} else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
old_allow_url_fopen = PG(allow_url_fopen);
PG(allow_url_fopen) = 1;
- if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) {
+ if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY) == NULL) {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
return FALSE;
@@ -471,7 +471,7 @@ try_again:
if (stream != NULL) {
php_url *orig;
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1)) != NULL &&
- (orig = (php_url *) zend_fetch_resource(tmp TSRMLS_CC, -1, "httpurl", NULL, 1, le_url)) != NULL &&
+ (orig = (php_url *) zend_fetch_resource(tmp, -1, "httpurl", NULL, 1, le_url)) != NULL &&
((use_proxy && !use_ssl) ||
(((use_ssl && orig->scheme != NULL && strcmp(orig->scheme, "https") == 0) ||
(!use_ssl && orig->scheme == NULL) ||
@@ -499,7 +499,7 @@ try_again:
}
if (!stream) {
- stream = http_connect(this_ptr, phpurl, use_ssl, context, &use_proxy TSRMLS_CC);
+ stream = http_connect(this_ptr, phpurl, use_ssl, context, &use_proxy);
if (stream) {
php_stream_auto_cleanup(stream);
add_property_resource(this_ptr, "httpsocket", stream->res);
@@ -507,7 +507,7 @@ try_again:
} else {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
return FALSE;
@@ -517,7 +517,7 @@ try_again:
if (stream) {
zval *cookies, *login, *password;
- zend_resource *ret = zend_register_resource(NULL, phpurl, le_url TSRMLS_CC);
+ zend_resource *ret = zend_register_resource(NULL, phpurl, le_url);
add_property_resource(this_ptr, "httpurl", ret);
/*zend_list_addref(ret);*/
@@ -630,7 +630,7 @@ try_again:
unsigned char hash[16];
PHP_MD5Init(&md5ctx);
- snprintf(cnonce, sizeof(cnonce), ZEND_LONG_FMT, php_rand(TSRMLS_C));
+ snprintf(cnonce, sizeof(cnonce), ZEND_LONG_FMT, php_rand());
PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
PHP_MD5Final(hash, &md5ctx);
make_digest(cnonce, hash);
@@ -793,7 +793,7 @@ try_again:
/* Proxy HTTP Authentication */
if (use_proxy && !use_ssl) {
- has_proxy_authorization = proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ has_proxy_authorization = proxy_authentication(this_ptr, &soap_headers);
}
/* Send cookies along with request */
@@ -835,7 +835,7 @@ try_again:
}
}
- http_context_headers(context, has_authorization, has_proxy_authorization, has_cookies, &soap_headers TSRMLS_CC);
+ http_context_headers(context, has_authorization, has_proxy_authorization, has_cookies, &soap_headers);
smart_str_append_const(&soap_headers, "\r\n");
smart_str_0(&soap_headers);
@@ -853,13 +853,13 @@ try_again:
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
smart_str_free(&soap_headers);
} else {
- add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -873,13 +873,13 @@ try_again:
}
do {
- http_headers = get_http_headers(stream TSRMLS_CC);
+ http_headers = get_http_headers(stream);
if (!http_headers) {
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -1044,13 +1044,13 @@ try_again:
}
}
- if (!get_http_body(stream, http_close, http_headers->val, &http_body, &http_body_size TSRMLS_CC)) {
+ if (!get_http_body(stream, http_close, http_headers->val, &http_body, &http_body_size)) {
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_string_release(http_headers);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL);
if (http_msg) {
efree(http_msg);
}
@@ -1106,7 +1106,7 @@ try_again:
phpurl = new_url;
if (--redirect_max < 1) {
- add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -1170,7 +1170,7 @@ try_again:
php_url *new_url = emalloc(sizeof(php_url));
Z_DELREF(digest);
- add_property_zval_ex(this_ptr, "_digest", sizeof("_digest")-1, &digest TSRMLS_CC);
+ add_property_zval_ex(this_ptr, "_digest", sizeof("_digest")-1, &digest);
*new_url = *phpurl;
if (phpurl->scheme) phpurl->scheme = estrdup(phpurl->scheme);
@@ -1212,7 +1212,7 @@ try_again:
zval *err;
MAKE_STD_ZVAL(err);
ZVAL_STRINGL(err, http_body, http_body_size, 1);
- add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err);
efree(content_type);
zend_string_release(http_headers);
efree(http_body);
@@ -1246,10 +1246,10 @@ try_again:
if (http_msg) {
efree(http_msg);
}
- add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL);
return FALSE;
}
- if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS &&
+ if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, 1, params) == SUCCESS &&
Z_TYPE(retval) == IS_STRING) {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
@@ -1261,7 +1261,7 @@ try_again:
efree(content_encoding);
zend_string_release(http_headers);
efree(http_body);
- add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL);
if (http_msg) {
efree(http_msg);
}
@@ -1299,7 +1299,7 @@ try_again:
if (error) {
zval_ptr_dtor(return_value);
ZVAL_UNDEF(return_value);
- add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL);
efree(http_msg);
return FALSE;
}
@@ -1350,7 +1350,7 @@ static char *get_http_header_value(char *headers, char *type)
return NULL;
}
-static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size TSRMLS_DC)
+static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size)
{
char *header, *http_buf = NULL;
int header_close = close, header_chunked = 0, header_length = 0, http_buf_size = 0;
@@ -1484,7 +1484,7 @@ static int get_http_body(php_stream *stream, int close, char *headers, char **r
return TRUE;
}
-static zend_string *get_http_headers(php_stream *stream TSRMLS_DC)
+static zend_string *get_http_headers(php_stream *stream)
{
smart_str tmp_response = {0};
char headerbuf[8192];
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
index b752641b1b..03007f70f0 100644
--- a/ext/soap/php_http.h
+++ b/ext/soap/php_http.h
@@ -28,13 +28,13 @@ int make_http_soap_request(zval *this_ptr,
char *location,
char *soapaction,
int soap_version,
- zval *response TSRMLS_DC);
+ zval *response);
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
-int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers);
+int basic_authentication(zval* this_ptr, smart_str* soap_headers);
void http_context_headers(php_stream_context* context,
zend_bool has_authorization,
zend_bool has_proxy_authorization,
zend_bool has_cookies,
- smart_str* soap_headers TSRMLS_DC);
+ smart_str* soap_headers);
#endif
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 52fa71d4e0..074c9819eb 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -22,7 +22,7 @@
#include "php_soap.h"
/* SOAP client calls this function to parse response from SOAP server */
-int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC)
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers)
{
char* envelope_ns = NULL;
xmlDocPtr response;
@@ -43,11 +43,11 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
response = soap_xmlParseMemory(buffer, buffer_size);
if (!response) {
- add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL);
return FALSE;
}
if (xmlGetIntSubset(response) != NULL) {
- add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -66,7 +66,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
soap_version = SOAP_1_2;
} else {
- add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -74,7 +74,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
trav = trav->next;
}
if (env == NULL) {
- add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -82,16 +82,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -123,7 +123,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
trav = trav->next;
}
if (body == NULL) {
- add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -131,17 +131,17 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
while (attr != NULL) {
if (attr->ns == NULL) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -149,7 +149,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = attr->next;
}
if (trav != NULL && soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -158,16 +158,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -194,20 +194,20 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = get_node(fault->children, "faultstring");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultstring = Z_STR(zv);
}
tmp = get_node(fault->children, "faultactor");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultactor = Z_STR(zv);
}
tmp = get_node(fault->children, "detail");
if (tmp != NULL) {
- master_to_zval(&details, NULL, tmp TSRMLS_CC);
+ master_to_zval(&details, NULL, tmp);
}
} else {
tmp = get_node(fault->children, "Code");
@@ -224,17 +224,17 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = get_node(tmp->children,"Text");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultstring = Z_STR(zv);
}
}
tmp = get_node(fault->children,"Detail");
if (tmp != NULL) {
- master_to_zval(&details, NULL, tmp TSRMLS_CC);
+ master_to_zval(&details, NULL, tmp);
}
}
- add_soap_fault(this_ptr, faultcode, faultstring ? faultstring->val : NULL, faultactor ? faultactor->val : NULL, &details TSRMLS_CC);
+ add_soap_fault(this_ptr, faultcode, faultstring ? faultstring->val : NULL, faultactor ? faultactor->val : NULL, &details);
if (faultstring) {
zend_string_release(faultstring);
}
@@ -317,16 +317,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
/* TODO: may be "nil" is not OK? */
ZVAL_NULL(&tmp);
/*
- add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
*/
} else {
/* Decoding value of parameter */
if (param != NULL) {
- master_to_zval(&tmp, param->encode, val TSRMLS_CC);
+ master_to_zval(&tmp, param->encode, val);
} else {
- master_to_zval(&tmp, NULL, val TSRMLS_CC);
+ master_to_zval(&tmp, NULL, val);
}
}
add_assoc_zval(return_value, param->paramName, &tmp);
@@ -347,7 +347,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
zval tmp;
zval *arr;
- master_to_zval(&tmp, NULL, val TSRMLS_CC);
+ master_to_zval(&tmp, NULL, val);
if (val->name) {
if ((arr = zend_hash_str_find(Z_ARRVAL_P(return_value), (char*)val->name, strlen((char*)val->name))) != NULL) {
add_next_index_zval(arr, &tmp);
@@ -412,7 +412,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
}
smart_str_free(&key);
}
- master_to_zval(&val, enc, trav TSRMLS_CC);
+ master_to_zval(&val, enc, trav);
add_assoc_zval(soap_headers, (char*)trav->name, &val);
}
trav = trav->next;
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index 632470f255..cabfe1a07e 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -22,6 +22,6 @@
#ifndef PHP_PACKET_SOAP_H
#define PHP_PACKET_SOAP_H
-int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC);
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers);
#endif
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index b5aa5f21c2..9eecd35548 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -95,16 +95,16 @@ static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlCh
return enc;
}
-static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) {
+static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import) {
if (location != NULL &&
!zend_hash_str_exists(&ctx->docs, (char*)location, xmlStrlen(location))) {
xmlDocPtr doc;
xmlNodePtr schema;
xmlAttrPtr new_tns;
- sdl_set_uri_credentials(ctx, (char*)location TSRMLS_CC);
- doc = soap_xmlParseFile((char*)location TSRMLS_CC);
- sdl_restore_uri_credentials(ctx TSRMLS_CC);
+ sdl_set_uri_credentials(ctx, (char*)location);
+ doc = soap_xmlParseFile((char*)location);
+ sdl_restore_uri_credentials(ctx);
if (doc == NULL) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
@@ -136,7 +136,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
}
}
zend_hash_str_add_ptr(&ctx->docs, (char*)location, xmlStrlen(location), doc);
- load_schema(ctx, schema TSRMLS_CC);
+ load_schema(ctx, schema);
}
}
@@ -160,7 +160,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*)
</schema>
*/
-int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
+int load_schema(sdlCtx *ctx, xmlNodePtr schema)
{
xmlNodePtr trav;
xmlAttrPtr tns;
@@ -202,7 +202,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ schema_load_file(ctx, NULL, uri, tns, 0);
xmlFree(uri);
}
@@ -222,7 +222,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ schema_load_file(ctx, NULL, uri, tns, 0);
xmlFree(uri);
/* TODO: <redefine> support */
}
@@ -251,7 +251,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
xmlFree(base);
}
}
- schema_load_file(ctx, ns, uri, tns, 1 TSRMLS_CC);
+ schema_load_file(ctx, ns, uri, tns, 1);
if (uri != NULL) {xmlFree(uri);}
} else if (node_is_equal(trav,"annotation")) {
/* TODO: <annotation> support */
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
index 55595f2ad8..0a1ff0da58 100644
--- a/ext/soap/php_schema.h
+++ b/ext/soap/php_schema.h
@@ -22,7 +22,7 @@
#ifndef PHP_SCHEMA_H
#define PHP_SCHEMA_H
-int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC);
+int load_schema(sdlCtx *ctx, xmlNodePtr schema);
void schema_pass2(sdlCtx *ctx);
void delete_model(zval *zv);
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 798c06fdd2..f970958b4f 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -168,7 +168,6 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len)
{
encodePtr enc;
- TSRMLS_FETCH();
if ((enc = zend_hash_str_find_ptr(&SOAP_GLOBAL(defEnc), (char*)nscat, len)) != NULL) {
return enc;
@@ -225,7 +224,7 @@ static int is_wsdl_element(xmlNodePtr node)
return 1;
}
-void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri)
{
char *s;
int l1, l2;
@@ -277,8 +276,8 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
}
if (l1 != l2 || memcmp(ctx->sdl->source, uri, l1) != 0) {
/* another server. clear authentication credentals */
- php_libxml_switch_context(NULL, &context TSRMLS_CC);
- php_libxml_switch_context(&context, NULL TSRMLS_CC);
+ php_libxml_switch_context(NULL, &context);
+ php_libxml_switch_context(&context, NULL);
if (Z_TYPE(context) != IS_UNDEF) {
zval *context_ptr = &context;
ctx->context = php_stream_context_from_zval(context_ptr, 1);
@@ -305,7 +304,7 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
}
}
-void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC)
+void sdl_restore_uri_credentials(sdlCtx *ctx)
{
if (Z_TYPE(ctx->old_header) != IS_UNDEF) {
php_stream_context_set_option(ctx->context, "http", "header", &ctx->old_header);
@@ -315,7 +314,7 @@ void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC)
ctx->context = NULL;
}
-static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC)
+static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
{
sdlPtr tmpsdl = ctx->sdl;
xmlDocPtr wsdl;
@@ -326,9 +325,9 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
return;
}
- sdl_set_uri_credentials(ctx, struri TSRMLS_CC);
- wsdl = soap_xmlParseFile(struri TSRMLS_CC);
- sdl_restore_uri_credentials(ctx TSRMLS_CC);
+ sdl_set_uri_credentials(ctx, struri);
+ wsdl = soap_xmlParseFile(struri);
+ sdl_restore_uri_credentials(ctx);
if (!wsdl) {
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
@@ -348,7 +347,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
if (include) {
xmlNodePtr schema = get_node_ex(root, "schema", XSD_NAMESPACE);
if (schema) {
- load_schema(ctx, schema TSRMLS_CC);
+ load_schema(ctx, schema);
return;
}
}
@@ -374,7 +373,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
while (trav2 != NULL) {
if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) {
- load_schema(ctx, trav2 TSRMLS_CC);
+ load_schema(ctx, trav2);
} else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
@@ -393,7 +392,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
uri = xmlBuildURI(tmp->children->content, base);
xmlFree(base);
}
- load_wsdl_ex(this_ptr, (char*)uri, ctx, 1 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, (char*)uri, ctx, 1);
xmlFree(uri);
}
@@ -722,7 +721,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
return parameters;
}
-static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
+static sdlPtr load_wsdl(zval *this_ptr, char *struri)
{
sdlCtx ctx;
int i,n;
@@ -739,7 +738,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
zend_hash_init(&ctx.portTypes, 0, NULL, NULL, 0);
zend_hash_init(&ctx.services, 0, NULL, NULL, 0);
- load_wsdl_ex(this_ptr, struri,&ctx, 0 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, struri,&ctx, 0);
schema_pass2(&ctx);
n = zend_hash_num_elements(&ctx.services);
@@ -1523,7 +1522,7 @@ static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *ty
return ht;
}
-static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached TSRMLS_DC)
+static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached)
{
sdlPtr sdl;
time_t old_t;
@@ -2094,7 +2093,7 @@ static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTabl
}
}
-static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl TSRMLS_DC)
+static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl)
{
smart_str buf = {0};
smart_str *out = &buf;
@@ -2917,7 +2916,7 @@ static sdlFunctionPtr make_persistent_sdl_function(sdlFunctionPtr func, HashTabl
return pfunc;
}
-static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
+static sdlPtr make_persistent_sdl(sdlPtr sdl)
{
sdlPtr psdl = NULL;
HashTable ptr_map;
@@ -3151,7 +3150,7 @@ static void delete_psdl(zval *zv)
free(Z_PTR_P(zv));
}
-sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
+sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
{
char fn[MAXPATHLEN];
sdlPtr sdl = NULL;
@@ -3196,7 +3195,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
unsigned char digest[16];
int len = strlen(SOAP_GLOBAL(cache_dir));
time_t cached;
- char *user = php_get_current_user(TSRMLS_C);
+ char *user = php_get_current_user();
int user_len = user ? strlen(user) + 1 : 0;
md5str[0] = '\0';
@@ -3215,7 +3214,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
}
memcpy(key+len,md5str,sizeof(md5str));
- if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached TSRMLS_CC)) != NULL) {
+ if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached)) != NULL) {
t = cached;
efree(key);
goto cache_in_memory;
@@ -3226,7 +3225,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
"_stream_context", sizeof("_stream_context")-1))) {
context = php_stream_context_from_zval(tmp, 0);
} else {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent")-1)) != NULL &&
@@ -3253,7 +3252,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
ZVAL_NEW_STR(&str_proxy, proxy.s);
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "http", "proxy", &str_proxy);
zval_ptr_dtor(&str_proxy);
@@ -3264,10 +3263,10 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
php_stream_context_set_option(context, "http", "request_fulluri", &str_proxy);
}
- has_proxy_authorization = proxy_authentication(this_ptr, &headers TSRMLS_CC);
+ has_proxy_authorization = proxy_authentication(this_ptr, &headers);
}
- has_authorization = basic_authentication(this_ptr, &headers TSRMLS_CC);
+ has_authorization = basic_authentication(this_ptr, &headers);
/* Use HTTP/1.1 with "Connection: close" by default */
if ((tmp = php_stream_context_get_option(context, "http", "protocol_version")) == NULL) {
@@ -3282,9 +3281,9 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
zval str_headers;
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
} else {
- http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers TSRMLS_CC);
+ http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers);
}
smart_str_0(&headers);
@@ -3295,12 +3294,12 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
if (context) {
php_stream_context_to_zval(context, &new_context);
- php_libxml_switch_context(&new_context, &orig_context TSRMLS_CC);
+ php_libxml_switch_context(&new_context, &orig_context);
}
SOAP_GLOBAL(error_code) = "WSDL";
- sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
+ sdl = load_wsdl(this_ptr, uri);
if (sdl) {
sdl->is_persistent = 0;
}
@@ -3308,13 +3307,13 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
SOAP_GLOBAL(error_code) = old_error_code;
if (context) {
- php_libxml_switch_context(&orig_context, NULL TSRMLS_CC);
+ php_libxml_switch_context(&orig_context, NULL);
zval_ptr_dtor(&new_context);
}
if ((cache_wsdl & WSDL_CACHE_DISK) && key) {
if (sdl) {
- add_sdl_to_cache(key, uri, t, sdl TSRMLS_CC);
+ add_sdl_to_cache(key, uri, t, sdl);
}
efree(key);
}
@@ -3348,7 +3347,7 @@ cache_in_memory:
}
}
- psdl = make_persistent_sdl(sdl TSRMLS_CC);
+ psdl = make_persistent_sdl(sdl);
psdl->is_persistent = 1;
p.time = t;
p.sdl = psdl;
@@ -3360,7 +3359,7 @@ cache_in_memory:
/* and replace it with persistent one */
sdl = psdl;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to register persistent entry");
+ php_error_docref(NULL, E_WARNING, "Failed to register persistent entry");
/* clean up persistent sdl */
delete_psdl_int(&p);
/* keep non-persistent sdl and return it */
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index 9ecf40c067..37911a7bc5 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -254,7 +254,7 @@ struct _sdlAttribute {
};
-sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC);
+sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl);
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
@@ -266,7 +266,7 @@ sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
void delete_sdl(void *handle);
void delete_sdl_impl(void *handle);
-void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC);
-void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC);
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri);
+void sdl_restore_uri_credentials(sdlCtx *ctx);
#endif
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index f32555cd93..f998587994 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -193,14 +193,17 @@ extern zend_module_entry soap_module_entry;
ZEND_EXTERN_MODULE_GLOBALS(soap)
#ifdef ZTS
-# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
+# define SOAP_GLOBAL(v) ZEND_TSRMG(soap_globals_id, zend_soap_globals *, v)
+# ifdef COMPILE_DL_SOAP
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define SOAP_GLOBAL(v) (soap_globals.v)
#endif
extern zend_class_entry* soap_var_class_entry;
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
+void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
#define soap_error0(severity, format) \
php_error(severity, "SOAP-ERROR: " format)
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 5ad5548c40..de79c07a30 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -77,7 +77,7 @@ static void soap_Comment(void *ctx, const xmlChar *value)
{
}
-xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
+xmlDocPtr soap_xmlParseFile(const char *filename)
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
@@ -100,9 +100,9 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
ctxt->sax->warning = NULL;
ctxt->sax->error = NULL;
/*ctxt->sax->fatalError = NULL;*/
- old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
- php_libxml_disable_entity_loader(old TSRMLS_CC);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
@@ -133,7 +133,6 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
- TSRMLS_FETCH();
/*
xmlInitParser();
@@ -150,9 +149,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
#if LIBXML_VERSION >= 20703
ctxt->options |= XML_PARSE_HUGE;
#endif
- old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
- php_libxml_disable_entity_loader(old TSRMLS_CC);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index 42d9dc9c6b..86cbf1b3ba 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -30,7 +30,7 @@
#define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
#define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
-xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC);
+xmlDocPtr soap_xmlParseFile(const char *filename);
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
xmlNsPtr attr_find_ns(xmlAttrPtr node);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 0e7d004564..1dac5b7143 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -49,21 +49,21 @@ typedef struct _soapHeader {
static void function_to_string(sdlFunctionPtr function, smart_str *buf);
static void type_to_string(sdlTypePtr type, smart_str *buf, int level);
-static void clear_soap_fault(zval *obj TSRMLS_DC);
-static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC);
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
-static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name TSRMLS_DC);
-static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr TSRMLS_DC);
+static void clear_soap_fault(zval *obj);
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name);
+static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name);
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr);
static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int);
static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name);
static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr node);
-static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers TSRMLS_DC);
-static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version TSRMLS_DC);
-static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC);
-static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC);
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers);
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version);
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers);
+static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent);
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent);
static void delete_service(void *service);
static void delete_url(void *handle);
@@ -105,7 +105,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
CG(in_compilation) = _old_in_compilation; \
EG(current_execute_data) = _old_current_execute_data; \
if (EG(exception) == NULL || \
- !instanceof_function(EG(exception)->ce, soap_fault_class_entry TSRMLS_CC)) {\
+ !instanceof_function(EG(exception)->ce, soap_fault_class_entry)) {\
_bailout = 1;\
}\
if (_old_stack_top != EG(vm_stack_top)) { \
@@ -139,18 +139,18 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
#define FIND_SDL_PROPERTY(ss,tmp) (tmp = zend_hash_str_find(Z_OBJPROP_P(ss), "sdl", sizeof("sdl")-1))
-#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp TSRMLS_CC, -1, "sdl", NULL, 1, le_sdl)
+#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp, -1, "sdl", NULL, 1, le_sdl)
#define FIND_TYPEMAP_PROPERTY(ss,tmp) (tmp = zend_hash_str_find(Z_OBJPROP_P(ss), "typemap", sizeof("typemap")-1))
-#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp TSRMLS_CC, -1, "typemap", NULL, 1, le_typemap)
+#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp, -1, "typemap", NULL, 1, le_typemap)
#define FETCH_THIS_SERVICE(ss) \
{ \
zval *tmp; \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(getThis()),"service", sizeof("service")-1)) != NULL) { \
- ss = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service); \
+ ss = (soapServicePtr)zend_fetch_resource(tmp, -1, "service", NULL, 1, le_service); \
} else { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch service object"); \
+ php_error_docref(NULL, E_WARNING, "Can not fetch service object"); \
SOAP_SERVER_END_CODE(); \
return; \
} \
@@ -466,6 +466,9 @@ zend_module_entry soap_module_entry = {
};
#ifdef COMPILE_DL_SOAP
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(soap)
#endif
@@ -506,12 +509,12 @@ static PHP_INI_MH(OnUpdateCacheDir)
p = new_value->val;
}
- if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
+ if (PG(open_basedir) && *p && php_check_open_basedir(p)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -571,7 +574,7 @@ static void php_soap_prepare_globals()
zend_hash_str_add_ptr(&defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1, SOAP_1_2_ENC_NS_PREFIX);
}
-static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC)
+static void php_soap_init_globals(zend_soap_globals *soap_globals)
{
soap_globals->defEnc = defEnc;
soap_globals->defEncIndex = defEncIndex;
@@ -602,6 +605,9 @@ PHP_MSHUTDOWN_FUNCTION(soap)
PHP_RINIT_FUNCTION(soap)
{
+#if defined(COMPILE_DL_SOAP) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
SOAP_GLOBAL(typemap) = NULL;
SOAP_GLOBAL(use_soap_error_handler) = 0;
SOAP_GLOBAL(error_code) = NULL;
@@ -615,22 +621,22 @@ PHP_RINIT_FUNCTION(soap)
return SUCCESS;
}
-static void delete_sdl_res(zend_resource *res TSRMLS_DC)
+static void delete_sdl_res(zend_resource *res)
{
delete_sdl(res->ptr);
}
-static void delete_url_res(zend_resource *res TSRMLS_DC)
+static void delete_url_res(zend_resource *res)
{
delete_url(res->ptr);
}
-static void delete_service_res(zend_resource *res TSRMLS_DC)
+static void delete_service_res(zend_resource *res)
{
delete_service(res->ptr);
}
-static void delete_hashtable_res(zend_resource *res TSRMLS_DC)
+static void delete_hashtable_res(zend_resource *res)
{
delete_hashtable(res->ptr);
}
@@ -639,6 +645,9 @@ PHP_MINIT_FUNCTION(soap)
{
zend_class_entry ce;
+#if defined(COMPILE_DL_SOAP) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
/* TODO: add ini entry for always use soap errors */
php_soap_prepare_globals();
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
@@ -662,26 +671,26 @@ PHP_MINIT_FUNCTION(soap)
INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions,
(zend_function *)&fe, NULL, NULL);
- soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_class_entry = zend_register_internal_class(&ce);
}
/* Register SoapVar class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, soap_var_functions);
- soap_var_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_var_class_entry = zend_register_internal_class(&ce);
/* Register SoapServer class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, soap_server_functions);
- soap_server_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_server_class_entry = zend_register_internal_class(&ce);
/* Register SoapFault class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
- soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
/* Register SoapParam class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
- soap_param_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_param_class_entry = zend_register_internal_class(&ce);
INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, soap_header_functions);
- soap_header_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_header_class_entry = zend_register_internal_class(&ce);
le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number);
le_url = zend_register_list_destructors_ex(delete_url_res, NULL, "SOAP URL", module_number);
@@ -811,11 +820,11 @@ PHP_METHOD(SoapParam, SoapParam)
size_t name_length;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &data, &name, &name_length) == FAILURE) {
return;
}
if (name_length == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter name");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter name");
return;
}
@@ -836,15 +845,15 @@ PHP_METHOD(SoapHeader, SoapHeader)
zend_bool must_understand = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
return;
}
if (ns_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid namespace");
+ php_error_docref(NULL, E_WARNING, "Invalid namespace");
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid header name");
+ php_error_docref(NULL, E_WARNING, "Invalid header name");
return;
}
@@ -864,7 +873,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
} else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) {
add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid actor");
+ php_error_docref(NULL, E_WARNING, "Invalid actor");
}
}
@@ -876,7 +885,7 @@ PHP_METHOD(SoapFault, SoapFault)
size_t fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
zval *code = NULL, *details = NULL, *headerfault = NULL, *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|s!z!s!z",
&code,
&fault_string, &fault_string_len,
&fault_actor, &fault_actor_len,
@@ -900,15 +909,15 @@ PHP_METHOD(SoapFault, SoapFault)
fault_code = Z_STRVAL_P(t_code);
fault_code_len = Z_STRLEN_P(t_code);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
if (fault_code != NULL && fault_code_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
if (name != NULL && name_len == 0) {
@@ -916,7 +925,7 @@ PHP_METHOD(SoapFault, SoapFault)
}
this_ptr = getThis();
- set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name TSRMLS_CC);
+ set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name);
if (headerfault != NULL) {
add_property_zval(this_ptr, "headerfault", headerfault);
}
@@ -938,10 +947,10 @@ PHP_METHOD(SoapFault, __toString)
}
this_ptr = getThis();
- faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC);
- faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1 TSRMLS_CC);
- file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1 TSRMLS_CC);
- line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1 TSRMLS_CC);
+ faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1);
+ faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1);
+ file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1);
+ line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1);
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(getThis())->function_table;
@@ -953,7 +962,7 @@ PHP_METHOD(SoapFault, __toString)
fci.params = NULL;
fci.no_separation = 1;
- zend_call_function(&fci, NULL TSRMLS_CC);
+ zend_call_function(&fci, NULL);
zval_ptr_dtor(&fci.function_name);
@@ -975,7 +984,7 @@ PHP_METHOD(SoapVar, SoapVar)
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
return;
}
@@ -986,7 +995,7 @@ PHP_METHOD(SoapVar, SoapVar)
if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) {
add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type ID");
+ php_error_docref(NULL, E_WARNING, "Invalid type ID");
return;
}
}
@@ -1010,7 +1019,7 @@ PHP_METHOD(SoapVar, SoapVar)
}
/* }}} */
-static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
+static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht)
{
zval *tmp;
HashTable *ht2;
@@ -1025,7 +1034,7 @@ static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
zend_string *name;
if (Z_TYPE_P(tmp) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong 'typemap' option");
+ php_error_docref(NULL, E_WARNING, "Wrong 'typemap' option");
return NULL;
}
ht2 = Z_ARRVAL_P(tmp);
@@ -1127,12 +1136,12 @@ PHP_METHOD(SoapServer, SoapServer)
SOAP_SERVER_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
service = emalloc(sizeof(soapService));
@@ -1150,7 +1159,7 @@ PHP_METHOD(SoapServer, SoapServer)
(Z_LVAL_P(tmp) == SOAP_1_1 || Z_LVAL_P(tmp) == SOAP_1_2)) {
version = Z_LVAL_P(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'soap_version' option must be SOAP_1_1 or SOAP_1_2");
+ php_error_docref(NULL, E_ERROR, "'soap_version' option must be SOAP_1_1 or SOAP_1_2");
}
}
@@ -1158,7 +1167,7 @@ PHP_METHOD(SoapServer, SoapServer)
Z_TYPE_P(tmp) == IS_STRING) {
service->uri = estrndup(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "actor", sizeof("actor")-1)) != NULL &&
@@ -1172,7 +1181,7 @@ PHP_METHOD(SoapServer, SoapServer)
encoding = xmlFindCharEncodingHandler(Z_STRVAL_P(tmp));
if (encoding == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
+ php_error_docref(NULL, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
} else {
service->encoding = encoding;
}
@@ -1211,7 +1220,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
service->version = version;
@@ -1221,7 +1230,7 @@ PHP_METHOD(SoapServer, SoapServer)
zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
if (Z_TYPE_P(wsdl) != IS_NULL) {
- service->sdl = get_sdl(getThis(), Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ service->sdl = get_sdl(getThis(), Z_STRVAL_P(wsdl), cache_wsdl);
if (service->uri == NULL) {
if (service->sdl->target_ns) {
service->uri = estrdup(service->sdl->target_ns);
@@ -1233,10 +1242,10 @@ PHP_METHOD(SoapServer, SoapServer)
}
if (typemap_ht) {
- service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
+ service->typemap = soap_create_typemap(service->sdl, typemap_ht);
}
- res = zend_register_resource(NULL, service, le_service TSRMLS_CC);
+ res = zend_register_resource(NULL, service, le_service);
add_property_resource(getThis(), "service", res);
SOAP_SERVER_END_CODE();
@@ -1255,17 +1264,17 @@ PHP_METHOD(SoapServer, setPersistence)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) != FAILURE) {
if (service->type == SOAP_CLASS) {
if (value == SOAP_PERSISTENCE_SESSION ||
value == SOAP_PERSISTENCE_REQUEST) {
service->soap_class.persistence = value;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
+ php_error_docref(NULL, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
+ php_error_docref(NULL, E_WARNING, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
return;
}
}
@@ -1289,11 +1298,11 @@ PHP_METHOD(SoapServer, setClass)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S*", &classname, &argv, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S*", &classname, &argv, &num_args) == FAILURE) {
return;
}
- ce = zend_lookup_class(classname TSRMLS_CC);
+ ce = zend_lookup_class(classname);
if (ce) {
service->type = SOAP_CLASS;
@@ -1309,7 +1318,7 @@ PHP_METHOD(SoapServer, setClass)
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existent class (%s)", classname->val);
+ php_error_docref(NULL, E_WARNING, "Tried to set a non existent class (%s)", classname->val);
return;
}
@@ -1329,7 +1338,7 @@ PHP_METHOD(SoapServer, setObject)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
@@ -1397,7 +1406,7 @@ PHP_METHOD(SoapServer, addFunction)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &function_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &function_name) == FAILURE) {
return;
}
@@ -1418,7 +1427,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_function *f;
if (Z_TYPE_P(tmp_function) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a function that isn't a string");
+ php_error_docref(NULL, E_WARNING, "Tried to add a function that isn't a string");
return;
}
@@ -1426,7 +1435,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_str_tolower_copy(key->val, Z_STRVAL_P(tmp_function), Z_STRLEN_P(tmp_function));
if ((f = zend_hash_find_ptr(EG(function_table), key)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(tmp_function));
+ php_error_docref(NULL, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(tmp_function));
return;
}
@@ -1444,7 +1453,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_str_tolower_copy(key->val, Z_STRVAL_P(function_name), Z_STRLEN_P(function_name));
if ((f = zend_hash_find_ptr(EG(function_table), key)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name));
+ php_error_docref(NULL, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name));
return;
}
if (service->soap_functions.ft == NULL) {
@@ -1465,7 +1474,7 @@ PHP_METHOD(SoapServer, addFunction)
}
service->soap_functions.functions_all = TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value passed");
+ php_error_docref(NULL, E_WARNING, "Invalid value passed");
return;
}
}
@@ -1501,7 +1510,7 @@ PHP_METHOD(SoapServer, handle)
FETCH_THIS_SERVICE(service);
SOAP_GLOBAL(soap_version) = service->version;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -1523,8 +1532,8 @@ PHP_METHOD(SoapServer, handle)
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
ZVAL_STRING(&param, service->sdl->source);
ZVAL_STRING(&readfile, "readfile");
- if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param TSRMLS_CC) == FAILURE) {
- soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL TSRMLS_CC);
+ if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param ) == FAILURE) {
+ soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL);
}
zval_ptr_dtor(&param);
@@ -1534,7 +1543,7 @@ PHP_METHOD(SoapServer, handle)
SOAP_SERVER_END_CODE();
return;
} else {
- soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL);
/*
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
@@ -1551,8 +1560,8 @@ PHP_METHOD(SoapServer, handle)
ZVAL_NULL(&retval);
- if (php_output_start_default(TSRMLS_C) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR,"ob_start failed");
+ if (php_output_start_default() != SUCCESS) {
+ php_error_docref(NULL, E_ERROR,"ob_start failed");
}
if (ZEND_NUM_ARGS() == 0) {
@@ -1561,7 +1570,7 @@ PHP_METHOD(SoapServer, handle)
php_stream_filter *zf = NULL;
zend_string *server = zend_string_init("_SERVER", sizeof("_SERVER")-1, 0);
- zend_is_auto_global(server TSRMLS_CC);
+ zend_is_auto_global(server);
if ((server_vars = zend_hash_find(&EG(symbol_table).ht, server)) != NULL &&
Z_TYPE_P(server_vars) == IS_ARRAY &&
(encoding = zend_hash_str_find(Z_ARRVAL_P(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING")-1)) != NULL &&
@@ -1576,28 +1585,28 @@ PHP_METHOD(SoapServer, handle)
array_init_size(&filter_params, 1);
add_assoc_long_ex(&filter_params, "window", sizeof("window")-1, 0x2f); /* ANY WBITS */
- zf = php_stream_filter_create("zlib.inflate", &filter_params, 0 TSRMLS_CC);
+ zf = php_stream_filter_create("zlib.inflate", &filter_params, 0);
zval_dtor(&filter_params);
if (zf) {
php_stream_filter_append(&SG(request_info).request_body->readfilters, zf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't uncompress compressed request");
+ php_error_docref(NULL, E_WARNING,"Can't uncompress compressed request");
zend_string_release(server);
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_P(encoding));
+ php_error_docref(NULL, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_P(encoding));
zend_string_release(server);
return;
}
}
zend_string_release(server);
- doc_request = soap_xmlParseFile("php://input" TSRMLS_CC);
+ doc_request = soap_xmlParseFile("php://input");
if (zf) {
- php_stream_filter_remove(zf, 1 TSRMLS_CC);
+ php_stream_filter_remove(zf, 1);
}
} else {
zval_ptr_dtor(&retval);
@@ -1608,7 +1617,7 @@ PHP_METHOD(SoapServer, handle)
}
if (doc_request == NULL) {
- soap_server_fault("Client", "Bad Request", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Bad Request", NULL, NULL, NULL);
}
if (xmlGetIntSubset(doc_request) != NULL) {
xmlNodePtr env = get_node(doc_request->children,"Envelope");
@@ -1620,7 +1629,7 @@ PHP_METHOD(SoapServer, handle)
}
}
xmlFreeDoc(doc_request);
- soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL);
}
old_sdl = SOAP_GLOBAL(sdl);
@@ -1634,16 +1643,16 @@ PHP_METHOD(SoapServer, handle)
old_features = SOAP_GLOBAL(features);
SOAP_GLOBAL(features) = service->features;
old_soap_version = SOAP_GLOBAL(soap_version);
- function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers TSRMLS_CC);
+ function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers);
xmlFreeDoc(doc_request);
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
goto fail;
}
@@ -1663,7 +1672,7 @@ PHP_METHOD(SoapServer, handle)
if (PS(session_status) != php_session_active &&
PS(session_status) != php_session_disabled) {
- php_session_start(TSRMLS_C);
+ php_session_start();
}
/* Find the soap object and assign */
@@ -1688,16 +1697,16 @@ PHP_METHOD(SoapServer, handle)
zval c_ret, constructor;
ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME);
- if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Error calling constructor");
}
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
zval_dtor(&constructor);
zval_dtor(&c_ret);
@@ -1715,17 +1724,17 @@ PHP_METHOD(SoapServer, handle)
zval c_ret, constructor;
ZVAL_STR_COPY(&constructor, service->soap_class.ce->name);
- if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Error calling constructor");
}
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
zval_dtor(&constructor);
zval_dtor(&c_ret);
@@ -1781,7 +1790,7 @@ PHP_METHOD(SoapServer, handle)
#if 0
if (service->sdl && !h->function && !h->hdr) {
if (h->mustUnderstand) {
- soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
} else {
continue;
}
@@ -1792,16 +1801,16 @@ PHP_METHOD(SoapServer, handle)
((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_str_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
- call_status = call_user_function(NULL, soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ call_status = call_user_function(NULL, soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters);
} else {
- call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters);
}
if (call_status != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(h->function_name));
+ php_error_docref(NULL, E_WARNING, "Function '%s' call failed", Z_STRVAL(h->function_name));
return;
}
if (Z_TYPE(h->retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry)) {
//??? zval *headerfault = NULL;
zval *tmp;
@@ -1809,8 +1818,8 @@ PHP_METHOD(SoapServer, handle)
Z_TYPE_P(tmp) != IS_NULL) {
//??? headerfault = tmp;
}
- php_output_discard(TSRMLS_C);
- soap_server_fault_ex(function, &h->retval, h TSRMLS_CC);
+ php_output_discard();
+ soap_server_fault_ex(function, &h->retval, h);
efree(fn_name);
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(soap_obj);}
goto fail;
@@ -1818,8 +1827,8 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
//??? zval *headerfault = NULL;
zval *tmp;
@@ -1827,14 +1836,14 @@ PHP_METHOD(SoapServer, handle)
Z_TYPE_P(tmp) != IS_NULL) {
//??? headerfault = tmp;
}
- soap_server_fault_ex(function, &exception_object, h TSRMLS_CC);
+ soap_server_fault_ex(function, &exception_object, h);
}
efree(fn_name);
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(soap_obj);}
goto fail;
}
} else if (h->mustUnderstand) {
- soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
}
efree(fn_name);
}
@@ -1845,7 +1854,7 @@ PHP_METHOD(SoapServer, handle)
((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_str_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
- call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params TSRMLS_CC);
+ call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
if (service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
@@ -1858,7 +1867,7 @@ PHP_METHOD(SoapServer, handle)
#endif
}
} else {
- call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params TSRMLS_CC);
+ call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params);
}
} else {
php_error(E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name));
@@ -1869,9 +1878,9 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
@@ -1889,9 +1898,9 @@ PHP_METHOD(SoapServer, handle)
char *response_name;
if (Z_TYPE(retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) {
- php_output_discard(TSRMLS_C);
- soap_server_fault_ex(function, &retval, NULL TSRMLS_CC);
+ instanceof_function(Z_OBJCE(retval), soap_fault_class_entry)) {
+ php_output_discard();
+ soap_server_fault_ex(function, &retval, NULL);
goto fail;
}
@@ -1902,10 +1911,10 @@ PHP_METHOD(SoapServer, handle)
memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name));
memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response"));
}
- doc_return = serialize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version TSRMLS_CC);
+ doc_return = serialize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version);
efree(response_name);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(function_name));
+ php_error_docref(NULL, E_WARNING, "Function '%s' call failed", Z_STRVAL(function_name));
return;
}
@@ -1913,9 +1922,9 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
@@ -1930,14 +1939,14 @@ PHP_METHOD(SoapServer, handle)
}
/* Flush buffer */
- php_output_discard(TSRMLS_C);
+ php_output_discard();
if (doc_return) {
/* xmlDocDumpMemoryEnc(doc_return, &buf, &size, XML_CHAR_ENCODING_UTF8); */
xmlDocDumpMemory(doc_return, &buf, &size);
if (size == 0) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed");
+ php_error_docref(NULL, E_ERROR, "Dump memory failed");
}
if (soap_version == SOAP_1_2) {
@@ -1954,7 +1963,7 @@ PHP_METHOD(SoapServer, handle)
snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
sapi_add_header(cont_len, strlen(cont_len), 1);
}
- php_write(buf, size TSRMLS_CC);
+ php_write(buf, size);
xmlFree(buf);
} else {
sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 Accepted")-1, 1);
@@ -2018,13 +2027,13 @@ PHP_METHOD(SoapServer, fault)
old_encoding = SOAP_GLOBAL(encoding);
SOAP_GLOBAL(encoding) = service->encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szs",
&code, &code_len, &string, &string_len, &actor, &actor_len, &details,
&name, &name_len) == FAILURE) {
return;
}
- soap_server_fault(code, string, actor, details, name TSRMLS_CC);
+ soap_server_fault(code, string, actor, details, name);
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_SERVER_END_CODE();
@@ -2042,11 +2051,11 @@ PHP_METHOD(SoapServer, addSoapHeader)
FETCH_THIS_SERVICE(service);
if (!service || !service->soap_headers_ptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
+ php_error_docref(NULL, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &fault, soap_header_class_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &fault, soap_header_class_entry) == FAILURE) {
return;
}
@@ -2063,7 +2072,7 @@ PHP_METHOD(SoapServer, addSoapHeader)
SOAP_SERVER_END_CODE();
}
-static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC)
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr)
{
int soap_version;
xmlChar *buf;
@@ -2076,12 +2085,12 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
soap_version = SOAP_GLOBAL(soap_version);
- doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version TSRMLS_CC);
+ doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version);
xmlDocDumpMemory(doc_return, &buf, &size);
server = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(server TSRMLS_CC);
+ zend_is_auto_global(server);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF &&
(agent_name = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) != NULL &&
Z_TYPE_P(agent_name) == IS_STRING) {
@@ -2109,21 +2118,21 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
}
- php_write(buf, size TSRMLS_CC);
+ php_write(buf, size);
xmlFreeDoc(doc_return);
xmlFree(buf);
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
-static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name TSRMLS_DC)
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name)
{
zval ret;
ZVAL_NULL(&ret);
- set_soap_fault(&ret, NULL, code, string, actor, details, name TSRMLS_CC);
+ set_soap_fault(&ret, NULL, code, string, actor, details, name);
/* TODO: Which function */
- soap_server_fault_ex(NULL, &ret, NULL TSRMLS_CC);
+ soap_server_fault_ex(NULL, &ret, NULL);
zend_bailout();
}
@@ -2133,7 +2142,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
zend_execute_data *_old_current_execute_data;
int _old_http_response_code;
char *_old_http_status_line;
- TSRMLS_FETCH();
_old_in_compilation = CG(in_compilation);
_old_current_execute_data = EG(current_execute_data);
@@ -2146,7 +2154,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
if (Z_OBJ(SOAP_GLOBAL(error_object)) &&
- instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_class_entry)) {
zval *tmp;
int use_exceptions = 0;
@@ -2189,9 +2197,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
if (code == NULL) {
code = "Client";
}
- add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL TSRMLS_CC);
+ add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL);
Z_ADDREF(fault);
- zend_throw_exception_object(&fault TSRMLS_CC);
+ zend_throw_exception_object(&fault);
old_objects = EG(objects_store).object_buckets;
EG(objects_store).object_buckets = NULL;
@@ -2242,9 +2250,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
code = "Server";
}
if (Z_OBJ(SOAP_GLOBAL(error_object)) &&
- instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_server_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_server_class_entry) &&
(tmp = zend_hash_str_find(Z_OBJPROP(SOAP_GLOBAL(error_object)), "service", sizeof("service")-1)) != NULL &&
- (service = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service)) &&
+ (service = (soapServicePtr)zend_fetch_resource(tmp, -1, "service", NULL, 1, le_service)) &&
!service->send_errors) {
strcpy(buffer, "Internal Error");
} else {
@@ -2266,14 +2274,14 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
/* Get output buffer and send as fault detials */
- if (php_output_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_LVAL(outbuflen) != 0) {
- php_output_get_contents(&outbuf TSRMLS_CC);
+ if (php_output_get_length(&outbuflen) != FAILURE && Z_LVAL(outbuflen) != 0) {
+ php_output_get_contents(&outbuf);
}
- php_output_discard(TSRMLS_C);
+ php_output_discard();
}
ZVAL_NULL(&fault_obj);
- set_soap_fault(&fault_obj, NULL, code, buffer, NULL, &outbuf, NULL TSRMLS_CC);
+ set_soap_fault(&fault_obj, NULL, code, buffer, NULL, &outbuf, NULL);
fault = 1;
}
@@ -2293,7 +2301,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
PG(display_errors) = old;
if (fault) {
- soap_server_fault_ex(NULL, &fault_obj, NULL TSRMLS_CC);
+ soap_server_fault_ex(NULL, &fault_obj, NULL);
zend_bailout();
}
}
@@ -2304,7 +2312,7 @@ PHP_FUNCTION(use_soap_error_handler)
zend_bool handler = 1;
ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler));
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &handler) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &handler) == SUCCESS) {
SOAP_GLOBAL(use_soap_error_handler) = handler;
}
}
@@ -2313,9 +2321,9 @@ PHP_FUNCTION(is_soap_fault)
{
zval *fault;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS &&
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &fault) == SUCCESS &&
Z_TYPE_P(fault) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry)) {
RETURN_TRUE;
}
RETURN_FALSE
@@ -2338,12 +2346,12 @@ PHP_METHOD(SoapClient, SoapClient)
SOAP_CLIENT_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "$wsdl must be string or null");
+ php_error_docref(NULL, E_ERROR, "$wsdl must be string or null");
}
cache_wsdl = SOAP_GLOBAL(cache_enabled) ? SOAP_GLOBAL(cache_mode) : 0;
@@ -2358,7 +2366,7 @@ PHP_METHOD(SoapClient, SoapClient)
Z_TYPE_P(tmp) == IS_STRING) {
add_property_str(this_ptr, "uri", zend_string_copy(Z_STR_P(tmp)));
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "style", sizeof("style")-1)) != NULL &&
@@ -2384,7 +2392,7 @@ PHP_METHOD(SoapClient, SoapClient)
Z_TYPE_P(tmp) == IS_STRING) {
add_property_str(this_ptr, "location", zend_string_copy(Z_STR_P(tmp)));
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'location' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "soap_version", sizeof("soap_version")-1)) != NULL) {
@@ -2428,7 +2436,7 @@ PHP_METHOD(SoapClient, SoapClient)
if ((tmp = zend_hash_str_find(ht, "local_cert", sizeof("local_cert")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "ssl", "local_cert", tmp);
if ((tmp = zend_hash_str_find(ht, "passphrase", sizeof("passphrase")-1)) != NULL &&
@@ -2463,7 +2471,7 @@ PHP_METHOD(SoapClient, SoapClient)
encoding = xmlFindCharEncodingHandler(Z_STRVAL_P(tmp));
if (encoding == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
+ php_error_docref(NULL, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
} else {
xmlCharEncCloseFunc(encoding);
add_property_str(this_ptr, "_encoding", zend_string_copy(Z_STR_P(tmp)));
@@ -2526,7 +2534,7 @@ PHP_METHOD(SoapClient, SoapClient)
add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp));
}
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
}
add_property_long(this_ptr, "_soap_version", soap_version);
@@ -2538,8 +2546,8 @@ PHP_METHOD(SoapClient, SoapClient)
old_soap_version = SOAP_GLOBAL(soap_version);
SOAP_GLOBAL(soap_version) = soap_version;
- sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
- res = zend_register_resource(NULL, sdl, le_sdl TSRMLS_CC);
+ sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl);
+ res = zend_register_resource(NULL, sdl, le_sdl);
add_property_resource(this_ptr, "sdl", res);
@@ -2547,11 +2555,11 @@ PHP_METHOD(SoapClient, SoapClient)
}
if (typemap_ht) {
- HashTable *typemap = soap_create_typemap(sdl, typemap_ht TSRMLS_CC);
+ HashTable *typemap = soap_create_typemap(sdl, typemap_ht);
if (typemap) {
zend_resource *res;
- res = zend_register_resource(NULL, typemap, le_typemap TSRMLS_CC);
+ res = zend_register_resource(NULL, typemap, le_typemap);
add_property_resource(this_ptr, "typemap", res);
}
}
@@ -2559,7 +2567,7 @@ PHP_METHOD(SoapClient, SoapClient)
}
/* }}} */
-static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response TSRMLS_DC)
+static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response)
{
int ret = TRUE;
char *buf;
@@ -2573,7 +2581,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size);
if (!buf) {
- add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL);
return FALSE;
}
@@ -2597,12 +2605,12 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
ZVAL_LONG(&params[3], version);
ZVAL_LONG(&params[4], one_way);
- if (call_user_function(NULL, this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) {
- add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL TSRMLS_CC);
+ if (call_user_function(NULL, this_ptr, &func, response, 5, params) != SUCCESS) {
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL);
ret = FALSE;
} else if (Z_TYPE_P(response) != IS_STRING) {
if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) == NULL) {
- add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL);
}
ret = FALSE;
} else if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
@@ -2634,7 +2642,7 @@ static void do_soap_call(zend_execute_data *execute_data,
char* call_uri,
HashTable* soap_headers,
zval* output_headers
- TSRMLS_DC)
+ )
{
zval *tmp;
zval *trace;
@@ -2678,7 +2686,7 @@ static void do_soap_call(zend_execute_data *execute_data,
FETCH_TYPEMAP_RES(typemap,tmp);
}
- clear_soap_fault(this_ptr TSRMLS_CC);
+ clear_soap_fault(this_ptr);
SOAP_GLOBAL(soap_version) = soap_version;
old_sdl = SOAP_GLOBAL(sdl);
@@ -2725,18 +2733,18 @@ static void do_soap_call(zend_execute_data *execute_data,
}
if (binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
- request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
+ request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers);
+ ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response);
} else {
- request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response TSRMLS_CC);
+ request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers);
+ ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response);
}
xmlFreeDoc(request);
if (ret && Z_TYPE(response) == IS_STRING) {
encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC);
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers);
encode_finish();
}
@@ -2748,7 +2756,7 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str_appends(&error,function);
smart_str_appends(&error,"\") is not a valid method for this service");
smart_str_0(&error);
- add_soap_fault(this_ptr, "Client", error.s->val, NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", error.s->val, NULL, NULL);
smart_str_free(&error);
}
} else {
@@ -2756,14 +2764,14 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str action = {0};
if ((uri = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri")-1)) == NULL) {
- add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL);
} else if (location == NULL) {
- add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL);
} else {
if (call_uri == NULL) {
call_uri = Z_STRVAL_P(uri);
}
- request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers);
if (soap_action == NULL) {
smart_str_appends(&action, call_uri);
@@ -2774,14 +2782,14 @@ static void do_soap_call(zend_execute_data *execute_data,
}
smart_str_0(&action);
- ret = do_request(this_ptr, request, location, action.s->val, soap_version, 0, &response TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, action.s->val, soap_version, 0, &response);
smart_str_free(&action);
xmlFreeDoc(request);
if (ret && Z_TYPE(response) == IS_STRING) {
encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC);
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers);
encode_finish();
}
@@ -2794,7 +2802,7 @@ static void do_soap_call(zend_execute_data *execute_data,
if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) != NULL) {
ZVAL_COPY(return_value, fault);
} else {
- add_soap_fault_ex(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC);
+ add_soap_fault_ex(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL);
}
} else {
zval* fault;
@@ -2805,11 +2813,11 @@ static void do_soap_call(zend_execute_data *execute_data,
if (!EG(exception) &&
Z_TYPE_P(return_value) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry) &&
((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions")-1)) == NULL ||
Z_TYPE_P(tmp) != IS_FALSE)) {
Z_ADDREF_P(return_value);
- zend_throw_exception_object(return_value TSRMLS_CC);
+ zend_throw_exception_object(return_value);
}
} zend_catch {
@@ -2832,14 +2840,14 @@ static void do_soap_call(zend_execute_data *execute_data,
SOAP_CLIENT_END_CODE();
}
-static void verify_soap_headers_array(HashTable *ht TSRMLS_DC)
+static void verify_soap_headers_array(HashTable *ht)
{
zval *tmp;
ZEND_HASH_FOREACH_VAL(ht, tmp) {
if (Z_TYPE_P(tmp) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(tmp), soap_header_class_entry TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header");
+ !instanceof_function(Z_OBJCE_P(tmp), soap_header_class_entry)) {
+ php_error_docref(NULL, E_ERROR, "Invalid SOAP header");
}
} ZEND_HASH_FOREACH_END();
}
@@ -2864,7 +2872,7 @@ PHP_METHOD(SoapClient, __call)
zend_bool free_soap_headers = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|a!zz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sa|a!zz/",
&function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
return;
}
@@ -2890,17 +2898,17 @@ PHP_METHOD(SoapClient, __call)
if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) {
} else if (Z_TYPE_P(headers) == IS_ARRAY) {
soap_headers = Z_ARRVAL_P(headers);
- verify_soap_headers_array(soap_headers TSRMLS_CC);
+ verify_soap_headers_array(soap_headers);
free_soap_headers = 0;
} else if (Z_TYPE_P(headers) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) {
soap_headers = emalloc(sizeof(HashTable));
zend_hash_init(soap_headers, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_next_index_insert(soap_headers, headers);
Z_ADDREF_P(headers);
free_soap_headers = 1;
} else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ php_error_docref(NULL, E_WARNING, "Invalid SOAP header");
return;
}
@@ -2938,7 +2946,7 @@ PHP_METHOD(SoapClient, __call)
if (output_headers) {
array_init(output_headers);
}
- do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
+ do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers);
if (arg_count > 0) {
efree(real_args);
}
@@ -3089,7 +3097,7 @@ PHP_METHOD(SoapClient, __doRequest)
zend_long one_way = 0;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl|l",
&buf, &buf_size,
&location, &location_size,
&action, &action_size,
@@ -3100,11 +3108,11 @@ PHP_METHOD(SoapClient, __doRequest)
one_way = 0;
}
if (one_way) {
- if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL TSRMLS_CC)) {
+ if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL)) {
RETURN_EMPTY_STRING();
}
} else if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version,
- return_value TSRMLS_CC)) {
+ return_value)) {
return;
}
RETURN_NULL();
@@ -3123,7 +3131,7 @@ PHP_METHOD(SoapClient, __setCookie)
zval *cookies;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
return;
}
@@ -3177,7 +3185,7 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
zval *headers = NULL;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &headers) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &headers) == FAILURE) {
return;
}
@@ -3186,12 +3194,12 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
} else if (Z_TYPE_P(headers) == IS_ARRAY) {
zval *default_headers;
- verify_soap_headers_array(Z_ARRVAL_P(headers) TSRMLS_CC);
+ verify_soap_headers_array(Z_ARRVAL_P(headers));
if ((default_headers = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) == NULL) {
add_property_zval(this_ptr, "__default_headers", headers);
}
} else if (Z_TYPE_P(headers) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) {
zval default_headers;
array_init(&default_headers);
@@ -3200,7 +3208,7 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
add_property_zval(this_ptr, "__default_headers", &default_headers);
Z_DELREF_P(&default_headers);
} else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ php_error_docref(NULL, E_WARNING, "Invalid SOAP header");
}
RETURN_TRUE;
}
@@ -3221,7 +3229,7 @@ PHP_METHOD(SoapClient, __setLocation)
zval *tmp;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &location, &location_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &location, &location_len) == FAILURE) {
return;
}
@@ -3239,39 +3247,39 @@ PHP_METHOD(SoapClient, __setLocation)
}
/* }}} */
-static void clear_soap_fault(zval *obj TSRMLS_DC)
+static void clear_soap_fault(zval *obj)
{
if (obj != NULL && Z_TYPE_P(obj) == IS_OBJECT) {
zend_hash_str_del(Z_OBJPROP_P(obj), "__soap_fault", sizeof("__soap_fault")-1);
}
}
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC)
+static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
ZVAL_NULL(fault);
- set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
+ set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL);
add_property_zval(obj, "__soap_fault", fault);
Z_DELREF_P(fault);
}
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC)
+void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
zval fault;
ZVAL_NULL(&fault);
- set_soap_fault(&fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
+ set_soap_fault(&fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL);
add_property_zval(obj, "__soap_fault", &fault);
Z_DELREF(fault);
}
-static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC)
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name)
{
if (Z_TYPE_P(obj) != IS_OBJECT) {
object_init_ex(obj, soap_fault_class_entry);
}
add_property_string(obj, "faultstring", fault_string ? fault_string : "");
- zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, (fault_string ? fault_string : "") TSRMLS_CC);
+ zend_update_property_string(zend_exception_get_default(), obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
if (fault_code != NULL) {
int soap_version = SOAP_GLOBAL(soap_version);
@@ -3317,7 +3325,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
}
}
-static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval **parameters TSRMLS_DC)
+static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval **parameters)
{
int cur_param = 0,num_of_params = 0;
zval *tmp_parameters = NULL;
@@ -3344,7 +3352,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
/* TODO: may be "nil" is not OK? */
ZVAL_NULL(&tmp_parameters[cur_param]);
} else {
- master_to_zval(&tmp_parameters[cur_param], param->encode, val TSRMLS_CC);
+ master_to_zval(&tmp_parameters[cur_param], param->encode, val);
}
cur_param++;
} ZEND_HASH_FOREACH_END();
@@ -3384,15 +3392,14 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
sdlParamPtr param = NULL;
if (function != NULL &&
(param = zend_hash_index_find_ptr(function->requestParameters, cur_param)) == NULL) {
- TSRMLS_FETCH();
- soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL);
}
if (param == NULL) {
enc = NULL;
} else {
enc = param->encode;
}
- master_to_zval(&tmp_parameters[cur_param], enc, trav TSRMLS_CC);
+ master_to_zval(&tmp_parameters[cur_param], enc, trav);
cur_param++;
}
trav = trav->next;
@@ -3400,7 +3407,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
}
}
if (num_of_params > cur_param) {
- soap_server_fault("Client","Missing parameter", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Missing parameter", NULL, NULL, NULL);
}
(*parameters) = tmp_parameters;
(*num_params) = num_of_params;
@@ -3434,7 +3441,7 @@ static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_
return function;
}
-static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers TSRMLS_DC)
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers)
{
char* envelope_ns = NULL;
xmlNodePtr trav,env,head,body,func;
@@ -3459,24 +3466,24 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
SOAP_GLOBAL(soap_version) = SOAP_1_2;
} else {
- soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL);
}
}
trav = trav->next;
}
if (env == NULL) {
- soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL);
}
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3506,26 +3513,26 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
trav = trav->next;
}
if (body == NULL) {
- soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL);
}
attr = body->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
}
if (trav != NULL && *version == SOAP_1_2) {
- soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL);
}
func = NULL;
@@ -3534,7 +3541,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (trav->type == XML_ELEMENT_NODE) {
/*
if (func != NULL) {
- soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL);
}
*/
func = trav;
@@ -3547,24 +3554,24 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (function != NULL) {
ZVAL_STRING(function_name, (char *)function->functionName);
} else {
- soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL);
}
} else {
if (*version == SOAP_1_1) {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
} else {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
}
function = find_function(sdl, func, function_name);
if (sdl != NULL && function == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL);
} else {
php_error(E_ERROR, "Procedure '%s' not present", func->name);
}
@@ -3578,12 +3585,12 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3597,7 +3604,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (*version == SOAP_1_1) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
if (attr != NULL) {
@@ -3609,7 +3616,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} else if (*version == SOAP_1_2) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
if (attr != NULL) {
@@ -3629,7 +3636,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
- soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL);
}
}
h = emalloc(sizeof(soapHeader));
@@ -3657,7 +3664,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (h->hdr) {
h->num_params = 1;
h->parameters = emalloc(sizeof(zval));
- master_to_zval(&h->parameters[0], h->hdr->encode, hdr_func TSRMLS_CC);
+ master_to_zval(&h->parameters[0], h->hdr->encode, hdr_func);
} else {
if (h->function && h->function->binding && h->function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)h->function->bindingAttributes;
@@ -3665,7 +3672,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
hdr_func = hdr_func->children;
}
}
- deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters TSRMLS_CC);
+ deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters);
}
ZVAL_NULL(&h->retval);
if (last == NULL) {
@@ -3688,7 +3695,7 @@ ignore_header:
} else {
func = func->children;
}
- deserialize_parameters(func, function, num_params, parameters TSRMLS_CC);
+ deserialize_parameters(func, function, num_params, parameters);
encode_finish();
@@ -3732,7 +3739,7 @@ static void set_soap_header_attributes(xmlNodePtr h, HashTable *ht, int version)
}
}
-static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node TSRMLS_DC)
+static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node)
{
xmlNodePtr method = NULL, param;
sdlParamPtr parameter = NULL;
@@ -3780,13 +3787,13 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
if (main && version == SOAP_1_2) {
xmlNs *rpc_ns = xmlNewNs(body, BAD_CAST(RPC_SOAP12_NAMESPACE), BAD_CAST(RPC_SOAP12_NS_PREFIX));
rpc_result = xmlNewChild(method, rpc_ns, BAD_CAST("result"), NULL);
- param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, method);
xmlNodeSetContent(rpc_result,param->name);
} else {
- param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, method);
}
} else {
- param = serialize_parameter(parameter, ret, 0, "return", use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -3809,9 +3816,9 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(ret), param_index, param_name, data) {
parameter = get_param(function, param_name->val, param_index, TRUE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, data, i, param_name->val, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, data, i, param_name->val, use, method);
} else {
- param = serialize_parameter(parameter, data, i, param_name->val, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, data, i, param_name->val, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -3834,7 +3841,7 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
return use;
}
-static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version TSRMLS_DC)
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version)
{
xmlDocPtr doc;
xmlNodePtr envelope = NULL, body, param;
@@ -3857,12 +3864,12 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
- soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL);
}
xmlDocSetRootElement(doc, envelope);
if (Z_TYPE_P(ret) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry)) {
char *detail_name;
HashTable* prop;
zval *tmp;
@@ -3881,7 +3888,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
if (Z_TYPE_P(hdr_ret) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry)) {
HashTable* ht = Z_OBJPROP_P(hdr_ret);
sdlSoapBindingFunctionHeaderPtr hdr;
smart_str key = {0};
@@ -3912,11 +3919,11 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
if (headers->function) {
- if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
} else {
- xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
@@ -3981,7 +3988,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (version == SOAP_1_1) {
if ((tmp = zend_hash_str_find(prop, "faultcode", sizeof("faultcode")-1)) != NULL) {
xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
- zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL TSRMLS_CC);
+ zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL);
xmlAddChild(param, node);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
@@ -3994,18 +4001,18 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
zend_string_release(str);
}
if ((tmp = zend_hash_str_find(prop, "faultstring", sizeof("faultstring")-1)) != NULL) {
- xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param);
xmlNodeSetName(node, BAD_CAST("faultstring"));
}
if ((tmp = zend_hash_str_find(prop, "faultactor", sizeof("faultactor")-1)) != NULL) {
- xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param);
xmlNodeSetName(node, BAD_CAST("faultactor"));
}
detail_name = "detail";
} else {
if ((tmp = zend_hash_str_find(prop, "faultcode", sizeof("faultcode")-1)) != NULL) {
xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
- zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL TSRMLS_CC);
+ zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL);
node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
@@ -4019,7 +4026,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
if ((tmp = zend_hash_str_find(prop, "faultstring", sizeof("faultstring")-1)) != NULL) {
xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Reason"), NULL);
- node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, node TSRMLS_CC);
+ node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, node);
xmlNodeSetName(node, BAD_CAST("Text"));
xmlSetNs(node, ns);
}
@@ -4049,7 +4056,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
detail = tmp;
}
- x = serialize_parameter(sparam, detail, 1, NULL, use, node TSRMLS_CC);
+ x = serialize_parameter(sparam, detail, 1, NULL, use, node);
if (function &&
function->binding &&
@@ -4077,7 +4084,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
} else if ((tmp = zend_hash_str_find(prop, "detail", sizeof("detail")-1)) != NULL &&
Z_TYPE_P(tmp) != IS_NULL) {
- serialize_zval(tmp, NULL, detail_name, use, param TSRMLS_CC);
+ serialize_zval(tmp, NULL, detail_name, use, param);
}
} else {
@@ -4096,7 +4103,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
HashTable *ht = NULL;
if (Z_TYPE(h->retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry)) {
zval *tmp;
sdlSoapBindingFunctionHeaderPtr hdr;
smart_str key = {0};
@@ -4134,14 +4141,14 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (h->function) {
xmlNodePtr xmlHdr = NULL;
- if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
if (ht) {
set_soap_header_attributes(xmlHdr, ht, version);
}
} else {
- xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
@@ -4165,7 +4172,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
- if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
@@ -4191,7 +4198,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
return doc;
}
-static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC)
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers)
{
xmlDoc *doc;
xmlNodePtr envelope = NULL, body, method = NULL, head = NULL;
@@ -4276,9 +4283,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, &arguments[i], i, NULL, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, &arguments[i], i, NULL, use, method);
} else if (style == SOAP_DOCUMENT) {
- param = serialize_parameter(parameter, &arguments[i], i, NULL, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, &arguments[i], i, NULL, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -4298,9 +4305,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, NULL, i, NULL, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, NULL, i, NULL, use, method);
} else if (style == SOAP_DOCUMENT) {
- param = serialize_parameter(parameter, NULL, i, NULL, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, NULL, i, NULL, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -4348,7 +4355,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
}
if ((tmp = zend_hash_str_find(ht, "data", sizeof("data")-1)) != NULL) {
- h = master_to_xml(enc, tmp, hdr_use, head TSRMLS_CC);
+ h = master_to_xml(enc, tmp, hdr_use, head);
xmlNodeSetName(h, BAD_CAST(Z_STRVAL_P(name)));
} else {
h = xmlNewNode(NULL, BAD_CAST(Z_STRVAL_P(name)));
@@ -4379,7 +4386,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
return doc;
}
-static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent)
{
char *paramName;
xmlNodePtr xmlParam;
@@ -4409,12 +4416,12 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
}
}
- xmlParam = serialize_zval(param_val, param, paramName, style, parent TSRMLS_CC);
+ xmlParam = serialize_zval(param_val, param, paramName, style, parent);
return xmlParam;
}
-static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent)
{
xmlNodePtr xmlParam;
encodePtr enc;
@@ -4437,7 +4444,7 @@ static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName,
} else {
enc = NULL;
}
- xmlParam = master_to_xml(enc, val, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, val, style, parent);
zval_ptr_dtor(&defval);
if (!strcmp((char*)xmlParam->name, "BOGUS")) {
xmlNodeSetName(xmlParam, BAD_CAST(paramName));
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index a5a63dfb61..cea27000cf 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -56,6 +56,6 @@ if test "$PHP_SOCKETS" != "no"; then
AC_DEFINE(HAVE_AI_V4MAPPED,1,[Whether you have AI_V4MAPPED])
fi
- PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared])
+ PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
fi
diff --git a/ext/sockets/config.w32 b/ext/sockets/config.w32
index aeaa8ed425..d3455b05dd 100644
--- a/ext/sockets/config.w32
+++ b/ext/sockets/config.w32
@@ -7,7 +7,7 @@ if (PHP_SOCKETS != "no") {
if (CHECK_LIB("ws2_32.lib", "sockets", PHP_SOCKETS)
&& CHECK_LIB("Iphlpapi.lib", "sockets", PHP_SOCKETS)
&& CHECK_HEADER_ADD_INCLUDE("winsock.h", "CFLAGS_SOCKETS")) {
- EXTENSION('sockets', 'sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c');
+ EXTENSION('sockets', 'sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c', PHP_SOCKETS_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_SOCKETS', 1);
PHP_INSTALL_HEADERS("ext/sockets", "php_sockets.h");
} else {
diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c
index d808271728..98ece64855 100644
--- a/ext/sockets/conversions.c
+++ b/ext/sockets/conversions.c
@@ -196,10 +196,10 @@ static void do_to_zval_err(res_context *ctx, const char *fmt, ...)
va_end(ap);
}
-void err_msg_dispose(struct err_s *err TSRMLS_DC)
+void err_msg_dispose(struct err_s *err)
{
if (err->msg != NULL) {
- php_error_docref0(NULL TSRMLS_CC, err->level, "%s", err->msg);
+ php_error_docref0(NULL, err->level, "%s", err->msg);
if (err->should_free) {
efree(err->msg);
}
@@ -541,10 +541,9 @@ static void from_zval_write_sin_addr(const zval *zaddr_str, char *inaddr, ser_co
int res;
struct sockaddr_in saddr = {0};
zend_string *addr_str;
- TSRMLS_FETCH();
addr_str = zval_get_string((zval *) zaddr_str);
- res = php_set_inet_addr(&saddr, addr_str->val, ctx->sock TSRMLS_CC);
+ res = php_set_inet_addr(&saddr, addr_str->val, ctx->sock);
if (res) {
memcpy(inaddr, &saddr.sin_addr, sizeof saddr.sin_addr);
} else {
@@ -592,10 +591,9 @@ static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_co
int res;
struct sockaddr_in6 saddr6 = {0};
zend_string *addr_str;
- TSRMLS_FETCH();
addr_str = zval_get_string((zval *) zaddr_str);
- res = php_set_inet6_addr(&saddr6, addr_str->val, ctx->sock TSRMLS_CC);
+ res = php_set_inet6_addr(&saddr6, addr_str->val, ctx->sock);
if (res) {
memcpy(addr6, &saddr6.sin6_addr, sizeof saddr6.sin6_addr);
} else {
@@ -645,7 +643,6 @@ static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_
{
zend_string *path_str;
struct sockaddr_un *saddr = (struct sockaddr_un*)sockaddr_un_c;
- TSRMLS_FETCH();
path_str = zval_get_string((zval *) path);
@@ -1246,8 +1243,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
}
} else {
zend_string *str;
- TSRMLS_FETCH();
-
+
str = zval_get_string((zval *) zv);
#if HAVE_IF_NAMETOINDEX
@@ -1350,7 +1346,6 @@ size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx)
static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, ser_context *ctx)
{
int *iarr = args[0];
- TSRMLS_FETCH();
if (Z_TYPE_P(elem) == IS_RESOURCE) {
php_stream *stream;
@@ -1395,7 +1390,6 @@ void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
i;
struct cmsghdr *dummy_cmsg = 0;
size_t data_offset;
- TSRMLS_FETCH();
data_offset = (unsigned char *)CMSG_DATA(dummy_cmsg)
- (unsigned char *)dummy_cmsg;
@@ -1428,8 +1422,8 @@ void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
return;
}
if (S_ISSOCK(statbuf.st_mode)) {
- php_socket *sock = socket_import_file_descriptor(fd TSRMLS_CC);
- zend_register_resource(&elem, sock, php_sockets_le_socket() TSRMLS_CC);
+ php_socket *sock = socket_import_file_descriptor(fd);
+ zend_register_resource(&elem, sock, php_sockets_le_socket());
} else {
php_stream *stream = php_stream_fopen_from_fd(fd, "rw", NULL);
php_stream_to_zval(stream, &elem);
diff --git a/ext/sockets/conversions.h b/ext/sockets/conversions.h
index 42e98882f4..0ae6b6d853 100644
--- a/ext/sockets/conversions.h
+++ b/ext/sockets/conversions.h
@@ -39,7 +39,7 @@ typedef void (to_zval_read_field)(const char *data, zval *zv, res_context *ctx);
extern const struct key_value empty_key_value_list[];
/* AUX FUNCTIONS */
-void err_msg_dispose(struct err_s *err TSRMLS_DC);
+void err_msg_dispose(struct err_s *err);
void allocations_dispose(zend_llist **allocations);
/* CONVERSION FUNCTIONS */
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index 3c076b4e7c..b8e7216c9b 100644
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@ -51,9 +51,9 @@ enum source_op {
UNBLOCK_SOURCE
};
-static int _php_mcast_join_leave(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index, int join TSRMLS_DC);
+static int _php_mcast_join_leave(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index, int join);
#ifdef HAS_MCAST_EXT
-static int _php_mcast_source_op(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, struct sockaddr *source, socklen_t source_len, unsigned int if_index, enum source_op sop TSRMLS_DC);
+static int _php_mcast_source_op(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, struct sockaddr *source, socklen_t source_len, unsigned int if_index, enum source_op sop);
#endif
#ifdef RFC3678_API
@@ -63,14 +63,14 @@ static const char *_php_source_op_to_string(enum source_op sop);
static int _php_source_op_to_ipv4_op(enum source_op sop);
#endif
-int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC)
+int php_string_to_if_index(const char *val, unsigned *out)
{
#if HAVE_IF_NAMETOINDEX
unsigned int ind;
ind = if_nametoindex(val);
if (ind == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"no interface with name \"%s\" could be found", val);
return FAILURE;
} else {
@@ -78,20 +78,20 @@ int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC)
return SUCCESS;
}
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"this platform does not support looking up an interface by "
"name, an integer interface index must be supplied instead");
return FAILURE;
#endif
}
-static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
+static int php_get_if_index_from_zval(zval *val, unsigned *out)
{
int ret;
if (Z_TYPE_P(val) == IS_LONG) {
if (Z_LVAL_P(val) < 0 || Z_LVAL_P(val) > UINT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"the interface index cannot be negative or larger than %u;"
" given %pd", UINT_MAX, Z_LVAL_P(val));
ret = FAILURE;
@@ -104,7 +104,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
Z_ADDREF_P(val);
}
convert_to_string_ex(val);
- ret = php_string_to_if_index(Z_STRVAL_P(val), out TSRMLS_CC);
+ ret = php_string_to_if_index(Z_STRVAL_P(val), out);
zval_ptr_dtor(val);
}
@@ -114,7 +114,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
static int php_get_if_index_from_array(const HashTable *ht, const char *key,
- php_socket *sock, unsigned int *if_index TSRMLS_DC)
+ php_socket *sock, unsigned int *if_index)
{
zval *val;
@@ -123,23 +123,23 @@ static int php_get_if_index_from_array(const HashTable *ht, const char *key,
return SUCCESS;
}
- return php_get_if_index_from_zval(val, if_index TSRMLS_CC);
+ return php_get_if_index_from_zval(val, if_index);
}
static int php_get_address_from_array(const HashTable *ht, const char *key,
- php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len TSRMLS_DC)
+ php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len)
{
zval *val;
if ((val = zend_hash_str_find(ht, key, strlen(key))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", key);
return FAILURE;
}
if (Z_REFCOUNTED_P(val)) {
Z_ADDREF_P(val);
}
convert_to_string_ex(val);
- if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(val), sock TSRMLS_CC)) {
+ if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(val), sock)) {
zval_ptr_dtor(val);
return FAILURE;
}
@@ -147,16 +147,16 @@ static int php_get_address_from_array(const HashTable *ht, const char *key,
return SUCCESS;
}
-static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC)
+static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval *arg4)
{
HashTable *opt_ht;
unsigned int if_index;
int retval;
int (*mcast_req_fun)(php_socket *, int, struct sockaddr *, socklen_t,
- unsigned TSRMLS_DC);
+ unsigned);
#ifdef HAS_MCAST_EXT
int (*mcast_sreq_fun)(php_socket *, int, struct sockaddr *, socklen_t,
- struct sockaddr *, socklen_t, unsigned TSRMLS_DC);
+ struct sockaddr *, socklen_t, unsigned);
#endif
switch (optname) {
@@ -174,16 +174,16 @@ mcast_req_fun:
opt_ht = HASH_OF(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
- &glen TSRMLS_CC) == FAILURE) {
+ &glen) == FAILURE) {
return FAILURE;
}
if (php_get_if_index_from_array(opt_ht, "interface", php_sock,
- &if_index TSRMLS_CC) == FAILURE) {
+ &if_index) == FAILURE) {
return FAILURE;
}
retval = mcast_req_fun(php_sock, level, (struct sockaddr*)&group,
- glen, if_index TSRMLS_CC);
+ glen, if_index);
break;
}
@@ -210,25 +210,25 @@ mcast_req_fun:
opt_ht = HASH_OF(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
- &glen TSRMLS_CC) == FAILURE) {
+ &glen) == FAILURE) {
return FAILURE;
}
if (php_get_address_from_array(opt_ht, "source", php_sock, &source,
- &slen TSRMLS_CC) == FAILURE) {
+ &slen) == FAILURE) {
return FAILURE;
}
if (php_get_if_index_from_array(opt_ht, "interface", php_sock,
- &if_index TSRMLS_CC) == FAILURE) {
+ &if_index) == FAILURE) {
return FAILURE;
}
retval = mcast_sreq_fun(php_sock, level, (struct sockaddr*)&group,
- glen, (struct sockaddr*)&source, slen, if_index TSRMLS_CC);
+ glen, (struct sockaddr*)&source, slen, if_index);
break;
}
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"unexpected option in php_do_mcast_opt (level %d, option %d). "
"This is a bug.", level, optname);
return FAILURE;
@@ -246,7 +246,7 @@ mcast_req_fun:
int php_do_setsockopt_ip_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC)
+ zval *arg4)
{
unsigned int if_index;
struct in_addr if_addr;
@@ -264,18 +264,18 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
case PHP_MCAST_JOIN_SOURCE_GROUP:
case PHP_MCAST_LEAVE_SOURCE_GROUP:
#endif
- if (php_do_mcast_opt(php_sock, level, optname, arg4 TSRMLS_CC) == FAILURE) {
+ if (php_do_mcast_opt(php_sock, level, optname, arg4) == FAILURE) {
return FAILURE;
} else {
return SUCCESS;
}
case IP_MULTICAST_IF:
- if (php_get_if_index_from_zval(arg4, &if_index TSRMLS_CC) == FAILURE) {
+ if (php_get_if_index_from_zval(arg4, &if_index) == FAILURE) {
return FAILURE;
}
- if (php_if_index_to_addr4(if_index, php_sock, &if_addr TSRMLS_CC) == FAILURE) {
+ if (php_if_index_to_addr4(if_index, php_sock, &if_addr) == FAILURE) {
return FAILURE;
}
opt_ptr = &if_addr;
@@ -290,7 +290,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
case IP_MULTICAST_TTL:
convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < 0L || Z_LVAL_P(arg4) > 255L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected a value between 0 and 255");
return FAILURE;
}
@@ -316,7 +316,7 @@ dosockopt:
int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC)
+ zval *arg4)
{
unsigned int if_index;
void *opt_ptr;
@@ -333,14 +333,14 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
case PHP_MCAST_JOIN_SOURCE_GROUP:
case PHP_MCAST_LEAVE_SOURCE_GROUP:
#endif
- if (php_do_mcast_opt(php_sock, level, optname, arg4 TSRMLS_CC) == FAILURE) {
+ if (php_do_mcast_opt(php_sock, level, optname, arg4) == FAILURE) {
return FAILURE;
} else {
return SUCCESS;
}
case IPV6_MULTICAST_IF:
- if (php_get_if_index_from_zval(arg4, &if_index TSRMLS_CC) == FAILURE) {
+ if (php_get_if_index_from_zval(arg4, &if_index) == FAILURE) {
return FAILURE;
}
@@ -355,7 +355,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
case IPV6_MULTICAST_HOPS:
convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < -1L || Z_LVAL_P(arg4) > 255L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected a value between -1 and 255");
return FAILURE;
}
@@ -383,9 +383,9 @@ int php_mcast_join(
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_join_leave(sock, level, group, group_len, if_index, 1 TSRMLS_CC);
+ return _php_mcast_join_leave(sock, level, group, group_len, if_index, 1);
}
int php_mcast_leave(
@@ -393,9 +393,9 @@ int php_mcast_leave(
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_join_leave(sock, level, group, group_len, if_index, 0 TSRMLS_CC);
+ return _php_mcast_join_leave(sock, level, group, group_len, if_index, 0);
}
#ifdef HAS_MCAST_EXT
@@ -406,9 +406,9 @@ int php_mcast_join_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, JOIN_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, JOIN_SOURCE);
}
int php_mcast_leave_source(
@@ -418,9 +418,9 @@ int php_mcast_leave_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, LEAVE_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, LEAVE_SOURCE);
}
int php_mcast_block_source(
@@ -430,9 +430,9 @@ int php_mcast_block_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, BLOCK_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, BLOCK_SOURCE);
}
int php_mcast_unblock_source(
@@ -442,9 +442,9 @@ int php_mcast_unblock_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, UNBLOCK_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, UNBLOCK_SOURCE);
}
#endif /* HAS_MCAST_EXT */
@@ -455,7 +455,7 @@ static int _php_mcast_join_leave(
struct sockaddr *group, /* struct sockaddr_in/sockaddr_in6 */
socklen_t group_len,
unsigned int if_index,
- int join TSRMLS_DC)
+ int join)
{
#ifdef RFC3678_API
struct group_req greq = {0};
@@ -475,7 +475,7 @@ static int _php_mcast_join_leave(
assert(group_len == sizeof(struct sockaddr_in));
if (if_index != 0) {
- if (php_if_index_to_addr4(if_index, sock, &addr TSRMLS_CC) ==
+ if (php_if_index_to_addr4(if_index, sock, &addr) ==
FAILURE)
return -2; /* failure, but notice already emitted */
mreq.imr_interface = addr;
@@ -502,7 +502,7 @@ static int _php_mcast_join_leave(
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Option %s is inapplicable to this socket type",
join ? "MCAST_JOIN_GROUP" : "MCAST_LEAVE_GROUP");
return -2;
@@ -519,7 +519,7 @@ static int _php_mcast_source_op(
struct sockaddr *source,
socklen_t source_len,
unsigned int if_index,
- enum source_op sop TSRMLS_DC)
+ enum source_op sop)
{
#ifdef RFC3678_API
struct group_source_req gsreq = {0};
@@ -544,7 +544,7 @@ static int _php_mcast_source_op(
assert(source_len == sizeof(struct sockaddr_in));
if (if_index != 0) {
- if (php_if_index_to_addr4(if_index, sock, &addr TSRMLS_CC) ==
+ if (php_if_index_to_addr4(if_index, sock, &addr) ==
FAILURE)
return -2; /* failure, but notice already emitted */
mreqs.imr_interface = addr;
@@ -557,14 +557,14 @@ static int _php_mcast_source_op(
}
#if HAVE_IPV6
else if (sock->type == AF_INET6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"This platform does not support %s for IPv6 sockets",
_php_source_op_to_string(sop));
return -2;
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Option %s is inapplicable to this socket type",
_php_source_op_to_string(sop));
return -2;
@@ -628,7 +628,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
#endif /* HAS_MCAST_EXT */
#if PHP_WIN32
-int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr TSRMLS_DC)
+int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
@@ -652,7 +652,7 @@ retry:
goto retry;
}
if (retval != NO_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"GetIpAddrTable failed with error %lu", retval);
return FAILURE;
}
@@ -663,12 +663,12 @@ retry:
return SUCCESS;
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"No interface with index %u was found", if_index);
return FAILURE;
}
-int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index TSRMLS_DC)
+int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
@@ -692,7 +692,7 @@ retry:
goto retry;
}
if (retval != NO_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"GetIpAddrTable failed with error %lu", retval);
return FAILURE;
}
@@ -707,7 +707,7 @@ retry:
{
char addr_str[17] = {0};
inet_ntop(AF_INET, addr, addr_str, sizeof(addr_str));
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"The interface with IP address %s was not found", addr_str);
}
return FAILURE;
@@ -715,7 +715,7 @@ retry:
#else
-int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr TSRMLS_DC)
+int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
struct ifreq if_req;
@@ -736,13 +736,13 @@ int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_add
#else
#error Neither SIOCGIFNAME nor if_indextoname are available
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining address for interface %u: error %d", if_index, errno);
return FAILURE;
}
if (ioctl(php_sock->bsd_socket, SIOCGIFADDR, &if_req) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining address for interface %u: error %d", if_index, errno);
return FAILURE;
}
@@ -752,7 +752,7 @@ int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_add
return SUCCESS;
}
-int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index TSRMLS_DC)
+int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
{
struct ifconf if_conf = {0};
char *buf = NULL,
@@ -774,7 +774,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
if (ioctl(php_sock->bsd_socket, SIOCGIFCONF, (char*)&if_conf) == -1 &&
(errno != EINVAL || lastsize != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining interfaces list: error %d", errno);
goto err;
}
@@ -817,7 +817,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
#else
#error Neither SIOCGIFINDEX nor if_nametoindex are available
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Error converting interface name to index: error %d",
errno);
goto err;
@@ -836,7 +836,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
{
char addr_str[17] = {0};
inet_ntop(AF_INET, addr, addr_str, sizeof(addr_str));
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"The interface with IP address %s was not found", addr_str);
}
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h
index de76dfcec7..05ad28274d 100644
--- a/ext/sockets/multicast.h
+++ b/ext/sockets/multicast.h
@@ -48,38 +48,38 @@
int php_do_setsockopt_ip_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC);
+ zval *arg4);
int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC);
+ zval *arg4);
int php_if_index_to_addr4(
unsigned if_index,
php_socket *php_sock,
- struct in_addr *out_addr TSRMLS_DC);
+ struct in_addr *out_addr);
int php_add4_to_if_index(
struct in_addr *addr,
php_socket *php_sock,
- unsigned *if_index TSRMLS_DC);
+ unsigned *if_index);
-int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC);
+int php_string_to_if_index(const char *val, unsigned *out);
int php_mcast_join(
php_socket *sock,
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_leave(
php_socket *sock,
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
#ifdef HAS_MCAST_EXT
int php_mcast_join_source(
@@ -89,7 +89,7 @@ int php_mcast_join_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_leave_source(
php_socket *sock,
@@ -98,7 +98,7 @@ int php_mcast_leave_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_block_source(
php_socket *sock,
@@ -107,7 +107,7 @@ int php_mcast_block_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_unblock_source(
php_socket *sock,
@@ -116,5 +116,5 @@ int php_mcast_unblock_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
#endif
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 209b4d1659..63638e23e3 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -71,7 +71,7 @@ struct sockaddr_un {
PHP_SOCKETS_API int php_sockets_le_socket(void);
PHP_SOCKETS_API php_socket *php_create_socket(void);
-PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc);
#define php_sockets_le_socket_name "Socket"
@@ -81,7 +81,7 @@ PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
(socket)->error = _err; \
SOCKETS_G(last_error) = _err; \
if (_err != EAGAIN && _err != EWOULDBLOCK && _err != EINPROGRESS) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, sockets_strerror(_err TSRMLS_CC)); \
+ php_error_docref(NULL, E_WARNING, "%s [%d]: %s", msg, _err, sockets_strerror(_err)); \
} \
} while (0)
@@ -91,7 +91,7 @@ ZEND_BEGIN_MODULE_GLOBALS(sockets)
ZEND_END_MODULE_GLOBALS(sockets)
#ifdef ZTS
-#define SOCKETS_G(v) TSRMG(sockets_globals_id, zend_sockets_globals *, v)
+#define SOCKETS_G(v) ZEND_TSRMG(sockets_globals_id, zend_sockets_globals *, v)
#else
#define SOCKETS_G(v) (sockets_globals.v)
#endif
@@ -104,8 +104,8 @@ enum sockopt_return {
SOCKOPT_SUCCESS
};
-char *sockets_strerror(int error TSRMLS_DC);
-php_socket *socket_import_file_descriptor(PHP_SOCKET sock TSRMLS_DC);
+char *sockets_strerror(int error);
+php_socket *socket_import_file_descriptor(PHP_SOCKET sock);
#else
#define phpext_sockets_ptr NULL
diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c
index dcaa60ac7a..eedc9e1639 100644
--- a/ext/sockets/sendrecvmsg.c
+++ b/ext/sockets/sendrecvmsg.c
@@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
#define LONG_CHECK_VALID_INT(l) \
do { \
if ((l) < INT_MIN && (l) > INT_MAX) { \
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value %pd does not fit inside " \
+ php_error_docref0(NULL, E_WARNING, "The value %pd does not fit inside " \
"the boundaries of a native integer", (l)); \
return; \
} \
@@ -175,7 +175,7 @@ PHP_FUNCTION(socket_sendmsg)
ssize_t res;
/* zmsg should be passed by ref */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|l", &zsocket, &zmsg, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|l", &zsocket, &zmsg, &flags) == FAILURE) {
return;
}
@@ -188,7 +188,7 @@ PHP_FUNCTION(socket_sendmsg)
sizeof(*msghdr), "msghdr", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
RETURN_FALSE;
}
@@ -217,7 +217,7 @@ PHP_FUNCTION(socket_recvmsg)
struct err_s err = {0};
//ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra/|l",
&zsocket, &zmsg, &flags) == FAILURE) {
return;
}
@@ -231,7 +231,7 @@ PHP_FUNCTION(socket_recvmsg)
sizeof(*msghdr), "msghdr", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
RETURN_FALSE;
}
@@ -256,15 +256,15 @@ PHP_FUNCTION(socket_recvmsg)
if (!err.has_error) {
ZVAL_COPY_VALUE(zmsg, zres);
} else {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
ZVAL_FALSE(zmsg);
/* no need to destroy/free zres -- it's NULL in this circumstance */
assert(zres == NULL);
}
} else {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error in recvmsg [%d]: %s",
- errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "error in recvmsg [%d]: %s",
+ errno, sockets_strerror(errno));
RETURN_FALSE;
}
@@ -278,7 +278,7 @@ PHP_FUNCTION(socket_cmsg_space)
n = 0;
ancillary_reg_entry *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|l",
&level, &type, &n) == FAILURE) {
return;
}
@@ -288,14 +288,14 @@ PHP_FUNCTION(socket_cmsg_space)
LONG_CHECK_VALID_INT(n);
if (n < 0) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The third argument "
+ php_error_docref0(NULL, E_WARNING, "The third argument "
"cannot be negative");
return;
}
entry = get_ancillary_reg_entry(level, type);
if (entry == NULL) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The pair level %pd/type %pd is "
+ php_error_docref0(NULL, E_WARNING, "The pair level %pd/type %pd is "
"not supported by PHP", level, type);
return;
}
@@ -303,7 +303,7 @@ PHP_FUNCTION(socket_cmsg_space)
if (entry->var_el_size > 0 && n > (ZEND_LONG_MAX - (zend_long)entry->size -
(zend_long)CMSG_SPACE(0) - 15L) / entry->var_el_size) {
/* the -15 is to account for any padding CMSG_SPACE may add after the data */
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value for the "
+ php_error_docref0(NULL, E_WARNING, "The value for the "
"third argument (%pd) is too large", n);
return;
}
@@ -312,7 +312,7 @@ PHP_FUNCTION(socket_cmsg_space)
}
#if HAVE_IPV6
-int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC)
+int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4)
{
struct err_s err = {0};
zend_llist *allocations = NULL;
@@ -327,7 +327,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
case IPV6_PKTINFO:
#ifdef PHP_WIN32
if (Z_TYPE_P(arg4) == IS_ARRAY) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "Windows does not "
+ php_error_docref0(NULL, E_WARNING, "Windows does not "
"support sticky IPV6_PKTINFO");
return FAILURE;
} else {
@@ -340,7 +340,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
opt_ptr = from_zval_run_conversions(arg4, php_sock, from_zval_write_in6_pktinfo,
sizeof(struct in6_pktinfo), "in6_pktinfo", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
return FAILURE;
}
@@ -363,7 +363,7 @@ dosockopt:
return retval != 0 ? FAILURE : SUCCESS;
}
-int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result TSRMLS_DC)
+int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result)
{
struct err_s err = {0};
void *buffer;
@@ -393,7 +393,7 @@ int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
zval *zv = to_zval_run_conversions(buffer, reader, "in6_pktinfo",
empty_key_value_list, &err, &tmp);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
res = -1;
} else {
ZVAL_COPY_VALUE(result, zv);
diff --git a/ext/sockets/sendrecvmsg.h b/ext/sockets/sendrecvmsg.h
index db099ed65e..b12974e4bd 100644
--- a/ext/sockets/sendrecvmsg.h
+++ b/ext/sockets/sendrecvmsg.h
@@ -12,8 +12,8 @@ PHP_FUNCTION(socket_cmsg_space);
void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS);
void php_socket_sendrecvmsg_shutdown(SHUTDOWN_FUNC_ARGS);
-int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC);
-int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result TSRMLS_DC);
+int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4);
+int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result);
/* for conversions.c */
typedef struct {
diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c
index f9de9f1361..db1c2f1111 100644
--- a/ext/sockets/sockaddr_conv.c
+++ b/ext/sockets/sockaddr_conv.c
@@ -9,11 +9,11 @@
#include <arpa/inet.h>
#endif
-extern int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC);
+extern int php_string_to_if_index(const char *val, unsigned *out);
#if HAVE_IPV6
/* Sets addr by hostname, or by ip in string form (AF_INET6) */
-int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock) /* {{{ */
{
struct in6_addr tmp;
#if HAVE_GETADDRINFO
@@ -44,7 +44,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
return 0;
}
if (addrinfo->ai_family != PF_INET6 || addrinfo->ai_addrlen != sizeof(struct sockaddr_in6)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET6 domain returned on AF_INET6 socket");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: Non AF_INET6 domain returned on AF_INET6 socket");
freeaddrinfo(addrinfo);
return 0;
}
@@ -54,7 +54,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
#else
/* No IPv6 specific hostname resolution is available on this system? */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: getaddrinfo() not available on this system");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: getaddrinfo() not available on this system");
return 0;
#endif
@@ -70,7 +70,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
scope_id = lval;
}
} else {
- php_string_to_if_index(scope, &scope_id TSRMLS_CC);
+ php_string_to_if_index(scope, &scope_id);
}
sin6->sin6_scope_id = scope_id;
@@ -82,7 +82,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
#endif
/* Sets addr by hostname, or by ip in string form (AF_INET) */
-int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock) /* {{{ */
{
struct in_addr tmp;
struct hostent *host_entry;
@@ -100,7 +100,7 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc
return 0;
}
if (host_entry->h_addrtype != AF_INET) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET domain returned on AF_INET socket");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: Non AF_INET domain returned on AF_INET socket");
return 0;
}
memcpy(&(sin->sin_addr.s_addr), host_entry->h_addr_list[0], host_entry->h_length);
@@ -112,11 +112,11 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc
/* Sets addr by hostname or by ip in string form (AF_INET or AF_INET6,
* depending on the socket) */
-int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock) /* {{{ */
{
if (php_sock->type == AF_INET) {
struct sockaddr_in t = {0};
- if (php_set_inet_addr(&t, string, php_sock TSRMLS_CC)) {
+ if (php_set_inet_addr(&t, string, php_sock)) {
memcpy(ss, &t, sizeof t);
ss->ss_family = AF_INET;
*ss_len = sizeof(t);
@@ -126,7 +126,7 @@ int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *strin
#if HAVE_IPV6
else if (php_sock->type == AF_INET6) {
struct sockaddr_in6 t = {0};
- if (php_set_inet6_addr(&t, string, php_sock TSRMLS_CC)) {
+ if (php_set_inet6_addr(&t, string, php_sock)) {
memcpy(ss, &t, sizeof t);
ss->ss_family = AF_INET6;
*ss_len = sizeof(t);
@@ -135,7 +135,7 @@ int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *strin
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"IP address used in the context of an unexpected type of socket");
}
return 0;
diff --git a/ext/sockets/sockaddr_conv.h b/ext/sockets/sockaddr_conv.h
index 8e51edac8f..1e7e3cf046 100644
--- a/ext/sockets/sockaddr_conv.h
+++ b/ext/sockets/sockaddr_conv.h
@@ -16,16 +16,16 @@
* The IPv6 literal can be a IPv4 mapped address (like ::ffff:127.0.0.1).
* If the hostname yields no IPv6 addresses, a mapped IPv4 address may be returned (AI_V4MAPPED)
*/
-int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock);
/*
* Convert an IPv4 literal or a hostname into a sockaddr_in.
*/
-int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock);
/*
* Calls either php_set_inet6_addr() or php_set_inet_addr(), depending on the type of the socket.
*/
-int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock);
#endif
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 584d98576f..8e3d37da9b 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -370,6 +370,9 @@ zend_module_entry sockets_module_entry = {
#ifdef COMPILE_DL_SOCKETS
+#ifdef ZTS
+ ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(sockets)
#endif
@@ -398,7 +401,7 @@ PHP_SOCKETS_API php_socket *php_create_socket(void) /* {{{ */
}
/* }}} */
-PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc) /* {{{ */
{
php_socket *php_sock = rsrc->ptr;
@@ -413,7 +416,7 @@ PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSRMLS_DC) /* {{{ */
+static int php_open_listen_sock(php_socket **php_sock, int port, int backlog) /* {{{ */
{
struct sockaddr_in la;
struct hostent *hp;
@@ -463,7 +466,7 @@ static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSR
}
/* }}} */
-static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la, socklen_t *la_len TSRMLS_DC) /* {{{ */
+static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la, socklen_t *la_len) /* {{{ */
{
php_socket *out_sock = php_create_socket();
@@ -550,7 +553,7 @@ static int php_read(php_socket *sock, void *buf, size_t maxlen, int flags)
}
/* }}} */
-char *sockets_strerror(int error TSRMLS_DC) /* {{{ */
+char *sockets_strerror(int error) /* {{{ */
{
const char *buf;
@@ -600,6 +603,9 @@ char *sockets_strerror(int error TSRMLS_DC) /* {{{ */
/* {{{ PHP_GINIT_FUNCTION */
static PHP_GINIT_FUNCTION(sockets)
{
+#if defined(COMPILE_DL_SOCKETS) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
sockets_globals->last_error = 0;
sockets_globals->strerror_buf = NULL;
}
@@ -609,6 +615,9 @@ static PHP_GINIT_FUNCTION(sockets)
*/
static PHP_MINIT_FUNCTION(sockets)
{
+#if defined(COMPILE_DL_SOCKETS) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
le_socket = zend_register_list_destructors_ex(php_destroy_socket, NULL, le_socket_name, module_number);
REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT);
@@ -763,7 +772,7 @@ static PHP_RSHUTDOWN_FUNCTION(sockets)
}
/* }}} */
-static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *max_fd TSRMLS_DC) /* {{{ */
+static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *max_fd) /* {{{ */
{
zval *element;
php_socket *php_sock;
@@ -772,7 +781,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(sock_array), element) {
- php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
+ php_sock = (php_socket*) zend_fetch_resource(element, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
@@ -786,7 +795,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
}
/* }}} */
-static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) /* {{{ */
+static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds) /* {{{ */
{
zval *element;
zval *dest_element;
@@ -800,7 +809,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) /
array_init(&new_hash);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(sock_array), num_key, key, element) {
- php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
+ php_sock = (php_socket*) zend_fetch_resource(element, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) {
@@ -838,7 +847,7 @@ PHP_FUNCTION(socket_select)
int retval, sets = 0;
zend_long usec = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) {
return;
}
@@ -846,12 +855,12 @@ PHP_FUNCTION(socket_select)
FD_ZERO(&wfds);
FD_ZERO(&efds);
- if (r_array != NULL) sets += php_sock_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
- if (w_array != NULL) sets += php_sock_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC);
- if (e_array != NULL) sets += php_sock_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ if (r_array != NULL) sets += php_sock_array_to_fd_set(r_array, &rfds, &max_fd);
+ if (w_array != NULL) sets += php_sock_array_to_fd_set(w_array, &wfds, &max_fd);
+ if (e_array != NULL) sets += php_sock_array_to_fd_set(e_array, &efds, &max_fd);
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no resource arrays were passed to select");
+ php_error_docref(NULL, E_WARNING, "no resource arrays were passed to select");
RETURN_FALSE;
}
@@ -888,13 +897,13 @@ PHP_FUNCTION(socket_select)
if (retval == -1) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s", errno, sockets_strerror(errno));
RETURN_FALSE;
}
- if (r_array != NULL) php_sock_array_from_fd_set(r_array, &rfds TSRMLS_CC);
- if (w_array != NULL) php_sock_array_from_fd_set(w_array, &wfds TSRMLS_CC);
- if (e_array != NULL) php_sock_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ if (r_array != NULL) php_sock_array_from_fd_set(r_array, &rfds);
+ if (w_array != NULL) php_sock_array_from_fd_set(w_array, &wfds);
+ if (e_array != NULL) php_sock_array_from_fd_set(e_array, &efds);
RETURN_LONG(retval);
}
@@ -907,11 +916,11 @@ PHP_FUNCTION(socket_create_listen)
php_socket *php_sock;
zend_long port, backlog = 128;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &port, &backlog) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &port, &backlog) == FAILURE) {
return;
}
- if (!php_open_listen_sock(&php_sock, port, backlog TSRMLS_CC)) {
+ if (!php_open_listen_sock(&php_sock, port, backlog)) {
RETURN_FALSE;
}
@@ -931,13 +940,13 @@ PHP_FUNCTION(socket_accept)
php_sockaddr_storage sa;
socklen_t php_sa_len = sizeof(sa);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(php_sock, php_socket *, arg1, -1, le_socket_name, le_socket);
- if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr*)&sa, &php_sa_len TSRMLS_CC)) {
+ if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr*)&sa, &php_sa_len)) {
RETURN_FALSE;
}
@@ -952,7 +961,7 @@ PHP_FUNCTION(socket_set_nonblock)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -961,7 +970,7 @@ PHP_FUNCTION(socket_set_nonblock)
if (!Z_ISUNDEF(php_sock->zstream)) {
php_stream *stream;
/* omit notice if resource doesn't exist anymore */
- stream = zend_fetch_resource(&php_sock->zstream TSRMLS_CC, -1,
+ stream = zend_fetch_resource(&php_sock->zstream, -1,
NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream != NULL) {
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 0,
@@ -972,7 +981,7 @@ PHP_FUNCTION(socket_set_nonblock)
}
}
- if (php_set_sock_blocking(php_sock->bsd_socket, 0 TSRMLS_CC) == SUCCESS) {
+ if (php_set_sock_blocking(php_sock->bsd_socket, 0) == SUCCESS) {
php_sock->blocking = 0;
RETURN_TRUE;
} else {
@@ -989,7 +998,7 @@ PHP_FUNCTION(socket_set_block)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -1000,7 +1009,7 @@ PHP_FUNCTION(socket_set_block)
* state */
if (!Z_ISUNDEF(php_sock->zstream)) {
php_stream *stream;
- stream = zend_fetch_resource(&php_sock->zstream TSRMLS_CC, -1,
+ stream = zend_fetch_resource(&php_sock->zstream, -1,
NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream != NULL) {
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 1,
@@ -1011,7 +1020,7 @@ PHP_FUNCTION(socket_set_block)
}
}
- if (php_set_sock_blocking(php_sock->bsd_socket, 1 TSRMLS_CC) == SUCCESS) {
+ if (php_set_sock_blocking(php_sock->bsd_socket, 1) == SUCCESS) {
php_sock->blocking = 1;
RETURN_TRUE;
} else {
@@ -1029,7 +1038,7 @@ PHP_FUNCTION(socket_listen)
php_socket *php_sock;
zend_long backlog = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &backlog) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &arg1, &backlog) == FAILURE) {
return;
}
@@ -1050,7 +1059,7 @@ PHP_FUNCTION(socket_close)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -1080,7 +1089,7 @@ PHP_FUNCTION(socket_write)
zend_long length = 0;
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &arg1, &str, &str_len, &length) == FAILURE) {
return;
}
@@ -1115,7 +1124,7 @@ PHP_FUNCTION(socket_read)
int retval;
zend_long length, type = PHP_BINARY_READ;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &arg1, &length, &type) == FAILURE) {
return;
}
@@ -1180,7 +1189,7 @@ PHP_FUNCTION(socket_getsockname)
char *addr_string;
socklen_t salen = sizeof(php_sockaddr_storage);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|z/", &arg1, &addr, &port) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|z/", &arg1, &addr, &port) == FAILURE) {
return;
}
@@ -1238,7 +1247,7 @@ PHP_FUNCTION(socket_getsockname)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family);
+ php_error_docref(NULL, E_WARNING, "Unsupported address family %d", sa->sa_family);
RETURN_FALSE;
}
}
@@ -1261,7 +1270,7 @@ PHP_FUNCTION(socket_getpeername)
char *addr_string;
socklen_t salen = sizeof(php_sockaddr_storage);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|z/", &arg1, &arg2, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|z/", &arg1, &arg2, &arg3) == FAILURE) {
return;
}
@@ -1317,7 +1326,7 @@ PHP_FUNCTION(socket_getpeername)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family);
+ php_error_docref(NULL, E_WARNING, "Unsupported address family %d", sa->sa_family);
RETURN_FALSE;
}
}
@@ -1330,7 +1339,7 @@ PHP_FUNCTION(socket_create)
zend_long arg1, arg2, arg3;
php_socket *php_sock = php_create_socket();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &arg1, &arg2, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &arg1, &arg2, &arg3) == FAILURE) {
efree(php_sock);
return;
}
@@ -1340,12 +1349,12 @@ PHP_FUNCTION(socket_create)
&& arg1 != AF_INET6
#endif
&& arg1 != AF_INET) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", arg1);
+ php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", arg1);
arg1 = AF_INET;
}
if (arg2 > 10) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", arg2);
+ php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", arg2);
arg2 = SOCK_STREAM;
}
@@ -1354,7 +1363,7 @@ PHP_FUNCTION(socket_create)
if (IS_INVALID_SOCKET(php_sock)) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create socket [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "Unable to create socket [%d]: %s", errno, sockets_strerror(errno));
efree(php_sock);
RETURN_FALSE;
}
@@ -1378,7 +1387,7 @@ PHP_FUNCTION(socket_connect)
zend_long port = 0;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1390,7 +1399,7 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_in6 sin6 = {0};
if (argc != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET6 requires 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Socket of type AF_INET6 requires 3 arguments");
RETURN_FALSE;
}
@@ -1399,7 +1408,7 @@ PHP_FUNCTION(socket_connect)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons((unsigned short int)port);
- if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(&sin6, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1411,14 +1420,14 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_in sin = {0};
if (argc != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET requires 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Socket of type AF_INET requires 3 arguments");
RETURN_FALSE;
}
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short int)port);
- if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(&sin, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1430,7 +1439,7 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_un s_un = {0};
if (addr_len >= sizeof(s_un.sun_path)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Path too long");
+ php_error_docref(NULL, E_WARNING, "Path too long");
RETURN_FALSE;
}
@@ -1442,7 +1451,7 @@ PHP_FUNCTION(socket_connect)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1461,11 +1470,11 @@ PHP_FUNCTION(socket_strerror)
{
zend_long arg1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg1) == FAILURE) {
return;
}
- RETURN_STRING(sockets_strerror(arg1 TSRMLS_CC));
+ RETURN_STRING(sockets_strerror(arg1));
}
/* }}} */
@@ -1482,7 +1491,7 @@ PHP_FUNCTION(socket_bind)
zend_long port = 0;
zend_long retval = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1496,7 +1505,7 @@ PHP_FUNCTION(socket_bind)
sa->sun_family = AF_UNIX;
if (addr_len >= sizeof(sa->sun_path)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid path: too long (maximum size is %d)",
(int)sizeof(sa->sun_path) - 1);
RETURN_FALSE;
@@ -1515,7 +1524,7 @@ PHP_FUNCTION(socket_bind)
sa->sin_family = AF_INET;
sa->sin_port = htons((unsigned short) port);
- if (! php_set_inet_addr(sa, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(sa, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1530,7 +1539,7 @@ PHP_FUNCTION(socket_bind)
sa->sin6_family = AF_INET6;
sa->sin6_port = htons((unsigned short) port);
- if (! php_set_inet6_addr(sa, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(sa, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1539,7 +1548,7 @@ PHP_FUNCTION(socket_bind)
}
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported socket type '%d', must be AF_UNIX, AF_INET, or AF_INET6", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "unsupported socket type '%d', must be AF_UNIX, AF_INET, or AF_INET6", php_sock->type);
RETURN_FALSE;
}
@@ -1562,7 +1571,7 @@ PHP_FUNCTION(socket_recv)
int retval;
zend_long len, flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/ll", &php_sock_res, &buf, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/ll", &php_sock_res, &buf, &len, &flags) == FAILURE) {
return;
}
@@ -1608,7 +1617,7 @@ PHP_FUNCTION(socket_send)
zend_long len, flags;
char *buf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) {
return;
}
@@ -1643,7 +1652,7 @@ PHP_FUNCTION(socket_recvfrom)
char *address;
zend_string *recv_buf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/llz/|z/", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/llz/|z/", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
return;
}
@@ -1741,7 +1750,7 @@ PHP_FUNCTION(socket_recvfrom)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1766,7 +1775,7 @@ PHP_FUNCTION(socket_sendto)
char *buf, *addr;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(argc, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1790,7 +1799,7 @@ PHP_FUNCTION(socket_sendto)
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short) port);
- if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(&sin, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1806,7 +1815,7 @@ PHP_FUNCTION(socket_sendto)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons((unsigned short) port);
- if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(&sin6, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1814,7 +1823,7 @@ PHP_FUNCTION(socket_sendto)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1842,7 +1851,7 @@ PHP_FUNCTION(socket_get_option)
int other_val;
zend_long level, optname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1, &level, &optname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &arg1, &level, &optname) == FAILURE) {
return;
}
@@ -1858,7 +1867,7 @@ PHP_FUNCTION(socket_get_option)
PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno);
RETURN_FALSE;
}
- if (php_add4_to_if_index(&if_addr, php_sock, &if_index TSRMLS_CC) == SUCCESS) {
+ if (php_add4_to_if_index(&if_addr, php_sock, &if_index) == SUCCESS) {
RETURN_LONG((zend_long) if_index);
} else {
RETURN_FALSE;
@@ -1868,7 +1877,7 @@ PHP_FUNCTION(socket_get_option)
}
#if HAVE_IPV6
else if (level == IPPROTO_IPV6) {
- int ret = php_do_getsockopt_ipv6_rfc3542(php_sock, level, optname, return_value TSRMLS_CC);
+ int ret = php_do_getsockopt_ipv6_rfc3542(php_sock, level, optname, return_value);
if (ret == SUCCESS) {
return;
} else if (ret == FAILURE) {
@@ -1955,7 +1964,7 @@ PHP_FUNCTION(socket_set_option)
zval *sec, *usec;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllz", &arg1, &level, &optname, &arg4) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllz", &arg1, &level, &optname, &arg4) == FAILURE) {
return;
}
@@ -1972,15 +1981,15 @@ PHP_FUNCTION(socket_set_option)
if (level == IPPROTO_IP) {
- int res = php_do_setsockopt_ip_mcast(php_sock, level, optname, arg4 TSRMLS_CC);
+ int res = php_do_setsockopt_ip_mcast(php_sock, level, optname, arg4);
HANDLE_SUBCALL(res);
}
#if HAVE_IPV6
else if (level == IPPROTO_IPV6) {
- int res = php_do_setsockopt_ipv6_mcast(php_sock, level, optname, arg4 TSRMLS_CC);
+ int res = php_do_setsockopt_ipv6_mcast(php_sock, level, optname, arg4);
if (res == 1) {
- res = php_do_setsockopt_ipv6_rfc3542(php_sock, level, optname, arg4 TSRMLS_CC);
+ res = php_do_setsockopt_ipv6_rfc3542(php_sock, level, optname, arg4);
}
HANDLE_SUBCALL(res);
}
@@ -1995,11 +2004,11 @@ PHP_FUNCTION(socket_set_option)
opt_ht = HASH_OF(arg4);
if ((l_onoff = zend_hash_str_find(opt_ht, l_onoff_key, sizeof(l_onoff_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
RETURN_FALSE;
}
if ((l_linger = zend_hash_str_find(opt_ht, l_linger_key, sizeof(l_linger_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_linger_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", l_linger_key);
RETURN_FALSE;
}
@@ -2023,11 +2032,11 @@ PHP_FUNCTION(socket_set_option)
opt_ht = HASH_OF(arg4);
if ((sec = zend_hash_str_find(opt_ht, sec_key, sizeof(sec_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", sec_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", sec_key);
RETURN_FALSE;
}
if ((usec = zend_hash_str_find(opt_ht, usec_key, sizeof(usec_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", usec_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", usec_key);
RETURN_FALSE;
}
@@ -2088,7 +2097,7 @@ PHP_FUNCTION(socket_create_pair)
PHP_SOCKET fds_array[2];
zend_long domain, type, protocol;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllz/", &domain, &type, &protocol, &fds_array_zval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lllz/", &domain, &type, &protocol, &fds_array_zval) == FAILURE) {
return;
}
@@ -2100,18 +2109,18 @@ PHP_FUNCTION(socket_create_pair)
&& domain != AF_INET6
#endif
&& domain != AF_UNIX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", domain);
+ php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", domain);
domain = AF_INET;
}
if (type > 10) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", type);
+ php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", type);
type = SOCK_STREAM;
}
if (socketpair(domain, type, protocol, fds_array) != 0) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create socket pair [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "unable to create socket pair [%d]: %s", errno, sockets_strerror(errno));
efree(php_sock[0]);
efree(php_sock[1]);
RETURN_FALSE;
@@ -2149,7 +2158,7 @@ PHP_FUNCTION(socket_shutdown)
zend_long how_shutdown = 2;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &how_shutdown) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &arg1, &how_shutdown) == FAILURE) {
return;
}
@@ -2172,7 +2181,7 @@ PHP_FUNCTION(socket_last_error)
zval *arg1 = NULL;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg1) == FAILURE) {
return;
}
@@ -2192,7 +2201,7 @@ PHP_FUNCTION(socket_clear_error)
zval *arg1 = NULL;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg1) == FAILURE) {
return;
}
@@ -2207,7 +2216,7 @@ PHP_FUNCTION(socket_clear_error)
}
/* }}} */
-php_socket *socket_import_file_descriptor(PHP_SOCKET socket TSRMLS_DC)
+php_socket *socket_import_file_descriptor(PHP_SOCKET socket)
{
#ifdef SO_DOMAIN
int type;
@@ -2263,7 +2272,7 @@ PHP_FUNCTION(socket_import_stream)
php_socket *retsock = NULL;
PHP_SOCKET socket; /* fd */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstream) == FAILURE) {
return;
}
php_stream_from_zval(stream, zstream);
@@ -2273,7 +2282,7 @@ PHP_FUNCTION(socket_import_stream)
RETURN_FALSE;
}
- retsock = socket_import_file_descriptor(socket TSRMLS_CC);
+ retsock = socket_import_file_descriptor(socket);
if (retsock == NULL) {
RETURN_FALSE;
}
diff --git a/ext/spl/config.m4 b/ext/spl/config.m4
index a0f0d1a06d..869e542ef4 100755
--- a/ext/spl/config.m4
+++ b/ext/spl/config.m4
@@ -22,6 +22,6 @@ int main(int argc, char **argv) {
CPPFLAGS=$old_CPPFLAGS
AC_DEFINE_UNQUOTED(HAVE_PACKED_OBJECT_VALUE, $ac_result, [Whether struct _zend_object_value is packed])
AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support])
- PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no)
+ PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/spl], [php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h])
PHP_ADD_EXTENSION_DEP(spl, pcre, true)
diff --git a/ext/spl/config.w32 b/ext/spl/config.w32
index 77cbd20346..56c466c220 100644
--- a/ext/spl/config.w32
+++ b/ext/spl/config.w32
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
-EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */);
+EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_SPL', 1);
PHP_SPL="yes";
PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h");
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index aa740c40e2..bd6fa9019b 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -61,7 +61,7 @@ static PHP_GINIT_FUNCTION(spl)
}
/* }}} */
-static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload TSRMLS_DC)
+static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload)
{
zend_class_entry *ce;
@@ -72,10 +72,10 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autol
ce = zend_hash_find_ptr(EG(class_table), lc_name);
zend_string_free(lc_name);
} else {
- ce = zend_lookup_class(name TSRMLS_CC);
+ ce = zend_lookup_class(name);
}
if (ce == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : "");
+ php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : "");
return NULL;
}
@@ -90,17 +90,17 @@ PHP_FUNCTION(class_parents)
zend_class_entry *parent_class, *ce;
zend_bool autoload = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -110,7 +110,7 @@ PHP_FUNCTION(class_parents)
array_init(return_value);
parent_class = ce->parent;
while (parent_class) {
- spl_add_class_name(return_value, parent_class, 0, 0 TSRMLS_CC);
+ spl_add_class_name(return_value, parent_class, 0, 0);
parent_class = parent_class->parent;
}
}
@@ -124,16 +124,16 @@ PHP_FUNCTION(class_implements)
zend_bool autoload = 1;
zend_class_entry *ce;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -141,7 +141,7 @@ PHP_FUNCTION(class_implements)
}
array_init(return_value);
- spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE TSRMLS_CC);
+ spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE);
}
/* }}} */
@@ -153,16 +153,16 @@ PHP_FUNCTION(class_uses)
zend_bool autoload = 1;
zend_class_entry *ce;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -170,12 +170,12 @@ PHP_FUNCTION(class_uses)
}
array_init(return_value);
- spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT TSRMLS_CC);
+ spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT);
}
/* }}} */
#define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \
- spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC)
+ spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags)
#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \
SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \
@@ -245,7 +245,7 @@ PHP_FUNCTION(spl_classes)
}
/* }}} */
-static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len TSRMLS_DC) /* {{{ */
+static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len) /* {{{ */
{
char *class_file;
int class_file_len;
@@ -268,7 +268,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
}
#endif
- ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE);
if (ret == SUCCESS) {
zend_string *opened_path;
@@ -278,18 +278,18 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
opened_path = zend_string_init(file_handle.opened_path, strlen(file_handle.opened_path), 0);
ZVAL_NULL(&dummy);
if (zend_hash_add(&EG(included_files), opened_path, &dummy)) {
- new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE);
+ zend_destroy_file_handle(&file_handle);
} else {
new_op_array = NULL;
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
}
zend_string_release(opened_path);
if (new_op_array) {
ZVAL_UNDEF(&result);
- zend_execute(new_op_array, &result TSRMLS_CC);
+ zend_execute(new_op_array, &result);
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree(new_op_array);
if (!EG(exception)) {
zval_ptr_dtor(&result);
@@ -311,7 +311,7 @@ PHP_FUNCTION(spl_autoload)
char *pos, *pos1;
zend_string *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &class_name, &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &class_name, &file_exts) == FAILURE) {
RETURN_FALSE;
}
@@ -332,7 +332,7 @@ PHP_FUNCTION(spl_autoload)
} else {
pos1_len = pos_len;
}
- if (spl_autoload(class_name, lc_name, pos, pos1_len TSRMLS_CC)) {
+ if (spl_autoload(class_name, lc_name, pos, pos1_len)) {
found = 1;
break; /* loaded */
}
@@ -354,9 +354,9 @@ PHP_FUNCTION(spl_autoload)
if (ex &&
ex->opline->opcode != ZEND_FETCH_CLASS &&
ex->opline->opcode != ZEND_NEW) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name->val);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Class %s could not be loaded", class_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be loaded", class_name->val);
+ php_error_docref(NULL, E_ERROR, "Class %s could not be loaded", class_name->val);
}
}
} /* }}} */
@@ -367,7 +367,7 @@ PHP_FUNCTION(spl_autoload_extensions)
{
zend_string *file_exts = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &file_exts) == FAILURE) {
return;
}
if (file_exts) {
@@ -412,7 +412,7 @@ PHP_FUNCTION(spl_autoload_call)
zend_string *lc_name, *func_name;
autoload_func_info *alfi;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) {
return;
}
@@ -422,8 +422,8 @@ PHP_FUNCTION(spl_autoload_call)
lc_name = zend_string_alloc(Z_STRLEN_P(class_name), 0);
zend_str_tolower_copy(lc_name->val, Z_STRVAL_P(class_name), Z_STRLEN_P(class_name));
ZEND_HASH_FOREACH_STR_KEY_PTR(SPL_G(autoload_functions), func_name, alfi) {
- zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL TSRMLS_CC);
- zend_exception_save(TSRMLS_C);
+ zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL);
+ zend_exception_save();
if (retval) {
zval_ptr_dtor(retval);
retval = NULL;
@@ -432,7 +432,7 @@ PHP_FUNCTION(spl_autoload_call)
break;
}
} ZEND_HASH_FOREACH_END();
- zend_exception_restore(TSRMLS_C);
+ zend_exception_restore();
zend_string_free(lc_name);
SPL_G(autoload_running) = l_autoload_running;
} else {
@@ -465,19 +465,19 @@ PHP_FUNCTION(spl_autoload_register)
zend_object *obj_ptr;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS()) {
- if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error TSRMLS_CC)) {
+ if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error)) {
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
obj_ptr = fcc.object;
if (Z_TYPE_P(zcallable) == IS_ARRAY) {
if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object (%s)", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array specifies a non static method but no object (%s)", error);
}
if (error) {
efree(error);
@@ -485,7 +485,7 @@ PHP_FUNCTION(spl_autoload_register)
zend_string_release(func_name);
RETURN_FALSE;
} else if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error);
}
if (error) {
efree(error);
@@ -494,7 +494,7 @@ PHP_FUNCTION(spl_autoload_register)
RETURN_FALSE;
} else if (Z_TYPE_P(zcallable) == IS_STRING) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error);
}
if (error) {
efree(error);
@@ -503,7 +503,7 @@ PHP_FUNCTION(spl_autoload_register)
RETURN_FALSE;
} else {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed (%s)", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Illegal value passed (%s)", error);
}
if (error) {
efree(error);
@@ -514,7 +514,7 @@ PHP_FUNCTION(spl_autoload_register)
} else if (fcc.function_handler->type == ZEND_INTERNAL_FUNCTION &&
fcc.function_handler->internal_function.handler == zif_spl_autoload_call) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered");
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Function spl_autoload_call() cannot be registered");
}
if (error) {
efree(error);
@@ -621,12 +621,12 @@ PHP_FUNCTION(spl_autoload_unregister)
zend_object *obj_ptr;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zcallable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcallable) == FAILURE) {
return;
}
- if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Unable to unregister invalid function (%s)", error);
+ if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error)) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Unable to unregister invalid function (%s)", error);
if (error) {
efree(error);
}
@@ -745,25 +745,25 @@ PHP_FUNCTION(spl_object_hash)
{
zval *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC));
+ RETURN_NEW_STR(php_spl_object_hash(obj));
}
/* }}} */
-PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/
+PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
{
intptr_t hash_handle, hash_handlers;
if (!SPL_G(hash_mask_init)) {
if (!BG(mt_rand_is_seeded)) {
- php_mt_srand((uint32_t)GENERATE_SEED() TSRMLS_CC);
+ php_mt_srand((uint32_t)GENERATE_SEED());
}
- SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1);
- SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1);
+ SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand() >> 1);
+ SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand() >> 1);
SPL_G(hash_mask_init) = 1;
}
@@ -774,7 +774,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/
}
/* }}} */
-int spl_build_class_list_string(zval *entry, char **list TSRMLS_DC) /* {{{ */
+int spl_build_class_list_string(zval *entry, char **list) /* {{{ */
{
char *res;
@@ -797,7 +797,7 @@ PHP_MINFO_FUNCTION(spl)
array_init(&list);
SPL_LIST_CLASSES(&list, 0, 1, ZEND_ACC_INTERFACE)
strg = estrdup("");
- zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg);
zval_dtor(&list);
php_info_print_table_row(2, "Interfaces", strg + 2);
efree(strg);
@@ -805,7 +805,7 @@ PHP_MINFO_FUNCTION(spl)
array_init(&list);
SPL_LIST_CLASSES(&list, 0, -1, ZEND_ACC_INTERFACE)
strg = estrdup("");
- zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg);
zval_dtor(&list);
php_info_print_table_row(2, "Classes", strg + 2);
efree(strg);
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index 534a03885e..6d075e6c3f 100644
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -67,7 +67,7 @@ ZEND_BEGIN_MODULE_GLOBALS(spl)
ZEND_END_MODULE_GLOBALS(spl)
#ifdef ZTS
-# define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v)
+# define SPL_G(v) ZEND_TSRMG(spl_globals_id, zend_spl_globals *, v)
extern int spl_globals_id;
#else
# define SPL_G(v) (spl_globals.v)
@@ -79,7 +79,7 @@ PHP_FUNCTION(class_parents);
PHP_FUNCTION(class_implements);
PHP_FUNCTION(class_uses);
-PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC);
+PHPAPI zend_string *php_spl_object_hash(zval *obj);
#endif /* PHP_SPL_H */
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 8aab4c49bf..4f6efcac7d 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -87,7 +87,7 @@ static inline spl_array_object *spl_array_from_obj(zend_object *obj) /* {{{ */ {
#define Z_SPLARRAY_P(zv) spl_array_from_obj(Z_OBJ_P((zv)))
-static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) { /* {{{ */
+static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props) { /* {{{ */
if ((intern->ar_flags & SPL_ARRAY_IS_SELF) != 0) {
if (!intern->std.properties) {
rebuild_object_properties(&intern->std);
@@ -95,7 +95,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int
return intern->std.properties;
} else if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0) && Z_TYPE(intern->array) == IS_OBJECT) {
spl_array_object *other = Z_SPLARRAY_P(&intern->array);
- return spl_array_get_hash_table(other, check_std_props TSRMLS_CC);
+ return spl_array_get_hash_table(other, check_std_props);
} else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) {
if (!intern->std.properties) {
rebuild_object_properties(&intern->std);
@@ -106,7 +106,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int
}
} /* }}} */
-static void spl_array_rewind(spl_array_object *intern TSRMLS_DC);
+static void spl_array_rewind(spl_array_object *intern);
static void spl_array_update_pos(HashTable *ht, spl_array_object* intern) /* {{{ */
{
@@ -122,7 +122,7 @@ static void spl_array_set_pos(spl_array_object* intern, HashTable *ht, HashPosit
spl_array_update_pos(ht, intern);
} /* }}} */
-SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSRMLS_DC) /* {{{ */
+SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht) /* {{{ */
{
uint idx;
@@ -143,24 +143,24 @@ SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSR
}
}
/* HASH_UNPROTECT_RECURSION(ht); */
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
return FAILURE;
} /* }}} */
-SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */
+SPL_API int spl_hash_verify_pos(spl_array_object * intern) /* {{{ */
{
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
- return spl_hash_verify_pos_ex(intern, ht TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
+ return spl_hash_verify_pos_ex(intern, ht);
}
/* }}} */
/* {{{ spl_array_object_free_storage */
-static void spl_array_object_free_storage(zend_object *object TSRMLS_DC)
+static void spl_array_object_free_storage(zend_object *object)
{
spl_array_object *intern = spl_array_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zval_ptr_dtor(&intern->array);
zval_ptr_dtor(&intern->retval);
@@ -172,10 +172,10 @@ static void spl_array_object_free_storage(zend_object *object TSRMLS_DC)
}
/* }}} */
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
/* {{{ spl_array_object_new_ex */
-static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC)
+static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig)
{
spl_array_object *intern;
zend_class_entry *parent = class_type;
@@ -183,7 +183,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
intern = ecalloc(1, sizeof(spl_array_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->ar_flags = 0;
@@ -227,7 +227,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
inherited = 1;
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator");
}
if (inherited) {
intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1);
@@ -270,40 +270,40 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
}
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
return &intern->std;
}
/* }}} */
/* {{{ spl_array_object_new */
-static zend_object *spl_array_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_array_object_new(zend_class_entry *class_type)
{
- return spl_array_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_array_object_new_ex(class_type, NULL, 0);
}
/* }}} */
/* {{{ spl_array_object_clone */
-static zend_object *spl_array_object_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_array_object_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_array_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_array_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
+static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type) /* {{{ */
{
zval *retval;
zend_long index;
zend_string *offset_key;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
if (!offset || Z_ISUNDEF_P(offset)) {
return &EG(uninitialized_zval);
@@ -400,7 +400,7 @@ num_index:
}
} /* }}} */
-static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv) /* {{{ */
{
zval *ret;
@@ -424,7 +424,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
return &EG(uninitialized_zval);
}
}
- ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type TSRMLS_CC);
+ ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type);
//!!! FIXME?
// ZVAL_COPY(result, ret);
@@ -442,12 +442,12 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
return ret;
} /* }}} */
-static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
- return spl_array_read_dimension_ex(1, object, offset, type, rv TSRMLS_CC);
+ return spl_array_read_dimension_ex(1, object, offset, type, rv);
} /* }}} */
-static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long index;
@@ -468,7 +468,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
}
if (!offset) {
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -485,7 +485,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
}
switch (Z_TYPE_P(offset)) {
case IS_STRING:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -507,7 +507,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
case IS_LONG:
index = Z_LVAL_P(offset);
num_index:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -515,7 +515,7 @@ num_index:
zend_hash_index_update(ht, index, value);
return;
case IS_NULL:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -528,12 +528,12 @@ num_index:
}
} /* }}} */
-static void spl_array_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_array_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
- spl_array_write_dimension_ex(1, object, offset, value TSRMLS_CC);
+ spl_array_write_dimension_ex(1, object, offset, value);
} /* }}} */
-static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset) /* {{{ */
{
zend_long index;
HashTable *ht;
@@ -548,13 +548,13 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
if (ht == &EG(symbol_table).ht) {
- if (zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC)) {
+ if (zend_delete_global_variable(Z_STR_P(offset))) {
zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
} else {
@@ -574,7 +574,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
ZVAL_UNDEF(data);
}
//??? fix for ext/spl/tests/bug45614.phpt (may be fix is wrong)
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
} else if (zend_symtable_del(ht, Z_STR_P(offset)) == FAILURE) {
zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
@@ -599,7 +599,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
case IS_LONG:
index = Z_LVAL_P(offset);
num_index:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -612,15 +612,15 @@ num_index:
zend_error(E_WARNING, "Illegal offset type");
return;
}
- spl_hash_verify_pos(intern TSRMLS_CC); /* call rewind on FAILURE */
+ spl_hash_verify_pos(intern); /* call rewind on FAILURE */
} /* }}} */
-static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_array_unset_dimension(zval *object, zval *offset) /* {{{ */
{
- spl_array_unset_dimension_ex(1, object, offset TSRMLS_CC);
+ spl_array_unset_dimension_ex(1, object, offset);
} /* }}} */
-static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long index;
@@ -636,12 +636,12 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
zend_call_method_with_1_params(object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset);
zval_ptr_dtor(offset);
- if (!Z_ISUNDEF(rv) && zend_is_true(&rv TSRMLS_CC)) {
+ if (!Z_ISUNDEF(rv) && zend_is_true(&rv)) {
zval_ptr_dtor(&rv);
if (check_empty != 1) {
return 1;
} else if (intern->fptr_offset_get) {
- value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC);
+ value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv);
}
} else {
zval_ptr_dtor(&rv);
@@ -650,7 +650,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
}
if (!value) {
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
switch(Z_TYPE_P(offset)) {
case IS_STRING:
@@ -693,30 +693,30 @@ num_index:
}
if (check_empty && check_inherited && intern->fptr_offset_get) {
- value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC);
+ value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv);
} else {
value = tmp;
}
}
- return check_empty ? zend_is_true(value TSRMLS_CC) : Z_TYPE_P(value) != IS_NULL;
+ return check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
} /* }}} */
-static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_array_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
- return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC);
+ return spl_array_has_dimension_ex(1, object, offset, check_empty);
} /* }}} */
/* {{{ spl_array_object_verify_pos_ex */
-static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix TSRMLS_DC)
+static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix)
{
if (!ht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix);
+ php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix);
return FAILURE;
}
- if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix);
+ if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix);
return FAILURE;
}
@@ -724,9 +724,9 @@ static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashT
} /* }}} */
/* {{{ spl_array_object_verify_pos */
-static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht TSRMLS_DC)
+static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht)
{
- return spl_array_object_verify_pos_ex(object, ht, "" TSRMLS_CC);
+ return spl_array_object_verify_pos_ex(object, ht, "");
} /* }}} */
/* {{{ proto bool ArrayObject::offsetExists(mixed $index)
@@ -735,10 +735,10 @@ static inline int spl_array_object_verify_pos(spl_array_object *object, HashTabl
SPL_METHOD(Array, offsetExists)
{
zval *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2 TSRMLS_CC));
+ RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2));
} /* }}} */
/* {{{ proto mixed ArrayObject::offsetGet(mixed $index)
@@ -747,10 +747,10 @@ SPL_METHOD(Array, offsetExists)
SPL_METHOD(Array, offsetGet)
{
zval *value, *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value TSRMLS_CC);
+ value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value);
if (value != return_value) {
RETURN_ZVAL(value, 1, 0);
}
@@ -762,28 +762,28 @@ SPL_METHOD(Array, offsetGet)
SPL_METHOD(Array, offsetSet)
{
zval *index, *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &index, &value) == FAILURE) {
return;
}
- spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC);
+ spl_array_write_dimension_ex(0, getThis(), index, value);
} /* }}} */
-void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */
+void spl_array_iterator_append(zval *object, zval *append_value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
if (Z_TYPE(intern->array) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val);
return;
}
- spl_array_write_dimension(object, NULL, append_value TSRMLS_CC);
+ spl_array_write_dimension(object, NULL, append_value);
if (intern->pos == INVALID_IDX) {
if (aht->nNumUsed && !Z_ISUNDEF(aht->arData[aht->nNumUsed-1].val)) {
spl_array_set_pos(intern, aht, aht->nNumUsed - 1);
@@ -798,10 +798,10 @@ SPL_METHOD(Array, append)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
- spl_array_iterator_append(getThis(), value TSRMLS_CC);
+ spl_array_iterator_append(getThis(), value);
} /* }}} */
/* {{{ proto void ArrayObject::offsetUnset(mixed $index)
@@ -810,10 +810,10 @@ SPL_METHOD(Array, append)
SPL_METHOD(Array, offsetUnset)
{
zval *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- spl_array_unset_dimension_ex(0, getThis(), index TSRMLS_CC);
+ spl_array_unset_dimension_ex(0, getThis(), index);
} /* }}} */
/* {{{ proto array ArrayObject::getArrayCopy()
@@ -825,25 +825,25 @@ SPL_METHOD(Array, getArrayCopy)
spl_array_object *intern = Z_SPLARRAY_P(object);
ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC));
+ zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0));
} /* }}} */
-static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *spl_array_get_properties(zval *object) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *result;
if (intern->nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Nesting level too deep - recursive dependency?");
+ php_error_docref(NULL, E_ERROR, "Nesting level too deep - recursive dependency?");
}
intern->nApplyCount++;
- result = spl_array_get_hash_table(intern, 1 TSRMLS_CC);
+ result = spl_array_get_hash_table(intern, 1);
intern->nApplyCount--;
return result;
} /* }}} */
-static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
zval *storage;
zend_string *zname;
@@ -872,7 +872,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /*
zval_add_ref(storage);
base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject;
- zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1 TSRMLS_CC);
+ zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1);
zend_symtable_update(intern->debug_info, zname, storage);
zend_string_release(zname);
}
@@ -882,67 +882,67 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /*
}
/* }}} */
-static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_read_dimension(object, member, type, rv TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_read_dimension(object, member, type, rv);
}
- return std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ return std_object_handlers.read_property(object, member, type, cache_slot, rv);
} /* }}} */
-static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- spl_array_write_dimension(object, member, value TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ spl_array_write_dimension(object, member, value);
return;
}
- std_object_handlers.write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_object_handlers.write_property(object, member, value, cache_slot);
} /* }}} */
-static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_get_dimension_ptr(1, object, member, type TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_get_dimension_ptr(1, object, member, type);
}
//!!! FIXME
- //return std_object_handlers.get_property_ptr_ptr(object, member, type, key TSRMLS_CC);
+ //return std_object_handlers.get_property_ptr_ptr(object, member, type, key);
return NULL;
} /* }}} */
-static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_has_dimension(object, member, has_set_exists TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_has_dimension(object, member, has_set_exists);
}
- return std_object_handlers.has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ return std_object_handlers.has_property(object, member, has_set_exists, cache_slot);
} /* }}} */
-static void spl_array_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void spl_array_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- spl_array_unset_dimension(object, member TSRMLS_CC);
- spl_array_rewind(intern TSRMLS_CC); /* because deletion might invalidate position */
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ spl_array_unset_dimension(object, member);
+ spl_array_rewind(intern); /* because deletion might invalidate position */
return;
}
- std_object_handlers.unset_property(object, member, cache_slot TSRMLS_CC);
+ std_object_handlers.unset_property(object, member, cache_slot);
} /* }}} */
-static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int spl_array_compare_objects(zval *o1, zval *o2) /* {{{ */
{
HashTable *ht1,
*ht2;
@@ -953,20 +953,20 @@ static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
intern1 = Z_SPLARRAY_P(o1);
intern2 = Z_SPLARRAY_P(o2);
- ht1 = spl_array_get_hash_table(intern1, 0 TSRMLS_CC);
- ht2 = spl_array_get_hash_table(intern2, 0 TSRMLS_CC);
+ ht1 = spl_array_get_hash_table(intern1, 0);
+ ht2 = spl_array_get_hash_table(intern2, 0);
- zend_compare_symbol_tables(&temp_zv, ht1, ht2 TSRMLS_CC);
+ zend_compare_symbol_tables(&temp_zv, ht1, ht2);
result = (int)Z_LVAL(temp_zv);
/* if we just compared std.properties, don't do it again */
if (result == 0 &&
!(ht1 == intern1->std.properties && ht2 == intern2->std.properties)) {
- result = std_object_handlers.compare_objects(o1, o2 TSRMLS_CC);
+ result = std_object_handlers.compare_objects(o1, o2);
}
return result;
} /* }}} */
-static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_string *string_key;
zend_ulong num_key;
@@ -995,51 +995,51 @@ static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSR
return FAILURE;
} /* }}} */
-static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_hash_move_forward_ex(aht, &intern->pos);
spl_array_update_pos(aht, intern);
if (Z_TYPE(intern->array) == IS_OBJECT) {
- return spl_array_skip_protected(intern, aht TSRMLS_CC);
+ return spl_array_skip_protected(intern, aht);
} else {
return zend_hash_has_more_elements_ex(aht, &intern->pos);
}
} /* }}} */
-static int spl_array_next_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_next_ex(spl_array_object *intern, HashTable *aht) /* {{{ */
{
- if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
return FAILURE;
}
- return spl_array_next_no_verify(intern, aht TSRMLS_CC);
+ return spl_array_next_no_verify(intern, aht);
} /* }}} */
-static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */
+static int spl_array_next(spl_array_object *intern) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
- return spl_array_next_ex(intern, aht TSRMLS_CC);
+ return spl_array_next_ex(intern, aht);
} /* }}} */
-static void spl_array_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_dtor(zend_object_iterator *iter) /* {{{ */
{
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iter->data);
}
/* }}} */
-static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_array_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) {
- return zend_user_it_valid(iter TSRMLS_CC);
+ return zend_user_it_valid(iter);
} else {
- if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): " TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): ") == FAILURE) {
return FAILURE;
}
@@ -1048,13 +1048,13 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT) {
- return zend_user_it_get_current_data(iter TSRMLS_CC);
+ return zend_user_it_get_current_data(iter);
} else {
zval *data = zend_hash_get_current_data_ex(aht, &object->pos);
if (Z_TYPE_P(data) == IS_INDIRECT) {
@@ -1065,15 +1065,15 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) {
- zend_user_it_get_current_key(iter, key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key);
} else {
- if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): ") == FAILURE) {
ZVAL_NULL(key);
} else {
zend_hash_get_current_key_zval_ex(aht, key, &object->pos);
@@ -1082,66 +1082,66 @@ static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_NEXT) {
- zend_user_it_move_forward(iter TSRMLS_CC);
+ zend_user_it_move_forward(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array");
return;
}
- if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid");
+ if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid");
} else {
- spl_array_next_no_verify(object, aht TSRMLS_CC);
+ spl_array_next_no_verify(object, aht);
}
}
}
/* }}} */
-static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_hash_internal_pointer_reset_ex(aht, &intern->pos);
spl_array_update_pos(aht, intern);
- spl_array_skip_protected(intern, aht TSRMLS_CC);
+ spl_array_skip_protected(intern, aht);
} /* }}} */
-static void spl_array_rewind(spl_array_object *intern TSRMLS_DC) /* {{{ */
+static void spl_array_rewind(spl_array_object *intern) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array");
return;
}
- spl_array_rewind_ex(intern, aht TSRMLS_CC);
+ spl_array_rewind_ex(intern, aht);
}
/* }}} */
-static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_REWIND) {
- zend_user_it_rewind(iter TSRMLS_CC);
+ zend_user_it_rewind(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
- spl_array_rewind(object TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
+ spl_array_rewind(object);
}
}
/* }}} */
/* {{{ spl_array_set_array */
-static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array TSRMLS_DC) {
+static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array) {
if (Z_TYPE_P(array) == IS_ARRAY) {
SEPARATE_ARRAY(array);
@@ -1157,7 +1157,7 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
ZVAL_COPY_VALUE(&intern->array, array);
} else {
if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0);
return;
}
zval_ptr_dtor(&intern->array);
@@ -1174,12 +1174,12 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
if (Z_TYPE_P(array) == IS_OBJECT) {
zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties);
if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties)
- || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
+ || !spl_array_get_hash_table(intern, 0)) {
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
}
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
}
/* }}} */
@@ -1193,7 +1193,7 @@ zend_object_iterator_funcs spl_array_it_funcs = {
spl_array_it_rewind
};
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
zend_user_iterator *iterator;
spl_array_object *array_object = Z_SPLARRAY_P(object);
@@ -1204,7 +1204,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object,
iterator = emalloc(sizeof(zend_user_iterator));
- zend_iterator_init(&iterator->it TSRMLS_CC);
+ zend_iterator_init(&iterator->it);
ZVAL_COPY(&iterator->it.data, object);
iterator->it.funcs = &spl_array_it_funcs;
@@ -1231,12 +1231,12 @@ SPL_METHOD(Array, __construct)
return; /* nothing to do */
}
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
intern = Z_SPLARRAY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -1246,9 +1246,9 @@ SPL_METHOD(Array, __construct)
ar_flags &= ~SPL_ARRAY_INT_MASK;
- spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC);
+ spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1262,7 +1262,7 @@ SPL_METHOD(Array, setIteratorClass)
zend_class_entry * ce_get_iterator = spl_ce_Iterator;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &ce_get_iterator) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce_get_iterator) == FAILURE) {
return;
}
#else
@@ -1314,7 +1314,7 @@ SPL_METHOD(Array, setFlags)
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long ar_flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ar_flags) == FAILURE) {
return;
}
@@ -1330,12 +1330,12 @@ SPL_METHOD(Array, exchangeArray)
spl_array_object *intern = Z_SPLARRAY_P(object);
ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC));
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &array) == FAILURE) {
+ zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0));
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &array) == FAILURE) {
return;
}
- spl_array_set_array(object, intern, array, 0L, 1 TSRMLS_CC);
+ spl_array_set_array(object, intern, array, 0L, 1);
}
/* }}} */
@@ -1345,18 +1345,18 @@ SPL_METHOD(Array, getIterator)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
- ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0 TSRMLS_CC));
+ ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0));
Z_SET_REFCOUNT_P(return_value, 1);
//!!!PZ_SET_ISREF_P(return_value);
}
@@ -1373,7 +1373,7 @@ SPL_METHOD(Array, rewind)
return;
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
}
/* }}} */
@@ -1384,40 +1384,40 @@ SPL_METHOD(Array, seek)
zend_long opos, position;
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) {
return;
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
opos = position;
if (position >= 0) { /* negative values are not supported */
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
result = SUCCESS;
- while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS);
+ while (position-- > 0 && (result = spl_array_next(intern)) == SUCCESS);
if (result == SUCCESS && zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) {
return; /* ok */
}
}
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %pd is out of range", opos);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position %pd is out of range", opos);
} /* }}} */
-int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count TSRMLS_DC) /* {{{ */
+int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
HashPosition pos;
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
*count = 0;
return FAILURE;
}
@@ -1427,8 +1427,8 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend
* we're going to call and which do not support 'pos' as parameter. */
pos = intern->pos;
*count = 0;
- spl_array_rewind(intern TSRMLS_CC);
- while(intern->pos != INVALID_IDX && spl_array_next(intern TSRMLS_CC) == SUCCESS) {
+ spl_array_rewind(intern);
+ while(intern->pos != INVALID_IDX && spl_array_next(intern) == SUCCESS) {
(*count)++;
}
spl_array_set_pos(intern, aht, pos);
@@ -1439,7 +1439,7 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend
}
} /* }}} */
-int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+int spl_array_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
@@ -1456,7 +1456,7 @@ int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /*
*count = 0;
return FAILURE;
}
- return spl_array_object_count_elements_helper(intern, count TSRMLS_CC);
+ return spl_array_object_count_elements_helper(intern, count);
} /* }}} */
/* {{{ proto int ArrayObject::count()
@@ -1471,7 +1471,7 @@ SPL_METHOD(Array, count)
return;
}
- spl_array_object_count_elements_helper(intern, &count TSRMLS_CC);
+ spl_array_object_count_elements_helper(intern, &count);
RETURN_LONG(count);
} /* }}} */
@@ -1479,7 +1479,7 @@ SPL_METHOD(Array, count)
static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(getThis());
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
zval tmp, *arg = NULL;
zval retval;
@@ -1490,25 +1490,25 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
if (!use_arg) {
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL);
aht->u.v.nApplyCount--;
} else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
zval_ptr_dtor(&tmp);
- zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0);
return;
}
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg);
aht->u.v.nApplyCount--;
} else {
- if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
zval_ptr_dtor(&tmp);
- zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0);
return;
}
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg);
aht->u.v.nApplyCount--;
}
/* A tricky way to pass "aht" by reference, copy back and cleanup */
@@ -1566,13 +1566,13 @@ SPL_METHOD(Array, current)
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
zval *entry;
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1597,15 +1597,15 @@ SPL_METHOD(Array, key)
return;
}
- spl_array_iterator_key(getThis(), return_value TSRMLS_CC);
+ spl_array_iterator_key(getThis(), return_value);
} /* }}} */
-void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */
+void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1619,17 +1619,17 @@ SPL_METHOD(Array, next)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
- spl_array_next_no_verify(intern, aht TSRMLS_CC);
+ spl_array_next_no_verify(intern, aht);
}
/* }}} */
@@ -1639,13 +1639,13 @@ SPL_METHOD(Array, valid)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
RETURN_FALSE;
} else {
RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS);
@@ -1659,13 +1659,13 @@ SPL_METHOD(Array, hasChildren)
{
zval *object = getThis(), *entry;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
RETURN_FALSE;
}
@@ -1683,13 +1683,13 @@ SPL_METHOD(Array, getChildren)
{
zval *object = getThis(), *entry, flags;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1701,13 +1701,13 @@ SPL_METHOD(Array, getChildren)
if ((intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) != 0) {
return;
}
- if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()))) {
RETURN_ZVAL(entry, 1, 0);
}
}
ZVAL_LONG(&flags, SPL_ARRAY_USE_OTHER | intern->ar_flags);
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags);
}
/* }}} */
@@ -1717,7 +1717,7 @@ SPL_METHOD(Array, serialize)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
zval members, flags;
php_serialize_data_t var_hash;
smart_str buf = {0};
@@ -1727,7 +1727,7 @@ SPL_METHOD(Array, serialize)
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
@@ -1738,10 +1738,10 @@ SPL_METHOD(Array, serialize)
/* storage */
smart_str_appendl(&buf, "x:", 2);
//!!! php_var_serialize need to be modified
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
if (!(intern->ar_flags & SPL_ARRAY_IS_SELF)) {
- php_var_serialize(&buf, &intern->array, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &intern->array, &var_hash);
smart_str_appendc(&buf, ';');
}
@@ -1754,7 +1754,7 @@ SPL_METHOD(Array, serialize)
ZVAL_NEW_ARR(&members);
zend_array_dup(Z_ARRVAL(members), intern->std.properties);
- php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */
+ php_var_serialize(&buf, &members, &var_hash); /* finishes the string */
zval_ptr_dtor(&members);
@@ -1783,7 +1783,7 @@ SPL_METHOD(Array, unserialize)
HashTable *aht;
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -1791,7 +1791,7 @@ SPL_METHOD(Array, unserialize)
return;
}
- aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ aht = spl_array_get_hash_table(intern, 0);
if (aht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -1806,7 +1806,7 @@ SPL_METHOD(Array, unserialize)
}
++p;
- if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(zflags) != IS_LONG) {
+ if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash) || Z_TYPE(zflags) != IS_LONG) {
goto outexcept;
}
@@ -1829,7 +1829,7 @@ SPL_METHOD(Array, unserialize)
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
zval_ptr_dtor(&intern->array);
- if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
}
@@ -1845,13 +1845,13 @@ SPL_METHOD(Array, unserialize)
++p;
ZVAL_UNDEF(&members);
- if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(members) != IS_ARRAY) {
+ if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash) || Z_TYPE(members) != IS_ARRAY) {
zval_ptr_dtor(&members);
goto outexcept;
}
/* copy members */
- object_properties_load(&intern->std, Z_ARRVAL(members) TSRMLS_CC);
+ object_properties_load(&intern->std, Z_ARRVAL(members));
zval_ptr_dtor(&members);
/* done reading $serialized */
@@ -1861,7 +1861,7 @@ SPL_METHOD(Array, unserialize)
outexcept:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h
index c27e55bbec..189038032e 100644
--- a/ext/spl/spl_array.h
+++ b/ext/spl/spl_array.h
@@ -31,8 +31,8 @@ extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
PHP_MINIT_FUNCTION(spl_array);
-extern void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC);
-extern void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC);
+extern void spl_array_iterator_append(zval *object, zval *append_value);
+extern void spl_array_iterator_key(zval *object, zval *return_value);
#endif /* SPL_ARRAY_H */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 8da1d1165f..2d8a1d62bd 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -60,7 +60,7 @@ PHPAPI zend_class_entry *spl_ce_GlobIterator;
PHPAPI zend_class_entry *spl_ce_SplFileObject;
PHPAPI zend_class_entry *spl_ce_SplTempFileObject;
-static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static void spl_filesystem_file_free_line(spl_filesystem_object *intern) /* {{{ */
{
if (intern->u.file.current_line) {
efree(intern->u.file.current_line);
@@ -72,15 +72,15 @@ static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_D
}
} /* }}} */
-static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_filesystem_object_free_storage(zend_object *object) /* {{{ */
{
spl_filesystem_object *intern = spl_filesystem_from_obj(object);
if (intern->oth_handler && intern->oth_handler->dtor) {
- intern->oth_handler->dtor(intern TSRMLS_CC);
+ intern->oth_handler->dtor(intern);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->_path) {
efree(intern->_path);
@@ -119,7 +119,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /*
efree(intern->orig_path);
}
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
break;
}
@@ -139,7 +139,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /*
- clone
- new
*/
-static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type)
{
spl_filesystem_object *intern;
@@ -148,7 +148,7 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS
intern->file_class = spl_ce_SplFileObject;
intern->info_class = spl_ce_SplFileInfo;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_filesystem_object_handlers;
@@ -158,22 +158,22 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS
/* {{{ spl_filesystem_object_new */
/* See spl_filesystem_object_new_ex */
-static zend_object *spl_filesystem_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new(zend_class_entry *class_type)
{
- return spl_filesystem_object_new_ex(class_type TSRMLS_CC);
+ return spl_filesystem_object_new_ex(class_type);
}
/* }}} */
/* {{{ spl_filesystem_object_new_check */
-static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type)
{
- spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type TSRMLS_CC));
+ spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type));
ret->std.handlers = &spl_filesystem_object_check_handlers;
return &ret->std;
}
/* }}} */
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC) /* {{{ */
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len) /* {{{ */
{
#ifdef HAVE_GLOB
if (intern->type == SPL_FS_DIR) {
@@ -188,7 +188,7 @@ PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_
return intern->_path;
} /* }}} */
-static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern) /* {{{ */
{
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
@@ -196,18 +196,18 @@ static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *in
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized");
+ php_error_docref(NULL, E_ERROR, "Object not initialized");
break;
case SPL_FS_DIR:
intern->file_name_len = (int)spprintf(&intern->file_name, 0, "%s%c%s",
- spl_filesystem_object_get_path(intern, NULL TSRMLS_CC),
+ spl_filesystem_object_get_path(intern, NULL),
slash, intern->u.dir.entry.d_name);
break;
}
}
} /* }}} */
-static int spl_filesystem_dir_read(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static int spl_filesystem_dir_read(spl_filesystem_object *intern) /* {{{ */
{
if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) {
intern->u.dir.entry.d_name[0] = '\0';
@@ -228,7 +228,7 @@ static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */
/* {{{ spl_filesystem_dir_open */
/* open a directory resource */
-static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TSRMLS_DC)
+static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path)
{
int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS);
@@ -247,28 +247,28 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS
intern->u.dir.entry.d_name[0] = '\0';
if (!EG(exception)) {
/* open failed w/out notice (turned to exception due to EH_THROW) */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0
- TSRMLS_CC, "Failed to open directory \"%s\"", path);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
+ "Failed to open directory \"%s\"", path);
}
} else {
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
}
/* }}} */
-static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent) /* {{{ */
{
zval tmp;
intern->type = SPL_FS_FILE;
- php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp TSRMLS_CC);
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp);
if (Z_TYPE(tmp) == IS_TRUE) {
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Cannot use SplFileObject with directories");
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Cannot use SplFileObject with directories");
return FAILURE;
}
@@ -277,7 +277,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
if (!intern->file_name_len || !intern->u.file.stream) {
if (!EG(exception)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : "");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : "");
}
intern->file_name = NULL; /* until here it is not a copy */
intern->u.file.open_mode = NULL;
@@ -322,7 +322,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
Open the directory
Clone other members (properties)
*/
-static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_filesystem_object_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
@@ -332,7 +332,7 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
old_object = Z_OBJ_P(zobject);
source = spl_filesystem_from_obj(old_object);
- new_object = spl_filesystem_object_new_ex(old_object->ce TSRMLS_CC);
+ new_object = spl_filesystem_object_new_ex(old_object->ce);
intern = spl_filesystem_from_obj(new_object);
intern->flags = source->flags;
@@ -345,18 +345,18 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
intern->file_name = estrndup(source->file_name, intern->file_name_len);
break;
case SPL_FS_DIR:
- spl_filesystem_dir_open(intern, source->_path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, source->_path);
/* read until we hit the position in which we were before */
skip_dots = SPL_HAS_FLAG(source->flags, SPL_FILE_DIR_SKIPDOTS);
for(index = 0; index < source->u.dir.index; ++index) {
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
intern->u.dir.index = index;
break;
case SPL_FS_FILE:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val);
+ php_error_docref(NULL, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val);
break;
}
@@ -365,17 +365,17 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
intern->oth = source->oth;
intern->oth_handler = source->oth_handler;
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
if (intern->oth_handler && intern->oth_handler->clone) {
- intern->oth_handler->clone(source, intern TSRMLS_CC);
+ intern->oth_handler->clone(source, intern);
}
return new_object;
}
/* }}} */
-void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy TSRMLS_DC) /* {{{ */
+void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy) /* {{{ */
{
char *p1, *p2;
@@ -409,7 +409,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path,
intern->_path = estrndup(path, intern->_path_len);
} /* }}} */
-static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */
+static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value) /* {{{ */
{
spl_filesystem_object *intern;
zval arg1;
@@ -417,7 +417,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
if (!file_path || !file_path_len) {
#if defined(PHP_WIN32)
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot create SplFileInfo for empty path");
if (file_path && !use_copy) {
efree(file_path);
}
@@ -431,13 +431,13 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
return NULL;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
ce = ce ? ce : source->info_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
if (ce->constructor->common.scope != spl_ce_SplFileInfo) {
@@ -445,21 +445,21 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1);
zval_ptr_dtor(&arg1);
} else {
- spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC);
+ spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return intern;
} /* }}} */
-static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */
+static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value) /* {{{ */
{
spl_filesystem_object *intern;
zend_bool use_include_path = 0;
zval arg1, arg2;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
switch (source->type) {
case SPL_FS_INFO:
@@ -467,8 +467,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
break;
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");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Could not open file");
+ zend_restore_error_handling(&error_handling);
return NULL;
}
}
@@ -477,12 +477,12 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
case SPL_FS_INFO:
ce = ce ? ce : source->info_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
- spl_filesystem_object_get_file_name(source TSRMLS_CC);
+ spl_filesystem_object_get_file_name(source);
if (ce->constructor->common.scope != spl_ce_SplFileInfo) {
ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len);
zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1);
@@ -490,20 +490,20 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
} else {
intern->file_name = estrndup(source->file_name, source->file_name_len);
intern->file_name_len = source->file_name_len;
- intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC);
+ intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len);
intern->_path = estrndup(intern->_path, intern->_path_len);
}
break;
case SPL_FS_FILE:
ce = ce ? ce : source->file_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
- spl_filesystem_object_get_file_name(source TSRMLS_CC);
+ spl_filesystem_object_get_file_name(source);
if (ce->constructor->common.scope != spl_ce_SplFileObject) {
ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len);
@@ -514,16 +514,16 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
} else {
intern->file_name = source->file_name;
intern->file_name_len = source->file_name_len;
- intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC);
+ intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len);
intern->_path = estrndup(intern->_path, intern->_path_len);
intern->u.file.open_mode = "r";
intern->u.file.open_mode_len = 1;
- if (ht && zend_parse_parameters(ht TSRMLS_CC, "|sbr",
+ if (ht && zend_parse_parameters(ht, "|sbr",
&intern->u.file.open_mode, &intern->u.file.open_mode_len,
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
zval_ptr_dtor(return_value);
@@ -531,8 +531,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
return NULL;
}
- if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (spl_filesystem_file_open(intern, use_include_path, 0) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
zval_ptr_dtor(return_value);
ZVAL_NULL(return_value);
return NULL;
@@ -540,11 +540,11 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
}
break;
case SPL_FS_DIR:
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Operation not supported");
+ zend_restore_error_handling(&error_handling);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Operation not supported");
return NULL;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
} /* }}} */
@@ -554,7 +554,7 @@ static int spl_filesystem_is_invalid_or_dot(const char * d_name) /* {{{ */
}
/* }}} */
-static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len TSRMLS_DC) { /* {{{ */
+static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len) { /* {{{ */
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
@@ -562,7 +562,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s
return intern->file_name;
case SPL_FS_DIR:
if (intern->u.dir.entry.d_name[0]) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
*len = intern->file_name_len;
return intern->file_name;
}
@@ -572,7 +572,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s
}
/* }}} */
-static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(object);
zval tmp;
@@ -592,15 +592,15 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_array_dup(rv, intern->std.properties);
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1 TSRMLS_CC);
- path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1);
+ path = spl_filesystem_object_get_pathname(intern, &path_len);
ZVAL_STRINGL(&tmp, path, path_len);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
if (intern->file_name) {
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1 TSRMLS_CC);
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
ZVAL_STRINGL(&tmp, intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1));
@@ -612,7 +612,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
}
if (intern->type == SPL_FS_DIR) {
#ifdef HAVE_GLOB
- pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1);
if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) {
ZVAL_STRINGL(&tmp, intern->_path, intern->_path_len);
} else {
@@ -621,7 +621,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
#endif
- pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1);
if (intern->u.dir.sub_path) {
ZVAL_STRINGL(&tmp, intern->u.dir.sub_path, intern->u.dir.sub_path_len);
} else {
@@ -631,18 +631,18 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_string_release(pnstr);
}
if (intern->type == SPL_FS_FILE) {
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1);
ZVAL_STRINGL(&tmp, intern->u.file.open_mode, intern->u.file.open_mode_len);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
stmp[1] = '\0';
stmp[0] = intern->u.file.delimiter;
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1);
ZVAL_STRINGL(&tmp, stmp, 1);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
stmp[0] = intern->u.file.enclosure;
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1);
ZVAL_STRINGL(&tmp, stmp, 1);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
@@ -652,19 +652,19 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
}
/* }}} */
-zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
+zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
spl_filesystem_object *fsobj = spl_filesystem_from_obj(*object);
if (fsobj->u.dir.entry.d_name[0] == '\0' && fsobj->orig_path == NULL) {
zend_function *func;
zend_string *tmp = zend_string_init("_bad_state_ex", sizeof("_bad_state_ex") - 1, 0);
- func = zend_get_std_object_handlers()->get_method(object, tmp, NULL TSRMLS_CC);
+ func = zend_get_std_object_handlers()->get_method(object, tmp, NULL);
zend_string_release(tmp);
return func;
}
- return zend_get_std_object_handlers()->get_method(object, method, key TSRMLS_CC);
+ return zend_get_std_object_handlers()->get_method(object, method, key);
}
/* }}} */
@@ -679,14 +679,14 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
zend_long flags;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_FLAGS)) {
flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO;
- parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &len, &flags);
+ parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &len, &flags);
} else {
flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF;
- parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len);
+ parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len);
}
if (SPL_HAS_FLAG(ctor_flags, SPL_FILE_DIR_SKIPDOTS)) {
flags |= SPL_FILE_DIR_SKIPDOTS;
@@ -695,38 +695,38 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
flags |= SPL_FILE_DIR_UNIXPATHS;
}
if (parsed == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return;
}
if (!len) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Directory name must not be empty.");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Directory name must not be empty.");
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLFILESYSTEM_P(getThis());
if (intern->_path) {
/* object is alreay initialized */
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized");
+ zend_restore_error_handling(&error_handling);
+ php_error_docref(NULL, E_WARNING, "Directory object is already initialized");
return;
}
intern->flags = flags;
#ifdef HAVE_GLOB
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) {
spprintf(&path, 0, "glob://%s", path);
- spl_filesystem_dir_open(intern, path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, path);
efree(path);
} else
#endif
{
- spl_filesystem_dir_open(intern, path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, path);
}
- intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0;
+ intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator) ? 1 : 0;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -752,7 +752,7 @@ SPL_METHOD(DirectoryIterator, rewind)
if (intern->u.dir.dirp) {
php_stream_rewinddir(intern->u.dir.dirp);
}
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
}
/* }}} */
@@ -798,7 +798,7 @@ SPL_METHOD(DirectoryIterator, next)
intern->u.dir.index++;
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
if (intern->file_name) {
efree(intern->file_name);
@@ -815,7 +815,7 @@ SPL_METHOD(DirectoryIterator, seek)
zval retval;
zend_long pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) {
return;
}
@@ -828,7 +828,7 @@ SPL_METHOD(DirectoryIterator, seek)
int valid = 0;
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval);
if (!Z_ISUNDEF(retval)) {
- valid = zend_is_true(&retval TSRMLS_CC);
+ valid = zend_is_true(&retval);
zval_ptr_dtor(&retval);
}
if (!valid) {
@@ -864,7 +864,7 @@ SPL_METHOD(SplFileInfo, getPath)
return;
}
- path = spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ path = spl_filesystem_object_get_path(intern, &path_len);
RETURN_STRINGL(path, path_len);
}
/* }}} */
@@ -880,7 +880,7 @@ SPL_METHOD(SplFileInfo, getFilename)
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
RETURN_STRINGL(intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1));
@@ -920,7 +920,7 @@ SPL_METHOD(SplFileInfo, getExtension)
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
fname = intern->file_name + path_len + 1;
@@ -930,7 +930,7 @@ SPL_METHOD(SplFileInfo, getExtension)
flen = intern->file_name_len;
}
- ret = php_basename(fname, flen, NULL, 0 TSRMLS_CC);
+ ret = php_basename(fname, flen, NULL, 0);
p = zend_memrchr(ret->val, '.', ret->len);
if (p) {
@@ -959,7 +959,7 @@ SPL_METHOD(DirectoryIterator, getExtension)
return;
}
- fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0 TSRMLS_CC);
+ fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0);
p = zend_memrchr(fname->val, '.', fname->len);
if (p) {
@@ -983,11 +983,11 @@ SPL_METHOD(SplFileInfo, getBasename)
size_t flen;
size_t slen = 0, path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) {
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
fname = intern->file_name + path_len + 1;
@@ -997,7 +997,7 @@ SPL_METHOD(SplFileInfo, getBasename)
flen = intern->file_name_len;
}
- RETURN_STR(php_basename(fname, flen, suffix, slen TSRMLS_CC));
+ RETURN_STR(php_basename(fname, flen, suffix, slen));
}
/* }}}*/
@@ -1010,11 +1010,11 @@ SPL_METHOD(DirectoryIterator, getBasename)
size_t slen = 0;
zend_string *fname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) {
return;
}
- fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen TSRMLS_CC);
+ fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen);
RETVAL_STR(fname);
}
@@ -1031,7 +1031,7 @@ SPL_METHOD(SplFileInfo, getPathname)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ path = spl_filesystem_object_get_pathname(intern, &path_len);
if (path != NULL) {
RETURN_STRINGL(path, path_len);
} else {
@@ -1053,7 +1053,7 @@ SPL_METHOD(FilesystemIterator, key)
if (SPL_FILE_DIR_KEY(intern, SPL_FILE_DIR_KEY_AS_FILENAME)) {
RETURN_STRING(intern->u.dir.entry.d_name);
} else {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
RETURN_STRINGL(intern->file_name, intern->file_name_len);
}
}
@@ -1070,11 +1070,11 @@ SPL_METHOD(FilesystemIterator, current)
}
if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
RETURN_STRINGL(intern->file_name, intern->file_name_len);
} else if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
- spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
+ spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value);
} else {
RETURN_ZVAL(getThis(), 1, 0);
/*RETURN_STRING(intern->u.dir.entry.d_name, 1);*/
@@ -1112,18 +1112,18 @@ SPL_METHOD(SplFileInfo, __construct)
size_t len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLFILESYSTEM_P(getThis());
- spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC);
+ spl_filesystem_info_set_filename(intern, path, len, 1);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
/* intern->type = SPL_FS_INFO; already set */
}
@@ -1139,10 +1139,10 @@ SPL_METHOD(SplFileInfo, func_name) \
return; \
} \
\
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling 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); \
- zend_restore_error_handling(&error_handling TSRMLS_CC); \
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);\
+ spl_filesystem_object_get_file_name(intern); \
+ php_stat(intern->file_name, intern->file_name_len, func_num, return_value); \
+ zend_restore_error_handling(&error_handling); \
}
/* }}} */
@@ -1234,16 +1234,16 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
return;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
#if defined(PHP_WIN32) || HAVE_SYMLINK
if (intern->file_name == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty filename");
+ php_error_docref(NULL, E_WARNING, "Empty filename");
RETURN_FALSE;
} else if (!IS_ABSOLUTE_PATH(intern->file_name, intern->file_name_len)) {
char expanded_path[MAXPATHLEN];
- if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND )) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
ret = php_sys_readlink(expanded_path, buff, MAXPATHLEN - 1);
@@ -1255,7 +1255,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
#endif
if (ret == -1) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Unable to read link %s, error: %s", intern->file_name, strerror(errno));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Unable to read link %s, error: %s", intern->file_name, strerror(errno));
RETVAL_FALSE;
} else {
/* Append NULL to the end of the string */
@@ -1264,7 +1264,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
RETVAL_STRINGL(buff, ret);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1282,10 +1282,10 @@ SPL_METHOD(SplFileInfo, getRealPath)
return;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
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);
+ spl_filesystem_object_get_file_name(intern);
}
if (intern->orig_path) {
@@ -1306,7 +1306,7 @@ SPL_METHOD(SplFileInfo, getRealPath)
RETVAL_FALSE;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
#endif
@@ -1317,7 +1317,7 @@ SPL_METHOD(SplFileInfo, openFile)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value TSRMLS_CC);
+ spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value);
}
/* }}} */
@@ -1329,13 +1329,13 @@ SPL_METHOD(SplFileInfo, setFileClass)
zend_class_entry *ce = spl_ce_SplFileObject;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
intern->file_class = ce;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1347,13 +1347,13 @@ SPL_METHOD(SplFileInfo, setInfoClass)
zend_class_entry *ce = spl_ce_SplFileInfo;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling );
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
intern->info_class = ce;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1365,13 +1365,13 @@ SPL_METHOD(SplFileInfo, getFileInfo)
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
- spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
+ spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1383,27 +1383,27 @@ SPL_METHOD(SplFileInfo, getPathInfo)
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
size_t path_len;
- char *path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ char *path = spl_filesystem_object_get_pathname(intern, &path_len);
if (path) {
char *dpath = estrndup(path, path_len);
path_len = php_dirname(dpath, path_len);
- spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value TSRMLS_CC);
+ spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value);
efree(dpath);
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
/* {{{ proto SplFileInfo::_bad_state_ex(void) */
SPL_METHOD(SplFileInfo, _bad_state_ex)
{
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The parent constructor was not called: the object is in an "
"invalid state ");
}
@@ -1433,7 +1433,7 @@ SPL_METHOD(FilesystemIterator, rewind)
php_stream_rewinddir(intern->u.dir.dirp);
}
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
/* }}} */
@@ -1458,7 +1458,7 @@ SPL_METHOD(FilesystemIterator, setFlags)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -1473,20 +1473,20 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
zend_bool allow_links = 0;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &allow_links) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) {
return;
}
if (spl_filesystem_is_invalid_or_dot(intern->u.dir.entry.d_name)) {
RETURN_FALSE;
} else {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) {
- php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC);
- if (zend_is_true(return_value TSRMLS_CC)) {
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value);
+ if (zend_is_true(return_value)) {
RETURN_FALSE;
}
}
- php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value TSRMLS_CC);
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value);
}
}
/* }}} */
@@ -1504,11 +1504,11 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
return;
}
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
ZVAL_LONG(&zflags, intern->flags);
ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len);
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags);
zval_ptr_dtor(&zpath);
zval_ptr_dtor(&zflags);
@@ -1599,19 +1599,19 @@ SPL_METHOD(GlobIterator, count)
RETURN_LONG(php_glob_stream_get_count(intern->u.dir.dirp, NULL));
} else {
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "GlobIterator lost glob state");
+ php_error_docref(NULL, E_ERROR, "GlobIterator lost glob state");
}
}
/* }}} */
#endif /* HAVE_GLOB */
/* {{{ forward declarations to the iterator handlers */
-static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC);
-static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC);
-static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC);
-static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
-static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC);
-static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC);
+static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter);
+static int spl_filesystem_dir_it_valid(zend_object_iterator *iter);
+static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter);
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key);
+static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter);
+static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter);
/* iterator handler table */
zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
@@ -1625,7 +1625,7 @@ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
/* }}} */
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
@@ -1634,7 +1634,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
+ iterator = spl_filesystem_object_to_iterator(dir_object);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
/* ->current must be initialized; rewind doesn't set it and valid
@@ -1646,7 +1646,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
/* }}} */
/* {{{ spl_filesystem_dir_it_dtor */
-static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1663,16 +1663,16 @@ static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ spl_filesystem_dir_it_valid */
-static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
+static int spl_filesystem_dir_it_valid(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE;
}
/* }}} */
/* {{{ spl_filesystem_dir_it_current_data */
-static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1681,21 +1681,21 @@ static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRML
/* }}} */
/* {{{ spl_filesystem_dir_it_current_key */
-static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
ZVAL_LONG(key, object->u.dir.index);
}
/* }}} */
/* {{{ spl_filesystem_dir_it_move_forward */
-static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
object->u.dir.index++;
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
if (object->file_name) {
efree(object->file_name);
object->file_name = NULL;
@@ -1704,20 +1704,20 @@ static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS
/* }}} */
/* {{{ spl_filesystem_dir_it_rewind */
-static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
php_stream_rewinddir(object->u.dir.dirp);
}
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
}
/* }}} */
/* {{{ spl_filesystem_tree_it_dtor */
-static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1734,21 +1734,21 @@ static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ spl_filesystem_tree_it_current_data */
-static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
if (Z_ISUNDEF(iterator->current)) {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
ZVAL_STRINGL(&iterator->current, object->file_name, object->file_name_len);
}
return &iterator->current;
} else if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
if (Z_ISUNDEF(iterator->current)) {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
- spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
+ spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current);
}
return &iterator->current;
} else {
@@ -1758,28 +1758,28 @@ static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRM
/* }}} */
/* {{{ spl_filesystem_tree_it_current_key */
-static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
ZVAL_STRING(key, object->u.dir.entry.d_name);
} else {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
ZVAL_STRINGL(key, object->file_name, object->file_name_len);
}
}
/* }}} */
/* {{{ spl_filesystem_tree_it_move_forward */
-static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
object->u.dir.index++;
do {
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
} while (spl_filesystem_is_dot(object->u.dir.entry.d_name));
if (object->file_name) {
efree(object->file_name);
@@ -1793,17 +1793,17 @@ static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRML
/* }}} */
/* {{{ spl_filesystem_tree_it_rewind */
-static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
php_stream_rewinddir(object->u.dir.dirp);
}
do {
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
} while (spl_filesystem_is_dot(object->u.dir.entry.d_name));
if (!Z_ISUNDEF(iterator->current)) {
zval_ptr_dtor(&iterator->current);
@@ -1824,7 +1824,7 @@ zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
/* }}} */
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
@@ -1833,7 +1833,7 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
+ iterator = spl_filesystem_object_to_iterator(dir_object);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
@@ -1843,13 +1843,13 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
/* }}} */
/* {{{ spl_filesystem_object_cast */
-static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(readobj);
if (type == IS_STRING) {
if (Z_OBJCE_P(readobj)->__tostring) {
- return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC);
+ return std_object_handlers.cast_object(readobj, writeobj, type);
}
switch (intern->type) {
@@ -2020,17 +2020,17 @@ static const zend_function_entry spl_GlobIterator_functions[] = {
#endif
/* }}} */
-static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent) /* {{{ */
{
char *buf;
size_t line_len = 0;
zend_long line_add = (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) ? 1 : 0;
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (php_stream_eof(intern->u.file.stream)) {
if (!silent) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name);
}
return FAILURE;
}
@@ -2064,7 +2064,7 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS
return SUCCESS;
} /* }}} */
-static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2 TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2) /* {{{ */
{
zend_fcall_info fci;
zend_fcall_info_cache fcic;
@@ -2100,7 +2100,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
fcic.called_scope = NULL;
fcic.object = NULL;
- result = zend_call_function(&fci, &fcic TSRMLS_CC);
+ result = zend_call_function(&fci, &fcic);
if (result == FAILURE || Z_ISUNDEF(retval)) {
RETVAL_FALSE;
@@ -2117,18 +2117,18 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
zend_function *func_ptr; \
func_ptr = (zend_function *)zend_hash_str_find_ptr(EG(function_table), #func_name, sizeof(#func_name) - 1); \
if (func_ptr == NULL) { \
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Internal error, function '%s' not found. Please report", #func_name); \
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Internal error, function '%s' not found. Please report", #func_name); \
return; \
} \
- spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \
+ spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2); \
} /* }}} */
-static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value) /* {{{ */
{
int ret = SUCCESS;
do {
- ret = spl_filesystem_file_read(intern, 1 TSRMLS_CC);
+ ret = spl_filesystem_file_read(intern, 1);
} while (ret == SUCCESS && !intern->u.file.current_line_len && SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY));
if (ret == SUCCESS) {
@@ -2140,7 +2140,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli
ZVAL_UNDEF(&intern->u.file.current_zval);
}
- php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval TSRMLS_CC);
+ php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval);
if (return_value) {
if (Z_TYPE_P(return_value) != IS_NULL) {
zval_dtor(return_value);
@@ -2153,7 +2153,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli
}
/* }}} */
-static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */
{
zval retval;
@@ -2161,12 +2161,12 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) {
if (php_stream_eof(intern->u.file.stream)) {
if (!silent) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name);
}
return FAILURE;
}
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV)) {
- return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC);
+ return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL);
} else {
zend_execute_data *execute_data = EG(current_execute_data);
zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
@@ -2175,7 +2175,7 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) {
intern->u.file.current_line_num++;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (Z_TYPE(retval) == IS_STRING) {
intern->u.file.current_line = estrndup(Z_STRVAL(retval), Z_STRLEN(retval));
intern->u.file.current_line_len = Z_STRLEN(retval);
@@ -2188,11 +2188,11 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
return FAILURE;
}
} else {
- return spl_filesystem_file_read(intern, silent TSRMLS_CC);
+ return spl_filesystem_file_read(intern, silent);
}
} /* }}} */
-static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern) /* {{{ */
{
if (intern->u.file.current_line) {
return intern->u.file.current_line_len == 0;
@@ -2224,33 +2224,33 @@ static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRML
}
/* }}} */
-static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */
{
- int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+ int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent);
- while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern TSRMLS_CC)) {
- spl_filesystem_file_free_line(intern TSRMLS_CC);
- ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+ while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern)) {
+ spl_filesystem_file_free_line(intern);
+ ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent);
}
return ret;
}
/* }}} */
-static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern) /* {{{ */
{
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (-1 == php_stream_rewind(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot rewind file %s", intern->file_name);
} else {
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num = 0;
}
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
- spl_filesystem_file_read_line(this_ptr, intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(this_ptr, intern, 1);
}
} /* }}} */
@@ -2265,18 +2265,18 @@ SPL_METHOD(SplFileObject, __construct)
size_t tmp_path_len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
intern->u.file.open_mode = NULL;
intern->u.file.open_mode_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbr!",
&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) {
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -2285,7 +2285,7 @@ SPL_METHOD(SplFileObject, __construct)
intern->u.file.open_mode_len = 1;
}
- if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == SUCCESS) {
+ if (spl_filesystem_file_open(intern, use_include_path, 0) == SUCCESS) {
tmp_path_len = strlen(intern->u.file.stream->orig_path);
if (tmp_path_len > 1 && IS_SLASH_AT(intern->u.file.stream->orig_path, tmp_path_len-1)) {
@@ -2311,7 +2311,7 @@ SPL_METHOD(SplFileObject, __construct)
intern->_path = estrndup(intern->u.file.stream->orig_path, intern->_path_len);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
} /* }}} */
@@ -2324,10 +2324,10 @@ SPL_METHOD(SplTempFileObject, __construct)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_memory) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -2344,11 +2344,11 @@ SPL_METHOD(SplTempFileObject, __construct)
intern->u.file.open_mode = "wb";
intern->u.file.open_mode_len = 1;
- if (spl_filesystem_file_open(intern, 0, 0 TSRMLS_CC) == SUCCESS) {
+ if (spl_filesystem_file_open(intern, 0, 0) == SUCCESS) {
intern->_path_len = 0;
intern->_path = estrndup("", 0);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
} /* }}} */
/* {{{ proto void SplFileObject::rewind()
@@ -2361,7 +2361,7 @@ SPL_METHOD(SplFileObject, rewind)
return;
}
- spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
+ spl_filesystem_file_rewind(getThis(), intern);
} /* }}} */
/* {{{ proto void SplFileObject::eof()
@@ -2375,7 +2375,7 @@ SPL_METHOD(SplFileObject, eof)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2413,11 +2413,11 @@ SPL_METHOD(SplFileObject, fgets)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- if (spl_filesystem_file_read(intern, 0 TSRMLS_CC) == FAILURE) {
+ if (spl_filesystem_file_read(intern, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@@ -2434,12 +2434,12 @@ SPL_METHOD(SplFileObject, current)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
}
if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) {
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@@ -2461,7 +2461,7 @@ SPL_METHOD(SplFileObject, key)
/* Do not read the next line to support correct counting with fgetc()
if (!intern->current_line) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
} */
RETURN_LONG(intern->u.file.current_line_num);
} /* }}} */
@@ -2476,9 +2476,9 @@ SPL_METHOD(SplFileObject, next)
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
}
intern->u.file.current_line_num++;
} /* }}} */
@@ -2489,7 +2489,7 @@ SPL_METHOD(SplFileObject, setFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
}
} /* }}} */
@@ -2515,12 +2515,12 @@ SPL_METHOD(SplFileObject, setMaxLineLen)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &max_len) == FAILURE) {
return;
}
if (max_len < 0) {
- zend_throw_exception_ex(spl_ce_DomainException, 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero");
+ zend_throw_exception_ex(spl_ce_DomainException, 0, "Maximum line length must be greater than or equal zero");
return;
}
@@ -2579,10 +2579,10 @@ SPL_METHOD(SplFileObject, fgetcsv)
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2590,21 +2590,21 @@ SPL_METHOD(SplFileObject, fgetcsv)
{
case 3:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 2:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 1:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2612,7 +2612,7 @@ SPL_METHOD(SplFileObject, fgetcsv)
case 0:
break;
}
- spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value TSRMLS_CC);
+ spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value);
}
}
/* }}} */
@@ -2628,26 +2628,26 @@ SPL_METHOD(SplFileObject, fputcsv)
zend_long ret;
zval *fields = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
case 4:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 3:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 2:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2656,7 +2656,7 @@ SPL_METHOD(SplFileObject, fputcsv)
case 0:
break;
}
- ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape TSRMLS_CC);
+ ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape);
RETURN_LONG(ret);
}
}
@@ -2671,26 +2671,26 @@ SPL_METHOD(SplFileObject, setCsvControl)
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
case 3:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 2:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 1:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2736,7 +2736,7 @@ SPL_METHOD(SplFileObject, fflush)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2751,7 +2751,7 @@ SPL_METHOD(SplFileObject, ftell)
zend_long ret;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2771,16 +2771,16 @@ SPL_METHOD(SplFileObject, fseek)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long pos, whence = SEEK_SET;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &pos, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &pos, &whence) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, (int)whence));
} /* }}} */
@@ -2793,11 +2793,11 @@ SPL_METHOD(SplFileObject, fgetc)
int result;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
result = php_stream_getc(intern->u.file.stream);
@@ -2822,7 +2822,7 @@ SPL_METHOD(SplFileObject, fgetss)
zval arg2;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2832,7 +2832,7 @@ SPL_METHOD(SplFileObject, fgetss)
ZVAL_LONG(&arg2, 1024);
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num++;
FileFunctionCall(fgetss, ZEND_NUM_ARGS(), &arg2);
@@ -2845,7 +2845,7 @@ SPL_METHOD(SplFileObject, fpassthru)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2859,11 +2859,11 @@ SPL_METHOD(SplFileObject, fscanf)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num++;
FileFunctionCall(fscanf, ZEND_NUM_ARGS(), NULL);
@@ -2879,12 +2879,12 @@ SPL_METHOD(SplFileObject, fwrite)
size_t str_len;
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &length) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2908,17 +2908,17 @@ SPL_METHOD(SplFileObject, fread)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -2941,17 +2941,17 @@ SPL_METHOD(SplFileObject, ftruncate)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (!php_stream_truncate_supported(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't truncate file %s", intern->file_name);
RETURN_FALSE;
}
@@ -2965,23 +2965,23 @@ SPL_METHOD(SplFileObject, seek)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long line_pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &line_pos) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (line_pos < 0) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't seek file %s to negative line %pd", intern->file_name, line_pos);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't seek file %s to negative line %pd", intern->file_name, line_pos);
RETURN_FALSE;
}
- spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
+ spl_filesystem_file_rewind(getThis(), intern);
while(intern->u.file.current_line_num < line_pos) {
- if (spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC) == FAILURE) {
+ if (spl_filesystem_file_read_line(getThis(), intern, 1) == FAILURE) {
break;
}
}
@@ -3117,7 +3117,7 @@ PHP_MINIT_FUNCTION(spl_directory)
REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_DirectoryIterator_functions);
- zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, zend_ce_iterator);
+ zend_class_implements(spl_ce_DirectoryIterator, 1, zend_ce_iterator);
REGISTER_SPL_IMPLEMENTS(DirectoryIterator, SeekableIterator);
spl_ce_DirectoryIterator->get_iterator = spl_filesystem_dir_get_iterator;
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index b6c8b72933..f62306c2c6 100644
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -42,10 +42,10 @@ typedef enum {
typedef struct _spl_filesystem_object spl_filesystem_object;
-typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC);
-typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC);
+typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object);
+typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst);
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC);
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len);
typedef struct _spl_other_handler {
spl_foreign_dtor_t dtor;
@@ -112,15 +112,15 @@ static inline spl_filesystem_object *spl_filesystem_from_obj(zend_object *obj) /
#define Z_SPLFILESYSTEM_P(zv) spl_filesystem_from_obj(Z_OBJ_P((zv)))
-static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj TSRMLS_DC)
+static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj)
{
obj->it = ecalloc(1, sizeof(spl_filesystem_iterator));
obj->it->object = (void *)obj;
- zend_iterator_init(&obj->it->intern TSRMLS_CC);
+ zend_iterator_init(&obj->it->intern);
return obj->it;
}
-static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it TSRMLS_DC)
+static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it)
{
return (spl_filesystem_object*)it->object;
}
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 8a61407589..b08623eb4d 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -68,8 +68,8 @@ typedef struct _spl_ptr_llist_element {
zval data;
} spl_ptr_llist_element;
-typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element * TSRMLS_DC);
-typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element * TSRMLS_DC);
+typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element *);
+typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element *);
typedef struct _spl_ptr_llist {
spl_ptr_llist_element *head;
@@ -113,7 +113,7 @@ static inline spl_dllist_object *spl_dllist_from_obj(zend_object *obj) /* {{{ */
#define Z_SPLDLLIST_P(zv) spl_dllist_from_obj(Z_OBJ_P((zv)))
/* {{{ spl_ptr_llist */
-static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem) { /* {{{ */
if (!Z_ISUNDEF(elem->data)) {
zval_ptr_dtor(&elem->data);
ZVAL_UNDEF(&elem->data);
@@ -121,7 +121,7 @@ static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /*
}
/* }}} */
-static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem) { /* {{{ */
if (Z_REFCOUNTED(elem->data)) {
Z_ADDREF(elem->data);
}
@@ -148,7 +148,7 @@ static zend_long spl_ptr_llist_count(spl_ptr_llist *llist) /* {{{ */
}
/* }}} */
-static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_destroy(spl_ptr_llist *llist) /* {{{ */
{
spl_ptr_llist_element *current = llist->head, *next;
spl_ptr_llist_dtor_func dtor = llist->dtor;
@@ -156,7 +156,7 @@ static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */
while (current) {
next = current->next;
if(current && dtor) {
- dtor(current TSRMLS_CC);
+ dtor(current);
}
SPL_LLIST_DELREF(current);
current = next;
@@ -191,7 +191,7 @@ static spl_ptr_llist_element *spl_ptr_llist_offset(spl_ptr_llist *llist, zend_lo
}
/* }}} */
-static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data) /* {{{ */
{
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -210,12 +210,12 @@ static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /*
llist->count++;
if (llist->ctor) {
- llist->ctor(elem TSRMLS_CC);
+ llist->ctor(elem);
}
}
/* }}} */
-static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data) /* {{{ */
{
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -234,12 +234,12 @@ static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{
llist->count++;
if (llist->ctor) {
- llist->ctor(elem TSRMLS_CC);
+ llist->ctor(elem);
}
}
/* }}} */
-static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret) /* {{{ */
{
spl_ptr_llist_element *tail = llist->tail;
@@ -259,7 +259,7 @@ static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{
ZVAL_COPY(ret, &tail->data);
if (llist->dtor) {
- llist->dtor(tail TSRMLS_CC);
+ llist->dtor(tail);
}
ZVAL_UNDEF(&tail->data);
@@ -292,7 +292,7 @@ static zval *spl_ptr_llist_first(spl_ptr_llist *llist) /* {{{ */
}
/* }}} */
-static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret) /* {{{ */
{
spl_ptr_llist_element *head = llist->head;
@@ -312,7 +312,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
ZVAL_COPY(ret, &head->data);
if (llist->dtor) {
- llist->dtor(head TSRMLS_CC);
+ llist->dtor(head);
}
ZVAL_UNDEF(&head->data);
@@ -320,7 +320,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
}
/* }}} */
-static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to) /* {{{ */
{
spl_ptr_llist_element *current = from->head, *next;
//??? spl_ptr_llist_ctor_func ctor = from->ctor;
@@ -330,11 +330,11 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC)
/*??? FIXME
if (ctor) {
- ctor(current TSRMLS_CC);
+ ctor(current);
}
*/
- spl_ptr_llist_push(to, &current->data TSRMLS_CC);
+ spl_ptr_llist_push(to, &current->data);
current = next;
}
@@ -343,19 +343,19 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC)
/* }}} */
-static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_dllist_object_free_storage(zend_object *object) /* {{{ */
{
spl_dllist_object *intern = spl_dllist_from_obj(object);
zval tmp;
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
while (intern->llist->count > 0) {
- spl_ptr_llist_pop(intern->llist, &tmp TSRMLS_CC);
+ spl_ptr_llist_pop(intern->llist, &tmp);
zval_ptr_dtor(&tmp);
}
- spl_ptr_llist_destroy(intern->llist TSRMLS_CC);
+ spl_ptr_llist_destroy(intern->llist);
SPL_LLIST_CHECK_DELREF(intern->traverse_pointer);
if (intern->debug_info != NULL) {
@@ -365,9 +365,9 @@ static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{
}
/* }}} */
-zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_dllist_object *intern;
zend_class_entry *parent = class_type;
@@ -375,7 +375,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
intern = ecalloc(1, sizeof(spl_dllist_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->flags = 0;
@@ -388,7 +388,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
if (clone_orig) {
intern->llist = (spl_ptr_llist *)spl_ptr_llist_init(other->llist->ctor, other->llist->dtor);
- spl_ptr_llist_copy(other->llist, intern->llist TSRMLS_CC);
+ spl_ptr_llist_copy(other->llist, intern->llist);
intern->traverse_pointer = intern->llist->head;
SPL_LLIST_CHECK_ADDREF(intern->traverse_pointer);
} else {
@@ -423,7 +423,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList");
}
if (inherited) {
intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1);
@@ -452,27 +452,27 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
}
/* }}} */
-static zend_object *spl_dllist_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_dllist_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_dllist_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_dllist_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_dllist_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_dllist_object *intern = Z_SPLDLLIST_P(object);
@@ -493,7 +493,7 @@ static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRML
}
/* }}} */
-static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{{ */
+static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp) /* {{{{ */
{
spl_dllist_object *intern = Z_SPLDLLIST_P(obj);
spl_ptr_llist_element *current = intern->llist->head, *next;
@@ -515,7 +515,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML
}
zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
- pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1);
ZVAL_LONG(&tmp, intern->flags);
zend_hash_add(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
@@ -534,7 +534,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML
current = next;
}
- pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1);
zend_hash_add(intern->debug_info, pnstr, &dllist_array);
zend_string_release(pnstr);
}
@@ -550,12 +550,12 @@ SPL_METHOD(SplDoublyLinkedList, push)
zval *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
RETURN_TRUE;
}
@@ -568,12 +568,12 @@ SPL_METHOD(SplDoublyLinkedList, unshift)
zval *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_unshift(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_unshift(intern->llist, value);
RETURN_TRUE;
}
@@ -590,10 +590,10 @@ SPL_METHOD(SplDoublyLinkedList, pop)
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_pop(intern->llist, return_value TSRMLS_CC);
+ spl_ptr_llist_pop(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0);
RETURN_NULL();
}
}
@@ -610,10 +610,10 @@ SPL_METHOD(SplDoublyLinkedList, shift)
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_shift(intern->llist, return_value TSRMLS_CC);
+ spl_ptr_llist_shift(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0);
RETURN_NULL();
}
}
@@ -634,7 +634,7 @@ SPL_METHOD(SplDoublyLinkedList, top)
value = spl_ptr_llist_last(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0);
return;
}
@@ -657,7 +657,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom)
value = spl_ptr_llist_first(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0);
return;
}
@@ -691,7 +691,7 @@ SPL_METHOD(SplDoublyLinkedList, isEmpty)
return;
}
- spl_dllist_object_count_elements(getThis(), &count TSRMLS_CC);
+ spl_dllist_object_count_elements(getThis(), &count);
RETURN_BOOL(count == 0);
}
/* }}} */
@@ -703,7 +703,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
zend_long value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
return;
}
@@ -711,7 +711,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
if (intern->flags & SPL_DLLIST_IT_FIX
&& (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) {
- zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0);
return;
}
@@ -745,12 +745,12 @@ SPL_METHOD(SplDoublyLinkedList, offsetExists)
spl_dllist_object *intern;
zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
RETURN_BOOL(index >= 0 && index < intern->llist->count);
} /* }}} */
@@ -764,15 +764,15 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
spl_dllist_object *intern;
spl_ptr_llist_element *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -781,7 +781,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
if (element != NULL) {
RETURN_ZVAL(&element->data, 1, 0);
} else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
} /* }}} */
@@ -793,7 +793,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
zval *zindex, *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
@@ -801,17 +801,17 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
if (Z_TYPE_P(zindex) == IS_NULL) {
/* $obj[] = ... */
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
} else {
/* $obj[$foo] = ... */
zend_long index;
spl_ptr_llist_element *element;
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
zval_ptr_dtor(value);
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -820,7 +820,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
if (element != NULL) {
/* call dtor on the old element as in spl_ptr_llist_pop */
if (intern->llist->dtor) {
- intern->llist->dtor(element TSRMLS_CC);
+ intern->llist->dtor(element);
}
/* the element is replaced, delref the old one as in
@@ -830,11 +830,11 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
/* new element, call ctor as in spl_ptr_llist_push */
if (intern->llist->ctor) {
- intern->llist->ctor(element TSRMLS_CC);
+ intern->llist->ctor(element);
}
} else {
zval_ptr_dtor(value);
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
}
@@ -850,16 +850,16 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
spl_ptr_llist_element *element;
spl_ptr_llist *llist;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
llist = intern->llist;
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0);
return;
}
@@ -888,7 +888,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
llist->count--;
if(llist->dtor) {
- llist->dtor(element TSRMLS_CC);
+ llist->dtor(element);
}
if (intern->traverse_pointer == element) {
@@ -900,23 +900,23 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
SPL_LLIST_DELREF(element);
} else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
} /* }}} */
-static void spl_dllist_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
SPL_LLIST_CHECK_DELREF(iterator->traverse_pointer);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */
{
SPL_LLIST_CHECK_DELREF(*traverse_pointer_ptr);
@@ -932,7 +932,7 @@ static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer
}
/* }}} */
-static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */
{
if (*traverse_pointer_ptr) {
spl_ptr_llist_element *old = *traverse_pointer_ptr;
@@ -943,7 +943,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
if (flags & SPL_DLLIST_IT_DELETE) {
zval prev;
- spl_ptr_llist_pop(llist, &prev TSRMLS_CC);
+ spl_ptr_llist_pop(llist, &prev);
zval_ptr_dtor(&prev);
}
@@ -952,7 +952,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
if (flags & SPL_DLLIST_IT_DELETE) {
zval prev;
- spl_ptr_llist_shift(llist, &prev TSRMLS_CC);
+ spl_ptr_llist_shift(llist, &prev);
zval_ptr_dtor(&prev);
} else {
@@ -966,17 +966,17 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
}
/* }}} */
-static void spl_dllist_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data);
spl_ptr_llist *llist = object->llist;
- spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags TSRMLS_CC);
+ spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags);
}
/* }}} */
-static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_dllist_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_ptr_llist_element *element = iterator->traverse_pointer;
@@ -985,7 +985,7 @@ static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_ptr_llist_element *element = iterator->traverse_pointer;
@@ -998,7 +998,7 @@ static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC
}
/* }}} */
-static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
@@ -1006,14 +1006,14 @@ static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key
}
/* }}} */
-static void spl_dllist_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
- spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags);
}
/* }}} */
@@ -1041,7 +1041,7 @@ SPL_METHOD(SplDoublyLinkedList, prev)
return;
}
- spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO);
}
/* }}} */
@@ -1055,7 +1055,7 @@ SPL_METHOD(SplDoublyLinkedList, next)
return;
}
- spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags);
}
/* }}} */
@@ -1083,7 +1083,7 @@ SPL_METHOD(SplDoublyLinkedList, rewind)
return;
}
- spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC);
+ spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags);
}
/* }}} */
@@ -1124,7 +1124,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
/* flags */
ZVAL_LONG(&flags, intern->flags);
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
zval_ptr_dtor(&flags);
/* elements */
@@ -1132,7 +1132,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
smart_str_appendc(&buf, ':');
next = current->next;
- php_var_serialize(&buf, &current->data, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &current->data, &var_hash);
current = next;
}
@@ -1161,7 +1161,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -1173,7 +1173,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
PHP_VAR_UNSERIALIZE_INIT(var_hash);
/* flags */
- if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash)) {
goto error;
}
@@ -1188,11 +1188,11 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
/* elements */
while(*p == ':') {
++p;
- if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash)) {
goto error;
}
- spl_ptr_llist_push(intern->llist, &elem TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, &elem);
zval_ptr_dtor(&elem);
}
@@ -1205,7 +1205,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
error:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
@@ -1219,15 +1219,15 @@ SPL_METHOD(SplDoublyLinkedList, add)
spl_ptr_llist_element *element;
zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index > intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -1236,7 +1236,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
}
if (index == intern->llist->count) {
/* If index is the last entry+1 then we do a push because we're not inserting before any entry */
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
} else {
/* Create the new element we want to insert */
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -1261,7 +1261,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
intern->llist->count++;
if (intern->llist->ctor) {
- intern->llist->ctor(elem TSRMLS_CC);
+ intern->llist->ctor(elem);
}
}
} /* }}} */
@@ -1276,19 +1276,19 @@ zend_object_iterator_funcs spl_dllist_it_funcs = {
spl_dllist_it_rewind
}; /* }}} */
-zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_dllist_it *iterator;
spl_dllist_object *dllist_object = Z_SPLDLLIST_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_dllist_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_dllist_it_funcs;
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c
index 1e51484394..753ea2cd91 100644
--- a/ext/spl/spl_engine.c
+++ b/ext/spl/spl_engine.c
@@ -32,7 +32,7 @@
#include "spl_array.h"
/* {{{ spl_instantiate */
-PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
+PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object)
{
object_init_ex(object, pce);
Z_SET_REFCOUNT_P(object, 1);
@@ -40,7 +40,7 @@ PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
}
/* }}} */
-PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset) /* {{{ */
{
zend_ulong idx;
diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h
index 8fa5539ba5..5666033d75 100644
--- a/ext/spl/spl_engine.h
+++ b/ext/spl/spl_engine.h
@@ -25,41 +25,41 @@
#include "php_spl.h"
#include "zend_interfaces.h"
-PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
+PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object);
-PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC);
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset);
/* {{{ spl_instantiate_arg_ex1 */
-static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1 TSRMLS_DC)
+static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1)
{
zend_function *func = pce->constructor;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
- zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL TSRMLS_CC);
+ zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL);
return 0;
}
/* }}} */
/* {{{ spl_instantiate_arg_ex2 */
-static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2 TSRMLS_DC)
+static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2)
{
zend_function *func = pce->constructor;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
- zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2 TSRMLS_CC);
+ zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2);
return 0;
}
/* }}} */
/* {{{ spl_instantiate_arg_n */
-static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv TSRMLS_DC)
+static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv)
{
zend_function *func = pce->constructor;
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval dummy;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
fci.size = sizeof(zend_fcall_info);
fci.function_table = &pce->function_table;
@@ -77,7 +77,7 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in
fcc.called_scope = pce;
fcc.object = Z_OBJ_P(retval);
- zend_call_function(&fci, &fcc TSRMLS_CC);
+ zend_call_function(&fci, &fcc);
}
/* }}} */
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
index 3c6b724b5c..e0cc164c13 100644
--- a/ext/spl/spl_exceptions.c
+++ b/ext/spl/spl_exceptions.c
@@ -47,7 +47,7 @@ PHPAPI zend_class_entry *spl_ce_RangeException;
PHPAPI zend_class_entry *spl_ce_UnderflowException;
PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
-#define spl_ce_Exception zend_exception_get_default(TSRMLS_C)
+#define spl_ce_Exception zend_exception_get_default()
/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
PHP_MINIT_FUNCTION(spl_exceptions)
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index d63ac2e6e6..d2105fb0fa 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -81,7 +81,7 @@ static inline spl_fixedarray_object *spl_fixed_array_from_obj(zend_object *obj)
#define Z_SPLFIXEDARRAY_P(zv) spl_fixed_array_from_obj(Z_OBJ_P((zv)))
-static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) /* {{{ */
{
if (size > 0) {
array->size = 0; /* reset size in case ecalloc() fails */
@@ -94,7 +94,7 @@ static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC)
}
/* }}} */
-static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) /* {{{ */
{
if (size == array->size) {
/* nothing to do */
@@ -103,7 +103,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D
/* first initialization */
if (array->size == 0) {
- spl_fixedarray_init(array, size TSRMLS_CC);
+ spl_fixedarray_init(array, size);
return;
}
@@ -135,7 +135,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D
}
/* }}} */
-static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from) /* {{{ */
{
int i;
for (i = 0; i < from->size; i++) {
@@ -144,10 +144,10 @@ static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_
}
/* }}} */
-static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{{ */
+static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n) /* {{{{ */
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj);
- HashTable *ht = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht = zend_std_get_properties(obj);
if (intern->array) {
*table = intern->array->elements;
@@ -161,10 +161,10 @@ static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n T
}
/* }}}} */
-static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {{{{ */
+static HashTable* spl_fixedarray_object_get_properties(zval *obj) /* {{{{ */
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj);
- HashTable *ht = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht = zend_std_get_properties(obj);
zend_long i = 0;
if (intern->array) {
@@ -191,7 +191,7 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {
}
/* }}}} */
-static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_free_storage(zend_object *object) /* {{{ */
{
spl_fixedarray_object *intern = spl_fixed_array_from_obj(object);
zend_long i;
@@ -207,14 +207,14 @@ static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /*
efree(intern->array);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zval_ptr_dtor(&intern->retval);
}
/* }}} */
-zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_fixedarray_object *intern;
zend_class_entry *parent = class_type;
@@ -222,7 +222,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
intern = ecalloc(1, sizeof(spl_fixedarray_object) + (sizeof(zval) * parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->current = 0;
@@ -233,11 +233,11 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
intern->ce_get_iterator = other->ce_get_iterator;
if (!other->array) {
/* leave a empty object, will be dtor later by CLONE handler */
- zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0);
} else {
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC);
- spl_fixedarray_copy(intern->array, other->array TSRMLS_CC);
+ spl_fixedarray_init(intern->array, other->array->size);
+ spl_fixedarray_copy(intern->array, other->array);
}
}
@@ -253,7 +253,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray");
}
if (!class_type->iterator_funcs.zf_current) {
@@ -306,45 +306,45 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
}
/* }}} */
-static zend_object *spl_fixedarray_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_fixedarray_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_fixedarray_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_fixedarray_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */
+static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */
{
zend_long index;
/* we have to return NULL on error here to avoid memleak because of
* ZE duplicating uninitialized_zval_ptr */
if (!offset) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return NULL;
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return NULL;
} else if (Z_ISUNDEF(intern->array->elements[index])) {
return NULL;
@@ -354,7 +354,7 @@ static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -378,28 +378,28 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in
return &EG(uninitialized_zval);
}
- return spl_fixedarray_object_read_dimension_helper(intern, offset TSRMLS_CC);
+ return spl_fixedarray_object_read_dimension_helper(intern, offset);
}
/* }}} */
-static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value) /* {{{ */
{
zend_long index;
if (!offset) {
/* '$array[] = value' syntax is not supported */
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
} else {
if (!Z_ISUNDEF(intern->array->elements[index])) {
@@ -411,7 +411,7 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -432,22 +432,22 @@ static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zv
return;
}
- spl_fixedarray_object_write_dimension_helper(intern, offset, value TSRMLS_CC);
+ spl_fixedarray_object_write_dimension_helper(intern, offset, value);
}
/* }}} */
-static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */
+static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */
{
zend_long index;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
} else {
zval_ptr_dtor(&(intern->array->elements[index]));
@@ -456,7 +456,7 @@ static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -469,18 +469,18 @@ static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSR
return;
}
- spl_fixedarray_object_unset_dimension_helper(intern, offset TSRMLS_CC);
+ spl_fixedarray_object_unset_dimension_helper(intern, offset);
}
/* }}} */
-static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty) /* {{{ */
{
zend_long index;
int retval;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
@@ -491,7 +491,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
if (Z_ISUNDEF(intern->array->elements[index])) {
retval = 0;
} else if (check_empty) {
- if (zend_is_true(&intern->array->elements[index] TSRMLS_CC)) {
+ if (zend_is_true(&intern->array->elements[index])) {
retval = 1;
} else {
retval = 0;
@@ -505,7 +505,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
}
/* }}} */
-static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -519,16 +519,16 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c
if (!Z_ISUNDEF(rv)) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- return zend_is_true(&intern->retval TSRMLS_CC);
+ return zend_is_true(&intern->retval);
}
return 0;
}
- return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty TSRMLS_CC);
+ return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty);
}
/* }}} */
-static int spl_fixedarray_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -561,12 +561,12 @@ SPL_METHOD(SplFixedArray, __construct)
spl_fixedarray_object *intern;
zend_long size = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &size) == FAILURE) {
return;
}
if (size < 0) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero");
return;
}
@@ -578,7 +578,7 @@ SPL_METHOD(SplFixedArray, __construct)
}
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, size TSRMLS_CC);
+ spl_fixedarray_init(intern->array, size);
}
/* }}} */
@@ -587,7 +587,7 @@ SPL_METHOD(SplFixedArray, __construct)
SPL_METHOD(SplFixedArray, __wakeup)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(getThis());
- HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC);
+ HashTable *intern_ht = zend_std_get_properties(getThis());
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
@@ -599,7 +599,7 @@ SPL_METHOD(SplFixedArray, __wakeup)
int size = zend_hash_num_elements(intern_ht);
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, size TSRMLS_CC);
+ spl_fixedarray_init(intern->array, size);
ZEND_HASH_FOREACH_VAL(intern_ht, data) {
if (Z_REFCOUNTED_P(data)) {
@@ -674,7 +674,7 @@ SPL_METHOD(SplFixedArray, fromArray)
int num;
zend_bool save_indexes = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &data, &save_indexes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &data, &save_indexes) == FAILURE) {
return;
}
@@ -690,7 +690,7 @@ SPL_METHOD(SplFixedArray, fromArray)
ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(data), num_index, str_index) {
if (str_index != NULL || (zend_long)num_index < 0) {
efree(array);
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array must contain only positive integer keys");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array must contain only positive integer keys");
return;
}
@@ -702,10 +702,10 @@ SPL_METHOD(SplFixedArray, fromArray)
tmp = max_index + 1;
if (tmp <= 0) {
efree(array);
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "integer overflow detected");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "integer overflow detected");
return;
}
- spl_fixedarray_init(array, tmp TSRMLS_CC);
+ spl_fixedarray_init(array, tmp);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_index, str_index, element) {
ZVAL_DEREF(element);
@@ -716,7 +716,7 @@ SPL_METHOD(SplFixedArray, fromArray)
zval *element;
zend_long i = 0;
- spl_fixedarray_init(array, num TSRMLS_CC);
+ spl_fixedarray_init(array, num);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), element) {
ZVAL_DEREF(element);
@@ -724,7 +724,7 @@ SPL_METHOD(SplFixedArray, fromArray)
i++;
} ZEND_HASH_FOREACH_END();
} else {
- spl_fixedarray_init(array, 0 TSRMLS_CC);
+ spl_fixedarray_init(array, 0);
}
object_init_ex(return_value, spl_ce_SplFixedArray);
@@ -761,12 +761,12 @@ SPL_METHOD(SplFixedArray, setSize)
spl_fixedarray_object *intern;
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) {
return;
}
if (size < 0) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero");
return;
}
@@ -775,7 +775,7 @@ SPL_METHOD(SplFixedArray, setSize)
intern->array = ecalloc(1, sizeof(spl_fixedarray));
}
- spl_fixedarray_resize(intern->array, size TSRMLS_CC);
+ spl_fixedarray_resize(intern->array, size);
RETURN_TRUE;
}
/* }}} */
@@ -787,13 +787,13 @@ SPL_METHOD(SplFixedArray, offsetExists)
zval *zindex;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0 TSRMLS_CC));
+ RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0));
} /* }}} */
/* {{{ proto mixed SplFixedArray::offsetGet(mixed $index)
@@ -803,12 +803,12 @@ SPL_METHOD(SplFixedArray, offsetGet)
zval *zindex, *value;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- value = spl_fixedarray_object_read_dimension_helper(intern, zindex TSRMLS_CC);
+ value = spl_fixedarray_object_read_dimension_helper(intern, zindex);
if (value) {
RETURN_ZVAL(value, 1, 0);
@@ -823,12 +823,12 @@ SPL_METHOD(SplFixedArray, offsetSet)
zval *zindex, *value;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- spl_fixedarray_object_write_dimension_helper(intern, zindex, value TSRMLS_CC);
+ spl_fixedarray_object_write_dimension_helper(intern, zindex, value);
} /* }}} */
@@ -839,42 +839,42 @@ SPL_METHOD(SplFixedArray, offsetUnset)
zval *zindex;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- spl_fixedarray_object_unset_dimension_helper(intern, zindex TSRMLS_CC);
+ spl_fixedarray_object_unset_dimension_helper(intern, zindex);
} /* }}} */
-static void spl_fixedarray_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter;
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) {
- zend_user_it_rewind(iter TSRMLS_CC);
+ zend_user_it_rewind(iter);
} else {
object->current = 0;
}
}
/* }}} */
-static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_VALID) {
- return zend_user_it_valid(iter TSRMLS_CC);
+ return zend_user_it_valid(iter);
}
if (object->current >= 0 && object->array && object->current < object->array->size) {
@@ -885,19 +885,19 @@ static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{
}
/* }}} */
-static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
zval zindex;
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_CURRENT) {
- return zend_user_it_get_current_data(iter TSRMLS_CC);
+ return zend_user_it_get_current_data(iter);
} else {
zval *data;
ZVAL_LONG(&zindex, object->current);
- data = spl_fixedarray_object_read_dimension_helper(object, &zindex TSRMLS_CC);
+ data = spl_fixedarray_object_read_dimension_helper(object, &zindex);
zval_ptr_dtor(&zindex);
if (data == NULL) {
@@ -908,26 +908,26 @@ static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRML
}
/* }}} */
-static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) {
- zend_user_it_get_current_key(iter, key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key);
} else {
ZVAL_LONG(key, object->current);
}
}
/* }}} */
-static void spl_fixedarray_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_NEXT) {
- zend_user_it_move_forward(iter TSRMLS_CC);
+ zend_user_it_move_forward(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
object->current++;
}
}
@@ -1002,7 +1002,7 @@ SPL_METHOD(SplFixedArray, current)
ZVAL_LONG(&zindex, intern->current);
- value = spl_fixedarray_object_read_dimension_helper(intern, &zindex TSRMLS_CC);
+ value = spl_fixedarray_object_read_dimension_helper(intern, &zindex);
zval_ptr_dtor(&zindex);
@@ -1023,18 +1023,18 @@ zend_object_iterator_funcs spl_fixedarray_it_funcs = {
spl_fixedarray_it_rewind
};
-zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_fixedarray_it *iterator;
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_fixedarray_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_fixedarray_it_funcs;
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index f409927271..c9b9642c6e 100644
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -28,22 +28,22 @@
#include "php_spl.h"
/* {{{ spl_register_interface */
-void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions TSRMLS_DC)
+void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), functions);
- *ppce = zend_register_internal_interface(&ce TSRMLS_CC);
+ *ppce = zend_register_internal_interface(&ce);
}
/* }}} */
/* {{{ spl_register_std_class */
-PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list TSRMLS_DC)
+PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list);
- *ppce = zend_register_internal_class(&ce TSRMLS_CC);
+ *ppce = zend_register_internal_class(&ce);
/* entries changed by initialize */
if (obj_ctor) {
@@ -53,12 +53,12 @@ PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name,
/* }}} */
/* {{{ spl_register_sub_class */
-PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list TSRMLS_DC)
+PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list);
- *ppce = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+ *ppce = zend_register_internal_class_ex(&ce, parent_ce);
/* entries changed by initialize */
if (obj_ctor) {
@@ -70,14 +70,14 @@ PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry *
/* }}} */
/* {{{ spl_register_property */
-void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC)
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags)
{
- zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC);
+ zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags);
}
/* }}} */
/* {{{ spl_add_class_name */
-void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags)
{
if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
zval *tmp;
@@ -92,47 +92,47 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla
/* }}} */
/* {{{ spl_add_interfaces */
-void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags)
{
uint32_t num_interfaces;
for (num_interfaces = 0; num_interfaces < pce->num_interfaces; num_interfaces++) {
- spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags);
}
}
/* }}} */
/* {{{ spl_add_traits */
-void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags)
{
uint32_t num_traits;
for (num_traits = 0; num_traits < pce->num_traits; num_traits++) {
- spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags);
}
}
/* }}} */
/* {{{ spl_add_classes */
-int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC)
+int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags)
{
if (!pce) {
return 0;
}
- spl_add_class_name(list, pce, allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce, allow, ce_flags);
if (sub) {
- spl_add_interfaces(list, pce, allow, ce_flags TSRMLS_CC);
+ spl_add_interfaces(list, pce, allow, ce_flags);
while (pce->parent) {
pce = pce->parent;
- spl_add_classes(pce, list, sub, allow, ce_flags TSRMLS_CC);
+ spl_add_classes(pce, list, sub, allow, ce_flags);
}
}
return 0;
}
/* }}} */
-zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC) /* {{{ */
+zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len) /* {{{ */
{
return zend_mangle_property_name(ce->name->val, ce->name->len, prop_name, prop_len, 0);
}
diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h
index 3381975e6c..942aed27e2 100644
--- a/ext/spl/spl_functions.h
+++ b/ext/spl/spl_functions.h
@@ -23,50 +23,50 @@
#include "php.h"
-typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type TSRMLS_DC);
+typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type);
#define REGISTER_SPL_STD_CLASS(class_name, obj_ctor) \
- spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL TSRMLS_CC);
+ spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL);
#define REGISTER_SPL_STD_CLASS_EX(class_name, obj_ctor, funcs) \
- spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs TSRMLS_CC);
+ spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs);
#define REGISTER_SPL_SUB_CLASS_EX(class_name, parent_class_name, obj_ctor, funcs) \
- spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs TSRMLS_CC);
+ spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs);
#define REGISTER_SPL_INTERFACE(class_name) \
- spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name TSRMLS_CC);
+ spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name);
#define REGISTER_SPL_IMPLEMENTS(class_name, interface_name) \
- zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, spl_ce_ ## interface_name);
+ zend_class_implements(spl_ce_ ## class_name, 1, spl_ce_ ## interface_name);
#define REGISTER_SPL_ITERATOR(class_name) \
- zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, zend_ce_iterator);
+ zend_class_implements(spl_ce_ ## class_name, 1, zend_ce_iterator);
#define REGISTER_SPL_PROPERTY(class_name, prop_name, prop_flags) \
- spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags TSRMLS_CC);
+ spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags);
#define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value);
-void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC);
-void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC);
-void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions TSRMLS_DC);
+void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list);
+void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list);
+void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions);
-void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC);
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags);
/* sub: whether to allow subclasses/interfaces
allow = 0: allow all classes and interfaces
allow > 0: allow all that match and mask ce_flags
allow < 0: disallow all that match and mask ce_flags
*/
-void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC);
+void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags);
/* caller must efree(return) */
-zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC);
+zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len);
#define SPL_ME(class_name, function_name, arg_info, flags) \
PHP_ME( spl_ ## class_name, function_name, arg_info, flags)
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index b421c03757..c13cd2f298 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -50,9 +50,9 @@ PHPAPI zend_class_entry *spl_ce_SplMinHeap;
PHPAPI zend_class_entry *spl_ce_SplPriorityQueue;
-typedef void (*spl_ptr_heap_dtor_func)(zval * TSRMLS_DC);
-typedef void (*spl_ptr_heap_ctor_func)(zval * TSRMLS_DC);
-typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval * TSRMLS_DC);
+typedef void (*spl_ptr_heap_dtor_func)(zval *);
+typedef void (*spl_ptr_heap_ctor_func)(zval *);
+typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval *);
typedef struct _spl_ptr_heap {
zval *elements;
@@ -91,21 +91,21 @@ static inline spl_heap_object *spl_heap_from_obj(zend_object *obj) /* {{{ */ {
#define Z_SPLHEAP_P(zv) spl_heap_from_obj(Z_OBJ_P((zv)))
-static void spl_ptr_heap_zval_dtor(zval *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_zval_dtor(zval *elem) { /* {{{ */
if (!Z_ISUNDEF_P(elem)) {
zval_ptr_dtor(elem);
}
}
/* }}} */
-static void spl_ptr_heap_zval_ctor(zval *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_zval_ctor(zval *elem) { /* {{{ */
if (Z_REFCOUNTED_P(elem)) {
Z_ADDREF_P(elem);
}
}
/* }}} */
-static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result) { /* {{{ */
zval zresult;
zend_call_method_with_2_params(object, heap_object->std.ce, &heap_object->fptr_cmp, "compare", &zresult, a, b);
@@ -145,7 +145,7 @@ static zval *spl_pqueue_extract_helper(zval *value, int flags) /* {{{ */
}
/* }}} */
-static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
if (EG(exception)) {
@@ -156,7 +156,7 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -164,12 +164,12 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
}
}
- compare_function(&result, a, b TSRMLS_CC);
+ compare_function(&result, a, b);
return (int)Z_LVAL(result);
}
/* }}} */
-static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
if (EG(exception)) {
@@ -180,7 +180,7 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -188,12 +188,12 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
}
}
- compare_function(&result, b, a TSRMLS_CC);
+ compare_function(&result, b, a);
return (int)Z_LVAL(result);
}
/* }}} */
-static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
zval *a_priority_p = spl_pqueue_extract_helper(a, SPL_PQUEUE_EXTR_PRIORITY);
zval *b_priority_p = spl_pqueue_extract_helper(b, SPL_PQUEUE_EXTR_PRIORITY);
@@ -211,7 +211,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -219,7 +219,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /
}
}
- compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC);
+ compare_function(&result, a_priority_p, b_priority_p);
return (int)Z_LVAL(result);
}
/* }}} */
@@ -240,7 +240,7 @@ static spl_ptr_heap *spl_ptr_heap_init(spl_ptr_heap_cmp_func cmp, spl_ptr_heap_c
}
/* }}} */
-static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */
int i;
if (heap->count+1 > heap->max_size) {
@@ -250,10 +250,10 @@ static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userda
heap->max_size *= 2;
}
- heap->ctor(elem TSRMLS_CC);
+ heap->ctor(elem);
/* sifting up */
- for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) {
+ for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) {
heap->elements[i] = heap->elements[(i-1)/2];
}
@@ -275,7 +275,7 @@ static zval *spl_ptr_heap_top(spl_ptr_heap *heap) { /* {{{ */
}
/* }}} */
-static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */
int i, j;
const int limit = (heap->count-1)/2;
zval *bottom;
@@ -291,12 +291,12 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us
for (i = 0; i < limit; i = j) {
/* Find smaller child */
j = i * 2 + 1;
- if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata TSRMLS_CC) > 0) {
+ if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata) > 0) {
j++; /* next child is bigger */
}
/* swap elements between two levels */
- if(heap->cmp(bottom, &heap->elements[j], cmp_userdata TSRMLS_CC) < 0) {
+ if(heap->cmp(bottom, &heap->elements[j], cmp_userdata) < 0) {
heap->elements[i] = heap->elements[j];
} else {
break;
@@ -309,11 +309,11 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us
}
ZVAL_COPY_VALUE(&heap->elements[i], bottom);
- heap->dtor(elem TSRMLS_CC);
+ heap->dtor(elem);
}
/* }}} */
-static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ */
+static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from) { /* {{{ */
int i;
spl_ptr_heap *heap = emalloc(sizeof(spl_ptr_heap));
@@ -329,18 +329,18 @@ static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ *
memcpy(heap->elements, from->elements, sizeof(zval)*from->max_size);
for (i=0; i < heap->count; ++i) {
- heap->ctor(&heap->elements[i] TSRMLS_CC);
+ heap->ctor(&heap->elements[i]);
}
return heap;
}
/* }}} */
-static void spl_ptr_heap_destroy(spl_ptr_heap *heap TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_destroy(spl_ptr_heap *heap) { /* {{{ */
int i;
for (i=0; i < heap->count; ++i) {
- heap->dtor(&heap->elements[i] TSRMLS_CC);
+ heap->dtor(&heap->elements[i]);
}
efree(heap->elements);
@@ -354,14 +354,14 @@ static int spl_ptr_heap_count(spl_ptr_heap *heap) { /* {{{ */
/* }}} */
/* }}} */
-zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_heap_object_free_storage(zend_object *object) /* {{{ */
{
int i;
spl_heap_object *intern = spl_heap_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
for (i = 0; i < intern->heap->count; ++i) {
if (!Z_ISUNDEF(intern->heap->elements[i])) {
@@ -369,7 +369,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
}
}
- spl_ptr_heap_destroy(intern->heap TSRMLS_CC);
+ spl_ptr_heap_destroy(intern->heap);
zval_ptr_dtor(&intern->retval);
@@ -380,7 +380,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_heap_object *intern;
zend_class_entry *parent = class_type;
@@ -388,7 +388,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
intern = ecalloc(1, sizeof(spl_heap_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->flags = 0;
@@ -401,7 +401,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
if (clone_orig) {
int i;
- intern->heap = spl_ptr_heap_clone(other->heap TSRMLS_CC);
+ intern->heap = spl_ptr_heap_clone(other->heap);
for (i = 0; i < intern->heap->count; ++i) {
if (Z_REFCOUNTED(intern->heap->elements[i])) {
Z_ADDREF(intern->heap->elements[i]);
@@ -445,7 +445,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap");
}
if (inherited) {
@@ -463,27 +463,27 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
}
/* }}} */
-static zend_object *spl_heap_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_heap_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_heap_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_heap_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_heap_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_heap_object *intern = Z_SPLHEAP_P(object);
@@ -507,7 +507,7 @@ static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_
}
/* }}} */
-static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp TSRMLS_DC) { /* {{{ */
+static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp) { /* {{{ */
spl_heap_object *intern = Z_SPLHEAP_P(obj);
zval tmp, heap_array;
zend_string *pnstr;
@@ -528,12 +528,12 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
- pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1);
ZVAL_LONG(&tmp, intern->flags);
zend_hash_update(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
- pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1);
ZVAL_BOOL(&tmp, intern->heap->flags&SPL_HEAP_CORRUPTED);
zend_hash_update(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
@@ -547,7 +547,7 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
}
}
- pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1);
zend_hash_update(intern->debug_info, pnstr, &heap_array);
zend_string_release(pnstr);
}
@@ -556,15 +556,15 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
}
/* }}} */
-static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp TSRMLS_CC);
+ return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp);
}
/* }}} */
-static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp TSRMLS_CC);
+ return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp);
}
/* }}} */
@@ -605,19 +605,19 @@ SPL_METHOD(SplHeap, insert)
zval *value;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- spl_ptr_heap_insert(intern->heap, value, getThis() TSRMLS_CC);
+ spl_ptr_heap_insert(intern->heap, value, getThis());
RETURN_TRUE;
}
@@ -637,14 +637,14 @@ SPL_METHOD(SplHeap, extract)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &value, getThis());
if (Z_ISUNDEF(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
return;
}
@@ -659,14 +659,14 @@ SPL_METHOD(SplPriorityQueue, insert)
zval *data, *priority, elem;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &data, &priority) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &data, &priority) == FAILURE) {
return;
}
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
@@ -677,7 +677,7 @@ SPL_METHOD(SplPriorityQueue, insert)
add_assoc_zval_ex(&elem, "data", sizeof("data") - 1, data);
add_assoc_zval_ex(&elem, "priority", sizeof("priority") - 1, priority);
- spl_ptr_heap_insert(intern->heap, &elem, getThis() TSRMLS_CC);
+ spl_ptr_heap_insert(intern->heap, &elem, getThis());
RETURN_TRUE;
}
@@ -697,14 +697,14 @@ SPL_METHOD(SplPriorityQueue, extract)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &value, getThis());
if (Z_ISUNDEF(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
return;
}
@@ -739,14 +739,14 @@ SPL_METHOD(SplPriorityQueue, top)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
value = spl_ptr_heap_top(intern->heap);
if (!value) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0);
return;
}
@@ -769,7 +769,7 @@ SPL_METHOD(SplPriorityQueue, setExtractFlags)
zend_long value;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
return;
}
@@ -837,11 +837,11 @@ SPL_METHOD(SplPriorityQueue, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL));
}
/* }}} */
@@ -859,14 +859,14 @@ SPL_METHOD(SplHeap, top)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
value = spl_ptr_heap_top(intern->heap);
if (!value) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0);
return;
}
@@ -880,11 +880,11 @@ SPL_METHOD(SplMinHeap, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL));
}
/* }}} */
@@ -894,42 +894,42 @@ SPL_METHOD(SplMaxHeap, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL));
}
/* }}} */
-static void spl_heap_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_heap_it *iterator = (spl_heap_it *)iter;
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_heap_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_rewind(zend_object_iterator *iter) /* {{{ */
{
/* do nothing, the iterator always points to the top element */
}
/* }}} */
-static int spl_heap_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_heap_it_valid(zend_object_iterator *iter) /* {{{ */
{
return ((Z_SPLHEAP_P(&iter->data))->heap->count != 0 ? SUCCESS : FAILURE);
}
/* }}} */
-static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_heap_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval *element = &object->heap->elements[0];
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return NULL;
}
@@ -941,13 +941,13 @@ static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval *element = &object->heap->elements[0];
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return NULL;
}
@@ -963,7 +963,7 @@ static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC
}
/* }}} */
-static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
@@ -971,21 +971,21 @@ static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TS
}
/* }}} */
-static void spl_heap_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval elem;
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(object->heap, &elem, &iter->data TSRMLS_CC);
+ spl_ptr_heap_delete_top(object->heap, &elem, &iter->data);
zval_ptr_dtor(&elem);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
}
/* }}} */
@@ -1009,7 +1009,7 @@ SPL_METHOD(SplHeap, next)
{
spl_heap_object *intern = Z_SPLHEAP_P(getThis());
zval elem;
- spl_ptr_heap_delete_top(intern->heap, &elem, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &elem, getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -1108,19 +1108,19 @@ zend_object_iterator_funcs spl_pqueue_it_funcs = {
spl_heap_it_rewind
};
-zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_heap_it *iterator;
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_heap_it));
- zend_iterator_init(&iterator->intern.it TSRMLS_CC);
+ zend_iterator_init(&iterator->intern.it);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_heap_it_funcs;
@@ -1132,19 +1132,19 @@ zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object,
}
/* }}} */
-zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_heap_it *iterator;
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_heap_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_pqueue_it_funcs;
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index c129115eeb..02bdcf8e61 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -138,7 +138,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
do { \
spl_dual_it_object *it = Z_SPLDUAL_IT_P(objzval); \
if (it->dit_type == DIT_Unknown) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -148,7 +148,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ELEMENT(var, object, element) \
do { \
if(!(object)->iterators) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -158,7 +158,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ELEMENT_ADDR(var, object, element) \
do { \
if(!(object)->iterators) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -168,7 +168,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ITERATOR(var, object) SPL_FETCH_SUB_ELEMENT(var, object, iterator)
-static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
+static void spl_recursive_it_dtor(zend_object_iterator *_iter)
{
spl_recursive_it_iterator *iter = (spl_recursive_it_iterator*)_iter;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->intern.data);
@@ -176,7 +176,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
while (object->level > 0) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator));
@@ -185,7 +185,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
zval_ptr_dtor(&iter->intern.data);
}
-static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *sub_iter;
int level = object->level;
@@ -195,7 +195,7 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi
}
while (level >=0) {
sub_iter = object->iterators[level].iterator;
- if (sub_iter->funcs->valid(sub_iter TSRMLS_CC) == SUCCESS) {
+ if (sub_iter->funcs->valid(sub_iter) == SUCCESS) {
return SUCCESS;
}
level--;
@@ -207,32 +207,32 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi
return FAILURE;
}
-static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC)
+static int spl_recursive_it_valid(zend_object_iterator *iter)
{
- return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data);
zend_object_iterator *sub_iter = object->iterators[object->level].iterator;
- return sub_iter->funcs->get_current_data(sub_iter TSRMLS_CC);
+ return sub_iter->funcs->get_current_data(sub_iter);
}
-static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data);
zend_object_iterator *sub_iter = object->iterators[object->level].iterator;
if (sub_iter->funcs->get_current_key) {
- sub_iter->funcs->get_current_key(sub_iter, key TSRMLS_CC);
+ sub_iter->funcs->get_current_key(sub_iter, key);
} else {
ZVAL_LONG(key, iter->index);
}
}
-static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *iterator;
zval *zobject;
@@ -248,17 +248,17 @@ next_step:
iterator = object->iterators[object->level].iterator;
switch (object->iterators[object->level].state) {
case RS_NEXT:
- iterator->funcs->move_forward(iterator TSRMLS_CC);
+ iterator->funcs->move_forward(iterator);
if (EG(exception)) {
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
/* fall through */
case RS_START:
- if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) {
+ if (iterator->funcs->valid(iterator) == FAILURE) {
break;
}
object->iterators[object->level].state = RS_TEST;
@@ -276,11 +276,11 @@ next_step:
object->iterators[object->level].state = RS_NEXT;
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
if (Z_TYPE(retval) != IS_UNDEF) {
- has_children = zend_is_true(&retval TSRMLS_CC);
+ has_children = zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (has_children) {
if (object->max_depth == -1 || object->max_depth > object->level) {
@@ -311,7 +311,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
return /* self */;
@@ -338,7 +338,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
zval_ptr_dtor(&child);
object->iterators[object->level].state = RS_NEXT;
goto next_step;
@@ -346,9 +346,9 @@ next_step:
}
if (Z_TYPE(child) == IS_UNDEF || Z_TYPE(child) != IS_OBJECT ||
- !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator TSRMLS_CC))) {
+ !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator))) {
zval_ptr_dtor(&child);
- zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0);
return;
}
@@ -358,13 +358,13 @@ next_step:
object->iterators[object->level].state = RS_NEXT;
}
object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator) * (++object->level+1));
- sub_iter = ce->get_iterator(ce, &child, 0 TSRMLS_CC);
+ sub_iter = ce->get_iterator(ce, &child, 0);
ZVAL_COPY_VALUE(&object->iterators[object->level].zobject, &child);
object->iterators[object->level].iterator = sub_iter;
object->iterators[object->level].ce = ce;
object->iterators[object->level].state = RS_START;
if (sub_iter->funcs->rewind) {
- sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
+ sub_iter->funcs->rewind(sub_iter);
}
if (object->beginChildren) {
zend_call_method_with_0_params(zthis, object->ce, &object->beginChildren, "beginchildren", NULL);
@@ -372,7 +372,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
}
@@ -386,11 +386,11 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
}
- zend_iterator_dtor(iterator TSRMLS_CC);
+ zend_iterator_dtor(iterator);
zval_ptr_dtor(&object->iterators[object->level].zobject);
object->level--;
} else {
@@ -399,7 +399,7 @@ next_step:
}
}
-static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *sub_iter;
@@ -407,7 +407,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
while (object->level) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
if (!EG(exception) && (!object->endChildren || object->endChildren->common.scope != spl_ce_RecursiveIteratorIterator)) {
zend_call_method_with_0_params(zthis, object->ce, &object->endChildren, "endchildren", NULL);
@@ -417,26 +417,26 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
object->iterators[0].state = RS_START;
sub_iter = object->iterators[0].iterator;
if (sub_iter->funcs->rewind) {
- sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
+ sub_iter->funcs->rewind(sub_iter);
}
if (!EG(exception) && object->beginIteration && !object->in_iteration) {
zend_call_method_with_0_params(zthis, object->ce, &object->beginIteration, "beginIteration", NULL);
}
object->in_iteration = 1;
- spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(object, zthis);
}
-static void spl_recursive_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_recursive_it_move_forward(zend_object_iterator *iter)
{
- spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static void spl_recursive_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_recursive_it_rewind(zend_object_iterator *iter)
{
- spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref TSRMLS_DC)
+static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref)
{
spl_recursive_it_iterator *iterator;
spl_recursive_it_object *object;
@@ -451,7 +451,7 @@ static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce,
"the parent constructor has not been called");
}
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.data, zobject);
iterator->intern.funcs = ce->iterator_funcs.funcs;
@@ -477,7 +477,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
int inc_refcount = 1;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
switch (rit_type) {
case RIT_RecursiveTreeIterator: {
@@ -486,8 +486,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
mode = RIT_SELF_FIRST;
flags = RTIT_BYPASS_KEY;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) {
- if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) {
+ if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
zval *aggregate = iterator;
zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator);
//??? inc_refcount = 0;
@@ -498,7 +498,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
} else {
ZVAL_LONG(&caching_it_flags, CIT_CATCH_GET_CHILD);
}
- spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags TSRMLS_CC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags);
zval_ptr_dtor(&caching_it_flags);
if (inc_refcount == 0 && iterator) {
zval_ptr_dtor(iterator);
@@ -515,8 +515,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
mode = RIT_LEAVES_ONLY;
flags = 0;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) {
- if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|ll", &iterator, &mode, &flags) == SUCCESS) {
+ if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
zval *aggregate = iterator;
zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator);
//??? inc_refcount = 0;
@@ -527,12 +527,12 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
break;
}
}
- if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) {
+ if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator)) {
if (iterator && !inc_refcount) {
zval_ptr_dtor(iterator);
}
- zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0);
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -575,7 +575,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
}
ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */
- intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0 TSRMLS_CC);
+ intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0);
//??? if (inc_refcount) {
ZVAL_COPY(&intern->iterators[0].zobject, iterator);
//??? } else {
@@ -584,14 +584,14 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
intern->iterators[0].ce = ce_iterator;
intern->iterators[0].state = RS_START;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (EG(exception)) {
zend_object_iterator *sub_iter;
while (intern->level >= 0) {
sub_iter = intern->iterators[intern->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&intern->iterators[intern->level--].zobject);
}
efree(intern->iterators);
@@ -616,7 +616,7 @@ SPL_METHOD(RecursiveIteratorIterator, rewind)
return;
}
- spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC);
+ spl_recursive_it_rewind_ex(object, getThis());
} /* }}} */
/* {{{ proto bool RecursiveIteratorIterator::valid()
@@ -629,7 +629,7 @@ SPL_METHOD(RecursiveIteratorIterator, valid)
return;
}
- RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis() TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis()) == SUCCESS);
} /* }}} */
/* {{{ proto mixed RecursiveIteratorIterator::key()
@@ -646,7 +646,7 @@ SPL_METHOD(RecursiveIteratorIterator, key)
SPL_FETCH_SUB_ITERATOR(iterator, object);
if (iterator->funcs->get_current_key) {
- iterator->funcs->get_current_key(iterator, return_value TSRMLS_CC);
+ iterator->funcs->get_current_key(iterator, return_value);
} else {
RETURN_NULL();
}
@@ -666,7 +666,7 @@ SPL_METHOD(RecursiveIteratorIterator, current)
SPL_FETCH_SUB_ITERATOR(iterator, object);
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -682,7 +682,7 @@ SPL_METHOD(RecursiveIteratorIterator, next)
return;
}
- spl_recursive_it_move_forward_ex(object, getThis() TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(object, getThis());
} /* }}} */
/* {{{ proto int RecursiveIteratorIterator::getDepth()
@@ -705,7 +705,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
zend_long level = object->level;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &level) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &level) == FAILURE) {
return;
}
if (level < 0 || level > object->level) {
@@ -713,7 +713,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
@@ -848,11 +848,11 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
zend_long max_depth = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_depth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_depth) == FAILURE) {
return;
}
if (max_depth < -1) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0);
return;
} else if (max_depth > INT_MAX) {
max_depth = INT_MAX;
@@ -878,7 +878,7 @@ SPL_METHOD(RecursiveIteratorIterator, getMaxDepth)
}
} /* }}} */
-static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key TSRMLS_DC)
+static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key)
{
union _zend_function *function_handler;
spl_recursive_it_object *object = spl_recursive_it_from_obj(*zobject);
@@ -886,16 +886,16 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject,
zval *zobj;
if (!object->iterators) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val);
+ php_error_docref(NULL, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val);
}
zobj = &object->iterators[level].zobject;
- function_handler = std_object_handlers.get_method(zobject, method, key TSRMLS_CC);
+ function_handler = std_object_handlers.get_method(zobject, method, key);
if (!function_handler) {
if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) {
if (Z_OBJ_HT_P(zobj)->get_method) {
*zobject = Z_OBJ_P(zobj);
- function_handler = (*zobject)->handlers->get_method(zobject, method, key TSRMLS_CC);
+ function_handler = (*zobject)->handlers->get_method(zobject, method, key);
}
} else {
*zobject = Z_OBJ_P(zobj);
@@ -905,18 +905,18 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject,
}
/* {{{ spl_RecursiveIteratorIterator_dtor */
-static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC)
+static void spl_RecursiveIteratorIterator_dtor(zend_object *_object)
{
spl_recursive_it_object *object = spl_recursive_it_from_obj(_object);
zend_object_iterator *sub_iter;
/* call standard dtor */
- zend_objects_destroy_object(_object TSRMLS_CC);
+ zend_objects_destroy_object(_object);
if (object->iterators) {
while (object->level >= 0) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
efree(object->iterators);
@@ -926,11 +926,11 @@ static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC)
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_free_storage */
-static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRMLS_DC)
+static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object)
{
spl_recursive_it_object *object = spl_recursive_it_from_obj(_object);
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
smart_str_free(&object->prefix[0]);
smart_str_free(&object->prefix[1]);
smart_str_free(&object->prefix[2]);
@@ -943,7 +943,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRM
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_new_ex */
-static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix TSRMLS_DC)
+static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix)
{
spl_recursive_it_object *intern;
@@ -960,7 +960,7 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class
smart_str_appendl(&intern->postfix[0], "", 0);
}
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_handlers_rec_it_it;
@@ -969,16 +969,16 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_new */
-static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type)
{
- return spl_RecursiveIteratorIterator_new_ex(class_type, 0 TSRMLS_CC);
+ return spl_RecursiveIteratorIterator_new_ex(class_type, 0);
}
/* }}} */
/* {{{ spl_RecursiveTreeIterator_new */
-static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type)
{
- return spl_RecursiveIteratorIterator_new_ex(class_type, 1 TSRMLS_CC);
+ return spl_RecursiveIteratorIterator_new_ex(class_type, 1);
}
/* }}} */
@@ -1018,7 +1018,7 @@ static const zend_function_entry spl_funcs_RecursiveIteratorIterator[] = {
PHP_FE_END
};
-static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value)
{
smart_str str = {0};
zval has_next;
@@ -1053,15 +1053,15 @@ static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *obje
RETURN_STR(str.s);
}
-static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value)
{
zend_object_iterator *iterator = object->iterators[object->level].iterator;
zval *data;
zend_error_handling error_handling;
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
if (data) {
RETVAL_ZVAL(data, 1, 0);
if (Z_TYPE_P(return_value) == IS_ARRAY) {
@@ -1071,10 +1071,10 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *objec
convert_to_string(return_value);
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
-static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value)
{
RETVAL_STR(object->postfix[0].s);
Z_ADDREF_P(return_value);
@@ -1096,12 +1096,12 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart)
size_t prefix_len;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &part, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &part, &prefix, &prefix_len) == FAILURE) {
return;
}
if (0 > part || part > 5) {
- zend_throw_exception_ex(spl_ce_OutOfRangeException, 0 TSRMLS_CC, "Use RecursiveTreeIterator::PREFIX_* constant");
+ zend_throw_exception_ex(spl_ce_OutOfRangeException, 0, "Use RecursiveTreeIterator::PREFIX_* constant");
return;
}
@@ -1120,12 +1120,12 @@ SPL_METHOD(RecursiveTreeIterator, getPrefix)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_prefix(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, return_value);
} /* }}} */
/* {{{ proto void RecursiveTreeIterator::setPostfix(string prefix)
@@ -1136,7 +1136,7 @@ SPL_METHOD(RecursiveTreeIterator, setPostfix)
char* postfix;
size_t postfix_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &postfix, &postfix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &postfix, &postfix_len) == FAILURE) {
return;
}
@@ -1155,12 +1155,12 @@ SPL_METHOD(RecursiveTreeIterator, getEntry)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_entry(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_entry(object, return_value);
} /* }}} */
/* {{{ proto string RecursiveTreeIterator::getPostfix()
@@ -1174,12 +1174,12 @@ SPL_METHOD(RecursiveTreeIterator, getPostfix)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_postfix(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_postfix(object, return_value);
} /* }}} */
/* {{{ proto mixed RecursiveTreeIterator::current()
@@ -1196,7 +1196,7 @@ SPL_METHOD(RecursiveTreeIterator, current)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
@@ -1206,7 +1206,7 @@ SPL_METHOD(RecursiveTreeIterator, current)
zval *data;
SPL_FETCH_SUB_ITERATOR(iterator, object);
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
} else {
@@ -1216,14 +1216,14 @@ SPL_METHOD(RecursiveTreeIterator, current)
ZVAL_NULL(&prefix);
ZVAL_NULL(&entry);
- spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC);
- spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, &prefix);
+ spl_recursive_tree_iterator_get_entry(object, &entry);
if (Z_TYPE(entry) != IS_STRING) {
zval_ptr_dtor(&prefix);
zval_ptr_dtor(&entry);
RETURN_NULL();
}
- spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC);
+ spl_recursive_tree_iterator_get_postfix(object, &postfix);
str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix), 0);
ptr = str->val;
@@ -1260,7 +1260,7 @@ SPL_METHOD(RecursiveTreeIterator, key)
SPL_FETCH_SUB_ITERATOR(iterator, object);
if (iterator->funcs->get_current_key) {
- iterator->funcs->get_current_key(iterator, &key TSRMLS_CC);
+ iterator->funcs->get_current_key(iterator, &key);
} else {
ZVAL_NULL(&key);
}
@@ -1273,13 +1273,13 @@ SPL_METHOD(RecursiveTreeIterator, key)
}
if (Z_TYPE(key) != IS_STRING) {
- if (zend_make_printable_zval(&key, &key_copy TSRMLS_CC)) {
+ if (zend_make_printable_zval(&key, &key_copy)) {
key = key_copy;
}
}
- spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC);
- spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, &prefix);
+ spl_recursive_tree_iterator_get_postfix(object, &postfix);
str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(key) + Z_STRLEN(postfix), 0);
ptr = str->val;
@@ -1334,7 +1334,7 @@ static const zend_function_entry spl_funcs_RecursiveTreeIterator[] = {
};
#if MBO_0
-static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type)
{
class_type->iterator_funcs.zf_valid = NULL;
class_type->iterator_funcs.zf_current = NULL;
@@ -1349,19 +1349,19 @@ static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_
}
#endif
-static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC)
+static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key)
{
union _zend_function *function_handler;
spl_dual_it_object *intern;
intern = spl_dual_it_from_obj(*object);
- function_handler = std_object_handlers.get_method(object, method, key TSRMLS_CC);
+ function_handler = std_object_handlers.get_method(object, method, key);
if (!function_handler && intern->inner.ce) {
if ((function_handler = zend_hash_find_ptr(&intern->inner.ce->function_table, method)) == NULL) {
if (Z_OBJ_HT(intern->inner.zobject)->get_method) {
*object = Z_OBJ(intern->inner.zobject);
- function_handler = (*object)->handlers->get_method(object, method, key TSRMLS_CC);
+ function_handler = (*object)->handlers->get_method(object, method, key);
}
} else {
*object = Z_OBJ(intern->inner.zobject);
@@ -1384,8 +1384,8 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
intern = Z_SPLDUAL_IT_P(getThis());
ZVAL_STRING(&func, method, 0);
- if (!zend_is_callable(&func, 0, &method TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method);
+ if (!zend_is_callable(&func, 0, &method)) {
+ php_error_docref(NULL, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method);
return FAILURE;
}
@@ -1401,12 +1401,12 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
}
arg_count = current; /* restore */
- if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
RETURN_ZVAL(&retval, 0, 0);
success = SUCCESS;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method);
+ php_error_docref(NULL, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method);
success = FAILURE;
}
@@ -1417,14 +1417,14 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
#define SPL_CHECK_CTOR(intern, classname) \
if (intern->dit_type == DIT_Unknown) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Classes derived from %s must call %s::__construct()", \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Classes derived from %s must call %s::__construct()", \
(spl_ce_##classname)->name->val, (spl_ce_##classname)->name->val); \
return; \
}
#define APPENDIT_CHECK_CTOR(intern) SPL_CHECK_CTOR(intern, AppendIterator)
-static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more);
static inline int spl_cit_check_flags(zend_long flags)
{
@@ -1449,29 +1449,29 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern = Z_SPLDUAL_IT_P(getThis());
if (intern->dit_type != DIT_Unknown) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s::getIterator() must be called exactly once per instance", ce_base->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called exactly once per instance", ce_base->name->val);
return NULL;
}
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
intern->dit_type = dit_type;
switch (dit_type) {
case DIT_LimitIterator: {
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) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (intern->u.limit.offset < 0) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (intern->u.limit.count < 0 && intern->u.limit.count != -1) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
break;
@@ -1479,13 +1479,13 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
case DIT_CachingIterator:
case DIT_RecursiveCachingIterator: {
zend_long flags = CIT_CALL_TOSTRING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &zobject, ce_inner, &flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (spl_cit_check_flags(flags) != SUCCESS) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.caching.flags |= flags & CIT_PUBLIC;
@@ -1496,33 +1496,33 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
zend_class_entry *ce_cast;
zend_string *class_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|S", &zobject, ce_inner, &class_name) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S", &zobject, ce_inner, &class_name) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
ce = Z_OBJCE_P(zobject);
- if (!instanceof_function(ce, zend_ce_iterator TSRMLS_CC)) {
+ if (!instanceof_function(ce, zend_ce_iterator)) {
if (ZEND_NUM_ARGS() > 1) {
- if (!(ce_cast = zend_lookup_class(class_name TSRMLS_CC))
- || !instanceof_function(ce, ce_cast TSRMLS_CC)
+ if (!(ce_cast = zend_lookup_class(class_name))
+ || !instanceof_function(ce, ce_cast)
|| !ce_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);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
ce = ce_cast;
}
- if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) {
+ if (instanceof_function(ce, zend_ce_aggregate)) {
zend_call_method_with_0_params(zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
if (EG(exception)) {
zval_ptr_dtor(&retval);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
- if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implements Traversable", ce->name->val);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable)) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "%s::getIterator() must return an object that implements Traversable", ce->name->val);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
zobject = &retval;
@@ -1533,10 +1533,10 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
break;
}
case DIT_AppendIterator:
- spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit TSRMLS_CC);
+ spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit);
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);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0);
+ zend_restore_error_handling(&error_handling);
return intern;
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
case DIT_RegexIterator:
@@ -1547,21 +1547,21 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern->u.regex.use_flags = ZEND_NUM_ARGS() >= 5;
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, &regex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS|lll", &zobject, ce_inner, &regex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (mode < 0 || mode >= REGIT_MODE_MAX) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.regex.mode = mode;
intern->u.regex.regex = zend_string_copy(regex);
- intern->u.regex.pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ intern->u.regex.pce = pcre_get_compiled_regex_cache(regex);
if (intern->u.regex.pce == NULL) {
/* pcre_get_compiled_regex_cache has already sent error */
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.regex.pce->refcount++;
@@ -1572,8 +1572,8 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
case DIT_RecursiveCallbackFilterIterator: {
_spl_cbfilter_it_intern *cfi = emalloc(sizeof(*cfi));
cfi->fci.object = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
efree(cfi);
return NULL;
}
@@ -1586,14 +1586,14 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
break;
}
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zobject, ce_inner) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
break;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (inc_refcount) {
ZVAL_COPY(&intern->inner.zobject, zobject);
@@ -1603,7 +1603,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern->inner.ce = dit_type == DIT_IteratorIterator ? ce : Z_OBJCE_P(zobject);
intern->inner.object = Z_OBJ_P(zobject);
- intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0 TSRMLS_CC);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0);
return intern;
}
@@ -1644,17 +1644,17 @@ SPL_METHOD(dual_it, getInnerIterator)
}
} /* }}} */
-static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern)
{
if (!intern->inner.iterator) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "The inner constructor wasn't initialized with an iterator instance");
+ php_error_docref(NULL, E_ERROR, "The inner constructor wasn't initialized with an iterator instance");
}
}
-static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern)
{
if (intern->inner.iterator && intern->inner.iterator->funcs->invalidate_current) {
- intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator);
}
if (Z_TYPE(intern->current.data) != IS_UNDEF) {
zval_ptr_dtor(&intern->current.data);
@@ -1676,37 +1676,37 @@ static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
}
}
-static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern)
{
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
intern->current.pos = 0;
if (intern->inner.iterator->funcs->rewind) {
- intern->inner.iterator->funcs->rewind(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->rewind(intern->inner.iterator);
}
}
-static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern)
{
if (!intern->inner.iterator) {
return FAILURE;
}
/* FAILURE / SUCCESS */
- return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC);
+ return intern->inner.iterator->funcs->valid(intern->inner.iterator);
}
-static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more)
{
zval *data;
- spl_dual_it_free(intern TSRMLS_CC);
- if (!check_more || spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC);
+ spl_dual_it_free(intern);
+ if (!check_more || spl_dual_it_valid(intern) == SUCCESS) {
+ data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator);
if (data) {
ZVAL_COPY(&intern->current.data, data);
}
if (intern->inner.iterator->funcs->get_current_key) {
- intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key);
if (EG(exception)) {
zval_ptr_dtor(&intern->current.key);
ZVAL_UNDEF(&intern->current.key);
@@ -1719,14 +1719,14 @@ static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more T
return FAILURE;
}
-static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free)
{
if (do_free) {
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
} else {
- spl_dual_it_require(intern TSRMLS_CC);
+ spl_dual_it_require(intern);
}
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
intern->current.pos++;
}
@@ -1744,8 +1744,8 @@ SPL_METHOD(dual_it, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_dual_it_fetch(intern, 1);
} /* }}} */
/* {{{ proto bool FilterIterator::valid()
@@ -1829,18 +1829,18 @@ SPL_METHOD(dual_it, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ spl_dual_it_fetch(intern, 1);
} /* }}} */
-static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern)
{
zval retval;
- while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
+ while (spl_dual_it_fetch(intern, 1) == SUCCESS) {
zend_call_method_with_0_params(zthis, intern->std.ce, NULL, "accept", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
- if (zend_is_true(&retval TSRMLS_CC)) {
+ if (zend_is_true(&retval)) {
zval_ptr_dtor(&retval);
return;
}
@@ -1849,21 +1849,21 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T
if (EG(exception)) {
return;
}
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
}
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
}
-static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern)
{
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_filter_it_fetch(zthis, intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_filter_it_fetch(zthis, intern);
}
-static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern)
{
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- spl_filter_it_fetch(zthis, intern TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ spl_filter_it_fetch(zthis, intern);
}
/* {{{ proto void FilterIterator::rewind()
@@ -1877,7 +1877,7 @@ SPL_METHOD(FilterIterator, rewind)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_filter_it_rewind(getThis(), intern TSRMLS_CC);
+ spl_filter_it_rewind(getThis(), intern);
} /* }}} */
/* {{{ proto void FilterIterator::next()
@@ -1891,7 +1891,7 @@ SPL_METHOD(FilterIterator, next)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_filter_it_next(getThis(), intern TSRMLS_CC);
+ spl_filter_it_next(getThis(), intern);
} /* }}} */
/* {{{ proto void RecursiveCallbackFilterIterator::__construct(RecursiveIterator it, callback)
@@ -1945,7 +1945,7 @@ SPL_METHOD(RecursiveFilterIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
- spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval TSRMLS_CC);
+ spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval);
}
zval_ptr_dtor(&retval);
} /* }}} */
@@ -1965,7 +1965,7 @@ SPL_METHOD(RecursiveCallbackFilterIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name);
}
zval_ptr_dtor(&retval);
} /* }}} */
@@ -2011,7 +2011,7 @@ SPL_METHOD(CallbackFilterIterator, accept)
fci->params = params;
fci->no_separation = 0;
- if (zend_call_function(fci, fcc TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ if (zend_call_function(fci, fcc) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
RETURN_FALSE;
}
if (EG(exception)) {
@@ -2051,7 +2051,7 @@ SPL_METHOD(RegexIterator, accept)
}
ZVAL_UNDEF(&subject_copy);
- use_copy = zend_make_printable_zval(subject_ptr, &subject_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(subject_ptr, &subject_copy);
if (use_copy) {
subject = Z_STRVAL(subject_copy);
subject_len = (int)Z_STRLEN(subject_copy);
@@ -2078,7 +2078,7 @@ SPL_METHOD(RegexIterator, accept)
zval_ptr_dtor(&intern->current.data);
ZVAL_UNDEF(&intern->current.data);
php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount,
- &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
+ &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0);
RETVAL_BOOL(Z_LVAL(zcount) > 0);
break;
@@ -2089,20 +2089,20 @@ SPL_METHOD(RegexIterator, accept)
}
zval_ptr_dtor(&intern->current.data);
ZVAL_UNDEF(&intern->current.data);
- php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC);
+ php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags);
count = zend_hash_num_elements(Z_ARRVAL(intern->current.data));
RETVAL_BOOL(count > 1);
break;
case REGIT_MODE_REPLACE:
- replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1 TSRMLS_CC);
+ replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1);
if (Z_TYPE_P(replacement) != IS_STRING) {
tmp_replacement = *replacement;
zval_copy_ctor(&tmp_replacement);
convert_to_string(&tmp_replacement);
replacement = &tmp_replacement;
}
- result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count TSRMLS_CC);
+ result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count);
if (intern->u.regex.flags & REGIT_USE_KEY) {
zval_ptr_dtor(&intern->current.key);
@@ -2165,12 +2165,12 @@ SPL_METHOD(RegexIterator, setMode)
spl_dual_it_object *intern;
zend_long mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &mode) == FAILURE) {
return;
}
if (mode < 0 || mode >= REGIT_MODE_MAX) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
return;/* NULL */
}
@@ -2201,7 +2201,7 @@ SPL_METHOD(RegexIterator, setFlags)
spl_dual_it_object *intern;
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -2236,7 +2236,7 @@ SPL_METHOD(RegexIterator, setPregFlags)
spl_dual_it_object *intern;
zend_long preg_flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preg_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &preg_flags) == FAILURE) {
return;
}
@@ -2276,7 +2276,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
ZVAL_LONG(&args[3], intern->u.regex.flags);
ZVAL_LONG(&args[4], intern->u.regex.preg_flags);
- spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args TSRMLS_CC);
+ spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args);
zval_ptr_dtor(&args[1]);
}
@@ -2305,23 +2305,23 @@ SPL_METHOD(RecursiveRegexIterator, accept)
#endif
/* {{{ spl_dual_it_dtor */
-static void spl_dual_it_dtor(zend_object *_object TSRMLS_DC)
+static void spl_dual_it_dtor(zend_object *_object)
{
spl_dual_it_object *object = spl_dual_it_from_obj(_object);
/* call standard dtor */
- zend_objects_destroy_object(_object TSRMLS_CC);
+ zend_objects_destroy_object(_object);
- spl_dual_it_free(object TSRMLS_CC);
+ spl_dual_it_free(object);
if (object->inner.iterator) {
- zend_iterator_dtor(object->inner.iterator TSRMLS_CC);
+ zend_iterator_dtor(object->inner.iterator);
}
}
/* }}} */
/* {{{ spl_dual_it_free_storage */
-static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
+static void spl_dual_it_free_storage(zend_object *_object)
{
spl_dual_it_object *object = spl_dual_it_from_obj(_object);
@@ -2331,7 +2331,7 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
}
if (object->dit_type == DIT_AppendIterator) {
- zend_iterator_dtor(object->u.append.iterator TSRMLS_CC);
+ zend_iterator_dtor(object->u.append.iterator);
if (Z_TYPE(object->u.append.zarrayit) != IS_UNDEF) {
zval_ptr_dtor(&object->u.append.zarrayit);
}
@@ -2367,19 +2367,19 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
}
}
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
}
/* }}} */
/* {{{ spl_dual_it_new */
-static zend_object *spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_dual_it_new(zend_class_entry *class_type)
{
spl_dual_it_object *intern;
intern = ecalloc(1, sizeof(spl_dual_it_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->dit_type = DIT_Unknown;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_handlers_dual_it;
@@ -2494,51 +2494,51 @@ static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
};
#endif
-static inline int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_limit_it_valid(spl_dual_it_object *intern)
{
/* FAILURE / SUCCESS */
if (intern->u.limit.count != -1 && intern->current.pos >= intern->u.limit.offset + intern->u.limit.count) {
return FAILURE;
} else {
- return spl_dual_it_valid(intern TSRMLS_CC);
+ return spl_dual_it_valid(intern);
}
}
-static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos TSRMLS_DC)
+static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos)
{
zval zpos;
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
if (pos < intern->u.limit.offset) {
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset);
return;
}
if (pos >= intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count);
return;
}
- if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator TSRMLS_CC)) {
+ if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator)) {
ZVAL_LONG(&zpos, pos);
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
zend_call_method_with_1_params(&intern->inner.zobject, intern->inner.ce, NULL, "seek", NULL, &zpos);
zval_ptr_dtor(&zpos);
if (!EG(exception)) {
intern->current.pos = pos;
- if (spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ if (spl_limit_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
}
}
} else {
/* emulate the forward seek, by next() calls */
/* a back ward seek is done by a previous rewind() */
if (pos < intern->current.pos) {
- spl_dual_it_rewind(intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
}
- while (pos > intern->current.pos && spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ while (pos > intern->current.pos && spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_next(intern, 1);
}
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 1);
}
}
}
@@ -2557,8 +2557,8 @@ SPL_METHOD(LimitIterator, rewind)
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_limit_it_seek(intern, intern->u.limit.offset TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_limit_it_seek(intern, intern->u.limit.offset);
} /* }}} */
/* {{{ proto bool LimitIterator::valid()
@@ -2569,7 +2569,7 @@ SPL_METHOD(LimitIterator, valid)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
-/* RETURN_BOOL(spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS);*/
+/* RETURN_BOOL(spl_limit_it_valid(intern) == SUCCESS);*/
RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && Z_TYPE(intern->current.data) != IS_UNDEF);
} /* }}} */
@@ -2581,9 +2581,9 @@ SPL_METHOD(LimitIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
if (intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) {
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_fetch(intern, 1);
}
} /* }}} */
@@ -2594,12 +2594,12 @@ SPL_METHOD(LimitIterator, seek)
spl_dual_it_object *intern;
zend_long pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) {
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_limit_it_seek(intern, pos TSRMLS_CC);
+ spl_limit_it_seek(intern, pos);
RETURN_LONG(intern->current.pos);
} /* }}} */
@@ -2644,19 +2644,19 @@ static const zend_function_entry spl_funcs_LimitIterator[] = {
PHP_FE_END
};
-static inline int spl_caching_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_caching_it_valid(spl_dual_it_object *intern)
{
return intern->u.caching.flags & CIT_VALID ? SUCCESS : FAILURE;
}
-static inline int spl_caching_it_has_next(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_caching_it_has_next(spl_dual_it_object *intern)
{
- return spl_dual_it_valid(intern TSRMLS_CC);
+ return spl_dual_it_valid(intern);
}
-static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_caching_it_next(spl_dual_it_object *intern)
{
- if (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
+ if (spl_dual_it_fetch(intern, 1) == SUCCESS) {
intern->u.caching.flags |= CIT_VALID;
/* Full cache ? */
if (intern->u.caching.flags & CIT_FULL_CACHE) {
@@ -2665,7 +2665,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
ZVAL_ZVAL(&zcacheval, &intern->current.data, 1, 0);
- array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval TSRMLS_CC);
+ array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval);
zval_ptr_dtor(&zcacheval);
}
@@ -2676,31 +2676,31 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
if (EG(exception)) {
zval_ptr_dtor(&retval);
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
return;
}
} else {
- if (zend_is_true(&retval TSRMLS_CC)) {
+ if (zend_is_true(&retval)) {
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren);
if (EG(exception)) {
zval_ptr_dtor(&zchildren);
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
zval_ptr_dtor(&retval);
return;
}
} else {
ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
- spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags TSRMLS_CC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags);
zval_ptr_dtor(&zchildren);
}
}
zval_ptr_dtor(&retval);
if (EG(exception)) {
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
return;
}
@@ -2715,24 +2715,24 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
} else {
ZVAL_COPY_VALUE(&intern->u.caching.zstr, &intern->current.data);
}
- use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy);
if (use_copy) {
ZVAL_COPY_VALUE(&intern->u.caching.zstr, &expr_copy);
} else if (Z_REFCOUNTED(intern->u.caching.zstr)) {
Z_ADDREF(intern->u.caching.zstr);
}
}
- spl_dual_it_next(intern, 0 TSRMLS_CC);
+ spl_dual_it_next(intern, 0);
} else {
intern->u.caching.flags &= ~CIT_VALID;
}
}
-static inline void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_caching_it_rewind(spl_dual_it_object *intern)
{
- spl_dual_it_rewind(intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
zend_hash_clean(HASH_OF(&intern->u.caching.zcache));
- spl_caching_it_next(intern TSRMLS_CC);
+ spl_caching_it_next(intern);
}
/* {{{ proto void CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING])
@@ -2754,7 +2754,7 @@ SPL_METHOD(CachingIterator, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_caching_it_rewind(intern TSRMLS_CC);
+ spl_caching_it_rewind(intern);
} /* }}} */
/* {{{ proto bool CachingIterator::valid()
@@ -2769,7 +2769,7 @@ SPL_METHOD(CachingIterator, valid)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(spl_caching_it_valid(intern TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_caching_it_valid(intern) == SUCCESS);
} /* }}} */
/* {{{ proto void CachingIterator::next()
@@ -2784,7 +2784,7 @@ SPL_METHOD(CachingIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_caching_it_next(intern TSRMLS_CC);
+ spl_caching_it_next(intern);
} /* }}} */
/* {{{ proto bool CachingIterator::hasNext()
@@ -2799,7 +2799,7 @@ SPL_METHOD(CachingIterator, hasNext)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(spl_caching_it_has_next(intern TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_caching_it_has_next(intern) == SUCCESS);
} /* }}} */
/* {{{ proto string CachingIterator::__toString()
@@ -2811,7 +2811,7 @@ SPL_METHOD(CachingIterator, __toString)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
@@ -2841,11 +2841,11 @@ SPL_METHOD(CachingIterator, offsetSet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &key, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &key, &value) == FAILURE) {
return;
}
@@ -2867,11 +2867,11 @@ SPL_METHOD(CachingIterator, offsetGet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2894,11 +2894,11 @@ SPL_METHOD(CachingIterator, offsetUnset)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2916,11 +2916,11 @@ SPL_METHOD(CachingIterator, offsetExists)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2941,7 +2941,7 @@ SPL_METHOD(CachingIterator, getCache)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
@@ -2974,20 +2974,20 @@ SPL_METHOD(CachingIterator, setFlags)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
if (spl_cit_check_flags(flags) != SUCCESS) {
- zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0);
return;
}
if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & CIT_CALL_TOSTRING) == 0) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0);
return;
}
if ((intern->u.caching.flags & CIT_TOSTRING_USE_INNER) != 0 && (flags & CIT_TOSTRING_USE_INNER) == 0) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0);
return;
}
if ((flags & CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) {
@@ -3011,7 +3011,7 @@ SPL_METHOD(CachingIterator, count)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
@@ -3161,7 +3161,7 @@ SPL_METHOD(NoRewindIterator, valid)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator) == SUCCESS);
} /* }}} */
/* {{{ proto mixed NoRewindIterator::key()
@@ -3177,7 +3177,7 @@ SPL_METHOD(NoRewindIterator, key)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (intern->inner.iterator->funcs->get_current_key) {
- intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value);
} else {
RETURN_NULL();
}
@@ -3195,7 +3195,7 @@ SPL_METHOD(NoRewindIterator, current)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC);
+ data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -3212,7 +3212,7 @@ SPL_METHOD(NoRewindIterator, next)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
} /* }}} */
ZEND_BEGIN_ARG_INFO(arginfo_norewind_it___construct, 0)
@@ -3249,13 +3249,13 @@ SPL_METHOD(InfiniteIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
} else {
- spl_dual_it_rewind(intern TSRMLS_CC);
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
}
}
} /* }}} */
@@ -3292,7 +3292,7 @@ SPL_METHOD(EmptyIterator, key)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0);
} /* }}} */
/* {{{ proto void EmptyIterator::current()
@@ -3302,7 +3302,7 @@ SPL_METHOD(EmptyIterator, current)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0);
} /* }}} */
/* {{{ proto void EmptyIterator::next()
@@ -3323,50 +3323,50 @@ static const zend_function_entry spl_funcs_EmptyIterator[] = {
PHP_FE_END
};
-int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+int spl_append_it_next_iterator(spl_dual_it_object *intern) /* {{{*/
{
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
if (!Z_ISUNDEF(intern->inner.zobject)) {
zval_ptr_dtor(&intern->inner.zobject);
ZVAL_UNDEF(&intern->inner.zobject);
intern->inner.ce = NULL;
if (intern->inner.iterator) {
- zend_iterator_dtor(intern->inner.iterator TSRMLS_CC);
+ zend_iterator_dtor(intern->inner.iterator);
intern->inner.iterator = NULL;
}
}
- if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) == SUCCESS) {
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) == SUCCESS) {
zval *it;
- it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator TSRMLS_CC);
+ it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator);
ZVAL_COPY(&intern->inner.zobject, it);
intern->inner.ce = Z_OBJCE_P(it);
- intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0 TSRMLS_CC);
- spl_dual_it_rewind(intern TSRMLS_CC);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0);
+ spl_dual_it_rewind(intern);
return SUCCESS;
} else {
return FAILURE;
}
} /* }}} */
-void spl_append_it_fetch(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+void spl_append_it_fetch(spl_dual_it_object *intern) /* {{{*/
{
- while (spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
- intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator TSRMLS_CC);
- if (spl_append_it_next_iterator(intern TSRMLS_CC) != SUCCESS) {
+ while (spl_dual_it_valid(intern) != SUCCESS) {
+ intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator);
+ if (spl_append_it_next_iterator(intern) != SUCCESS) {
return;
}
}
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_fetch(intern, 0);
} /* }}} */
-void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */
+void spl_append_it_next(spl_dual_it_object *intern) /* {{{ */
{
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_next(intern, 1);
}
- spl_append_it_fetch(intern TSRMLS_CC);
+ spl_append_it_fetch(intern);
} /* }}} */
/* {{{ proto void AppendIterator::__construct()
@@ -3385,19 +3385,19 @@ SPL_METHOD(AppendIterator, append)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &it, zend_ce_iterator) == FAILURE) {
return;
}
- spl_array_iterator_append(&intern->u.append.zarrayit, it TSRMLS_CC);
+ spl_array_iterator_append(&intern->u.append.zarrayit, it);
- if (!intern->inner.iterator || spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
- if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) != SUCCESS) {
- intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
+ if (!intern->inner.iterator || spl_dual_it_valid(intern) != SUCCESS) {
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) != SUCCESS) {
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator);
}
do {
- spl_append_it_next_iterator(intern TSRMLS_CC);
+ spl_append_it_next_iterator(intern);
} while (Z_OBJ(intern->inner.zobject) != Z_OBJ_P(it));
- spl_append_it_fetch(intern TSRMLS_CC);
+ spl_append_it_fetch(intern);
}
} /* }}} */
@@ -3413,9 +3413,9 @@ SPL_METHOD(AppendIterator, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
- if (spl_append_it_next_iterator(intern TSRMLS_CC) == SUCCESS) {
- spl_append_it_fetch(intern TSRMLS_CC);
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator);
+ if (spl_append_it_next_iterator(intern) == SUCCESS) {
+ spl_append_it_fetch(intern);
}
} /* }}} */
@@ -3446,7 +3446,7 @@ SPL_METHOD(AppendIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_append_it_next(intern TSRMLS_CC);
+ spl_append_it_next(intern);
} /* }}} */
/* {{{ proto int AppendIterator::getIteratorIndex()
@@ -3462,7 +3462,7 @@ SPL_METHOD(AppendIterator, getIteratorIndex)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
APPENDIT_CHECK_CTOR(intern);
- spl_array_iterator_key(&intern->u.append.zarrayit, return_value TSRMLS_CC);
+ spl_array_iterator_key(&intern->u.append.zarrayit, return_value);
} /* }}} */
/* {{{ proto ArrayIterator AppendIterator::getArrayIterator()
@@ -3498,12 +3498,12 @@ static const zend_function_entry spl_funcs_AppendIterator[] = {
PHP_FE_END
};
-PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC)
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser)
{
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(obj);
- iter = ce->get_iterator(ce, obj, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, obj, 0);
if (EG(exception)) {
goto done;
@@ -3511,21 +3511,21 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (EG(exception)) {
goto done;
}
}
- while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ while (iter->funcs->valid(iter) == SUCCESS) {
if (EG(exception)) {
goto done;
}
- if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) {
+ if (apply_func(iter, puser) == ZEND_HASH_APPLY_STOP || EG(exception)) {
goto done;
}
iter->index++;
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (EG(exception)) {
goto done;
}
@@ -3533,17 +3533,17 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
done:
if (iter) {
- zend_iterator_dtor(iter TSRMLS_CC);
+ zend_iterator_dtor(iter);
}
return EG(exception) ? FAILURE : SUCCESS;
}
/* }}} */
-static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *data, *return_value = (zval*)puser;
- data = iter->funcs->get_current_data(iter TSRMLS_CC);
+ data = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
@@ -3552,11 +3552,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- array_set_zval_key(Z_ARRVAL_P(return_value), &key, data TSRMLS_CC);
+ array_set_zval_key(Z_ARRVAL_P(return_value), &key, data);
zval_dtor(&key);
} else {
Z_TRY_ADDREF_P(data);
@@ -3566,11 +3566,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
}
/* }}} */
-static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *data, *return_value = (zval*)puser;
- data = iter->funcs->get_current_data(iter TSRMLS_CC);
+ data = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
@@ -3592,19 +3592,19 @@ PHP_FUNCTION(iterator_to_array)
zval *obj;
zend_bool use_keys = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) {
RETURN_FALSE;
}
array_init(return_value);
- if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value TSRMLS_CC) != SUCCESS) {
+ if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value) != SUCCESS) {
zval_dtor(return_value);
RETURN_NULL();
}
} /* }}} */
-static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
(*(zend_long*)puser)++;
return ZEND_HASH_APPLY_KEEP;
@@ -3618,11 +3618,11 @@ PHP_FUNCTION(iterator_count)
zval *obj;
zend_long count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, zend_ce_traversable) == FAILURE) {
RETURN_FALSE;
}
- if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count TSRMLS_CC) == SUCCESS) {
+ if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count) == SUCCESS) {
RETURN_LONG(count);
}
}
@@ -3636,16 +3636,16 @@ typedef struct {
zend_fcall_info_cache fcc;
} spl_iterator_apply_info;
-static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval retval;
spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser;
int result;
apply_info->count++;
- zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC);
+ zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL);
if (Z_TYPE(retval) != IS_UNDEF) {
- result = zend_is_true(&retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ result = zend_is_true(&retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
zval_ptr_dtor(&retval);
} else {
result = ZEND_HASH_APPLY_STOP;
@@ -3661,18 +3661,18 @@ PHP_FUNCTION(iterator_apply)
spl_iterator_apply_info apply_info;
apply_info.args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) {
return;
}
apply_info.count = 0;
- zend_fcall_info_args(&apply_info.fci, apply_info.args TSRMLS_CC);
- if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info TSRMLS_CC) == SUCCESS) {
+ zend_fcall_info_args(&apply_info.fci, apply_info.args);
+ if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info) == SUCCESS) {
RETVAL_LONG(apply_info.count);
} else {
RETVAL_FALSE;
}
- zend_fcall_info_args(&apply_info.fci, NULL TSRMLS_CC);
+ zend_fcall_info_args(&apply_info.fci, NULL);
}
/* }}} */
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 76f0b45e57..a0a2893ef5 100644
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -173,9 +173,9 @@ static inline spl_dual_it_object *spl_dual_it_from_obj(zend_object *obj) /* {{{
#define Z_SPLDUAL_IT_P(zv) spl_dual_it_from_obj(Z_OBJ_P((zv)))
-typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser TSRMLS_DC);
+typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser);
-PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC);
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser);
#endif /* SPL_ITERATORS_H */
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index f7f884df18..4b63caaed0 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -102,11 +102,11 @@ static inline spl_SplObjectStorage *spl_object_storage_from_obj(zend_object *obj
#define Z_SPLOBJSTORAGE_P(zv) spl_object_storage_from_obj(Z_OBJ_P((zv)))
-void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+void spl_SplObjectStorage_free_storage(zend_object *object) /* {{{ */
{
spl_SplObjectStorage *intern = spl_object_storage_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zend_hash_destroy(&intern->storage);
@@ -116,7 +116,7 @@ void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
} /* }}} */
-static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) {
+static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj) {
if (intern->fptr_get_hash) {
zval rv;
zend_call_method_with_1_params(this, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj);
@@ -124,7 +124,7 @@ static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zv
if (Z_TYPE(rv) == IS_STRING) {
return Z_STR(rv);
} else {
- zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0);
zval_ptr_dtor(&rv);
return NULL;
@@ -190,21 +190,21 @@ static void spl_object_storage_dtor(zval *element) /* {{{ */
efree(el);
} /* }}} */
-spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash TSRMLS_DC) /* {{{ */
+spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash) /* {{{ */
{
return (spl_SplObjectStorageElement*)zend_hash_find_ptr(&intern->storage, hash);
} /* }}} */
-spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf TSRMLS_DC) /* {{{ */
+spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf) /* {{{ */
{
spl_SplObjectStorageElement *pelement, element;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return NULL;
}
- pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
+ pelement = spl_object_storage_get(intern, hash);
if (pelement) {
zval_ptr_dtor(&pelement->inf);
@@ -228,10 +228,10 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int
return pelement;
} /* }}} */
-int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */
+int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
{
int ret = FAILURE;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return ret;
}
@@ -241,17 +241,17 @@ int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *ob
return ret;
} /* }}}*/
-void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other TSRMLS_DC) { /* {{{ */
+void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other) { /* {{{ */
spl_SplObjectStorageElement *element;
ZEND_HASH_FOREACH_PTR(&other->storage, element) {
- spl_object_storage_attach(intern, this, &element->obj, &element->inf TSRMLS_CC);
+ spl_object_storage_attach(intern, this, &element->obj, &element->inf);
} ZEND_HASH_FOREACH_END();
intern->index = 0;
} /* }}} */
-static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig) /* {{{ */
{
spl_SplObjectStorage *intern;
zend_class_entry *parent = class_type;
@@ -260,7 +260,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
memset(intern, 0, sizeof(spl_SplObjectStorage) - sizeof(zval));
intern->pos = INVALID_IDX;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
zend_hash_init(&intern->storage, 0, NULL, spl_object_storage_dtor, 0);
@@ -269,7 +269,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
if (orig) {
spl_SplObjectStorage *other = Z_SPLOBJSTORAGE_P(orig);
- spl_object_storage_addall(intern, orig, other TSRMLS_CC);
+ spl_object_storage_addall(intern, orig, other);
}
while (parent) {
@@ -291,21 +291,21 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
/* }}} */
/* {{{ spl_object_storage_clone */
-static zend_object *spl_object_storage_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_object_storage_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_object_storage_new_ex(old_object->ce, zobject TSRMLS_CC);
+ new_object = spl_object_storage_new_ex(old_object->ce, zobject);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp) /* {{{ */
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj);
spl_SplObjectStorageElement *element;
@@ -330,7 +330,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
array_init(&storage);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
- md5str = php_spl_object_hash(&element->obj TSRMLS_CC);
+ md5str = php_spl_object_hash(&element->obj);
array_init(&tmp);
/* Incrementing the refcount of obj and inf would confuse the garbage collector.
* Prefer to null the destructor */
@@ -341,7 +341,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
zend_string_release(md5str);
} ZEND_HASH_FOREACH_END();
- zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1 TSRMLS_CC);
+ zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1);
zend_symtable_update(intern->debug_info, zname, &storage);
zend_string_release(zname);
}
@@ -352,14 +352,14 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
/* overriden for garbage collection
* This is very hacky */
-static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n) /* {{{ */
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj);
spl_SplObjectStorageElement *element;
HashTable *props;
zval *gcdata_arr, tmp;
- props = std_object_handlers.get_properties(obj TSRMLS_CC);
+ props = std_object_handlers.get_properties(obj);
*table = NULL;
*n = 0;
@@ -388,13 +388,13 @@ static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRM
}
/* }}} */
-static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{ */
+static int spl_object_storage_compare_info(zval *e1, zval *e2) /* {{{ */
{
spl_SplObjectStorageElement *s1 = (spl_SplObjectStorageElement*)Z_PTR_P(e1);
spl_SplObjectStorageElement *s2 = (spl_SplObjectStorageElement*)Z_PTR_P(e2);
zval result;
- if (compare_function(&result, &s1->inf, &s2->inf TSRMLS_CC) == FAILURE) {
+ if (compare_function(&result, &s1->inf, &s2->inf) == FAILURE) {
return 1;
}
@@ -402,7 +402,7 @@ static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{
}
/* }}} */
-static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int spl_object_storage_compare_objects(zval *o1, zval *o2) /* {{{ */
{
zend_object *zo1 = (zend_object *)Z_OBJ_P(o1);
zend_object *zo2 = (zend_object *)Z_OBJ_P(o2);
@@ -411,21 +411,21 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {
return 1;
}
- return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC);
+ return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0);
}
/* }}} */
/* {{{ spl_array_object_new */
-static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type)
{
- return spl_object_storage_new_ex(class_type, NULL TSRMLS_CC);
+ return spl_object_storage_new_ex(class_type, NULL);
}
/* }}} */
-int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */
+int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
{
int found;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return 0;
}
@@ -443,10 +443,10 @@ SPL_METHOD(SplObjectStorage, attach)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|z!", &obj, &inf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|z!", &obj, &inf) == FAILURE) {
return;
}
- spl_object_storage_attach(intern, getThis(), obj, inf TSRMLS_CC);
+ spl_object_storage_attach(intern, getThis(), obj, inf);
} /* }}} */
/* {{{ proto void SplObjectStorage::detach($obj)
@@ -456,10 +456,10 @@ SPL_METHOD(SplObjectStorage, detach)
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- spl_object_storage_detach(intern, getThis(), obj TSRMLS_CC);
+ spl_object_storage_detach(intern, getThis(), obj);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
@@ -471,11 +471,11 @@ SPL_METHOD(SplObjectStorage, getHash)
{
zval *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC));
+ RETURN_NEW_STR(php_spl_object_hash(obj));
} /* }}} */
@@ -488,20 +488,20 @@ SPL_METHOD(SplObjectStorage, offsetGet)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zend_string *hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- hash = spl_object_storage_get_hash(intern, getThis(), obj TSRMLS_CC);
+ hash = spl_object_storage_get_hash(intern, getThis(), obj);
if (!hash) {
return;
}
- element = spl_object_storage_get(intern, hash TSRMLS_CC);
+ element = spl_object_storage_get(intern, hash);
spl_object_storage_free_hash(intern, hash);
if (!element) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Object not found");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Object not found");
} else {
RETURN_ZVAL(&element->inf, 1, 0);
}
@@ -515,13 +515,13 @@ SPL_METHOD(SplObjectStorage, addAll)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
spl_SplObjectStorage *other;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
other = Z_SPLOBJSTORAGE_P(obj);
- spl_object_storage_addall(intern, getThis(), other TSRMLS_CC);
+ spl_object_storage_addall(intern, getThis(), other);
RETURN_LONG(zend_hash_num_elements(&intern->storage));
} /* }}} */
@@ -535,7 +535,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
@@ -543,7 +543,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
zend_hash_internal_pointer_reset(&other->storage);
while ((element = zend_hash_get_current_data_ptr(&other->storage)) != NULL) {
- if (spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC) == FAILURE) {
+ if (spl_object_storage_detach(intern, getThis(), &element->obj) == FAILURE) {
zend_hash_move_forward(&other->storage);
}
}
@@ -563,15 +563,15 @@ SPL_METHOD(SplObjectStorage, removeAllExcept)
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
other = Z_SPLOBJSTORAGE_P(obj);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
- if (!spl_object_storage_contains(other, getThis(), &element->obj TSRMLS_CC)) {
- spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC);
+ if (!spl_object_storage_contains(other, getThis(), &element->obj)) {
+ spl_object_storage_detach(intern, getThis(), &element->obj);
}
} ZEND_HASH_FOREACH_END();
@@ -589,10 +589,10 @@ SPL_METHOD(SplObjectStorage, contains)
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj TSRMLS_CC));
+ RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj));
} /* }}} */
/* {{{ proto int SplObjectStorage::count()
@@ -602,7 +602,7 @@ SPL_METHOD(SplObjectStorage, count)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zend_long mode = COUNT_NORMAL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
return;
}
@@ -611,7 +611,7 @@ SPL_METHOD(SplObjectStorage, count)
zval *element;
ZEND_HASH_FOREACH_VAL(&intern->storage, element) {
- ret += php_count_recursive(element, mode TSRMLS_CC);
+ ret += php_count_recursive(element, mode);
} ZEND_HASH_FOREACH_END();
RETURN_LONG(ret);
@@ -703,7 +703,7 @@ SPL_METHOD(SplObjectStorage, setInfo)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zval *inf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &inf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &inf) == FAILURE) {
return;
}
@@ -749,7 +749,7 @@ SPL_METHOD(SplObjectStorage, serialize)
/* storage */
smart_str_appendl(&buf, "x:", 2);
ZVAL_LONG(&flags, zend_hash_num_elements(&intern->storage));
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
zval_ptr_dtor(&flags);
zend_hash_internal_pointer_reset_ex(&intern->storage, &pos);
@@ -760,9 +760,9 @@ SPL_METHOD(SplObjectStorage, serialize)
PHP_VAR_SERIALIZE_DESTROY(var_hash);
RETURN_NULL();
}
- php_var_serialize(&buf, &element->obj, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &element->obj, &var_hash);
smart_str_appendc(&buf, ',');
- php_var_serialize(&buf, &element->inf, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &element->inf, &var_hash);
smart_str_appendc(&buf, ';');
zend_hash_move_forward_ex(&intern->storage, &pos);
}
@@ -770,8 +770,8 @@ SPL_METHOD(SplObjectStorage, serialize)
/* members */
smart_str_appendl(&buf, "m:", 2);
ZVAL_NEW_ARR(&members);
- zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis() TSRMLS_CC));
- php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */
+ zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis()));
+ php_var_serialize(&buf, &members, &var_hash); /* finishes the string */
zval_ptr_dtor(&members);
/* done */
@@ -799,7 +799,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
spl_SplObjectStorageElement *element;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -816,7 +816,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
}
++p;
- if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
if (Z_TYPE(pcount) != IS_LONG) {
@@ -839,7 +839,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
goto outexcept;
}
/* sore reference to allow cross-references between different elements */
- if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
if (Z_TYPE(entry) != IS_OBJECT) {
@@ -848,19 +848,19 @@ SPL_METHOD(SplObjectStorage, unserialize)
}
if (*p == ',') { /* new version has inf */
++p;
- if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash)) {
zval_ptr_dtor(&entry);
goto outexcept;
}
}
- hash = spl_object_storage_get_hash(intern, getThis(), &entry TSRMLS_CC);
+ hash = spl_object_storage_get_hash(intern, getThis(), &entry);
if (!hash) {
zval_ptr_dtor(&entry);
zval_ptr_dtor(&inf);
goto outexcept;
}
- pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
+ pelement = spl_object_storage_get(intern, hash);
spl_object_storage_free_hash(intern, hash);
if (pelement) {
if (!Z_ISUNDEF(pelement->inf)) {
@@ -870,7 +870,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
var_push_dtor(&var_hash, &pelement->obj);
}
}
- element = spl_object_storage_attach(intern, getThis(), &entry, &inf TSRMLS_CC);
+ element = spl_object_storage_attach(intern, getThis(), &entry, &inf);
var_replace(&var_hash, &entry, &element->obj);
var_replace(&var_hash, &inf, &element->inf);
zval_ptr_dtor(&entry);
@@ -889,7 +889,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
++p;
ZVAL_UNDEF(&pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(pmembers) != IS_ARRAY) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash) || Z_TYPE(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
@@ -906,7 +906,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
outexcept:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
@@ -986,16 +986,16 @@ SPL_METHOD(MultipleIterator, __construct)
zend_long flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLOBJSTORAGE_P(getThis());
intern->flags = flags;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1019,7 +1019,7 @@ SPL_METHOD(MultipleIterator, setFlags)
spl_SplObjectStorage *intern;
intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
}
}
@@ -1032,7 +1032,7 @@ SPL_METHOD(MultipleIterator, attachIterator)
spl_SplObjectStorage *intern;
zval *iterator = NULL, *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) {
return;
}
@@ -1043,22 +1043,22 @@ SPL_METHOD(MultipleIterator, attachIterator)
zval compare_result;
if (Z_TYPE_P(info) != IS_LONG && Z_TYPE_P(info) != IS_STRING) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0);
return;
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL) {
- is_identical_function(&compare_result, info, &element->inf TSRMLS_CC);
+ is_identical_function(&compare_result, info, &element->inf);
if (Z_TYPE(compare_result) == IS_TRUE) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0);
return;
}
zend_hash_move_forward_ex(&intern->storage, &intern->pos);
}
}
- spl_object_storage_attach(intern, getThis(), iterator, info TSRMLS_CC);
+ spl_object_storage_attach(intern, getThis(), iterator, info);
}
/* }}} */
@@ -1152,7 +1152,7 @@ SPL_METHOD(MultipleIterator, valid)
}
/* }}} */
-static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value TSRMLS_DC) /* {{{ */
+static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value) /* {{{ */
{
spl_SplObjectStorageElement *element;
zval *it, retval;
@@ -1184,14 +1184,14 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_
zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_key, "key", &retval);
}
if (Z_ISUNDEF(retval)) {
- zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0);
return;
}
} else if (intern->flags & MIT_NEED_ALL) {
if (SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT == get_type) {
- zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0);
} else {
- zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0);
}
return;
} else {
@@ -1208,7 +1208,7 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_
break;
default:
zval_ptr_dtor(&retval);
- zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0);
return;
}
} else {
@@ -1231,7 +1231,7 @@ SPL_METHOD(MultipleIterator, current)
return;
}
- spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value TSRMLS_CC);
+ spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value);
}
/* }}} */
@@ -1246,7 +1246,7 @@ SPL_METHOD(MultipleIterator, key)
return;
}
- spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value TSRMLS_CC);
+ spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value);
}
/* }}} */
diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32
index 8ddb6b9ac8..60dd2fae52 100644
--- a/ext/sqlite3/config.w32
+++ b/ext/sqlite3/config.w32
@@ -5,7 +5,7 @@ ARG_WITH("sqlite3", "SQLite 3 support", "no");
if (PHP_SQLITE3 != "no") {
ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) ");
- EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname);
+ EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname + " /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4
index 6959a6f916..bbb1133fe4 100644
--- a/ext/sqlite3/config0.m4
+++ b/ext/sqlite3/config0.m4
@@ -8,7 +8,7 @@ PHP_ARG_WITH(sqlite3, whether to enable the SQLite3 extension,
if test $PHP_SQLITE3 != "no"; then
sqlite3_extra_sources=""
- PHP_SQLITE3_CFLAGS=""
+ PHP_SQLITE3_CFLAGS=" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 "
dnl when running phpize enable_maintainer_zts is not available
if test -z "$enable_maintainer_zts"; then
diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h
index 5c7dfcfa5a..8f1c500211 100644
--- a/ext/sqlite3/php_sqlite3.h
+++ b/ext/sqlite3/php_sqlite3.h
@@ -32,6 +32,9 @@ ZEND_END_MODULE_GLOBALS(sqlite3)
#ifdef ZTS
# define SQLITE3G(v) TSRMG(sqlite3_globals_id, zend_sqlite3_globals *, v)
+# ifdef COMPILE_DL_SQLITE3
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define SQLITE3G(v) (sqlite3_globals.v)
#endif
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index af3dec0681..ef823d9feb 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -48,16 +48,15 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
{
va_list arg;
char *message;
- TSRMLS_FETCH();
va_start(arg, format);
vspprintf(&message, 0, format, arg);
va_end(arg);
if (db_obj && db_obj->exception) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), message, 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), message, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
}
if (message) {
@@ -74,7 +73,7 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
#define SQLITE3_CHECK_INITIALIZED_STMT(member, class_name) \
if (!(member)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialised"); \
+ php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialised"); \
RETURN_FALSE; \
}
@@ -107,38 +106,38 @@ PHP_METHOD(sqlite3, open)
zend_error_handling error_handling;
db_obj = Z_SQLITE3_DB_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (db_obj->initialised) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Already initialised DB Object", 0);
}
if (strlen(filename) != filename_len) {
return;
}
if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) {
- if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC);
+ if (!(fullpath = expand_filepath(filename, NULL))) {
+ zend_throw_exception(zend_exception_get_default(), "Unable to expand filepath", 0);
return;
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "safe_mode prohibits opening %s", fullpath);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "safe_mode prohibits opening %s", fullpath);
efree(fullpath);
return;
}
#endif
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "open_basedir prohibits opening %s", fullpath);
+ if (php_check_open_basedir(fullpath)) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "open_basedir prohibits opening %s", fullpath);
efree(fullpath);
return;
}
@@ -151,7 +150,7 @@ PHP_METHOD(sqlite3, open)
#else
if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
#endif
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
if (fullpath) {
efree(fullpath);
}
@@ -161,7 +160,7 @@ PHP_METHOD(sqlite3, open)
#if SQLITE_HAS_CODEC
if (encryption_key_len > 0) {
if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
return;
}
}
@@ -224,7 +223,7 @@ PHP_METHOD(sqlite3, exec)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -321,7 +320,7 @@ PHP_METHOD(sqlite3, busyTimeout)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ms)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ms)) {
return;
}
@@ -350,7 +349,7 @@ PHP_METHOD(sqlite3, loadExtension)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension, &extension_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &extension, &extension_len)) {
return;
}
@@ -435,7 +434,7 @@ PHP_METHOD(sqlite3, escapeString)
zend_string *sql;
char *ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -466,7 +465,7 @@ PHP_METHOD(sqlite3, prepare)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -512,7 +511,7 @@ PHP_METHOD(sqlite3, query)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -618,7 +617,7 @@ PHP_METHOD(sqlite3, querySingle)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &sql, &entire_row)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &sql, &entire_row)) {
return;
}
@@ -676,7 +675,7 @@ PHP_METHOD(sqlite3, querySingle)
}
/* }}} */
-static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, sqlite3_value **argv, sqlite3_context *context, int is_agg TSRMLS_DC) /* {{{ */
+static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, sqlite3_value **argv, sqlite3_context *context, int is_agg) /* {{{ */
{
zval *zargs = NULL;
zval retval;
@@ -744,8 +743,8 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
fc->fci.params = zargs;
- if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&fc->fci, &fc->fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
}
/* clean up the params */
@@ -812,9 +811,8 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
static void php_sqlite3_callback_func(sqlite3_context *context, int argc, sqlite3_value **argv) /* {{{ */
{
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
- TSRMLS_FETCH();
- sqlite3_do_callback(&func->afunc, &func->func, argc, argv, context, 0 TSRMLS_CC);
+ sqlite3_do_callback(&func->afunc, &func->func, argc, argv, context, 0);
}
/* }}}*/
@@ -823,10 +821,9 @@ static void php_sqlite3_callback_step(sqlite3_context *context, int argc, sqlite
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
- TSRMLS_FETCH();
agg_context->row_count++;
- sqlite3_do_callback(&func->astep, &func->step, argc, argv, context, 1 TSRMLS_CC);
+ sqlite3_do_callback(&func->astep, &func->step, argc, argv, context, 1);
}
/* }}} */
@@ -835,10 +832,9 @@ static void php_sqlite3_callback_final(sqlite3_context *context) /* {{{ */
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
- TSRMLS_FETCH();
agg_context->row_count = 0;
- sqlite3_do_callback(&func->afini, &func->fini, 0, NULL, context, 1 TSRMLS_CC);
+ sqlite3_do_callback(&func->afini, &func->fini, 0, NULL, context, 1);
}
/* }}} */
@@ -849,7 +845,6 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
zval retval;
int ret;
- TSRMLS_FETCH();
collation->fci.fci.size = (sizeof(collation->fci.fci));
collation->fci.fci.function_table = EG(function_table);
@@ -865,8 +860,8 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
collation->fci.fci.params = zargs;
- if ((ret = zend_call_function(&collation->fci.fci, &collation->fci.fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the compare callback");
+ if ((ret = zend_call_function(&collation->fci.fci, &collation->fci.fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the compare callback");
}
zval_ptr_dtor(&zargs[0]);
@@ -877,7 +872,7 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
// (the result of a comparison, i.e. most likely -1, 0, or 1)
//I suppose we could accept any scalar return type, though.
if (Z_TYPE(retval) != IS_LONG){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the compare callback (invalid return type). Collation behaviour is undefined.");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the compare callback (invalid return type). Collation behaviour is undefined.");
}else{
ret = Z_LVAL(retval);
}
@@ -904,7 +899,7 @@ PHP_METHOD(sqlite3, createFunction)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &sql_func, &sql_func_len, &callback_func, &sql_func_num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|l", &sql_func, &sql_func_len, &callback_func, &sql_func_num_args) == FAILURE) {
return;
}
@@ -912,7 +907,7 @@ PHP_METHOD(sqlite3, createFunction)
RETURN_FALSE;
}
- if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(callback_func, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -954,7 +949,7 @@ PHP_METHOD(sqlite3, createAggregate)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &sql_func, &sql_func_len, &step_callback, &fini_callback, &sql_func_num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l", &sql_func, &sql_func_len, &step_callback, &fini_callback, &sql_func_num_args) == FAILURE) {
return;
}
@@ -962,14 +957,14 @@ PHP_METHOD(sqlite3, createAggregate)
RETURN_FALSE;
}
- if (!zend_is_callable(step_callback, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(step_callback, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
}
zend_string_release(callback_name);
- if (!zend_is_callable(fini_callback, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(fini_callback, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -1011,7 +1006,7 @@ PHP_METHOD(sqlite3, createCollation)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &collation_name, &collation_name_len, &callback_func) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz", &collation_name, &collation_name_len, &callback_func) == FAILURE) {
RETURN_FALSE;
}
@@ -1019,7 +1014,7 @@ PHP_METHOD(sqlite3, createCollation)
RETURN_FALSE;
}
- if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(callback_func, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -1049,14 +1044,14 @@ typedef struct {
size_t size;
} php_stream_sqlite3_data;
-static size_t php_sqlite3_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_sqlite3_stream_write(php_stream *stream, const char *buf, size_t count)
{
/* php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract; */
return 0;
}
-static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t count)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1073,7 +1068,7 @@ static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t coun
return count;
}
-static int php_sqlite3_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_sqlite3_stream_close(php_stream *stream, int close_handle)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1086,14 +1081,14 @@ static int php_sqlite3_stream_close(php_stream *stream, int close_handle TSRMLS_
return 0;
}
-static int php_sqlite3_stream_flush(php_stream *stream TSRMLS_DC)
+static int php_sqlite3_stream_flush(php_stream *stream)
{
/* do nothing */
return 0;
}
/* {{{ */
-static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1156,12 +1151,12 @@ static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int wh
/* }}} */
-static int php_sqlite3_stream_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_sqlite3_stream_cast(php_stream *stream, int castas, void **ret)
{
return FAILURE;
}
-static int php_sqlite3_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_sqlite3_stream_stat(php_stream *stream, php_stream_statbuf *ssb)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
ssb->sb.st_size = sqlite3_stream->size;
@@ -1196,7 +1191,7 @@ PHP_METHOD(sqlite3, openBlob)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl|s", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl|s", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len) == FAILURE) {
return;
}
@@ -1230,7 +1225,7 @@ PHP_METHOD(sqlite3, enableExceptions)
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enableExceptions) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &enableExceptions) == FAILURE) {
return;
}
@@ -1346,7 +1341,7 @@ PHP_METHOD(sqlite3stmt, readOnly)
}
/* }}} */
-static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *param, php_sqlite3_stmt *stmt TSRMLS_DC) /* {{{ */
+static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *param, php_sqlite3_stmt *stmt) /* {{{ */
{
HashTable *hash;
hash = stmt->bound_params;
@@ -1404,8 +1399,8 @@ PHP_METHOD(sqlite3stmt, bindParam)
param.param_number = -1;
param.type = SQLITE3_TEXT;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "lz|l", &param.param_number, &parameter, &param.type) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &param.name, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz|l", &param.param_number, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &param.name, &parameter, &param.type) == FAILURE) {
return;
}
}
@@ -1414,7 +1409,7 @@ PHP_METHOD(sqlite3stmt, bindParam)
ZVAL_COPY(&param.parameter, parameter);
- if (!register_bound_parameter_to_sqlite(&param, stmt_obj TSRMLS_CC)) {
+ if (!register_bound_parameter_to_sqlite(&param, stmt_obj)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1438,8 +1433,8 @@ PHP_METHOD(sqlite3stmt, bindValue)
param.param_number = -1;
param.type = SQLITE3_TEXT;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "lz/|l", &param.param_number, &parameter, &param.type) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz/|l", &param.name, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz/|l", &param.param_number, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name, &parameter, &param.type) == FAILURE) {
return;
}
}
@@ -1448,7 +1443,7 @@ PHP_METHOD(sqlite3stmt, bindValue)
ZVAL_COPY(&param.parameter, parameter);
- if (!register_bound_parameter_to_sqlite(&param, stmt_obj TSRMLS_CC)) {
+ if (!register_bound_parameter_to_sqlite(&param, stmt_obj)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1592,10 +1587,10 @@ PHP_METHOD(sqlite3stmt, __construct)
php_sqlite3_free_list *free_item;
stmt_obj = Z_SQLITE3_STMT_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OS", &db_zval, php_sqlite3_sc_entry, &sql) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS", &db_zval, php_sqlite3_sc_entry, &sql) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -1603,7 +1598,7 @@ PHP_METHOD(sqlite3stmt, __construct)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (!sql->len) {
RETURN_FALSE;
@@ -1659,7 +1654,7 @@ PHP_METHOD(sqlite3result, columnName)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &column) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &column) == FAILURE) {
return;
}
column_name = (char*) sqlite3_column_name(result_obj->stmt_obj->stmt, column);
@@ -1683,7 +1678,7 @@ PHP_METHOD(sqlite3result, columnType)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &column) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &column) == FAILURE) {
return;
}
@@ -1707,7 +1702,7 @@ PHP_METHOD(sqlite3result, fetchArray)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
return;
}
@@ -1806,7 +1801,7 @@ PHP_METHOD(sqlite3result, finalize)
__constructor for SQLite3Result. */
PHP_METHOD(sqlite3result, __construct)
{
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "SQLite3Result cannot be directly instantiated", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "SQLite3Result cannot be directly instantiated", 0);
}
/* }}} */
@@ -1966,15 +1961,14 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
case SQLITE_ATTACH:
{
if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
- TSRMLS_FETCH();
-
+
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return SQLITE_DENY;
}
#endif
- if (php_check_open_basedir(arg3 TSRMLS_CC)) {
+ if (php_check_open_basedir(arg3)) {
return SQLITE_DENY;
}
}
@@ -2014,7 +2008,7 @@ static int php_sqlite3_compare_stmt_free( php_sqlite3_free_list **free_list, sql
}
/* }}} */
-static void php_sqlite3_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_db_object *intern = php_sqlite3_db_from_obj(object);
php_sqlite3_func *func;
@@ -2063,11 +2057,11 @@ static void php_sqlite3_object_free_storage(zend_object *object TSRMLS_DC) /* {{
intern->initialised = 0;
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static void php_sqlite3_stmt_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_stmt_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_stmt *intern = php_sqlite3_stmt_from_obj(object);
@@ -2090,11 +2084,11 @@ static void php_sqlite3_stmt_object_free_storage(zend_object *object TSRMLS_DC)
zval_ptr_dtor(&intern->db_obj_zval);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static void php_sqlite3_result_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_result_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_result *intern = php_sqlite3_result_from_obj(object);
@@ -2110,11 +2104,11 @@ static void php_sqlite3_result_object_free_storage(zend_object *object TSRMLS_DC
zval_ptr_dtor(&intern->stmt_obj_zval);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_db_object *intern;
@@ -2124,7 +2118,7 @@ static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_D
/* Need to keep track of things to free */
zend_llist_init(&(intern->free_list), sizeof(php_sqlite3_free_list *), (llist_dtor_func_t)php_sqlite3_free_list_dtor, 0);
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_object_handlers;
@@ -2133,14 +2127,14 @@ static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_D
}
/* }}} */
-static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_stmt *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_sqlite3_stmt) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_stmt_object_handlers;
@@ -2149,14 +2143,14 @@ static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type TSR
}
/* }}} */
-static zend_object *php_sqlite3_result_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_result_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_result *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_sqlite3_result) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_result_object_handlers;
@@ -2190,7 +2184,7 @@ PHP_MINIT_FUNCTION(sqlite3)
#if defined(ZTS)
/* Refuse to load if this wasn't a threasafe library loaded */
if (!sqlite3_threadsafe()) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A thread safe version of SQLite is required when using a thread safe version of PHP.");
+ php_error_docref(NULL, E_WARNING, "A thread safe version of SQLite is required when using a thread safe version of PHP.");
return FAILURE;
}
#endif
@@ -2205,7 +2199,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_object_handlers.offset = XtOffsetOf(php_sqlite3_db_object, zo);
sqlite3_object_handlers.clone_obj = NULL;
sqlite3_object_handlers.free_obj = php_sqlite3_object_free_storage;
- php_sqlite3_sc_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_sc_entry = zend_register_internal_class(&ce);
/* Register SQLite 3 Prepared Statement Class */
INIT_CLASS_ENTRY(ce, "SQLite3Stmt", php_sqlite3_stmt_class_methods);
@@ -2213,7 +2207,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_stmt_object_handlers.offset = XtOffsetOf(php_sqlite3_stmt, zo);
sqlite3_stmt_object_handlers.clone_obj = NULL;
sqlite3_stmt_object_handlers.free_obj = php_sqlite3_stmt_object_free_storage;
- php_sqlite3_stmt_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_stmt_entry = zend_register_internal_class(&ce);
/* Register SQLite 3 Result Class */
INIT_CLASS_ENTRY(ce, "SQLite3Result", php_sqlite3_result_class_methods);
@@ -2221,7 +2215,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_result_object_handlers.offset = XtOffsetOf(php_sqlite3_result, zo);
sqlite3_result_object_handlers.clone_obj = NULL;
sqlite3_result_object_handlers.free_obj = php_sqlite3_result_object_free_storage;
- php_sqlite3_result_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_result_entry = zend_register_internal_class(&ce);
REGISTER_INI_ENTRIES();
@@ -2271,6 +2265,9 @@ PHP_MINFO_FUNCTION(sqlite3)
*/
static PHP_GINIT_FUNCTION(sqlite3)
{
+#if defined(COMPILE_DL_SQLITE3) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(sqlite3_globals, 0, sizeof(*sqlite3_globals));
}
/* }}} */
@@ -2296,6 +2293,9 @@ zend_module_entry sqlite3_module_entry = {
/* }}} */
#ifdef COMPILE_DL_SQLITE3
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(sqlite3)
#endif
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 83c00c993e..58bca29da8 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -141,7 +141,7 @@ PHP_MSHUTDOWN_FUNCTION(array) /* {{{ */
}
/* }}} */
-static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */
+static void php_set_compare_func(zend_long sort_type) /* {{{ */
{
switch (sort_type & ~PHP_SORT_FLAG_CASE) {
case PHP_SORT_NUMERIC:
@@ -170,7 +170,7 @@ static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -193,7 +193,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
ZVAL_STR(&second, s->key);
}
- if (ARRAYG(compare_func)(&result, &first, &second TSRMLS_CC) == FAILURE) {
+ if (ARRAYG(compare_func)(&result, &first, &second) == FAILURE) {
return 0;
}
@@ -207,9 +207,9 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
}
/* }}} */
-static int php_array_reverse_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_reverse_key_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_key_compare(a, b TSRMLS_CC) * -1;
+ return php_array_key_compare(a, b) * -1;
}
/* }}} */
@@ -220,13 +220,13 @@ PHP_FUNCTION(krsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -240,27 +240,27 @@ PHP_FUNCTION(ksort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* {{{ */
+PHPAPI zend_long php_count_recursive(zval *array, zend_long mode) /* {{{ */
{
zend_long cnt = 0;
zval *element;
if (Z_TYPE_P(array) == IS_ARRAY) {
if (Z_ARRVAL_P(array)->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
@@ -271,7 +271,7 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* {
}
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC);
+ cnt += php_count_recursive(element, COUNT_RECURSIVE);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(array))) {
Z_ARRVAL_P(array)->u.v.nApplyCount--;
@@ -293,7 +293,7 @@ PHP_FUNCTION(count)
zval *element;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &array, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &array, &mode) == FAILURE) {
return;
}
#else
@@ -313,7 +313,7 @@ PHP_FUNCTION(count)
if (mode == COUNT_RECURSIVE) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC);
+ cnt += php_count_recursive(element, COUNT_RECURSIVE);
} ZEND_HASH_FOREACH_END();
}
RETURN_LONG(cnt);
@@ -325,13 +325,13 @@ PHP_FUNCTION(count)
/* first, we check if the handler is defined */
if (Z_OBJ_HT_P(array)->count_elements) {
RETVAL_LONG(1);
- if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value) TSRMLS_CC)) {
+ if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value))) {
return;
}
}
#ifdef HAVE_SPL
/* if not and the object implements Countable we call its count() method */
- if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable)) {
zend_call_method_with_0_params(array, NULL, NULL, "count", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
RETVAL_LONG(zval_get_long(&retval));
@@ -354,7 +354,7 @@ PHP_FUNCTION(count)
*
* This is not correct any more, depends on what compare_func is set to.
*/
-static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_data_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -374,7 +374,7 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{
if (Z_TYPE_P(second) == IS_INDIRECT) {
second = Z_INDIRECT_P(second);
}
- if (ARRAYG(compare_func)(&result, first, second TSRMLS_CC) == FAILURE) {
+ if (ARRAYG(compare_func)(&result, first, second) == FAILURE) {
return 0;
}
@@ -388,13 +388,13 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{
}
/* }}} */
-static int php_array_reverse_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_reverse_data_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_data_compare(a, b TSRMLS_CC) * -1;
+ return php_array_data_compare(a, b) * -1;
}
/* }}} */
-static int php_array_natural_general_compare(const void *a, const void *b, int fold_case TSRMLS_DC) /* {{{ */
+static int php_array_natural_general_compare(const void *a, const void *b, int fold_case) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -409,15 +409,15 @@ static int php_array_natural_general_compare(const void *a, const void *b, int f
}
/* }}} */
-static int php_array_natural_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_natural_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_natural_general_compare(a, b, 0 TSRMLS_CC);
+ return php_array_natural_general_compare(a, b, 0);
}
/* }}} */
-static int php_array_natural_case_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_natural_case_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_natural_general_compare(a, b, 1 TSRMLS_CC);
+ return php_array_natural_general_compare(a, b, 1);
}
/* }}} */
@@ -425,16 +425,16 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) /* {{{ */
{
zval *array;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) {
return;
}
if (fold_case) {
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0) == FAILURE) {
return;
}
} else {
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0) == FAILURE) {
return;
}
}
@@ -466,13 +466,13 @@ PHP_FUNCTION(asort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -486,13 +486,13 @@ PHP_FUNCTION(arsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -506,13 +506,13 @@ PHP_FUNCTION(sort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -526,20 +526,20 @@ PHP_FUNCTION(rsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
-static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_user_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -556,7 +556,7 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{
BG(user_compare_fci).params = args;
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zend_long ret = zval_get_long(&retval);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&args[1]);
@@ -572,8 +572,8 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{
/* check if comparison function is valid */
#define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \
- if (!zend_is_callable(*func_name, 0, NULL TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function"); \
+ if (!zend_is_callable(*func_name, 0, NULL)) { \
+ php_error_docref(NULL, E_WARNING, "Invalid comparison function"); \
BG(user_compare_fci) = old_user_compare_fci; \
BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
RETURN_FALSE; \
@@ -610,7 +610,7 @@ PHP_FUNCTION(usort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -625,11 +625,11 @@ PHP_FUNCTION(usort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -655,7 +655,7 @@ PHP_FUNCTION(uasort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -670,11 +670,11 @@ PHP_FUNCTION(uasort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -689,7 +689,7 @@ PHP_FUNCTION(uasort)
}
/* }}} */
-static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_user_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -718,7 +718,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /*
BG(user_compare_fci).params = args;
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
result = zval_get_long(&retval);
zval_ptr_dtor(&retval);
} else {
@@ -743,7 +743,7 @@ PHP_FUNCTION(uksort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -758,11 +758,11 @@ PHP_FUNCTION(uksort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -785,7 +785,7 @@ PHP_FUNCTION(end)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -818,7 +818,7 @@ PHP_FUNCTION(prev)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -851,7 +851,7 @@ PHP_FUNCTION(next)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -884,7 +884,7 @@ PHP_FUNCTION(reset)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -917,7 +917,7 @@ PHP_FUNCTION(current)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -945,7 +945,7 @@ PHP_FUNCTION(key)
HashTable *array;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -965,24 +965,24 @@ PHP_FUNCTION(min)
int argc;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
- php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_REGULAR);
/* mixed min ( array $values ) */
if (argc == 1) {
zval *result;
if (Z_TYPE(args[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array");
+ php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array");
RETVAL_NULL();
} else {
- if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0 TSRMLS_CC)) != NULL) {
+ if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) {
RETVAL_ZVAL_FAST(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
+ php_error_docref(NULL, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
}
}
@@ -994,7 +994,7 @@ PHP_FUNCTION(min)
min = &args[0];
for (i = 1; i < argc; i++) {
- is_smaller_function(&result, &args[i], min TSRMLS_CC);
+ is_smaller_function(&result, &args[i], min);
if (Z_TYPE(result) == IS_TRUE) {
min = &args[i];
}
@@ -1012,24 +1012,24 @@ PHP_FUNCTION(max)
zval *args = NULL;
int argc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
- php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_REGULAR);
/* mixed max ( array $values ) */
if (argc == 1) {
zval *result;
if (Z_TYPE(args[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array");
+ php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array");
RETVAL_NULL();
} else {
- if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1 TSRMLS_CC)) != NULL) {
+ if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) {
RETVAL_ZVAL_FAST(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
+ php_error_docref(NULL, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
}
}
@@ -1041,7 +1041,7 @@ PHP_FUNCTION(max)
max = &args[0];
for (i = 1; i < argc; i++) {
- is_smaller_or_equal_function(&result, &args[i], max TSRMLS_CC);
+ is_smaller_or_equal_function(&result, &args[i], max);
if (Z_TYPE(result) == IS_FALSE) {
max = &args[i];
}
@@ -1052,7 +1052,7 @@ PHP_FUNCTION(max)
}
/* }}} */
-static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */
+static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive) /* {{{ */
{
zval args[3], /* Arguments to userland function */
retval, /* Return value - unused */
@@ -1094,7 +1094,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
thash = Z_ARRVAL_P(zv);
}
if (thash->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
if (userdata) {
zval_ptr_dtor(&args[2]);
}
@@ -1106,7 +1106,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
thash->u.v.nApplyCount++;
- php_array_walk(thash, userdata, recursive TSRMLS_CC);
+ php_array_walk(thash, userdata, recursive);
thash->u.v.nApplyCount--;
/* restore the fcall info and cache */
@@ -1121,7 +1121,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
zend_hash_get_current_key_zval(target_hash, &args[1]);
/* Call the userland function */
- if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache) TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache)) == SUCCESS) {
if (!was_ref && Z_ISREF(args[0])) {
/* copy reference back */
zval garbage;
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(array_walk)
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
return;
@@ -1188,7 +1188,7 @@ PHP_FUNCTION(array_walk)
);
#endif
- php_array_walk(array, userdata, 0 TSRMLS_CC);
+ php_array_walk(array, userdata, 0);
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
RETURN_TRUE;
@@ -1207,13 +1207,13 @@ PHP_FUNCTION(array_walk_recursive)
orig_array_walk_fci = BG(array_walk_fci);
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
return;
}
- php_array_walk(array, userdata, 1 TSRMLS_CC);
+ php_array_walk(array, userdata, 1);
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
RETURN_TRUE;
@@ -1235,7 +1235,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
zend_bool strict = 0; /* strict comparison or not */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|b", &value, &array, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "za|b", &value, &array, &strict) == FAILURE) {
return;
}
#else
@@ -1250,7 +1250,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
if (strict) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
ZVAL_DEREF(entry);
- is_identical_function(&res, value, entry TSRMLS_CC);
+ is_identical_function(&res, value, entry);
if (Z_TYPE(res) == IS_TRUE) {
if (behavior == 0) {
RETURN_TRUE;
@@ -1266,7 +1266,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
} ZEND_HASH_FOREACH_END();
} else {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
- if (fast_equal_check_function(&res, value, entry TSRMLS_CC)) {
+ if (fast_equal_check_function(&res, value, entry)) {
if (behavior == 0) {
RETURN_TRUE;
} else {
@@ -1338,7 +1338,7 @@ static int php_valid_var_name(char *var_name, size_t var_name_len) /* {{{ */
}
/* }}} */
-PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC) /* {{{ */
+PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore) /* {{{ */
{
ZVAL_NEW_STR(result, zend_string_alloc(Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len, 0));
memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix));
@@ -1366,7 +1366,7 @@ PHP_FUNCTION(extract)
int extract_refs = 0;
zend_array *symbol_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) {
return;
}
@@ -1377,24 +1377,24 @@ PHP_FUNCTION(extract)
extract_type &= 0xff;
if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid extract type");
+ php_error_docref(NULL, E_WARNING, "Invalid extract type");
return;
}
if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS && ZEND_NUM_ARGS() < 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "specified extract type requires the prefix parameter");
+ php_error_docref(NULL, E_WARNING, "specified extract type requires the prefix parameter");
return;
}
if (prefix) {
convert_to_string(prefix);
if (Z_STRLEN_P(prefix) && !php_valid_var_name(Z_STRVAL_P(prefix), Z_STRLEN_P(prefix))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "prefix is not a valid identifier");
+ php_error_docref(NULL, E_WARNING, "prefix is not a valid identifier");
return;
}
}
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(var_array), num_key, var_name, entry) {
zval final_name;
@@ -1409,7 +1409,7 @@ PHP_FUNCTION(extract)
ZVAL_LONG(&num, num_key);
convert_to_string(&num);
- php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1);
zval_dtor(&num);
} else {
continue;
@@ -1433,7 +1433,7 @@ PHP_FUNCTION(extract)
case EXTR_PREFIX_IF_EXISTS:
if (var_exists) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
}
break;
@@ -1445,14 +1445,14 @@ PHP_FUNCTION(extract)
case EXTR_PREFIX_ALL:
if (Z_TYPE(final_name) == IS_NULL && var_name->len != 0) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
}
break;
case EXTR_PREFIX_INVALID:
if (Z_TYPE(final_name) == IS_NULL) {
if (!php_valid_var_name(var_name->val, var_name->len)) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
} else {
ZVAL_STR_COPY(&final_name, var_name);
}
@@ -1484,7 +1484,7 @@ PHP_FUNCTION(extract)
}
} else {
if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry);
- zend_set_local_var(Z_STR(final_name), entry, 1 TSRMLS_CC);
+ zend_set_local_var(Z_STR(final_name), entry, 1);
}
count++;
}
@@ -1495,7 +1495,7 @@ PHP_FUNCTION(extract)
}
/* }}} */
-static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry TSRMLS_DC) /* {{{ */
+static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry) /* {{{ */
{
zval *value_ptr, data;
@@ -1507,7 +1507,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
if ((Z_ARRVAL_P(entry)->u.v.nApplyCount > 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return;
}
@@ -1515,7 +1515,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
Z_ARRVAL_P(entry)->u.v.nApplyCount++;
}
ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(entry), value_ptr) {
- php_compact_var(eg_active_symbol_table, return_value, value_ptr TSRMLS_CC);
+ php_compact_var(eg_active_symbol_table, return_value, value_ptr);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(entry))) {
Z_ARRVAL_P(entry)->u.v.nApplyCount--;
@@ -1532,11 +1532,11 @@ PHP_FUNCTION(compact)
uint32_t num_args, i;
zend_array *symbol_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
/* compact() is probably most used with a single array of var_names
or multiple string names, rather than a combination of both.
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(compact)
}
for (i=0; i<ZEND_NUM_ARGS(); i++) {
- php_compact_var(&symbol_table->ht, return_value, &args[i] TSRMLS_CC);
+ php_compact_var(&symbol_table->ht, return_value, &args[i]);
}
}
/* }}} */
@@ -1560,12 +1560,12 @@ PHP_FUNCTION(array_fill)
zval *val;
zend_long start_key, num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz", &start_key, &num, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "llz", &start_key, &num, &val) == FAILURE) {
return;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements can't be negative");
+ php_error_docref(NULL, E_WARNING, "Number of elements can't be negative");
RETURN_FALSE;
}
@@ -1585,7 +1585,7 @@ PHP_FUNCTION(array_fill)
zval_add_ref(val);
} else {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied");
RETURN_FALSE;
}
}
@@ -1598,7 +1598,7 @@ PHP_FUNCTION(array_fill_keys)
{
zval *keys, *val, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az", &keys, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "az", &keys, &val) == FAILURE) {
return;
}
@@ -1630,7 +1630,7 @@ PHP_FUNCTION(range)
int err = 0, is_step_double = 0;
double step = 1.0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &zlow, &zhigh, &zstep) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|z", &zlow, &zhigh, &zstep) == FAILURE) {
RETURN_FALSE;
}
@@ -1778,14 +1778,14 @@ long_str:
}
err:
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "step exceeds the specified range");
+ php_error_docref(NULL, E_WARNING, "step exceeds the specified range");
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
+static void php_array_data_shuffle(zval *array) /* {{{ */
{
uint32_t idx, j, n_elems;
Bucket *p, temp;
@@ -1812,7 +1812,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
}
}
while (--n_left) {
- rnd_idx = php_rand(TSRMLS_C);
+ rnd_idx = php_rand();
RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX);
if (rnd_idx != n_left) {
temp = hash->arData[n_left];
@@ -1847,11 +1847,11 @@ PHP_FUNCTION(shuffle)
{
zval *array;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) {
RETURN_FALSE;
}
- php_array_data_shuffle(array TSRMLS_CC);
+ php_array_data_shuffle(array);
RETURN_TRUE;
}
@@ -1973,7 +1973,7 @@ PHP_FUNCTION(array_push)
argc; /* Number of function arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) {
return;
}
@@ -1983,7 +1983,7 @@ PHP_FUNCTION(array_push)
if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) {
if (Z_REFCOUNTED(new_var)) Z_DELREF(new_var);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied");
RETURN_FALSE;
}
}
@@ -2003,7 +2003,7 @@ PHP_FUNCTION(array_pop)
Bucket *p;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
return;
}
#else
@@ -2042,7 +2042,7 @@ PHP_FUNCTION(array_pop)
/* Delete the last value */
if (p->key) {
if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(stack), p->key);
}
@@ -2064,7 +2064,7 @@ PHP_FUNCTION(array_shift)
Bucket *p;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
return;
}
#else
@@ -2099,7 +2099,7 @@ PHP_FUNCTION(array_shift)
/* Delete the first value */
if (p->key) {
if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(stack), p->key);
}
@@ -2161,7 +2161,7 @@ PHP_FUNCTION(array_unshift)
HashTable old_hash;
int argc; /* Number of function arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) {
return;
}
@@ -2196,7 +2196,7 @@ PHP_FUNCTION(array_splice)
repl_num = 0; /* Number of replacement elements */
int num_in; /* Number of elements in the input array */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) {
return;
}
@@ -2276,7 +2276,7 @@ PHP_FUNCTION(array_slice)
zend_ulong num_key;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
return;
}
#else
@@ -2348,7 +2348,7 @@ PHP_FUNCTION(array_slice)
}
/* }}} */
-PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry, *dest_entry;
zend_string *string_key;
@@ -2366,7 +2366,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
ZVAL_DEREF(dest_zval);
thash = Z_TYPE_P(dest_zval) == IS_ARRAY ? Z_ARRVAL_P(dest_zval) : NULL;
if ((thash && thash->u.v.nApplyCount > 1) || (src_entry == dest_entry && Z_ISREF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
@@ -2397,7 +2397,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
thash->u.v.nApplyCount++;
}
- ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC);
+ ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
thash->u.v.nApplyCount--;
}
@@ -2428,7 +2428,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
}
/* }}} */
-PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_merge(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry;
zend_string *string_key;
@@ -2450,7 +2450,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry, *dest_entry, *src_zval, *dest_zval;
zend_string *string_key;
@@ -2493,7 +2493,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC
if (Z_ARRVAL_P(dest_zval)->u.v.nApplyCount > 1 ||
Z_ARRVAL_P(src_zval)->u.v.nApplyCount > 1 ||
(Z_ISREF_P(src_entry) && Z_ISREF_P(dest_entry) && Z_REF_P(src_entry) == Z_REF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
SEPARATE_ZVAL(dest_zval);
@@ -2505,7 +2505,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC
Z_ARRVAL_P(src_zval)->u.v.nApplyCount++;
}
- ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC);
+ ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(dest_zval))) {
Z_ARRVAL_P(dest_zval)->u.v.nApplyCount--;
@@ -2530,7 +2530,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
int argc, i, init_size = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
#else
@@ -2544,7 +2544,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
ZVAL_DEREF(arg);
if (Z_TYPE_P(arg) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
} else {
int num = zend_hash_num_elements(Z_ARRVAL_P(arg));
@@ -2586,7 +2586,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
} else {
for (i = 1; i < argc; i++) {
@@ -2623,13 +2623,13 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
} else {
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
}
}
@@ -2681,10 +2681,10 @@ PHP_FUNCTION(array_keys)
zend_bool strict = 0; /* do strict comparison */
zend_ulong num_idx;
zend_string *str_idx;
- int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function;
+ int (*is_equal_func)(zval *, zval *, zval *) = is_equal_function;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|zb", &input, &search_value, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &input, &search_value, &strict) == FAILURE) {
return;
}
#else
@@ -2711,7 +2711,7 @@ PHP_FUNCTION(array_keys)
/* Go through input array and add keys to the return array */
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) {
if (search_value != NULL) {
- is_equal_func(&res, search_value, entry TSRMLS_CC);
+ is_equal_func(&res, search_value, entry);
add_key = zval_is_true(&res);
}
@@ -2734,7 +2734,7 @@ PHP_FUNCTION(array_values)
zval *input, /* Input array */
*entry; /* An entry in the input array */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -2758,7 +2758,7 @@ PHP_FUNCTION(array_count_values)
*tmp;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -2785,7 +2785,7 @@ PHP_FUNCTION(array_count_values)
Z_LVAL_P(tmp)++;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only count STRING and INTEGER values!");
+ php_error_docref(NULL, E_WARNING, "Can only count STRING and INTEGER values!");
}
} ZEND_HASH_FOREACH_END();
}
@@ -2796,7 +2796,7 @@ PHP_FUNCTION(array_count_values)
*/
static inline
zend_bool array_column_param_helper(zval *param,
- const char *name TSRMLS_DC) {
+ const char *name) {
switch (Z_TYPE_P(param)) {
case IS_DOUBLE:
convert_to_long_ex(param);
@@ -2811,7 +2811,7 @@ zend_bool array_column_param_helper(zval *param,
return 1;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The %s key should be either a string or an integer", name);
+ php_error_docref(NULL, E_WARNING, "The %s key should be either a string or an integer", name);
return 0;
}
}
@@ -2826,12 +2826,12 @@ PHP_FUNCTION(array_column)
zval *zcolval = NULL, *zkeyval = NULL;
HashTable *ht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
return;
}
- if ((zcolumn && !array_column_param_helper(zcolumn, "column" TSRMLS_CC)) ||
- (zkey && !array_column_param_helper(zkey, "index" TSRMLS_CC))) {
+ if ((zcolumn && !array_column_param_helper(zcolumn, "column")) ||
+ (zkey && !array_column_param_helper(zkey, "index"))) {
RETURN_FALSE;
}
@@ -2893,7 +2893,7 @@ PHP_FUNCTION(array_reverse)
zend_ulong num_key;
zend_bool preserve_keys = 0; /* whether to preserve keys */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &input, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &input, &preserve_keys) == FAILURE) {
return;
}
@@ -2932,7 +2932,7 @@ PHP_FUNCTION(array_pad)
int do_pad; /* Whether we should do padding at all */
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "alz", &input, &pad_size, &pad_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "alz", &input, &pad_size, &pad_value) == FAILURE) {
return;
}
@@ -2940,7 +2940,7 @@ PHP_FUNCTION(array_pad)
input_size = zend_hash_num_elements(Z_ARRVAL_P(input));
pad_size_abs = ZEND_ABS(pad_size);
if (pad_size_abs < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
+ php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2957,7 +2957,7 @@ PHP_FUNCTION(array_pad)
/* Populate the pads array */
num_pads = pad_size_abs - input_size;
if (num_pads > Z_L(1048576)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
+ php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2992,7 +2992,7 @@ PHP_FUNCTION(array_flip)
zend_ulong num_idx;
zend_string *str_idx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
return;
}
@@ -3014,7 +3014,7 @@ PHP_FUNCTION(array_flip)
}
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(entry), &data);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only flip STRING and INTEGER values!");
+ php_error_docref(NULL, E_WARNING, "Can only flip STRING and INTEGER values!");
}
} ZEND_HASH_FOREACH_END();
}
@@ -3030,7 +3030,7 @@ PHP_FUNCTION(array_change_key_case)
zend_ulong num_key;
zend_long change_to_upper=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &change_to_upper) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &change_to_upper) == FAILURE) {
return;
}
@@ -3070,11 +3070,11 @@ PHP_FUNCTION(array_unique)
unsigned int i;
zend_long sort_type = PHP_SORT_STRING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &sort_type) == FAILURE) {
return;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
ZVAL_NEW_ARR(return_value);
zend_array_dup(Z_ARRVAL_P(return_value), Z_ARRVAL_P(array));
@@ -3098,12 +3098,12 @@ PHP_FUNCTION(array_unique)
i++;
}
ZVAL_UNDEF(&arTmp[i].b.val);
- zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare TSRMLS_CC);
+ zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare);
/* go through the sorted array and delete duplicates from the copy */
lastkept = arTmp;
for (cmpdata = arTmp + 1; Z_TYPE(cmpdata->b.val) != IS_UNDEF; cmpdata++) {
- if (php_array_data_compare(lastkept, cmpdata TSRMLS_CC)) {
+ if (php_array_data_compare(lastkept, cmpdata)) {
lastkept = cmpdata;
} else {
if (lastkept->i > cmpdata->i) {
@@ -3116,7 +3116,7 @@ PHP_FUNCTION(array_unique)
zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);
} else {
if (Z_ARRVAL_P(return_value) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(return_value), p->key);
}
@@ -3127,7 +3127,7 @@ PHP_FUNCTION(array_unique)
}
/* }}} */
-static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
+static int zval_compare(zval *a, zval *b) /* {{{ */
{
zval result;
zval *first;
@@ -3142,7 +3142,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
if (Z_TYPE_P(second) == IS_INDIRECT) {
second = Z_INDIRECT_P(second);
}
- if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) {
+ if (string_compare_function(&result, first, second) == FAILURE) {
return 0;
}
@@ -3155,7 +3155,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
+static int zval_user_compare(zval *a, zval *b) /* {{{ */
{
zval args[2];
zval retval;
@@ -3175,7 +3175,7 @@ static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zend_long ret = zval_get_long(&retval);
zval_ptr_dtor(&retval);
return ret < 0 ? -1 : ret > 0 ? 1 : 0;;
@@ -3191,7 +3191,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
Bucket *p;
int argc, i;
zval *args;
- int (*intersect_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL;
+ int (*intersect_data_compare_func)(zval *, zval *) = NULL;
zend_bool ok;
zval *val, *data;
int req_args;
@@ -3216,17 +3216,17 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
}
if (argc < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, argc);
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, argc);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
}
}
@@ -3245,7 +3245,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
for (i = 1; i < argc; i++) {
if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) == NULL ||
(intersect_data_compare_func &&
- intersect_data_compare_func(val, data TSRMLS_CC) != 0)
+ intersect_data_compare_func(val, data) != 0)
) {
ok = 0;
break;
@@ -3262,7 +3262,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
for (i = 1; i < argc; i++) {
if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) == NULL ||
(intersect_data_compare_func &&
- intersect_data_compare_func(val, data TSRMLS_CC) != 0)
+ intersect_data_compare_func(val, data) != 0)
) {
ok = 0;
break;
@@ -3294,8 +3294,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
- int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC);
- int (*intersect_data_compare_func)(const void *, const void * TSRMLS_DC);
+ int (*intersect_key_compare_func)(const void *, const void *);
+ int (*intersect_data_compare_func)(const void *, const void *);
if (behavior == INTERSECT_NORMAL) {
intersect_key_compare_func = php_array_key_compare;
@@ -3311,16 +3311,16 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
param_spec = "+f";
intersect_data_compare_func = php_array_user_compare;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
return;
}
fci_data = &fci1;
@@ -3364,21 +3364,21 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
fci_key = &fci2;
fci_key_cache = &fci2_cache;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
+ php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
return;
}
@@ -3387,7 +3387,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
/* for each argument, create and sort list with pointers to the hash buckets */
lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
- php_set_compare_func(PHP_SORT_STRING TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_STRING);
if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
@@ -3399,7 +3399,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
for (i = 0; i < arr_argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
arr_argc = i; /* only free up to i - 1 */
goto out;
}
@@ -3421,9 +3421,9 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
ZVAL_UNDEF(&list->val);
if (behavior == INTERSECT_NORMAL) {
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func);
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func);
}
}
@@ -3443,11 +3443,11 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
for (i = 1; i < arr_argc; i++) {
if (behavior & INTERSECT_NORMAL) {
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
if ((!c && Z_TYPE(ptrs[i]->val) != IS_UNDEF) && (behavior == INTERSECT_ASSOC)) { /* only when INTERSECT_ASSOC */
@@ -3459,7 +3459,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
}
- if (intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC) != 0) {
+ if (intersect_data_compare_func(ptrs[0], ptrs[i]) != 0) {
c = 1;
if (key_compare_type == INTERSECT_COMP_KEY_USER) {
BG(user_compare_fci) = *fci_key;
@@ -3506,7 +3506,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
goto out;
}
if (behavior == INTERSECT_NORMAL) {
- if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)) {
+ if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i])) {
break;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
@@ -3522,7 +3522,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
goto out;
}
if (behavior == INTERSECT_NORMAL) {
- if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
@@ -3615,7 +3615,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
Bucket *p;
int argc, i;
zval *args;
- int (*diff_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL;
+ int (*diff_data_compare_func)(zval *, zval *) = NULL;
zend_bool ok;
zval *val, *data;
@@ -3623,19 +3623,19 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
argc = ZEND_NUM_ARGS();
if (data_compare_type == DIFF_COMP_DATA_USER) {
if (argc < 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
return;
}
diff_data_compare_func = zval_user_compare;
} else {
if (argc < 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
if (data_compare_type == DIFF_COMP_DATA_INTERNAL) {
@@ -3645,7 +3645,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
}
}
@@ -3664,7 +3664,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 1; i < argc; i++) {
if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) != NULL &&
(!diff_data_compare_func ||
- diff_data_compare_func(val, data TSRMLS_CC) == 0)
+ diff_data_compare_func(val, data) == 0)
) {
ok = 0;
break;
@@ -3681,7 +3681,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 1; i < argc; i++) {
if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) != NULL &&
(!diff_data_compare_func ||
- diff_data_compare_func(val, data TSRMLS_CC) == 0)
+ diff_data_compare_func(val, data) == 0)
) {
ok = 0;
break;
@@ -3713,8 +3713,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
- int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC);
- int (*diff_data_compare_func)(const void *, const void * TSRMLS_DC);
+ int (*diff_key_compare_func)(const void *, const void *);
+ int (*diff_data_compare_func)(const void *, const void *);
if (behavior == DIFF_NORMAL) {
diff_key_compare_func = php_array_key_compare;
@@ -3730,16 +3730,16 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
param_spec = "+f";
diff_data_compare_func = php_array_user_compare;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
return;
}
fci_data = &fci1;
@@ -3782,21 +3782,21 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
fci_key = &fci2;
fci_key_cache = &fci2_cache;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
+ php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
return;
}
@@ -3805,7 +3805,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
/* for each argument, create and sort list with pointers to the hash buckets */
lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
- php_set_compare_func(PHP_SORT_STRING TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_STRING);
if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
@@ -3817,7 +3817,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
for (i = 0; i < arr_argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
arr_argc = i; /* only free up to i - 1 */
goto out;
}
@@ -3839,9 +3839,9 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
}
ZVAL_UNDEF(&list->val);
if (behavior == DIFF_NORMAL) {
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func);
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func);
}
}
@@ -3862,11 +3862,11 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
for (i = 1; i < arr_argc; i++) {
Bucket *ptr = ptrs[i];
if (behavior == DIFF_NORMAL) {
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
- while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr TSRMLS_CC)))) {
+ while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr)))) {
ptr++;
}
}
@@ -3884,7 +3884,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
}
- if (diff_data_compare_func(ptrs[0], ptr TSRMLS_CC) != 0) {
+ if (diff_data_compare_func(ptrs[0], ptr) != 0) {
/* the data is not the same */
c = -1;
if (key_compare_type == DIFF_COMP_KEY_USER) {
@@ -3920,7 +3920,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
goto out;
}
if (behavior == DIFF_NORMAL) {
- if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
@@ -3936,7 +3936,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
goto out;
}
if (behavior == DIFF_NORMAL) {
- if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
@@ -4027,7 +4027,7 @@ PHP_FUNCTION(array_udiff_uassoc)
#define MULTISORT_TYPE 1
#define MULTISORT_LAST 2
-PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+PHPAPI int php_multisort_compare(const void *a, const void *b) /* {{{ */
{
Bucket *ab = *(Bucket **)a;
Bucket *bb = *(Bucket **)b;
@@ -4038,9 +4038,9 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{
r = 0;
do {
- php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r] TSRMLS_CC);
+ php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r]);
- ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val TSRMLS_CC);
+ ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val);
result = ARRAYG(multisort_flags)[MULTISORT_ORDER][r] * Z_LVAL(temp);
if (result != 0) {
return result > 0 ? 1 : -1;
@@ -4076,7 +4076,7 @@ PHP_FUNCTION(array_multisort)
int sort_type = PHP_SORT_REGULAR;
int i, k, n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
@@ -4124,7 +4124,7 @@ PHP_FUNCTION(array_multisort)
sort_order = Z_LVAL(args[i]) == PHP_SORT_DESC ? -1 : 1;
parse_state[MULTISORT_ORDER] = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
MULTISORT_ABORT;
}
break;
@@ -4142,19 +4142,19 @@ PHP_FUNCTION(array_multisort)
sort_type = (int)Z_LVAL(args[i]);
parse_state[MULTISORT_TYPE] = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
MULTISORT_ABORT;
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is an unknown sort flag", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is an unknown sort flag", i + 1);
MULTISORT_ABORT;
break;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1);
MULTISORT_ABORT;
}
}
@@ -4166,7 +4166,7 @@ PHP_FUNCTION(array_multisort)
array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0]));
for (i = 0; i < num_arrays; i++) {
if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != array_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array sizes are inconsistent");
+ php_error_docref(NULL, E_WARNING, "Array sizes are inconsistent");
MULTISORT_ABORT;
}
}
@@ -4202,7 +4202,7 @@ PHP_FUNCTION(array_multisort)
}
/* Do the actual sort magic - bada-bim, bada-boom. */
- zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare TSRMLS_CC);
+ zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare);
/* Restructure the arrays based on sorted indirect - this is mostly taken from zend_hash_sort() function. */
HANDLE_BLOCK_INTERRUPTIONS();
@@ -4252,7 +4252,7 @@ PHP_FUNCTION(array_rand)
zend_string *string_key;
zend_ulong num_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &input, &num_req) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &input, &num_req) == FAILURE) {
return;
}
@@ -4260,7 +4260,7 @@ PHP_FUNCTION(array_rand)
if (ZEND_NUM_ARGS() > 1) {
if (num_req <= 0 || num_req > num_avail) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be between 1 and the number of elements in the array");
+ php_error_docref(NULL, E_WARNING, "Second argument has to be between 1 and the number of elements in the array");
return;
}
}
@@ -4276,7 +4276,7 @@ PHP_FUNCTION(array_rand)
break;
}
- randval = php_rand(TSRMLS_C);
+ randval = php_rand();
if ((double) (randval / (PHP_RAND_MAX + 1.0)) < (double) num_req / (double) num_avail) {
/* If we are returning a single result, just do it. */
@@ -4309,7 +4309,7 @@ PHP_FUNCTION(array_sum)
*entry,
entry_n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -4320,8 +4320,8 @@ PHP_FUNCTION(array_sum)
continue;
}
ZVAL_DUP(&entry_n, entry);
- convert_scalar_to_number(&entry_n TSRMLS_CC);
- fast_add_function(return_value, return_value, &entry_n TSRMLS_CC);
+ convert_scalar_to_number(&entry_n);
+ fast_add_function(return_value, return_value, &entry_n);
} ZEND_HASH_FOREACH_END();
}
/* }}} */
@@ -4335,7 +4335,7 @@ PHP_FUNCTION(array_product)
entry_n;
double dval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -4349,7 +4349,7 @@ PHP_FUNCTION(array_product)
continue;
}
ZVAL_DUP(&entry_n, entry);
- convert_scalar_to_number(&entry_n TSRMLS_CC);
+ convert_scalar_to_number(&entry_n);
if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) {
dval = (double)Z_LVAL_P(return_value) * (double)Z_LVAL(entry_n);
@@ -4379,7 +4379,7 @@ PHP_FUNCTION(array_reduce)
zval *initial = NULL;
HashTable *htbl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) {
return;
}
@@ -4408,7 +4408,7 @@ PHP_FUNCTION(array_reduce)
ZVAL_COPY(&args[1], operand);
fci.params = args;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zval_ptr_dtor(&args[1]);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&result);
@@ -4416,7 +4416,7 @@ PHP_FUNCTION(array_reduce)
} else {
zval_ptr_dtor(&args[1]);
zval_ptr_dtor(&args[0]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the reduction callback");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the reduction callback");
return;
}
} ZEND_HASH_FOREACH_END();
@@ -4440,7 +4440,7 @@ PHP_FUNCTION(array_filter)
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
zend_ulong num_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) {
return;
}
@@ -4480,13 +4480,13 @@ PHP_FUNCTION(array_filter)
}
fci.params = args;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS) {
zval_ptr_dtor(&args[0]);
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
if (!Z_ISUNDEF(retval)) {
- int retval_true = zend_is_true(&retval TSRMLS_CC);
+ int retval_true = zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (!retval_true) {
@@ -4500,10 +4500,10 @@ PHP_FUNCTION(array_filter)
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the filter callback");
return;
}
- } else if (!zend_is_true(operand TSRMLS_CC)) {
+ } else if (!zend_is_true(operand)) {
continue;
}
@@ -4530,7 +4530,7 @@ PHP_FUNCTION(array_map)
uint32_t k, maxlen = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
return;
}
#else
@@ -4548,7 +4548,7 @@ PHP_FUNCTION(array_map)
zval *zv, arg;
if (Z_TYPE(arrays[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", 2);
+ php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2);
return;
}
maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0]));
@@ -4569,8 +4569,8 @@ PHP_FUNCTION(array_map)
ZVAL_COPY(&arg, zv);
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback");
+ if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
zval_dtor(return_value);
zval_ptr_dtor(&arg);
RETURN_NULL();
@@ -4588,7 +4588,7 @@ PHP_FUNCTION(array_map)
for (i = 0; i < n_arrays; i++) {
if (Z_TYPE(arrays[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2);
+ php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", i + 2);
efree(array_pos);
return;
}
@@ -4657,8 +4657,8 @@ PHP_FUNCTION(array_map)
fci.params = params;
fci.no_separation = 0;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback");
+ if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
efree(array_pos);
zval_dtor(return_value);
for (i = 0; i < n_arrays; i++) {
@@ -4690,7 +4690,7 @@ PHP_FUNCTION(array_key_exists)
HashTable *array; /* array to check in */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zH", &key, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zH", &key, &array) == FAILURE) {
return;
}
#else
@@ -4718,7 +4718,7 @@ PHP_FUNCTION(array_key_exists)
RETURN_FALSE;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be either a string or an integer");
+ php_error_docref(NULL, E_WARNING, "The first argument should be either a string or an integer");
RETURN_FALSE;
}
}
@@ -4737,12 +4737,12 @@ PHP_FUNCTION(array_chunk)
zval chunk;
zval *entry;
- if (zend_parse_parameters(argc TSRMLS_CC, "al|b", &input, &size, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(argc, "al|b", &input, &size, &preserve_keys) == FAILURE) {
return;
}
/* Do bounds checking for size parameter. */
if (size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size parameter expected to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Size parameter expected to be greater than 0");
return;
}
@@ -4799,7 +4799,7 @@ PHP_FUNCTION(array_combine)
zval *entry_keys, *entry_values;
int num_keys, num_values;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &keys, &values) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &keys, &values) == FAILURE) {
return;
}
@@ -4807,7 +4807,7 @@ PHP_FUNCTION(array_combine)
num_values = zend_hash_num_elements(Z_ARRVAL_P(values));
if (num_keys != num_values) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have an equal number of elements");
+ php_error_docref(NULL, E_WARNING, "Both parameters should have an equal number of elements");
RETURN_FALSE;
}
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index fa5ccfc12f..a0a8569adb 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -36,7 +36,7 @@ ZEND_END_MODULE_GLOBALS(assert)
ZEND_DECLARE_MODULE_GLOBALS(assert)
#ifdef ZTS
-#define ASSERTG(v) TSRMG(assert_globals_id, zend_assert_globals *, v)
+#define ASSERTG(v) ZEND_TSRMG(assert_globals_id, zend_assert_globals *, v)
#else
#define ASSERTG(v) (assert_globals.v)
#endif
@@ -85,7 +85,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateBool, quiet_eval, zend_assert_globals, assert_globals)
PHP_INI_END()
-static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC) /* {{{ */
+static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{{ */
{
ZVAL_UNDEF(&assert_globals_p->callback);
assert_globals_p->cb = NULL;
@@ -149,7 +149,7 @@ PHP_FUNCTION(assert)
RETURN_TRUE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &assertion, &description, &description_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &assertion, &description, &description_len) == FAILURE) {
return;
}
@@ -164,13 +164,13 @@ PHP_FUNCTION(assert)
EG(error_reporting) = 0;
}
- compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
- if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
+ compiled_string_description = zend_make_compiled_string_description("assert code");
+ if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description) == FAILURE) {
efree(compiled_string_description);
if (description_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
}
if (ASSERTG(bail)) {
zend_bailout();
@@ -202,8 +202,8 @@ PHP_FUNCTION(assert)
zval *args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval), 0);
zval retval;
int i;
- uint lineno = zend_get_executed_lineno(TSRMLS_C);
- const char *filename = zend_get_executed_filename(TSRMLS_C);
+ uint lineno = zend_get_executed_lineno();
+ const char *filename = zend_get_executed_filename();
ZVAL_STRING(&args[0], SAFE_STRING(filename));
ZVAL_LONG (&args[1], lineno);
@@ -213,14 +213,14 @@ PHP_FUNCTION(assert)
/* XXX do we want to check for error here? */
if (description_len == 0) {
- call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args);
for (i = 0; i <= 2; i++) {
zval_ptr_dtor(&(args[i]));
}
} else {
ZVAL_STRINGL(&args[3], SAFE_STRING(description), description_len);
- call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args);
for (i = 0; i <= 3; i++) {
zval_ptr_dtor(&(args[i]));
}
@@ -233,15 +233,15 @@ PHP_FUNCTION(assert)
if (ASSERTG(warning)) {
if (description_len == 0) {
if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ php_error_docref(NULL, E_WARNING, "Assertion \"%s\" failed", myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ php_error_docref(NULL, E_WARNING, "Assertion failed");
}
} else {
if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval);
+ php_error_docref(NULL, E_WARNING, "%s: \"%s\" failed", description, myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description);
+ php_error_docref(NULL, E_WARNING, "%s failed", description);
}
}
}
@@ -262,7 +262,7 @@ PHP_FUNCTION(assert_options)
int ac = ZEND_NUM_ARGS();
zend_string *key;
- if (zend_parse_parameters(ac TSRMLS_CC, "l|z", &what, &value) == FAILURE) {
+ if (zend_parse_parameters(ac, "l|z", &what, &value) == FAILURE) {
return;
}
@@ -272,7 +272,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.active", sizeof("assert.active")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -284,7 +284,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.bail", sizeof("assert.bail")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -296,7 +296,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.quiet_eval", sizeof("assert.quiet_eval")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -308,7 +308,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.warning", sizeof("assert.warning")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -332,7 +332,7 @@ PHP_FUNCTION(assert_options)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %pd", what);
+ php_error_docref(NULL, E_WARNING, "Unknown value %pd", what);
break;
}
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index fd1c910234..f3acd5b07f 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -121,7 +121,7 @@ void php_base64_init(void)
ch += 16;
}
sprintf(sp, "};");
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Reverse_table:\n%s", s);
+ php_error_docref(NULL, E_NOTICE, "Reverse_table:\n%s", s);
efree(s);
}
*/
@@ -215,7 +215,7 @@ PHP_FUNCTION(base64_encode)
size_t str_len;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
result = php_base64_encode((unsigned char*)str, str_len);
@@ -236,7 +236,7 @@ PHP_FUNCTION(base64_decode)
size_t str_len;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &strict) == FAILURE) {
return;
}
result = php_base64_decode_ex((unsigned char*)str, str_len, strict);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 479ac7b8a2..7cae46f29b 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3424,7 +3424,7 @@ static void php_putenv_destructor(zval *zv) /* {{{ */
/* }}} */
#endif
-static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
+static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
{
BG(rand_is_seeded) = 0;
BG(mt_rand_is_seeded) = 0;
@@ -3450,11 +3450,11 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /*
}
/* }}} */
-static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
+static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */
{
- if (BG(url_adapt_state_ex).tags) {
- zend_hash_destroy(BG(url_adapt_state_ex).tags);
- free(BG(url_adapt_state_ex).tags);
+ if (basic_globals_p->url_adapt_state_ex.tags) {
+ zend_hash_destroy(basic_globals_p->url_adapt_state_ex.tags);
+ free(basic_globals_p->url_adapt_state_ex.tags);
}
}
/* }}} */
@@ -3532,15 +3532,15 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
#endif
#else
- basic_globals_ctor(&basic_globals TSRMLS_CC);
+ basic_globals_ctor(&basic_globals);
#ifdef PHP_WIN32
- php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
+ php_win32_core_globals_ctor(&the_php_win32_core_globals);
#endif
#endif
zend_hash_init(&basic_submodules, 0, NULL, NULL, 1);
- BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C);
+ BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class();
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
@@ -3638,14 +3638,14 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
BASIC_MINIT_SUBMODULE(user_streams)
BASIC_MINIT_SUBMODULE(imagetypes)
- php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("php", &php_stream_php_wrapper);
+ php_register_url_stream_wrapper("file", &php_plain_files_wrapper);
#ifdef HAVE_GLOB
- php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper);
#endif
- php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper);
+ php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
+ php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -3668,15 +3668,15 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
ts_free_id(php_win32_core_globals_id);
#endif
#else
- basic_globals_dtor(&basic_globals TSRMLS_CC);
+ basic_globals_dtor(&basic_globals);
#ifdef PHP_WIN32
- php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC);
+ php_win32_core_globals_dtor(&the_php_win32_core_globals);
#endif
#endif
- php_unregister_url_stream_wrapper("php" TSRMLS_CC);
- php_unregister_url_stream_wrapper("http" TSRMLS_CC);
- php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("php");
+ php_unregister_url_stream_wrapper("http");
+ php_unregister_url_stream_wrapper("ftp");
BASIC_MSHUTDOWN_SUBMODULE(browscap)
BASIC_MSHUTDOWN_SUBMODULE(array)
@@ -3814,19 +3814,19 @@ PHP_FUNCTION(constant)
zend_string *const_name;
zval *c;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &const_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &const_name) == FAILURE) {
return;
}
- c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC);
+ c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT);
if (c) {
ZVAL_COPY_VALUE(return_value, c);
if (Z_CONSTANT_P(return_value)) {
- zval_update_constant_ex(return_value, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(return_value, 1, NULL);
}
zval_copy_ctor(return_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name->val);
+ php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", const_name->val);
RETURN_NULL();
}
}
@@ -3842,7 +3842,7 @@ PHP_NAMED_FUNCTION(php_inet_ntop)
int af = AF_INET;
char buffer[40];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3852,12 +3852,12 @@ PHP_NAMED_FUNCTION(php_inet_ntop)
} else
#endif
if (address_len != 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value");
+ php_error_docref(NULL, E_WARNING, "Invalid in_addr value");
RETURN_FALSE;
}
if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred");
+ php_error_docref(NULL, E_WARNING, "An unknown error occurred");
RETURN_FALSE;
}
@@ -3876,7 +3876,7 @@ PHP_NAMED_FUNCTION(php_inet_pton)
size_t address_len;
char buffer[17];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3888,14 +3888,14 @@ PHP_NAMED_FUNCTION(php_inet_pton)
} else
#endif
if (!strchr(address, '.')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address);
RETURN_FALSE;
}
ret = inet_pton(af, address, buffer);
if (ret <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address);
RETURN_FALSE;
}
@@ -3916,7 +3916,7 @@ PHP_FUNCTION(ip2long)
zend_ulong ip;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) {
return;
}
@@ -3955,7 +3955,7 @@ PHP_FUNCTION(long2ip)
char str[40];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &ip, &ip_len) == FAILURE) {
return;
}
@@ -3985,12 +3985,12 @@ PHP_FUNCTION(getenv)
char *ptr, *str;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
/* SAPI method returns an emalloc()'d string */
- ptr = sapi_getenv(str, str_len TSRMLS_CC);
+ ptr = sapi_getenv(str, str_len);
if (ptr) {
// TODO: avoid realocation ???
RETVAL_STRING(ptr);
@@ -4055,12 +4055,12 @@ PHP_FUNCTION(putenv)
int error_code;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &setting, &setting_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &setting, &setting_len) == FAILURE) {
return;
}
if(setting_len == 0 || setting[0] == '=') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter syntax");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter syntax");
RETURN_FALSE;
}
@@ -4228,7 +4228,7 @@ PHP_FUNCTION(getopt)
int optname_len = 0;
opt_struct *opts, *orig_opts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &options, &options_len, &p_longopts) == FAILURE) {
RETURN_FALSE;
}
@@ -4383,7 +4383,7 @@ PHP_FUNCTION(getopt)
Flush the output buffer */
PHP_FUNCTION(flush)
{
- sapi_flush(TSRMLS_C);
+ sapi_flush();
}
/* }}} */
@@ -4393,11 +4393,11 @@ PHP_FUNCTION(sleep)
{
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
RETURN_FALSE;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0");
RETURN_FALSE;
}
#ifdef PHP_SLEEP_NON_VOID
@@ -4416,11 +4416,11 @@ PHP_FUNCTION(usleep)
#if HAVE_USLEEP
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
return;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
RETURN_FALSE;
}
usleep((unsigned int)num);
@@ -4436,16 +4436,16 @@ PHP_FUNCTION(time_nanosleep)
zend_long tv_sec, tv_nsec;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &tv_sec, &tv_nsec) == FAILURE) {
return;
}
if (tv_sec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds value must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0");
RETURN_FALSE;
}
if (tv_nsec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The nanoseconds value must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The nanoseconds value must be greater than 0");
RETURN_FALSE;
}
@@ -4459,7 +4459,7 @@ PHP_FUNCTION(time_nanosleep)
add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
return;
} else if (errno == EINVAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
+ php_error_docref(NULL, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
}
RETURN_FALSE;
@@ -4474,7 +4474,7 @@ PHP_FUNCTION(time_sleep_until)
struct timeval tm;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &d_ts) == FAILURE) {
return;
}
@@ -4484,7 +4484,7 @@ PHP_FUNCTION(time_sleep_until)
c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
if (c_ts < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less than current time");
+ php_error_docref(NULL, E_WARNING, "Sleep until to time is less than current time");
RETURN_FALSE;
}
@@ -4517,13 +4517,13 @@ PHP_FUNCTION(get_current_user)
return;
}
- RETURN_STRING(php_get_current_user(TSRMLS_C));
+ RETURN_STRING(php_get_current_user());
}
/* }}} */
/* {{{ add_config_entry_cb
*/
-static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int add_config_entry_cb(zval *entry, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *retval = (zval *)va_arg(args, zval*);
zval tmp;
@@ -4536,7 +4536,7 @@ static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
array_init(&tmp);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, add_config_entry_cb, 1, tmp);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(entry), add_config_entry_cb, 1, tmp);
zend_hash_update(Z_ARRVAL_P(retval), hash_key->key, &tmp);
}
return 0;
@@ -4551,7 +4551,7 @@ PHP_FUNCTION(get_cfg_var)
size_t varname_len;
zval *retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
return;
}
@@ -4560,7 +4560,7 @@ PHP_FUNCTION(get_cfg_var)
if (retval) {
if (Z_TYPE_P(retval) == IS_ARRAY) {
array_init(return_value);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(retval), add_config_entry_cb, 1, return_value);
return;
} else {
RETURN_STRING(Z_STRVAL_P(retval));
@@ -4577,12 +4577,12 @@ PHP_FUNCTION(set_magic_quotes_runtime)
{
zend_bool new_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &new_setting) == FAILURE) {
return;
}
if (new_setting) {
- php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore");
+ php_error_docref(NULL, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore");
}
RETURN_FALSE;
}
@@ -4633,7 +4633,7 @@ PHP_FUNCTION(error_log)
int opt_err = 0, argc = ZEND_NUM_ARGS();
zend_long erropt = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
return;
}
@@ -4641,7 +4641,7 @@ PHP_FUNCTION(error_log)
opt_err = (int)erropt;
}
- if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) {
+ if (_php_error_log_ex(opt_err, message, message_len, opt, headers) == FAILURE) {
RETURN_FALSE;
}
@@ -4650,26 +4650,26 @@ PHP_FUNCTION(error_log)
/* }}} */
/* For BC (not binary-safe!) */
-PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers) /* {{{ */
{
- return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC);
+ return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers);
}
/* }}} */
-PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */
+PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */
{
php_stream *stream = NULL;
switch (opt_err)
{
case 1: /*send an email */
- if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
+ if (!php_mail(opt, "PHP error_log message", message, headers, NULL)) {
return FAILURE;
}
break;
case 2: /*send to an address */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!");
+ php_error_docref(NULL, E_WARNING, "TCP/IP option not available!");
return FAILURE;
break;
@@ -4684,14 +4684,14 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha
case 4: /* send to SAPI */
if (sapi_module.log_message) {
- sapi_module.log_message(message TSRMLS_CC);
+ sapi_module.log_message(message);
} else {
return FAILURE;
}
break;
default:
- php_log_err(message TSRMLS_CC);
+ php_log_err(message);
break;
}
return SUCCESS;
@@ -4702,7 +4702,7 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha
Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
PHP_FUNCTION(error_get_last)
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
@@ -4726,7 +4726,7 @@ PHP_FUNCTION(call_user_func)
zend_fcall_info_cache fci_cache;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
return;
}
#else
@@ -4738,7 +4738,7 @@ PHP_FUNCTION(call_user_func)
fci.retval = &retval;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
}
@@ -4754,7 +4754,7 @@ PHP_FUNCTION(call_user_func_array)
zend_fcall_info_cache fci_cache;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, &params) == FAILURE) {
return;
}
#else
@@ -4764,10 +4764,10 @@ PHP_FUNCTION(call_user_func_array)
ZEND_PARSE_PARAMETERS_END();
#endif
- zend_fcall_info_args(&fci, params TSRMLS_CC);
+ zend_fcall_info_args(&fci, params);
fci.retval = &retval;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
@@ -4783,7 +4783,7 @@ PHP_FUNCTION(forward_static_call)
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
return;
}
@@ -4794,11 +4794,11 @@ PHP_FUNCTION(forward_static_call)
fci.retval = &retval;
if (EX(called_scope) &&
- instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+ instanceof_function(EX(called_scope), fci_cache.calling_scope)) {
fci_cache.called_scope = EX(called_scope);
}
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
}
@@ -4812,19 +4812,19 @@ PHP_FUNCTION(forward_static_call_array)
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, &params) == FAILURE) {
return;
}
- zend_fcall_info_args(&fci, params TSRMLS_CC);
+ zend_fcall_info_args(&fci, params);
fci.retval = &retval;
if (EX(called_scope) &&
- instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+ instanceof_function(EX(called_scope), fci_cache.calling_scope)) {
fci_cache.called_scope = EX(called_scope);
}
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
@@ -4856,13 +4856,13 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {
}
/* }}} */
-static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
+static int user_shutdown_function_call(zval *zv) /* {{{ */
{
php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
zval retval;
zend_string *function_name;
- if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
+ if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name)) {
if (function_name) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val);
zend_string_release(function_name);
@@ -4879,8 +4879,7 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
&shutdown_function_entry->arguments[0],
&retval,
shutdown_function_entry->arg_count - 1,
- shutdown_function_entry->arguments + 1
- TSRMLS_CC ) == SUCCESS)
+ shutdown_function_entry->arguments + 1) == SUCCESS)
{
zval_dtor(&retval);
}
@@ -4888,7 +4887,7 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) /* {{{ */
+static void user_tick_function_call(user_tick_function_entry *tick_fe) /* {{{ */
{
zval retval;
zval *function = &tick_fe->arguments[0];
@@ -4902,22 +4901,22 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
&retval,
tick_fe->arg_count - 1,
tick_fe->arguments + 1
- TSRMLS_CC) == SUCCESS) {
+ ) == SUCCESS) {
zval_dtor(&retval);
} else {
zval *obj, *method;
if (Z_TYPE_P(function) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
+ php_error_docref(NULL, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
} else if ( Z_TYPE_P(function) == IS_ARRAY
&& (obj = zend_hash_index_find(Z_ARRVAL_P(function), 0)) != NULL
&& (method = zend_hash_index_find(Z_ARRVAL_P(function), 1)) != NULL
&& Z_TYPE_P(obj) == IS_OBJECT
&& Z_TYPE_P(method) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
+ php_error_docref(NULL, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function");
+ php_error_docref(NULL, E_WARNING, "Unable to call tick function");
}
}
@@ -4928,9 +4927,8 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
static void run_user_tick_functions(int tick_count) /* {{{ */
{
- TSRMLS_FETCH();
- zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC);
+ zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call);
}
/* }}} */
@@ -4939,43 +4937,42 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
zval *func1 = &tick_fe1->arguments[0];
zval *func2 = &tick_fe2->arguments[0];
int ret;
- TSRMLS_FETCH();
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
ret = (zend_binary_zval_strcmp(func1, func2) == 0);
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
zval result;
- zend_compare_arrays(&result, func1, func2 TSRMLS_CC);
+ zend_compare_arrays(&result, func1, func2);
ret = (Z_LVAL(result) == 0);
} else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
zval result;
- zend_compare_objects(&result, func1, func2 TSRMLS_CC);
+ zend_compare_objects(&result, func1, func2);
ret = (Z_LVAL(result) == 0);
} else {
ret = 0;
}
if (ret && tick_fe1->calling) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment");
+ php_error_docref(NULL, E_WARNING, "Unable to delete tick function executed at the moment");
return 0;
}
return ret;
}
/* }}} */
-PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_call_shutdown_functions(void) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
zend_try {
- zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call TSRMLS_CC);
+ zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
}
zend_end_try();
- php_free_shutdown_functions(TSRMLS_C);
+ php_free_shutdown_functions();
}
}
/* }}} */
-PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_free_shutdown_functions(void) /* {{{ */
{
if (BG(user_shutdown_function_names))
zend_try {
@@ -5012,11 +5009,11 @@ PHP_FUNCTION(register_shutdown_function)
}
/* Prevent entering of anything but valid callback (syntax check only!) */
- if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name)) {
if (callback_name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback passed");
+ php_error_docref(NULL, E_WARNING, "Invalid shutdown callback passed");
}
efree(shutdown_function_entry.arguments);
RETVAL_FALSE;
@@ -5037,7 +5034,7 @@ PHP_FUNCTION(register_shutdown_function)
}
/* }}} */
-PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
@@ -5048,7 +5045,7 @@ PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t fun
}
/* }}} */
-PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE;
@@ -5058,7 +5055,7 @@ PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t funct
}
/* }}} */
-PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
@@ -5088,32 +5085,32 @@ PHP_FUNCTION(highlight_file)
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &i) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
if (i) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
php_get_highlight_struct(&syntax_highlighter_ini);
- ret = highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC);
+ ret = highlight_file(filename, &syntax_highlighter_ini);
if (ret == FAILURE) {
if (i) {
- php_output_end(TSRMLS_C);
+ php_output_end();
}
RETURN_FALSE;
}
if (i) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5129,30 +5126,30 @@ PHP_FUNCTION(php_strip_whitespace)
zend_lex_state original_lex_state;
zend_file_handle file_handle = {{0}};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (open_file_for_scanning(&file_handle TSRMLS_CC) == FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- php_output_end(TSRMLS_C);
+ zend_save_lexical_state(&original_lex_state);
+ if (open_file_for_scanning(&file_handle) == FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
+ php_output_end();
RETURN_EMPTY_STRING();
}
- zend_strip(TSRMLS_C);
+ zend_strip();
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
+ zend_restore_lexical_state(&original_lex_state);
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
}
/* }}} */
@@ -5166,26 +5163,26 @@ PHP_FUNCTION(highlight_string)
zend_bool i = 0;
int old_error_reporting = EG(error_reporting);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &expr, &i) == FAILURE) {
RETURN_FALSE;
}
convert_to_string_ex(expr);
if (i) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
EG(error_reporting) = E_ERROR;
php_get_highlight_struct(&syntax_highlighter_ini);
- hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
+ hicompiled_string_description = zend_make_compiled_string_description("highlighted code");
- if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
+ if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description) == FAILURE) {
efree(hicompiled_string_description);
EG(error_reporting) = old_error_reporting;
if (i) {
- php_output_end(TSRMLS_C);
+ php_output_end();
}
RETURN_FALSE;
}
@@ -5194,8 +5191,8 @@ PHP_FUNCTION(highlight_string)
EG(error_reporting) = old_error_reporting;
if (i) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5209,7 +5206,7 @@ PHP_FUNCTION(ini_get)
char *varname, *str;
size_t varname_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
return;
}
@@ -5223,7 +5220,7 @@ PHP_FUNCTION(ini_get)
}
/* }}} */
-static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int php_ini_get_option(zval *zv, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_ini_entry *ini_entry = Z_PTR_P(zv);
zval *ini_array = va_arg(args, zval *);
@@ -5282,22 +5279,22 @@ PHP_FUNCTION(ini_get_all)
zend_module_entry *module;
zend_bool details = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &extname, &extname_len, &details) == FAILURE) {
return;
}
- zend_ini_sort_entries(TSRMLS_C);
+ zend_ini_sort_entries();
if (extname) {
if ((module = zend_hash_str_find_ptr(&module_registry, extname, extname_len)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname);
+ php_error_docref(NULL, E_WARNING, "Unable to find extension '%s'", extname);
RETURN_FALSE;
}
extnumber = module->module_number;
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, php_ini_get_option, 2, return_value, extnumber, details);
+ zend_hash_apply_with_arguments(EG(ini_directives), php_ini_get_option, 2, return_value, extnumber, details);
}
/* }}} */
@@ -5319,7 +5316,7 @@ PHP_FUNCTION(ini_set)
zend_string *new_value;
char *old_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &varname, &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &varname, &new_value) == FAILURE) {
return;
}
@@ -5341,14 +5338,14 @@ PHP_FUNCTION(ini_set)
_CHECK_PATH(varname->val, varname->len, "mail.log") ||
_CHECK_PATH(varname->val, varname->len, "java.library.path") ||
_CHECK_PATH(varname->val, varname->len, "vpopmail.directory")) {
- if (php_check_open_basedir(new_value->val TSRMLS_CC)) {
+ if (php_check_open_basedir(new_value->val)) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
}
- if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -5361,7 +5358,7 @@ PHP_FUNCTION(ini_restore)
{
zend_string *varname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &varname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &varname) == FAILURE) {
return;
}
@@ -5377,7 +5374,7 @@ PHP_FUNCTION(set_include_path)
char *old_value;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &new_value) == FAILURE) {
return;
}
@@ -5390,7 +5387,7 @@ PHP_FUNCTION(set_include_path)
}
key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
- if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
zend_string_release(key);
zval_dtor(return_value);
RETURN_FALSE;
@@ -5405,7 +5402,7 @@ PHP_FUNCTION(get_include_path)
{
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
@@ -5425,7 +5422,7 @@ PHP_FUNCTION(restore_include_path)
{
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
key = zend_string_init("include_path", sizeof("include_path")-1, 0);
@@ -5441,19 +5438,19 @@ PHP_FUNCTION(print_r)
zval *var;
zend_bool do_return = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &do_return) == FAILURE) {
RETURN_FALSE;
}
if (do_return) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
- zend_print_zval_r(var, 0 TSRMLS_CC);
+ zend_print_zval_r(var, 0);
if (do_return) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5483,7 +5480,7 @@ PHP_FUNCTION(ignore_user_abort)
zend_string *arg = NULL;
int old_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &arg) == FAILURE) {
return;
}
@@ -5491,7 +5488,7 @@ PHP_FUNCTION(ignore_user_abort)
if (arg) {
zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort"), 0);
- zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
}
@@ -5508,7 +5505,7 @@ PHP_FUNCTION(getservbyname)
size_t name_len, proto_len;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
return;
}
@@ -5542,7 +5539,7 @@ PHP_FUNCTION(getservbyport)
zend_long port;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &port, &proto, &proto_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &port, &proto, &proto_len) == FAILURE) {
return;
}
@@ -5566,7 +5563,7 @@ PHP_FUNCTION(getprotobyname)
size_t name_len;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -5589,7 +5586,7 @@ PHP_FUNCTION(getprotobynumber)
zend_long proto;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &proto) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &proto) == FAILURE) {
return;
}
@@ -5626,9 +5623,9 @@ PHP_FUNCTION(register_tick_function)
RETURN_FALSE;
}
- if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) {
+ if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name)) {
efree(tick_fe.arguments);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid tick callback '%s' passed", function_name->val);
zend_string_release(function_name);
RETURN_FALSE;
} else if (function_name) {
@@ -5644,7 +5641,7 @@ PHP_FUNCTION(register_tick_function)
zend_llist_init(BG(user_tick_functions),
sizeof(user_tick_function_entry),
(llist_dtor_func_t) user_tick_function_dtor, 0);
- php_add_tick_function(run_user_tick_functions TSRMLS_CC);
+ php_add_tick_function(run_user_tick_functions);
}
for (i = 0; i < tick_fe.arg_count; i++) {
@@ -5666,7 +5663,7 @@ PHP_FUNCTION(unregister_tick_function)
zval *function;
user_tick_function_entry tick_fe;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &function) == FAILURE) {
return;
}
@@ -5697,7 +5694,7 @@ PHP_FUNCTION(is_uploaded_file)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_len) == FAILURE) {
return;
}
@@ -5725,7 +5722,7 @@ PHP_FUNCTION(move_uploaded_file)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
return;
}
@@ -5733,7 +5730,7 @@ PHP_FUNCTION(move_uploaded_file)
RETURN_FALSE;
}
- if (php_check_open_basedir(new_path TSRMLS_CC)) {
+ if (php_check_open_basedir(new_path)) {
RETURN_FALSE;
}
@@ -5746,10 +5743,10 @@ PHP_FUNCTION(move_uploaded_file)
ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
#endif
- } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
+ } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR) == SUCCESS) {
VCWD_UNLINK(path);
successful = 1;
}
@@ -5757,7 +5754,7 @@ PHP_FUNCTION(move_uploaded_file)
if (successful) {
zend_hash_str_del(SG(rfc1867_uploaded_files), path, path_len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
+ php_error_docref(NULL, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
}
RETURN_BOOL(successful);
@@ -5766,7 +5763,7 @@ PHP_FUNCTION(move_uploaded_file)
/* {{{ php_simple_ini_parser_cb
*/
-static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
+static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
{
zval element;
@@ -5826,7 +5823,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal
/* {{{ php_ini_parser_cb_with_sections
*/
-static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
+static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
{
if (callback_type == ZEND_INI_PARSER_SECTION) {
array_init(&BG(active_ini_file_section));
@@ -5840,7 +5837,7 @@ static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3,
active_arr = arr;
}
- php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr TSRMLS_CC);
+ php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr);
}
}
/* }}} */
@@ -5856,12 +5853,12 @@ PHP_FUNCTION(parse_ini_file)
zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
RETURN_FALSE;
}
if (filename_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!");
+ php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
RETURN_FALSE;
}
@@ -5879,7 +5876,7 @@ PHP_FUNCTION(parse_ini_file)
fh.type = ZEND_HANDLE_FILENAME;
array_init(return_value);
- if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
+ if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -5896,7 +5893,7 @@ PHP_FUNCTION(parse_ini_string)
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
RETURN_FALSE;
}
@@ -5918,7 +5915,7 @@ PHP_FUNCTION(parse_ini_string)
memset(string + str_len, 0, ZEND_MMAP_AHEAD);
array_init(return_value);
- if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
+ if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
zval_dtor(return_value);
RETVAL_FALSE;
}
@@ -5934,7 +5931,7 @@ PHP_FUNCTION(config_get_hash) /* {{{ */
HashTable *hash = php_ini_get_configuration_hash();
array_init(return_value);
- zend_hash_apply_with_arguments(hash TSRMLS_CC, add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(hash, add_config_entry_cb, 1, return_value);
}
/* }}} */
#endif
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 5adc9a9a11..d6f926a90e 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -145,9 +145,9 @@ PHP_RSHUTDOWN_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(browscap);
/* Left for BC (not binary safe!) */
-PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC);
-PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC);
-PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC);
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers);
+PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers);
+PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore);
#if SIZEOF_INT == 4
/* Most 32-bit and 64-bit systems have 32-bit ints */
@@ -235,7 +235,7 @@ typedef struct _php_basic_globals {
} php_basic_globals;
#ifdef ZTS
-#define BG(v) TSRMG(basic_globals_id, php_basic_globals *, v)
+#define BG(v) ZEND_TSRMG(basic_globals_id, php_basic_globals *, v)
PHPAPI extern int basic_globals_id;
#else
#define BG(v) (basic_globals.v)
@@ -259,12 +259,12 @@ typedef struct _php_shutdown_function_entry {
int arg_count;
} php_shutdown_function_entry;
-PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC);
-PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC);
-PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC);
+PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry);
+PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len);
+PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry);
-PHPAPI void php_call_shutdown_functions(TSRMLS_D);
-PHPAPI void php_free_shutdown_functions(TSRMLS_D);
+PHPAPI void php_call_shutdown_functions(void);
+PHPAPI void php_free_shutdown_functions(void);
#endif /* BASIC_FUNCTIONS_H */
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index a76fb136a3..19d340a9d8 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -46,7 +46,7 @@ ZEND_END_MODULE_GLOBALS(browscap)
ZEND_DECLARE_MODULE_GLOBALS(browscap)
#ifdef ZTS
-#define BROWSCAP_G(v) TSRMG(browscap_globals_id, zend_browscap_globals *, v)
+#define BROWSCAP_G(v) ZEND_TSRMG(browscap_globals_id, zend_browscap_globals *, v)
#else
#define BROWSCAP_G(v) (browscap_globals.v)
#endif
@@ -136,7 +136,7 @@ static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */
}
/* }}} */
-static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
+static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */
{
browser_data *bdata = arg;
int persistent = bdata->htab->u.flags & HASH_FLAG_PERSISTENT;
@@ -219,7 +219,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
}
/* }}} */
-static int browscap_read_file(char *filename, browser_data *browdata, int persistent TSRMLS_DC) /* {{{ */
+static int browscap_read_file(char *filename, browser_data *browdata, int persistent) /* {{{ */
{
zend_file_handle fh = {{0}};
@@ -251,7 +251,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
fh.type = ZEND_HANDLE_FP;
browdata->current_section_name = NULL;
zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_RAW,
- (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata TSRMLS_CC);
+ (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata);
if (browdata->current_section_name != NULL) {
pefree(browdata->current_section_name, persistent);
browdata->current_section_name = NULL;
@@ -262,7 +262,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
/* }}} */
#ifdef ZTS
-static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS_DC) /* {{{ */
+static void browscap_globals_ctor(zend_browscap_globals *browscap_globals) /* {{{ */
{
browscap_globals->activation_bdata.htab = NULL;
ZVAL_UNDEF(&browscap_globals->activation_bdata.current_section);
@@ -272,7 +272,7 @@ static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS
/* }}} */
#endif
-static void browscap_bdata_dtor(browser_data *bdata, int persistent TSRMLS_DC) /* {{{ */
+static void browscap_bdata_dtor(browser_data *bdata, int persistent) /* {{{ */
{
if (bdata->htab != NULL) {
zend_hash_destroy(bdata->htab);
@@ -294,7 +294,7 @@ PHP_INI_MH(OnChangeBrowscap)
} else if (stage == PHP_INI_STAGE_ACTIVATE) {
browser_data *bdata = &BROWSCAP_G(activation_bdata);
if (bdata->filename[0] != '\0') {
- browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
+ browscap_bdata_dtor(bdata, 0);
}
if (VCWD_REALPATH(new_value->val, bdata->filename) == NULL) {
return FAILURE;
@@ -317,7 +317,7 @@ PHP_MINIT_FUNCTION(browscap) /* {{{ */
/* ctor call not really needed for non-ZTS */
if (browscap && browscap[0]) {
- if (browscap_read_file(browscap, &global_bdata, 1 TSRMLS_CC) == FAILURE) {
+ if (browscap_read_file(browscap, &global_bdata, 1) == FAILURE) {
return FAILURE;
}
}
@@ -330,7 +330,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */
{
browser_data *bdata = &BROWSCAP_G(activation_bdata);
if (bdata->filename[0] != '\0') {
- browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
+ browscap_bdata_dtor(bdata, 0);
}
return SUCCESS;
@@ -339,13 +339,13 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */
PHP_MSHUTDOWN_FUNCTION(browscap) /* {{{ */
{
- browscap_bdata_dtor(&global_bdata, 1 TSRMLS_CC);
+ browscap_bdata_dtor(&global_bdata, 1);
return SUCCESS;
}
/* }}} */
-static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
+static int browser_reg_compare(zval *browser, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
zval *browser_regex, *previous_match;
pcre *re;
@@ -369,7 +369,7 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar
return 0;
}
- re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options);
if (re == NULL) {
return 0;
}
@@ -446,30 +446,30 @@ PHP_FUNCTION(get_browser)
if (BROWSCAP_G(activation_bdata).filename[0] != '\0') {
bdata = &BROWSCAP_G(activation_bdata);
if (bdata->htab == NULL) { /* not initialized yet */
- if (browscap_read_file(bdata->filename, bdata, 0 TSRMLS_CC) == FAILURE) {
+ if (browscap_read_file(bdata->filename, bdata, 0) == FAILURE) {
RETURN_FALSE;
}
}
} else {
if (!global_bdata.htab) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "browscap ini directive not set");
+ php_error_docref(NULL, E_WARNING, "browscap ini directive not set");
RETURN_FALSE;
}
bdata = &global_bdata;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) {
return;
}
if (agent_name == NULL) {
zend_string *key = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(key TSRMLS_CC);
+ zend_is_auto_global(key);
zend_string_release(key);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF ||
(http_user_agent = zend_hash_str_find(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) == NULL
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
+ php_error_docref(NULL, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
RETURN_FALSE;
}
agent_name = Z_STRVAL_P(http_user_agent);
@@ -481,7 +481,7 @@ PHP_FUNCTION(get_browser)
if ((agent = zend_hash_str_find(bdata->htab, lookup_browser_name, agent_name_len)) == NULL) {
ZVAL_UNDEF(&found_browser_entry);
- zend_hash_apply_with_arguments(bdata->htab TSRMLS_CC, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
+ zend_hash_apply_with_arguments(bdata->htab, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
if (Z_TYPE(found_browser_entry) != IS_UNDEF) {
agent = &found_browser_entry;
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 7a5f0effa0..e2ce61f561 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -605,7 +605,8 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.
incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \
- filters.c proc_open.c streamsfuncs.c http.c password.c)
+ filters.c proc_open.c streamsfuncs.c http.c password.c,,,
+ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_MAKEFILE_FRAGMENT
PHP_INSTALL_HEADERS([ext/standard/])
diff --git a/ext/standard/config.w32 b/ext/standard/config.w32
index 5f24641b4d..e8b50efc7e 100644
--- a/ext/standard/config.w32
+++ b/ext/standard/config.w32
@@ -20,7 +20,8 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
- streamsfuncs.c http.c flock_compat.c", false /* never shared */);
+ streamsfuncs.c http.c flock_compat.c", false /* never shared */,
+ '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
PHP_INSTALL_HEADERS("", "ext/standard");
if (PHP_MBREGEX != "no") {
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index a515b492b8..be49239dfa 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -31,7 +31,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
php_uint32 crcinit = 0;
register php_uint32 crc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &p, &nr) == FAILURE) {
return;
}
crc = crcinit^0xFFFFFFFF;
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 1aeff9e679..27cfac37a5 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -25,10 +25,10 @@
#define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors)
-PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
+PHPAPI void php_print_credits(int flag) /* {{{ */
{
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
- php_print_info_htmlhead(TSRMLS_C);
+ php_print_info_htmlhead();
}
if (!sapi_module.phpinfo_as_text) {
diff --git a/ext/standard/credits.h b/ext/standard/credits.h
index 0a501526f8..6ec57da58e 100644
--- a/ext/standard/credits.h
+++ b/ext/standard/credits.h
@@ -37,6 +37,6 @@
#endif /* HAVE_CREDITS_DEFS */
-PHPAPI void php_print_credits(int flag TSRMLS_DC);
+PHPAPI void php_print_credits(int flag);
#endif
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index efc4248732..439d3e0d07 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -98,7 +98,7 @@
#define PHP_STD_DES_CRYPT 1
#endif
-#define PHP_CRYPT_RAND php_rand(TSRMLS_C)
+#define PHP_CRYPT_RAND php_rand()
PHP_MINIT_FUNCTION(crypt) /* {{{ */
{
@@ -267,14 +267,14 @@ PHP_FUNCTION(crypt)
* available (passing always 2-character salt). At least for glibc6.1 */
memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) {
return;
}
if (salt_in) {
memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len));
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.");
+ php_error_docref(NULL, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.");
}
/* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */
diff --git a/ext/standard/css.c b/ext/standard/css.c
index f4469bea30..1511c08145 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -21,7 +21,7 @@
#include "php.h"
#include "info.h"
-PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */
+PHPAPI void php_info_print_css(void) /* {{{ */
{
PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n");
PUTS("pre {margin: 0; font-family: monospace;}\n");
diff --git a/ext/standard/css.h b/ext/standard/css.h
index 408abc1787..934ae840c5 100644
--- a/ext/standard/css.h
+++ b/ext/standard/css.h
@@ -21,6 +21,6 @@
#ifndef CSS_H
#define CSS_H
-PHPAPI void php_info_print_css(TSRMLS_D);
+PHPAPI void php_info_print_css(void);
#endif
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index 1718b75729..073d9d206f 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -187,7 +187,7 @@ _cyr_mac = {
};
/* }}} */
-/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to TSRMLS_DC)
+/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to)
* This is the function that performs real in-place conversion of the string
* between charsets.
* Parameters:
@@ -201,7 +201,7 @@ _cyr_mac = {
* d - x-cp866
* m - x-mac-cyrillic
*****************************************************************************/
-static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to TSRMLS_DC)
+static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to)
{
const unsigned char *from_table, *to_table;
unsigned char tmp;
@@ -228,7 +228,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro
case 'K':
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown source charset: %c", from);
+ php_error_docref(NULL, E_WARNING, "Unknown source charset: %c", from);
break;
}
@@ -250,7 +250,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro
case 'K':
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown destination charset: %c", to);
+ php_error_docref(NULL, E_WARNING, "Unknown destination charset: %c", to);
break;
}
@@ -274,13 +274,13 @@ PHP_FUNCTION(convert_cyr_string)
size_t input_len, fr_cs_len, to_cs_len;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
return;
}
str = zend_string_init(input, input_len, 0);
- php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC);
+ php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0]);
RETVAL_NEW_STR(str);
}
/* }}} */
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 39f8669038..091cb47ded 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -49,9 +49,9 @@ char *day_short_names[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-/* {{{ PHPAPI char *php_std_date(time_t t TSRMLS_DC)
+/* {{{ PHPAPI char *php_std_date(time_t t)
Return date string in standard format for http headers */
-PHPAPI char *php_std_date(time_t t TSRMLS_DC)
+PHPAPI char *php_std_date(time_t t)
{
struct tm *tm1, tmbuf;
char *str;
@@ -92,7 +92,7 @@ PHP_FUNCTION(strptime)
struct tm parsed_time;
char *unparsed_part;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ts, &ts_length, &format, &format_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &ts, &ts_length, &format, &format_length) == FAILURE) {
return;
}
diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h
index 0edaff1b00..7b8ced8e67 100644
--- a/ext/standard/datetime.h
+++ b/ext/standard/datetime.h
@@ -26,6 +26,6 @@
PHP_FUNCTION(strptime);
#endif
-PHPAPI char *php_std_date(time_t t TSRMLS_DC);
+PHPAPI char *php_std_date(time_t t);
#endif /* DATETIME_H */
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 6a09ce3af5..ec4e7045d7 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -56,7 +56,7 @@ typedef struct {
} php_dir_globals;
#ifdef ZTS
-#define DIRG(v) TSRMG(dir_globals_id, php_dir_globals *, v)
+#define DIRG(v) ZEND_TSRMG(dir_globals_id, php_dir_globals *, v)
int dir_globals_id;
#else
#define DIRG(v) (dir_globals.v)
@@ -75,14 +75,14 @@ static int le_dirp;
static zend_class_entry *dir_class_entry_ptr;
#define FETCH_DIRP() \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &id) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &id) == FAILURE) { \
return; \
} \
if (ZEND_NUM_ARGS() == 0) { \
myself = getThis(); \
if (myself) { \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \
+ php_error_docref(NULL, E_WARNING, "Unable to find my handle property"); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \
@@ -90,7 +90,7 @@ static zend_class_entry *dir_class_entry_ptr;
ZEND_FETCH_RESOURCE(dirp, php_stream *, 0, (int)DIRG(default_dir)->handle, "Directory", php_file_le_stream()); \
} \
} else { \
- dirp = (php_stream *) zend_fetch_resource(id TSRMLS_CC, -1, "Directory", NULL, 1, php_file_le_stream()); \
+ dirp = (php_stream *) zend_fetch_resource(id, -1, "Directory", NULL, 1, php_file_le_stream()); \
if (!dirp) \
RETURN_FALSE; \
}
@@ -109,7 +109,7 @@ static const zend_function_entry php_dir_class_functions[] = {
};
-static void php_set_default_dir(zend_resource *res TSRMLS_DC)
+static void php_set_default_dir(zend_resource *res)
{
if (DIRG(default_dir)) {
zend_list_delete(DIRG(default_dir));
@@ -134,7 +134,7 @@ PHP_MINIT_FUNCTION(dir)
zend_class_entry dir_class_entry;
INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions);
- dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry TSRMLS_CC);
+ dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
#ifdef ZTS
ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
@@ -219,7 +219,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
php_stream_context *context = NULL;
php_stream *dirp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
RETURN_NULL();
}
@@ -233,7 +233,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
- php_set_default_dir(dirp->res TSRMLS_CC);
+ php_set_default_dir(dirp->res);
if (createobject) {
object_init_ex(return_value, dir_class_entry_ptr);
@@ -273,7 +273,7 @@ PHP_FUNCTION(closedir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -281,7 +281,7 @@ PHP_FUNCTION(closedir)
zend_list_close(dirp->res);
if (res == DIRG(default_dir)) {
- php_set_default_dir(NULL TSRMLS_CC);
+ php_set_default_dir(NULL);
}
}
/* }}} */
@@ -295,22 +295,22 @@ PHP_FUNCTION(chroot)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
ret = chroot(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
ret = chdir("/");
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -327,17 +327,17 @@ PHP_FUNCTION(chdir)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir(str TSRMLS_CC)) {
+ if (php_check_open_basedir(str)) {
RETURN_FALSE;
}
ret = VCWD_CHDIR(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -389,7 +389,7 @@ PHP_FUNCTION(rewinddir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -408,7 +408,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -438,17 +438,17 @@ PHP_FUNCTION(glob)
int ret;
zend_bool basedir_limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
return;
}
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
if ((GLOB_AVAILABLE_FLAGS & flags) != flags) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
RETURN_FALSE;
}
@@ -500,7 +500,7 @@ no_results:
query is senseless on windows. For instance while *.txt
is a pretty valid filename on EXT3, it's invalid on NTFS. */
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(pattern, 0)) {
RETURN_FALSE;
}
}
@@ -512,7 +512,7 @@ no_results:
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0)) {
basedir_limit = 1;
continue;
}
@@ -561,12 +561,12 @@ PHP_FUNCTION(scandir)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
return;
}
if (dirn_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Directory name cannot be empty");
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(scandir)
n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasortr);
}
if (n < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(errno %d): %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index a9ca94c0ad..82baa4eaa3 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -56,17 +56,17 @@ PHPAPI PHP_FUNCTION(dl)
char *filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
if (!PG(enable_dl)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled");
+ php_error_docref(NULL, E_WARNING, "Dynamically loaded extensions aren't enabled");
RETURN_FALSE;
}
if (filename_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
@@ -75,14 +75,14 @@ PHPAPI PHP_FUNCTION(dl)
(strncmp(sapi_module.name, "embed", 5) != 0)
) {
#ifdef ZTS
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename);
+ php_error_docref(NULL, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename);
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename);
+ php_error_docref(NULL, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename);
#endif
}
- php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
+ php_dl(filename, MODULE_TEMPORARY, return_value, 0);
if (Z_LVAL_P(return_value) == 1) {
EG(full_tables_cleanup) = 1;
}
@@ -99,7 +99,7 @@ PHPAPI PHP_FUNCTION(dl)
/* {{{ php_load_extension
*/
-PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
+PHPAPI int php_load_extension(char *filename, int type, int start_now)
{
void *handle;
char *libpath;
@@ -124,7 +124,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
if (strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) {
/* Passing modules with full path is not supported for dynamically loaded extensions */
if (type == MODULE_TEMPORARY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename");
+ php_error_docref(NULL, E_WARNING, "Temporary module name should contain only filename");
return FAILURE;
}
libpath = estrdup(filename);
@@ -146,13 +146,13 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
#if PHP_WIN32
char *err = GET_DL_ERROR();
if (err && (*err != '\0')) {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
LocalFree(err);
} else {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason");
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason");
}
#else
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR());
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR());
GET_DL_ERROR(); /* free the buffer storing the error */
#endif
efree(libpath);
@@ -173,11 +173,11 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
if (!get_module) {
if (DL_FETCH_SYMBOL(handle, "zend_extension_entry") || DL_FETCH_SYMBOL(handle, "_zend_extension_entry")) {
DL_UNLOAD(handle);
- php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename);
+ php_error_docref(NULL, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename);
return FAILURE;
}
DL_UNLOAD(handle);
- php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s'", filename);
+ php_error_docref(NULL, error_type, "Invalid library (maybe not a PHP library) '%s'", filename);
return FAILURE;
}
module_entry = get_module();
@@ -216,7 +216,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
zend_api = module_entry->zend_api;
}
- php_error_docref(NULL TSRMLS_CC, error_type,
+ php_error_docref(NULL, error_type,
"%s: Unable to initialize module\n"
"Module compiled with module API=%d\n"
"PHP compiled with module API=%d\n"
@@ -226,7 +226,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
return FAILURE;
}
if(strcmp(module_entry->build_id, ZEND_MODULE_BUILD_ID)) {
- php_error_docref(NULL TSRMLS_CC, error_type,
+ php_error_docref(NULL, error_type,
"%s: Unable to initialize module\n"
"Module compiled with build ID=%s\n"
"PHP compiled with build ID=%s\n"
@@ -239,19 +239,19 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
module_entry->module_number = zend_next_free_module();
module_entry->handle = handle;
- if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) {
+ if ((module_entry = zend_register_module_ex(module_entry)) == NULL) {
DL_UNLOAD(handle);
return FAILURE;
}
- if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+ if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry) == FAILURE) {
DL_UNLOAD(handle);
return FAILURE;
}
if ((type == MODULE_TEMPORARY || start_now) && module_entry->request_startup_func) {
- if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name);
+ if (module_entry->request_startup_func(type, module_entry->module_number) == FAILURE) {
+ php_error_docref(NULL, error_type, "Unable to initialize module '%s'", module_entry->name);
DL_UNLOAD(handle);
return FAILURE;
}
@@ -262,10 +262,10 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
/* {{{ php_dl
*/
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now)
{
/* Load extension */
- if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) {
+ if (php_load_extension(file, type, start_now) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -280,9 +280,9 @@ PHP_MINFO_FUNCTION(dl)
#else
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file);
+ php_error_docref(NULL, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file);
RETURN_FALSE;
}
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index 50ed19afc0..75fa0dd0f0 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -23,8 +23,8 @@
#ifndef DL_H
#define DL_H
-PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC);
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC);
+PHPAPI int php_load_extension(char *filename, int type, int start_now);
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now);
/* dynamic loading functions */
PHPAPI PHP_FUNCTION(dl);
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 37cad8bfc9..604e390ea3 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -135,7 +135,7 @@ PHP_FUNCTION(gethostname)
}
if (gethostname(buf, sizeof(buf) - 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno));
RETURN_FALSE;
}
@@ -156,7 +156,7 @@ PHP_FUNCTION(gethostbyaddr)
size_t addr_len;
zend_string *hostname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) {
return;
}
@@ -164,9 +164,9 @@ PHP_FUNCTION(gethostbyaddr)
if (hostname == NULL) {
#if HAVE_IPV6 && HAVE_INET_PTON
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not a valid IPv4 or IPv6 address");
+ php_error_docref(NULL, E_WARNING, "Address is not a valid IPv4 or IPv6 address");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not in a.b.c.d form");
+ php_error_docref(NULL, E_WARNING, "Address is not in a.b.c.d form");
#endif
RETVAL_FALSE;
} else {
@@ -217,7 +217,7 @@ PHP_FUNCTION(gethostbyname)
char *hostname;
size_t hostname_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) {
return;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(gethostbynamel)
struct in_addr in;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) {
return;
}
@@ -356,12 +356,12 @@ PHP_FUNCTION(dns_check_record)
struct __res_state *handle = &state;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
return;
}
if (hostname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Host cannot be empty");
RETURN_FALSE;
}
@@ -379,7 +379,7 @@ PHP_FUNCTION(dns_check_record)
else if (!strcasecmp("NAPTR", rectype)) type = DNS_T_NAPTR;
else if (!strcasecmp("A6", rectype)) type = DNS_T_A6;
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype);
+ php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype);
RETURN_FALSE;
}
}
@@ -772,7 +772,7 @@ PHP_FUNCTION(dns_get_record)
int type, first_query = 1, store_results = 1;
zend_bool raw = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
return;
}
@@ -788,12 +788,12 @@ PHP_FUNCTION(dns_get_record)
if (!raw) {
if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param);
+ php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param);
RETURN_FALSE;
}
} else {
if ((type_param < 1) || (type_param > 0xFFFF)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param);
RETURN_FALSE;
}
@@ -902,15 +902,15 @@ PHP_FUNCTION(dns_get_record)
continue;
case NO_RECOVERY:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unexpected server failure occurred.");
+ php_error_docref(NULL, E_WARNING, "An unexpected server failure occurred.");
break;
case TRY_AGAIN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A temporary server error occurred.");
+ php_error_docref(NULL, E_WARNING, "A temporary server error occurred.");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
+ php_error_docref(NULL, E_WARNING, "DNS Query failed");
}
zval_dtor(return_value);
RETURN_FALSE;
@@ -928,7 +928,7 @@ PHP_FUNCTION(dns_get_record)
while (qd-- > 0) {
n = dn_skipname(cp, end);
if (n < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse DNS data received");
+ php_error_docref(NULL, E_WARNING, "Unable to parse DNS data received");
zval_dtor(return_value);
php_dns_free_handle(handle);
RETURN_FALSE;
@@ -1000,7 +1000,7 @@ PHP_FUNCTION(dns_get_mx)
struct __res_state *handle = &state;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
return;
}
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index a0b917c5ca..fda264a3a8 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -50,7 +50,7 @@ PHP_FUNCTION(dns_get_mx) /* {{{ */
DNS_STATUS status; /* Return value of DnsQuery_A() function */
PDNS_RECORD pResult, pRec; /* Pointer to DNS_RECORD structure */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
return;
}
@@ -99,12 +99,12 @@ PHP_FUNCTION(dns_check_record)
DNS_STATUS status; /* Return value of DnsQuery_A() function */
PDNS_RECORD pResult; /* Pointer to DNS_RECORD structure */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
return;
}
if (hostname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Host cannot be empty");
RETURN_FALSE;
}
@@ -122,7 +122,7 @@ PHP_FUNCTION(dns_check_record)
else if (!strcasecmp("NAPTR", rectype)) type = DNS_TYPE_NAPTR;
else if (!strcasecmp("A6", rectype)) type = DNS_TYPE_A6;
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype);
+ php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype);
RETURN_FALSE;
}
}
@@ -352,7 +352,7 @@ PHP_FUNCTION(dns_get_record)
int type, type_to_fetch, first_query = 1, store_results = 1;
zend_bool raw = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
return;
}
@@ -368,12 +368,12 @@ PHP_FUNCTION(dns_get_record)
if (!raw) {
if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param);
+ php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param);
RETURN_FALSE;
}
} else {
if ((type_param < 1) || (type_param > 0xFFFF)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param);
RETURN_FALSE;
}
@@ -456,7 +456,7 @@ PHP_FUNCTION(dns_get_record)
if (status == DNS_INFO_NO_RECORDS || status == DNS_ERROR_RCODE_NAME_ERROR) {
continue;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
+ php_error_docref(NULL, E_WARNING, "DNS Query failed");
zval_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index ca6942a9c9..bd65d60656 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -57,7 +57,7 @@
* If type==3, output will be printed binary, no lines will be saved or returned (passthru)
*
*/
-PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)
+PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
{
FILE *fp;
char *buf;
@@ -80,7 +80,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
fp = VCWD_POPEN(cmd, "r");
#endif
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd);
+ php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd);
goto err;
}
@@ -110,8 +110,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
if (type == 1) {
PHPWRITE(buf, bufl);
- if (php_output_get_level(TSRMLS_C) < 1) {
- sapi_flush(TSRMLS_C);
+ if (php_output_get_level() < 1) {
+ sapi_flush();
}
} else if (type == 2) {
/* strip trailing whitespaces */
@@ -177,27 +177,27 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int ret;
if (mode) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
RETURN_FALSE;
}
}
if (!cmd_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute a blank command");
+ php_error_docref(NULL, E_WARNING, "Cannot execute a blank command");
RETURN_FALSE;
}
if (!ret_array) {
- ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC);
+ ret = php_exec(mode, cmd, NULL, return_value);
} else {
if (Z_TYPE_P(ret_array) != IS_ARRAY) {
zval_dtor(ret_array);
array_init(ret_array);
}
- ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC);
+ ret = php_exec(2, cmd, ret_array, return_value);
}
if (ret_code) {
zval_dtor(ret_code);
@@ -248,7 +248,6 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
char *p = NULL;
#endif
- TSRMLS_FETCH();
cmd = zend_string_alloc(2 * l, 0);
@@ -340,7 +339,6 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
zend_string *cmd;
size_t estimate = (4 * l) + 3;
- TSRMLS_FETCH();
cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */
@@ -404,7 +402,7 @@ PHP_FUNCTION(escapeshellcmd)
char *command;
size_t command_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -423,7 +421,7 @@ PHP_FUNCTION(escapeshellarg)
char *argument;
size_t argument_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument, &argument_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &argument, &argument_len) == FAILURE) {
return;
}
@@ -443,7 +441,7 @@ PHP_FUNCTION(shell_exec)
zend_string *ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -452,7 +450,7 @@ PHP_FUNCTION(shell_exec)
#else
if ((in=VCWD_POPEN(command, "r"))==NULL) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute '%s'", command);
+ php_error_docref(NULL, E_WARNING, "Unable to execute '%s'", command);
RETURN_FALSE;
}
@@ -473,14 +471,14 @@ PHP_FUNCTION(proc_nice)
{
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pri) == FAILURE) {
RETURN_FALSE;
}
errno = 0;
php_ignore_value(nice(pri));
if (errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a super user may attempt to increase the priority of a process");
+ php_error_docref(NULL, E_WARNING, "Only a super user may attempt to increase the priority of a process");
RETURN_FALSE;
}
diff --git a/ext/standard/exec.h b/ext/standard/exec.h
index 79b0574e28..a14efe3601 100644
--- a/ext/standard/exec.h
+++ b/ext/standard/exec.h
@@ -36,6 +36,6 @@ PHP_MINIT_FUNCTION(proc_open);
PHPAPI zend_string *php_escape_shell_cmd(char *);
PHPAPI zend_string *php_escape_shell_arg(char *);
-PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC);
+PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value);
#endif /* EXEC_H */
diff --git a/ext/standard/file.c b/ext/standard/file.c
index e7d870d719..f7c6e3acb9 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -138,7 +138,7 @@ php_file_globals file_globals;
/* sharing globals is *evil* */
static int le_stream_context = FAILURE;
-PHPAPI int php_le_stream_context(TSRMLS_D)
+PHPAPI int php_le_stream_context(void)
{
return le_stream_context;
}
@@ -156,7 +156,7 @@ static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
php_stream_context_free(context);
}
-static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
+static void file_globals_ctor(php_file_globals *file_globals_p)
{
FG(pclose_ret) = 0;
FG(pclose_wait) = 0;
@@ -165,7 +165,7 @@ static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
FG(wrapper_errors) = NULL;
}
-static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
+static void file_globals_dtor(php_file_globals *file_globals_p)
{
}
@@ -183,7 +183,7 @@ PHP_MINIT_FUNCTION(file)
#ifdef ZTS
ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
- file_globals_ctor(&file_globals TSRMLS_CC);
+ file_globals_ctor(&file_globals);
#endif
REGISTER_INI_ENTRIES();
@@ -327,7 +327,7 @@ PHP_MINIT_FUNCTION(file)
PHP_MSHUTDOWN_FUNCTION(file) /* {{{ */
{
#ifndef ZTS
- file_globals_dtor(&file_globals TSRMLS_CC);
+ file_globals_dtor(&file_globals);
#endif
return SUCCESS;
}
@@ -344,7 +344,7 @@ PHP_FUNCTION(flock)
php_stream *stream;
zend_long operation = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &res, &operation, &wouldblock) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z/", &res, &operation, &wouldblock) == FAILURE) {
return;
}
@@ -352,7 +352,7 @@ PHP_FUNCTION(flock)
act = operation & 3;
if (act < 1 || act > 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal operation argument");
+ php_error_docref(NULL, E_WARNING, "Illegal operation argument");
RETURN_FALSE;
}
@@ -393,7 +393,7 @@ PHP_FUNCTION(get_meta_tags)
memset(&md, 0, sizeof(md));
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -408,7 +408,7 @@ PHP_FUNCTION(get_meta_tags)
tok_last = TOK_EOF;
- while (!done && (tok = php_next_meta_token(&md TSRMLS_CC)) != TOK_EOF) {
+ while (!done && (tok = php_next_meta_token(&md)) != TOK_EOF) {
if (tok == TOK_ID) {
if (tok_last == TOK_OPENTAG) {
md.in_meta = !strcasecmp("meta", md.token_data);
@@ -533,12 +533,12 @@ PHP_FUNCTION(file_get_contents)
zend_string *contents;
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() == 5 && maxlen < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "length must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -552,13 +552,13 @@ PHP_FUNCTION(file_get_contents)
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset);
php_stream_close(stream);
RETURN_FALSE;
}
if (maxlen > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+ php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
maxlen = INT_MAX;
}
if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) {
@@ -587,7 +587,7 @@ PHP_FUNCTION(file_put_contents)
char mode[3] = "wb";
char ret_ok = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) {
return;
}
@@ -603,7 +603,7 @@ PHP_FUNCTION(file_put_contents)
/* check to make sure we are dealing with a regular file */
if (php_memnstr(filename, "://", sizeof("://") - 1, filename + filename_len)) {
if (strncasecmp(filename, "file://", sizeof("file://") - 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks may only be set for regular files");
+ php_error_docref(NULL, E_WARNING, "Exclusive locks may only be set for regular files");
RETURN_FALSE;
}
}
@@ -618,7 +618,7 @@ PHP_FUNCTION(file_put_contents)
if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
php_stream_close(stream);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks are not supported for this stream");
+ php_error_docref(NULL, E_WARNING, "Exclusive locks are not supported for this stream");
RETURN_FALSE;
}
@@ -633,7 +633,7 @@ PHP_FUNCTION(file_put_contents)
ret_ok = 0;
} else {
if (len > ZEND_LONG_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX);
+ php_error_docref(NULL, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX);
len = ZEND_LONG_MAX;
}
numbytes = len;
@@ -651,7 +651,7 @@ PHP_FUNCTION(file_put_contents)
if (Z_STRLEN_P(data)) {
numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data));
if (numbytes != Z_STRLEN_P(data)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
+ php_error_docref(NULL, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
numbytes = -1;
}
}
@@ -668,7 +668,7 @@ PHP_FUNCTION(file_put_contents)
numbytes += str->len;
bytes_written = php_stream_write(stream, str->val, str->len);
if (bytes_written != str->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename);
+ php_error_docref(NULL, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename);
ret_ok = 0;
zend_string_release(str);
break;
@@ -683,10 +683,10 @@ PHP_FUNCTION(file_put_contents)
if (Z_OBJ_HT_P(data) != NULL) {
zval out;
- if (zend_std_cast_object_tostring(data, &out, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (zend_std_cast_object_tostring(data, &out, IS_STRING) == SUCCESS) {
numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRLEN(out));
if (numbytes != Z_STRLEN(out)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out));
+ php_error_docref(NULL, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out));
numbytes = -1;
}
zval_dtor(&out);
@@ -728,11 +728,11 @@ PHP_FUNCTION(file)
zend_string *target_buf;
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
return;
}
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags);
+ php_error_docref(NULL, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags);
RETURN_FALSE;
}
@@ -754,7 +754,7 @@ PHP_FUNCTION(file)
s = target_buf->val;
e = target_buf->val + target_buf->len;
- if (!(p = (char*)php_stream_locate_eol(stream, target_buf TSRMLS_CC))) {
+ if (!(p = (char*)php_stream_locate_eol(stream, target_buf))) {
p = e;
goto parse_eol;
}
@@ -811,22 +811,22 @@ PHP_FUNCTION(tempnam)
int fd;
zend_string *p;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(dir TSRMLS_CC)) {
+ if (php_check_open_basedir(dir)) {
RETURN_FALSE;
}
- p = php_basename(prefix, prefix_len, NULL, 0 TSRMLS_CC);
+ p = php_basename(prefix, prefix_len, NULL, 0);
if (p->len > 64) {
p->val[63] = '\0';
}
RETVAL_FALSE;
- if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1 TSRMLS_CC)) >= 0) {
+ if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1)) >= 0) {
close(fd);
// TODO: avoid reallocation ???
RETVAL_STRING(opened_path);
@@ -867,7 +867,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
php_stream *stream;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -891,7 +891,7 @@ PHPAPI PHP_FUNCTION(fclose)
php_stream *stream;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
#else
@@ -903,7 +903,7 @@ PHPAPI PHP_FUNCTION(fclose)
PHP_STREAM_TO_ZVAL(stream, res);
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
RETURN_FALSE;
}
@@ -927,7 +927,7 @@ PHP_FUNCTION(popen)
php_stream *stream;
char *posix_mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
return;
}
@@ -943,7 +943,7 @@ PHP_FUNCTION(popen)
fp = VCWD_POPEN(command, posix_mode);
if (!fp) {
- php_error_docref2(NULL TSRMLS_CC, command, posix_mode, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, command, posix_mode, E_WARNING, "%s", strerror(errno));
efree(posix_mode);
RETURN_FALSE;
}
@@ -951,7 +951,7 @@ PHP_FUNCTION(popen)
stream = php_stream_fopen_from_pipe(fp, mode);
if (stream == NULL) {
- php_error_docref2(NULL TSRMLS_CC, command, mode, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, command, mode, E_WARNING, "%s", strerror(errno));
RETVAL_FALSE;
} else {
php_stream_to_zval(stream, return_value);
@@ -968,7 +968,7 @@ PHP_FUNCTION(pclose)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -988,7 +988,7 @@ PHPAPI PHP_FUNCTION(feof)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1013,7 +1013,7 @@ PHPAPI PHP_FUNCTION(fgets)
size_t line_len = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &len) == FAILURE) {
RETURN_FALSE;
}
@@ -1027,7 +1027,7 @@ PHPAPI PHP_FUNCTION(fgets)
}
} else if (argc > 1) {
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1067,7 +1067,7 @@ PHPAPI PHP_FUNCTION(fgetc)
int result;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1100,7 +1100,7 @@ PHPAPI PHP_FUNCTION(fgetss)
char *allowed_tags=NULL;
size_t allowed_tags_len=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lS", &fd, &bytes, &allowed) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|lS", &fd, &bytes, &allowed) == FAILURE) {
RETURN_FALSE;
}
@@ -1108,7 +1108,7 @@ PHPAPI PHP_FUNCTION(fgetss)
if (ZEND_NUM_ARGS() >= 2) {
if (bytes <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1161,11 +1161,11 @@ PHP_FUNCTION(fscanf)
size_t len;
void *what;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
return;
}
- what = zend_fetch_resource(file_handle TSRMLS_CC, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
+ what = zend_fetch_resource(file_handle, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
/* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up
* with a leak if we have an invalid filehandle. This needs changing
@@ -1179,7 +1179,7 @@ PHP_FUNCTION(fscanf)
RETURN_FALSE;
}
- result = php_sscanf_internal(buf, format, argc, args, 0, return_value TSRMLS_CC);
+ result = php_sscanf_internal(buf, format, argc, args, 0, return_value);
efree(buf);
@@ -1201,7 +1201,7 @@ PHPAPI PHP_FUNCTION(fwrite)
zend_long maxlen = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
RETURN_FALSE;
}
@@ -1233,7 +1233,7 @@ PHPAPI PHP_FUNCTION(fflush)
int ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1254,7 +1254,7 @@ PHPAPI PHP_FUNCTION(rewind)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1275,7 +1275,7 @@ PHPAPI PHP_FUNCTION(ftell)
zend_long ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1297,7 +1297,7 @@ PHPAPI PHP_FUNCTION(fseek)
zend_long offset, whence = SEEK_SET;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &res, &offset, &whence) == FAILURE) {
RETURN_FALSE;
}
@@ -1311,24 +1311,24 @@ PHPAPI PHP_FUNCTION(fseek)
*/
/* DEPRECATED APIs: Use php_stream_mkdir() instead */
-PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC)
+PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options)
{
int ret;
- if (php_check_open_basedir(dir TSRMLS_CC)) {
+ if (php_check_open_basedir(dir)) {
return -1;
}
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
return ret;
}
-PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC)
+PHPAPI int php_mkdir(const char *dir, zend_long mode)
{
- return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
+ return php_mkdir_ex(dir, mode, REPORT_ERRORS);
}
/* }}} */
@@ -1343,7 +1343,7 @@ PHP_FUNCTION(mkdir)
zend_bool recursive = 0;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1362,7 +1362,7 @@ PHP_FUNCTION(rmdir)
zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dir, &dir_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dir, &dir_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1384,7 +1384,7 @@ PHP_FUNCTION(readfile)
php_stream *stream;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(umask)
BG(umask) = oldumask;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mask) == FAILURE) {
RETURN_FALSE;
}
@@ -1436,7 +1436,7 @@ PHPAPI PHP_FUNCTION(fpassthru)
size_t size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1457,30 +1457,30 @@ PHP_FUNCTION(rename)
php_stream_wrapper *wrapper;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
- wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0);
if (!wrapper || !wrapper->wops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper");
+ php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper");
RETURN_FALSE;
}
if (!wrapper->wops->rename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source");
+ php_error_docref(NULL, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source");
RETURN_FALSE;
}
- if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot rename a file across wrapper types");
+ if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0)) {
+ php_error_docref(NULL, E_WARNING, "Cannot rename a file across wrapper types");
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context TSRMLS_CC));
+ RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context));
}
/* }}} */
@@ -1494,24 +1494,24 @@ PHP_FUNCTION(unlink)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if (!wrapper || !wrapper->wops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper");
+ php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper");
RETURN_FALSE;
}
if (!wrapper->wops->unlink) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper");
+ php_error_docref(NULL, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper");
RETURN_FALSE;
}
- RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context TSRMLS_CC));
+ RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context));
}
/* }}} */
@@ -1523,14 +1523,14 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
zend_long size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &fp, &size) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, fp);
if (!php_stream_truncate_supported(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!");
+ php_error_docref(NULL, E_WARNING, "Can't truncate this stream!");
RETURN_FALSE;
}
@@ -1552,7 +1552,7 @@ PHP_NAMED_FUNCTION(php_if_fstat)
"size", "atime", "mtime", "ctime", "blksize", "blocks"
};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fp) == FAILURE) {
RETURN_FALSE;
}
@@ -1642,17 +1642,17 @@ PHP_FUNCTION(copy)
zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
- if (php_check_open_basedir(source TSRMLS_CC)) {
+ if (php_check_open_basedir(source)) {
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- if (php_copy_file_ctx(source, target, 0, context TSRMLS_CC) == SUCCESS) {
+ if (php_copy_file_ctx(source, target, 0, context) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1662,23 +1662,23 @@ PHP_FUNCTION(copy)
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC)
+PHPAPI int php_copy_file(const char *src, const char *dest)
{
- return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
+ return php_copy_file_ctx(src, dest, 0, NULL);
}
/* }}} */
/* {{{ php_copy_file_ex
*/
-PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRMLS_DC)
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg)
{
- return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
+ return php_copy_file_ctx(src, dest, 0, NULL);
}
/* }}} */
/* {{{ php_copy_file_ctx
*/
-PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
@@ -1695,7 +1695,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php
return ret;
}
if (S_ISDIR(src_s.sb.st_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument to copy() function cannot be a directory");
+ php_error_docref(NULL, E_WARNING, "The first argument to copy() function cannot be a directory");
return FAILURE;
}
@@ -1710,7 +1710,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php
return ret;
}
if (S_ISDIR(dest_s.sb.st_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument to copy() function cannot be a directory");
+ php_error_docref(NULL, E_WARNING, "The second argument to copy() function cannot be a directory");
return FAILURE;
}
if (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
@@ -1726,10 +1726,10 @@ no_stat:
char *sp, *dp;
int res;
- if ((sp = expand_filepath(src, NULL TSRMLS_CC)) == NULL) {
+ if ((sp = expand_filepath(src, NULL)) == NULL) {
return ret;
}
- if ((dp = expand_filepath(dest, NULL TSRMLS_CC)) == NULL) {
+ if ((dp = expand_filepath(dest, NULL)) == NULL) {
efree(sp);
goto safe_to_copy;
}
@@ -1778,14 +1778,14 @@ PHPAPI PHP_FUNCTION(fread)
zend_long len;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &len) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, res);
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1797,7 +1797,7 @@ PHPAPI PHP_FUNCTION(fread)
}
/* }}} */
-static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter TSRMLS_DC) /* {{{ */
+static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter) /* {{{ */
{
int inc_len;
unsigned char last_chars[2] = { 0, 0 };
@@ -1850,7 +1850,7 @@ PHP_FUNCTION(fputcsv)
char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL;
size_t delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|sss",
&fp, &fields, &delimiter_str, &delimiter_str_len,
&enclosure_str, &enclosure_str_len,
&escape_str, &escape_str_len) == FAILURE) {
@@ -1860,10 +1860,10 @@ PHP_FUNCTION(fputcsv)
if (delimiter_str != NULL) {
/* Make sure that there is at least one character in string */
if (delimiter_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
} else if (delimiter_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
+ php_error_docref(NULL, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -1872,10 +1872,10 @@ PHP_FUNCTION(fputcsv)
if (enclosure_str != NULL) {
if (enclosure_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
} else if (enclosure_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
+ php_error_docref(NULL, E_NOTICE, "enclosure must be a single character");
}
/* use first character from string */
enclosure = *enclosure_str;
@@ -1883,10 +1883,10 @@ PHP_FUNCTION(fputcsv)
if (escape_str != NULL) {
if (escape_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
} else if (escape_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character");
+ php_error_docref(NULL, E_NOTICE, "escape must be a single character");
}
/* use first character from string */
escape_char = *escape_str;
@@ -1894,13 +1894,13 @@ PHP_FUNCTION(fputcsv)
PHP_STREAM_TO_ZVAL(stream, fp);
- ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char TSRMLS_CC);
+ ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char);
RETURN_LONG(ret);
}
/* }}} */
-/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */
-PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
+/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char) */
+PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char)
{
int count, i = 0;
size_t ret;
@@ -1982,7 +1982,7 @@ PHP_FUNCTION(fgetcsv)
char *escape_str = NULL;
size_t escape_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zsss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zsss",
&fd, &len_zv, &delimiter_str, &delimiter_str_len,
&enclosure_str, &enclosure_str_len,
&escape_str, &escape_str_len) == FAILURE
@@ -1993,10 +1993,10 @@ PHP_FUNCTION(fgetcsv)
if (delimiter_str != NULL) {
/* Make sure that there is at least one character in string */
if (delimiter_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
} else if (delimiter_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
+ php_error_docref(NULL, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -2005,10 +2005,10 @@ PHP_FUNCTION(fgetcsv)
if (enclosure_str != NULL) {
if (enclosure_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
} else if (enclosure_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
+ php_error_docref(NULL, E_NOTICE, "enclosure must be a single character");
}
/* use first character from string */
@@ -2017,10 +2017,10 @@ PHP_FUNCTION(fgetcsv)
if (escape_str != NULL) {
if (escape_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be character");
+ php_error_docref(NULL, E_WARNING, "escape must be character");
RETURN_FALSE;
} else if (escape_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character");
+ php_error_docref(NULL, E_NOTICE, "escape must be a single character");
}
escape = escape_str[0];
@@ -2029,7 +2029,7 @@ PHP_FUNCTION(fgetcsv)
if (len_zv != NULL && Z_TYPE_P(len_zv) != IS_NULL) {
len = zval_get_long(len_zv);
if (len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative");
+ php_error_docref(NULL, E_WARNING, "Length parameter may not be negative");
RETURN_FALSE;
} else if (len == 0) {
len = -1;
@@ -2053,11 +2053,11 @@ PHP_FUNCTION(fgetcsv)
}
}
- php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value TSRMLS_CC);
+ php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value);
}
/* }}} */
-PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC) /* {{{ */
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value) /* {{{ */
{
char *temp, *tptr, *bptr, *line_end, *limit;
size_t temp_len, line_end_len;
@@ -2072,7 +2072,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
/* Strip trailing space from buf, saving end of line in case required for enclosure field */
bptr = buf;
- tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC);
+ tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter);
line_end_len = buf_len - (size_t)(tptr - buf);
line_end = limit = tptr;
@@ -2170,7 +2170,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
bptr = buf = new_buf;
hunk_begin = buf;
- line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC);
+ line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter);
line_end_len = buf_len - (size_t)(limit - buf);
state = 0;
@@ -2296,7 +2296,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
memcpy(tptr, hunk_begin, bptr - hunk_begin);
tptr += (bptr - hunk_begin);
- comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter TSRMLS_CC);
+ comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter);
if (*bptr == delimiter) {
bptr++;
}
@@ -2325,7 +2325,7 @@ PHP_FUNCTION(realpath)
char resolved_path_buff[MAXPATHLEN];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
#else
@@ -2335,7 +2335,7 @@ PHP_FUNCTION(realpath)
#endif
if (VCWD_REALPATH(filename, resolved_path_buff)) {
- if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) {
+ if (php_check_open_basedir(resolved_path_buff)) {
RETURN_FALSE;
}
@@ -2357,7 +2357,7 @@ PHP_FUNCTION(realpath)
/* {{{ php_next_meta_token
Tokenizes an HTML file for get_meta_tags */
-php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
+php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
{
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
@@ -2468,16 +2468,16 @@ PHP_FUNCTION(fnmatch)
size_t pattern_len, filename_len;
zend_long flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
if (filename_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
@@ -2493,7 +2493,7 @@ PHP_FUNCTION(sys_get_temp_dir)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- RETURN_STRING((char *)php_get_temporary_directory(TSRMLS_C));
+ RETURN_STRING((char *)php_get_temporary_directory());
}
/* }}} */
diff --git a/ext/standard/file.h b/ext/standard/file.h
index ec60b86e99..17c82424fc 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -74,15 +74,15 @@ PHP_FUNCTION(sys_get_temp_dir);
PHP_MINIT_FUNCTION(user_streams);
-PHPAPI int php_le_stream_context(TSRMLS_D);
-PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC);
-PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC);
-PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk TSRMLS_DC);
-PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC);
-PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC);
-PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC);
-PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
-PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC);
+PHPAPI int php_le_stream_context(void);
+PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block);
+PHPAPI int php_copy_file(const char *src, const char *dest);
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk);
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx);
+PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options);
+PHPAPI int php_mkdir(const char *dir, zend_long mode);
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value);
+PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char);
#define META_DEF_BUFSIZE 8192
@@ -114,7 +114,7 @@ typedef struct _php_meta_tags_data {
int in_meta;
} php_meta_tags_data;
-php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC);
+php_meta_tags_token php_next_meta_token(php_meta_tags_data *);
typedef struct {
int pclose_ret;
@@ -132,7 +132,7 @@ typedef struct {
} php_file_globals;
#ifdef ZTS
-#define FG(v) TSRMG(file_globals_id, php_file_globals *, v)
+#define FG(v) ZEND_TSRMG(file_globals_id, php_file_globals *, v)
extern PHPAPI int file_globals_id;
#else
#define FG(v) (file_globals.v)
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 80d4ca4388..40cebcf7c5 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -119,7 +119,7 @@ PHP_RSHUTDOWN_FUNCTION(filestat) /* {{{ */
}
/* }}} */
-static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
+static int php_disk_total_space(char *path, double *space) /* {{{ */
#if defined(WINDOWS) /* {{{ */
{
double bytestotal = 0;
@@ -152,7 +152,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
&TotalNumberOfFreeBytes) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
@@ -164,13 +164,13 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
if (GetDiskFreeSpace(path,
&SectorsPerCluster, &BytesPerSector,
&NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
bytestotal = (double)TotalNumberOfClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll");
return FAILURE;
}
@@ -203,7 +203,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
if (buf.f_frsize) {
@@ -214,7 +214,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
@@ -235,22 +235,22 @@ PHP_FUNCTION(disk_total_space)
char *path;
size_t path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(path TSRMLS_CC)) {
+ if (php_check_open_basedir(path)) {
RETURN_FALSE;
}
- if (php_disk_total_space(path, &bytestotal TSRMLS_CC) == SUCCESS) {
+ if (php_disk_total_space(path, &bytestotal) == SUCCESS) {
RETURN_DOUBLE(bytestotal);
}
RETURN_FALSE;
}
/* }}} */
-static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
+static int php_disk_free_space(char *path, double *space) /* {{{ */
#if defined(WINDOWS) /* {{{ */
{
double bytesfree = 0;
@@ -284,7 +284,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
&TotalNumberOfFreeBytes) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
@@ -296,13 +296,13 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
if (GetDiskFreeSpace(path,
&SectorsPerCluster, &BytesPerSector,
&NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
bytesfree = (double)NumberOfFreeClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll");
return FAILURE;
}
@@ -335,7 +335,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
if (buf.f_frsize) {
@@ -345,7 +345,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
#ifdef NETWARE
@@ -370,15 +370,15 @@ PHP_FUNCTION(disk_free_space)
char *path;
size_t path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(path TSRMLS_CC)) {
+ if (php_check_open_basedir(path)) {
RETURN_FALSE;
}
- if (php_disk_free_space(path, &bytesfree TSRMLS_CC) == SUCCESS) {
+ if (php_disk_free_space(path, &bytesfree) == SUCCESS) {
RETURN_DOUBLE(bytesfree);
}
RETURN_FALSE;
@@ -386,7 +386,7 @@ PHP_FUNCTION(disk_free_space)
/* }}} */
#if !defined(WINDOWS) && !defined(NETWARE)
-PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC)
+PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid)
{
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
struct group gr;
@@ -428,11 +428,11 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
#endif
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &group) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &group) == FAILURE) {
RETURN_FALSE;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
int option;
@@ -444,10 +444,10 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
option = PHP_STREAM_META_GROUP_NAME;
value = Z_STRVAL_P(group);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
RETURN_FALSE;
}
- if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -455,7 +455,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
} else {
#if !defined(WINDOWS)
/* On Windows, we expect regular chgrp to fail silently by default */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chgrp() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chgrp() for a non-standard stream");
#endif
RETURN_FALSE;
}
@@ -468,17 +468,17 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
if (Z_TYPE_P(group) == IS_LONG) {
gid = (gid_t)Z_LVAL_P(group);
} else if (Z_TYPE_P(group) == IS_STRING) {
- if(php_get_gid_by_name(Z_STRVAL_P(group), &gid TSRMLS_CC) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group));
+ if(php_get_gid_by_name(Z_STRVAL_P(group), &gid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group));
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
RETURN_FALSE;
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -490,7 +490,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
ret = VCWD_CHOWN(filename, -1, gid);
}
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -523,7 +523,7 @@ PHP_FUNCTION(lchgrp)
#endif /* !NETWARE */
#if !defined(WINDOWS) && !defined(NETWARE)
-PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC)
+PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid)
{
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
struct passwd pw;
@@ -565,11 +565,11 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
#endif
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &user) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &user) == FAILURE) {
return;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
int option;
@@ -581,10 +581,10 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
option = PHP_STREAM_META_OWNER_NAME;
value = Z_STRVAL_P(user);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
RETURN_FALSE;
}
- if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -592,7 +592,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
} else {
#if !defined(WINDOWS)
/* On Windows, we expect regular chown to fail silently by default */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chown() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chown() for a non-standard stream");
#endif
RETURN_FALSE;
}
@@ -606,17 +606,17 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
if (Z_TYPE_P(user) == IS_LONG) {
uid = (uid_t)Z_LVAL_P(user);
} else if (Z_TYPE_P(user) == IS_STRING) {
- if(php_get_uid_by_name(Z_STRVAL_P(user), &uid TSRMLS_CC) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user));
+ if(php_get_uid_by_name(Z_STRVAL_P(user), &uid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user));
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
RETURN_FALSE;
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -628,7 +628,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
ret = VCWD_CHOWN(filename, uid, -1);
}
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -673,26 +673,26 @@ PHP_FUNCTION(chmod)
mode_t imode;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &filename, &filename_len, &mode) == FAILURE) {
return;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
- if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chmod() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chmod() for a non-standard stream");
RETURN_FALSE;
}
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -700,7 +700,7 @@ PHP_FUNCTION(chmod)
ret = VCWD_CHMOD(filename, imode);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -721,7 +721,7 @@ PHP_FUNCTION(touch)
struct utimbuf *newtime = &newtimebuf;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(argc TSRMLS_CC, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
+ if (zend_parse_parameters(argc, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
return;
}
@@ -749,10 +749,10 @@ PHP_FUNCTION(touch)
WRONG_PARAM_COUNT;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
- if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -760,7 +760,7 @@ PHP_FUNCTION(touch)
} else {
php_stream *stream;
if(argc > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call touch() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call touch() for a non-standard stream");
RETURN_FALSE;
}
stream = php_stream_open_wrapper_ex(filename, "c", REPORT_ERRORS, NULL, NULL);
@@ -774,7 +774,7 @@ PHP_FUNCTION(touch)
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -782,7 +782,7 @@ PHP_FUNCTION(touch)
if (VCWD_ACCESS(filename, F_OK) != 0) {
file = VCWD_FOPEN(filename, "w");
if (file == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno));
RETURN_FALSE;
}
fclose(file);
@@ -790,7 +790,7 @@ PHP_FUNCTION(touch)
ret = VCWD_UTIME(filename, newtime);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Utime failed: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Utime failed: %s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -800,7 +800,7 @@ PHP_FUNCTION(touch)
/* {{{ php_clear_stat_cache()
*/
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC)
+PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len)
{
/* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL
* as it may contain outdated data (e.g. "nlink" for a directory when deleting a file
@@ -815,9 +815,9 @@ PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *fil
}
if (clear_realpath_cache) {
if (filename != NULL) {
- realpath_cache_del(filename, filename_len TSRMLS_CC);
+ realpath_cache_del(filename, filename_len);
} else {
- realpath_cache_clean(TSRMLS_C);
+ realpath_cache_clean();
}
}
}
@@ -831,11 +831,11 @@ PHP_FUNCTION(clearstatcache)
char *filename = NULL;
size_t filename_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
return;
}
- php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len TSRMLS_CC);
+ php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len);
}
/* }}} */
@@ -846,7 +846,7 @@ PHP_FUNCTION(clearstatcache)
/* {{{ php_stat
*/
-PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC)
+PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
@@ -864,7 +864,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
RETURN_FALSE;
}
- if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC)) == &php_plain_files_wrapper && php_check_open_basedir(local TSRMLS_CC)) {
+ if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0)) == &php_plain_files_wrapper && php_check_open_basedir(local)) {
RETURN_FALSE;
}
@@ -906,7 +906,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) {
/* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
+ php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
RETURN_FALSE;
}
@@ -991,7 +991,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
case S_IFSOCK: RETURN_STRING("socket");
#endif
}
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT);
+ php_error_docref(NULL, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT);
RETURN_STRING("unknown");
case FS_IS_W:
RETURN_BOOL((ssb.sb.st_mode & wmask) != 0);
@@ -1081,7 +1081,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call");
+ php_error_docref(NULL, E_WARNING, "Didn't understand stat call");
RETURN_FALSE;
}
/* }}} */
@@ -1094,11 +1094,11 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
size_t filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
- php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \
+ php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
}
#else
# define FileFunction(name, funcnum) \
@@ -1110,7 +1110,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
Z_PARAM_PATH(filename, filename_len) \
ZEND_PARSE_PARAMETERS_END(); \
\
- php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \
+ php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
}
#endif
/* }}} */
@@ -1212,14 +1212,14 @@ PHP_FUNCTION(realpath_cache_size)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- RETURN_LONG(realpath_cache_size(TSRMLS_C));
+ RETURN_LONG(realpath_cache_size());
}
/* {{{ proto bool realpath_cache_get()
Get current size of realpath cache */
PHP_FUNCTION(realpath_cache_get)
{
- realpath_cache_bucket **buckets = realpath_cache_get_buckets(TSRMLS_C), **end = buckets + realpath_cache_max_buckets(TSRMLS_C);
+ realpath_cache_bucket **buckets = realpath_cache_get_buckets(), **end = buckets + realpath_cache_max_buckets();
if (zend_parse_parameters_none() == FAILURE) {
return;
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 3fd27afa43..912d2b1394 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -40,18 +40,18 @@ static php_stream_filter_status_t strfilter_rot13_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket;
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, rot13_from, rot13_to, 52);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -67,7 +67,7 @@ static php_stream_filter_ops strfilter_rot13_ops = {
"string.rot13"
};
-static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_rot13_ops, NULL, persistent);
}
@@ -88,18 +88,18 @@ static php_stream_filter_status_t strfilter_toupper_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket;
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, lowercase, uppercase, 26);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -116,18 +116,18 @@ static php_stream_filter_status_t strfilter_tolower_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket;
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, uppercase, lowercase, 26);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -149,12 +149,12 @@ static php_stream_filter_ops strfilter_tolower_ops = {
"string.tolower"
};
-static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_toupper_ops, NULL, persistent);
}
-static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_tolower_ops, NULL, persistent);
}
@@ -207,19 +207,19 @@ static php_stream_filter_status_t strfilter_strip_tags_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket;
size_t consumed = 0;
php_strip_tags_filter *inst = (php_strip_tags_filter *) Z_PTR(thisfilter->abstract);
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
consumed = bucket->buflen;
bucket->buflen = php_strip_tags(bucket->buf, bucket->buflen, &(inst->state), (char *)inst->allowed_tags, inst->allowed_tags_len);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -229,7 +229,7 @@ static php_stream_filter_status_t strfilter_strip_tags_filter(
return PSFS_PASS_ON;
}
-static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter)
{
assert(Z_PTR(thisfilter->abstract) != NULL);
@@ -244,7 +244,7 @@ static php_stream_filter_ops strfilter_strip_tags_ops = {
"string.strip_tags"
};
-static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent)
{
php_strip_tags_filter *inst;
smart_str tags_ss = {0};
@@ -1209,7 +1209,7 @@ typedef struct _php_convert_filter {
#define PHP_CONV_QPRINT_ENCODE 3
#define PHP_CONV_QPRINT_DECODE 4
-static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent TSRMLS_DC)
+static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent)
{
zval *tmpval;
@@ -1334,7 +1334,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval,
}
#define GET_STR_PROP(ht, var, var_len, fldname, persistent) \
- php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent TSRMLS_CC)
+ php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent)
#define GET_INT_PROP(ht, var, fldname) \
php_conv_get_int_prop_ex(ht, &var, fldname, sizeof(fldname))
@@ -1345,7 +1345,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval,
#define GET_BOOL_PROP(ht, var, fldname) \
php_conv_get_bool_prop_ex(ht, &var, fldname, sizeof(fldname))
-static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent TSRMLS_DC)
+static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent)
{
/* FIXME: I'll have to replace this ugly code by something neat
(factories?) in the near future. */
@@ -1481,13 +1481,13 @@ out_failure:
static int php_convert_filter_ctor(php_convert_filter *inst,
int conv_mode, HashTable *conv_opts,
- const char *filtername, int persistent TSRMLS_DC)
+ const char *filtername, int persistent)
{
inst->persistent = persistent;
inst->filtername = pestrdup(filtername, persistent);
inst->stub_len = 0;
- if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent TSRMLS_CC)) == NULL) {
+ if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == NULL) {
goto out_failure;
}
@@ -1522,7 +1522,7 @@ static int strfilter_convert_append_bucket(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
const char *ps, size_t buf_len, size_t *consumed,
- int persistent TSRMLS_DC)
+ int persistent)
{
php_conv_err_t err;
php_stream_bucket *new_bucket;
@@ -1557,14 +1557,14 @@ static int strfilter_convert_append_bucket(
switch (err) {
case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_MORE:
if (ps != NULL) {
if (icnt > 0) {
if (inst->stub_len >= sizeof(inst->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
goto out_failure;
}
inst->stub[inst->stub_len++] = *(ps++);
@@ -1579,7 +1579,7 @@ static int strfilter_convert_append_bucket(
break;
case PHP_CONV_ERR_UNEXPECTED_EOS:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_TOO_BIG: {
@@ -1590,11 +1590,11 @@ static int strfilter_convert_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -1603,11 +1603,11 @@ static int strfilter_convert_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
@@ -1619,7 +1619,7 @@ static int strfilter_convert_append_bucket(
} break;
case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
goto out_failure;
default:
@@ -1635,13 +1635,13 @@ static int strfilter_convert_append_bucket(
php_conv_convert(inst->cd, &ps, &icnt, &pd, &ocnt)));
switch (err) {
case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_MORE:
if (ps != NULL) {
if (icnt > sizeof(inst->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
goto out_failure;
}
memcpy(inst->stub, ps, icnt);
@@ -1649,7 +1649,7 @@ static int strfilter_convert_append_bucket(
ps += icnt;
icnt = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername);
goto out_failure;
}
break;
@@ -1662,11 +1662,11 @@ static int strfilter_convert_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -1675,11 +1675,11 @@ static int strfilter_convert_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -1690,7 +1690,7 @@ static int strfilter_convert_append_bucket(
} break;
case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
goto out_failure;
default:
@@ -1702,10 +1702,10 @@ static int strfilter_convert_append_bucket(
}
if (out_buf_size > ocnt) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
} else {
pefree(out_buf, persistent);
}
@@ -1726,7 +1726,7 @@ static php_stream_filter_status_t strfilter_convert_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket = NULL;
size_t consumed = 0;
@@ -1735,21 +1735,21 @@ static php_stream_filter_status_t strfilter_convert_filter(
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (strfilter_convert_append_bucket(inst, stream, thisfilter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags != PSFS_FLAG_NORMAL) {
if (strfilter_convert_append_bucket(inst, stream, thisfilter,
buckets_out, NULL, 0, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
}
@@ -1762,12 +1762,12 @@ static php_stream_filter_status_t strfilter_convert_filter(
out_failure:
if (bucket != NULL) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
return PSFS_ERR_FATAL;
}
-static void strfilter_convert_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void strfilter_convert_dtor(php_stream_filter *thisfilter)
{
assert(Z_PTR(thisfilter->abstract) != NULL);
@@ -1781,7 +1781,7 @@ static php_stream_filter_ops strfilter_convert_ops = {
"convert.*"
};
-static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent)
{
php_convert_filter *inst;
php_stream_filter *retval = NULL;
@@ -1790,7 +1790,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval
int conv_mode = 0;
if (filterparams != NULL && Z_TYPE_P(filterparams) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid filter parameter", filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid filter parameter", filtername);
return NULL;
}
@@ -1813,7 +1813,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval
if (php_convert_filter_ctor(inst, conv_mode,
(filterparams != NULL ? Z_ARRVAL_P(filterparams) : NULL),
- filtername, persistent TSRMLS_CC) != SUCCESS) {
+ filtername, persistent) != SUCCESS) {
goto out;
}
@@ -1845,7 +1845,7 @@ static php_stream_filter_status_t consumed_filter_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_consumed_filter_data *data = (php_consumed_filter_data *)Z_PTR(thisfilter->abstract);
php_stream_bucket *bucket;
@@ -1855,9 +1855,9 @@ static php_stream_filter_status_t consumed_filter_filter(
data->offset = php_stream_tell(stream);
}
while ((bucket = buckets_in->head) != NULL) {
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
*bytes_consumed = consumed;
@@ -1870,7 +1870,7 @@ static php_stream_filter_status_t consumed_filter_filter(
return PSFS_PASS_ON;
}
-static void consumed_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void consumed_filter_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_consumed_filter_data *data = (php_consumed_filter_data*)Z_PTR(thisfilter->abstract);
@@ -1884,7 +1884,7 @@ static php_stream_filter_ops consumed_filter_ops = {
"consumed"
};
-static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_consumed_filter_data *data;
@@ -1896,7 +1896,7 @@ static php_stream_filter *consumed_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_consumed_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data));
return NULL;
}
data->persistent = persistent;
@@ -2058,17 +2058,17 @@ static php_stream_filter_status_t php_chunked_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_stream_bucket *bucket;
size_t consumed = 0;
php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract);
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
consumed += bucket->buflen;
bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -2078,7 +2078,7 @@ static php_stream_filter_status_t php_chunked_filter(
return PSFS_PASS_ON;
}
-static void php_chunked_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_chunked_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract);
@@ -2092,7 +2092,7 @@ static php_stream_filter_ops chunked_filter_ops = {
"dechunk"
};
-static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_chunked_filter_data *data;
@@ -2104,7 +2104,7 @@ static php_stream_filter *chunked_filter_create(const char *filtername, zval *fi
/* Create this filter */
data = (php_chunked_filter_data *)pecalloc(1, sizeof(php_chunked_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data));
return NULL;
}
data->state = CHUNK_SIZE_START;
@@ -2144,7 +2144,7 @@ PHP_MINIT_FUNCTION(standard_filters)
if (FAILURE == php_stream_filter_register_factory(
standard_filters[i].ops->label,
standard_filters[i].factory
- TSRMLS_CC)) {
+ )) {
return FAILURE;
}
}
@@ -2156,7 +2156,7 @@ PHP_MSHUTDOWN_FUNCTION(standard_filters)
int i;
for (i = 0; standard_filters[i].ops; i++) {
- php_stream_filter_unregister_factory(standard_filters[i].ops->label TSRMLS_CC);
+ php_stream_filter_unregister_factory(standard_filters[i].ops->label);
}
return SUCCESS;
}
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 1c3abb4d50..26a2276fea 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -57,10 +57,10 @@ static char HEXCHARS[] = "0123456789ABCDEF";
/* php_spintf_appendchar() {{{ */
inline static void
-php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add TSRMLS_DC)
+php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add)
{
if (!*buffer || (*pos + 1) >= (*buffer)->len) {
- PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), (*buffer)->len));
+ PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(), (*buffer)->len));
*buffer = zend_string_realloc(*buffer, (*buffer)->len << 1, 0);
}
PRINTF_DEBUG(("sprintf: appending '%c', pos=\n", add, *pos));
@@ -209,7 +209,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos,
size_t alignment, int precision,
int adjust, char fmt,
int always_sign
- TSRMLS_DC)
+ )
{
char num_buf[NUM_BUF_SIZE];
char *s = NULL;
@@ -228,7 +228,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos,
if ((adjust & ADJ_PRECISION) == 0) {
precision = FLOAT_PRECISION;
} else if (precision > MAX_FLOAT_PRECISION) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION);
+ php_error_docref(NULL, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION);
precision = MAX_FLOAT_PRECISION;
}
@@ -383,7 +383,7 @@ php_sprintf_getnumber(char *buffer, size_t *pos)
*
*/
static zend_string *
-php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
+php_formatted_print(int param_count, int use_array, int format_offset)
{
zval *newargs = NULL;
zval *args, *z_format;
@@ -395,7 +395,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
int always_sign;
size_t format_len;
- if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(param_count, "+", &args, &argc) == FAILURE) {
return NULL;
}
@@ -443,9 +443,9 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));
PRINTF_DEBUG(("sprintf: outpos=%d\n", outpos));
if (format[inpos] != '%') {
- php_sprintf_appendchar(&result, &outpos, format[inpos++] TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, format[inpos++]);
} else if (format[inpos + 1] == '%') {
- php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, '%');
inpos += 2;
} else {
/* starting a new format specifier, reset variables */
@@ -469,7 +469,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument number must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Argument number must be greater than zero");
return NULL;
}
@@ -512,7 +512,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
if (newargs) {
efree(newargs);
}
@@ -534,7 +534,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
if (newargs) {
efree(newargs);
}
@@ -559,7 +559,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments");
+ php_error_docref(NULL, E_WARNING, "Too few arguments");
return NULL;
}
@@ -606,12 +606,12 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
width, padding, alignment,
precision, adjusting,
format[inpos], always_sign
- TSRMLS_CC);
+ );
break;
case 'c':
php_sprintf_appendchar(&result, &outpos,
- (char) zval_get_long(tmp) TSRMLS_CC);
+ (char) zval_get_long(tmp));
break;
case 'o':
@@ -643,7 +643,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
break;
case '%':
- php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, '%');
break;
default:
@@ -670,7 +670,7 @@ PHP_FUNCTION(user_sprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -683,7 +683,7 @@ PHP_FUNCTION(vsprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -697,7 +697,7 @@ PHP_FUNCTION(user_printf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -713,7 +713,7 @@ PHP_FUNCTION(vprintf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -734,13 +734,13 @@ PHP_FUNCTION(fprintf)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(1, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1))==NULL) {
RETURN_FALSE;
}
@@ -763,13 +763,13 @@ PHP_FUNCTION(vfprintf)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(1, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1))==NULL) {
RETURN_FALSE;
}
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 30a6fda5d6..df7ceae079 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -51,7 +51,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) {
RETURN_FALSE;
}
@@ -92,7 +92,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(hostname);
}
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val);
}
if (hashkey) {
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 536fccaa3e..e74fd6b65e 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -35,27 +35,27 @@ PHP_FUNCTION(ftok)
size_t pathname_len, proj_len;
key_t k;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
return;
}
if (pathname_len == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid");
+ php_error_docref(NULL, E_WARNING, "Pathname is invalid");
RETURN_LONG(-1);
}
if (proj_len != 1){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid");
+ php_error_docref(NULL, E_WARNING, "Project identifier is invalid");
RETURN_LONG(-1);
}
- if (php_check_open_basedir(pathname TSRMLS_CC)) {
+ if (php_check_open_basedir(pathname)) {
RETURN_LONG(-1);
}
k = ftok(pathname, proj[0]);
if (k == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftok() failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "ftok() failed - %s", strerror(errno));
}
RETURN_LONG(k);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 526a45b470..361019382e 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -70,7 +70,7 @@
#include "php_fopen_wrappers.h"
#define FTPS_ENCRYPT_DATA 1
-#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)
+#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line))
typedef struct _php_ftp_dirstream_data {
php_stream *datastream;
@@ -80,7 +80,7 @@ typedef struct _php_ftp_dirstream_data {
/* {{{ get_ftp_result
*/
-static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC)
+static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size)
{
while (php_stream_gets(stream, buffer, buffer_size-1) &&
!(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) &&
@@ -91,7 +91,7 @@ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer
/* {{{ php_stream_ftp_stream_stat
*/
-static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb)
{
/* For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
@@ -101,7 +101,7 @@ static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *s
/* {{{ php_stream_ftp_stream_close
*/
-static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC)
+static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream)
{
php_stream *controlstream = stream->wrapperthis;
int ret = 0;
@@ -114,7 +114,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *
/* For write modes close data stream first to signal EOF to server */
result = GET_FTP_RESULT(controlstream);
if (result != 226 && result != 250) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "FTP server error %d:%s", result, tmp_line);
+ php_error_docref(NULL, E_WARNING, "FTP server error %d:%s", result, tmp_line);
ret = EOF;
}
}
@@ -132,7 +132,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *
*/
static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
char **opened_path, php_stream_context *context, php_stream **preuseid,
- php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC)
+ php_url **presource, int *puse_ssl, int *puse_ssl_on_data)
{
php_stream *stream = NULL, *reuseid = NULL;
php_url *resource = NULL;
@@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
goto connect_errexit;
}
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
/* Start talking to ftp server */
@@ -203,9 +203,9 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
if (use_ssl) {
if (php_stream_xport_crypto_setup(stream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0
- || php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0
+ || php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(stream);
stream = NULL;
goto connect_errexit;
@@ -236,7 +236,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
unsigned char *s = val, *e = s + val_len; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, err_msg, val); \
+ php_stream_wrapper_log_error(wrapper, options, err_msg, val); \
goto connect_errexit; \
} \
s++; \
@@ -249,7 +249,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s")
- php_stream_printf(stream TSRMLS_CC, "USER %s\r\n", resource->user);
+ php_stream_printf(stream, "USER %s\r\n", resource->user);
} else {
php_stream_write_string(stream, "USER anonymous\r\n");
}
@@ -266,12 +266,12 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s")
- php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", resource->pass);
+ php_stream_printf(stream, "PASS %s\r\n", resource->pass);
} else {
/* if the user has configured who they are,
send that as the password */
if (FG(from_address)) {
- php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address));
+ php_stream_printf(stream, "PASS %s\r\n", FG(from_address));
} else {
php_stream_write_string(stream, "PASS anonymous\r\n");
}
@@ -320,7 +320,7 @@ connect_errexit:
/* {{{ php_fopen_do_pasv
*/
-static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart TSRMLS_DC)
+static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart)
{
char tmp_line[512];
int result, i;
@@ -412,7 +412,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_
/* {{{ php_fopen_url_wrap_ftp
*/
php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL, *datastream = NULL;
php_url *resource = NULL;
@@ -436,7 +436,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
if (strpbrk(mode, "wa+")) {
if (read_write) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP does not support simultaneous read/write connections");
+ php_stream_wrapper_log_error(wrapper, options, "FTP does not support simultaneous read/write connections");
return NULL;
}
if (strchr(mode, 'a')) {
@@ -447,7 +447,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
if (!read_write) {
/* No mode specified? */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unknown file open mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unknown file open mode");
return NULL;
}
@@ -455,15 +455,15 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
(tmpzval = php_stream_context_get_option(context, "ftp", "proxy")) != NULL) {
if (read_write == 1) {
/* Use http wrapper to proxy ftp request */
- return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC);
+ return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC);
} else {
/* ftp proxy is read-only */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP proxy may only be used in read mode");
+ php_stream_wrapper_log_error(wrapper, options, "FTP proxy may only be used in read mode");
return NULL;
}
}
- stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data);
if (!stream) {
goto errexit;
}
@@ -475,7 +475,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
/* find out the size of the file (verifying it exists) */
- php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path);
+ php_stream_printf(stream, "SIZE %s\r\n", resource->path);
/* read the response */
result = GET_FTP_RESULT(stream);
@@ -504,13 +504,13 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
if (allow_overwrite) {
/* Context permits overwriting file,
so we just delete whatever's there in preparation */
- php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path);
+ php_stream_printf(stream, "DELE %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result >= 300 || result <= 199) {
goto errexit;
}
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Remote file already exists and overwrite context option not specified");
+ php_stream_wrapper_log_error(wrapper, options, "Remote file already exists and overwrite context option not specified");
errno = EEXIST;
goto errexit;
}
@@ -518,7 +518,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
/* set up the passive connection */
- portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC);
+ portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart);
if (!portno) {
goto errexit;
@@ -531,10 +531,10 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
(tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL &&
Z_TYPE_P(tmpzval) == IS_LONG &&
Z_LVAL_P(tmpzval) > 0) {
- php_stream_printf(stream TSRMLS_CC, "REST %pd\r\n", Z_LVAL_P(tmpzval));
+ php_stream_printf(stream, "REST %pd\r\n", Z_LVAL_P(tmpzval));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval));
+ php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval));
goto errexit;
}
}
@@ -548,7 +548,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
/* Append */
memcpy(tmp_line, "APPE", sizeof("APPE"));
}
- php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
@@ -571,14 +571,14 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
}
- php_stream_context_set(datastream, context TSRMLS_CC);
+ php_stream_context_set(datastream, context);
php_stream_notify_progress_init(context, 0, file_size);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) {
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(datastream, 1) < 0)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(datastream);
datastream = NULL;
goto errexit;
@@ -599,14 +599,14 @@ errexit:
php_stream_close(stream);
}
if (tmp_line[0] != '\0')
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line);
return NULL;
}
/* }}} */
/* {{{ php_ftp_dirsteam_read
*/
-static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count)
{
php_stream_dirent *ent = (php_stream_dirent *)buf;
php_stream *innerstream;
@@ -627,7 +627,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
return 0;
}
- basename = php_basename(ent->d_name, tmp_len, NULL, 0 TSRMLS_CC);
+ basename = php_basename(ent->d_name, tmp_len, NULL, 0);
tmp_len = MIN(sizeof(ent->d_name), basename->len - 1);
memcpy(ent->d_name, basename->val, tmp_len);
@@ -647,7 +647,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
/* {{{ php_ftp_dirstream_close
*/
-static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_ftp_dirstream_close(php_stream *stream, int close_handle)
{
php_ftp_dirstream_data *data = stream->abstract;
@@ -684,7 +684,7 @@ static php_stream_ops php_ftp_dirstream_ops = {
/* {{{ php_stream_ftp_opendir
*/
php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ char **opened_path, php_stream_context *context STREAMS_DC)
{
php_stream *stream, *reuseid, *datastream = NULL;
php_ftp_dirstream_data *dirsdata;
@@ -696,7 +696,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
tmp_line[0] = '\0';
- stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data);
if (!stream) {
goto opendir_errexit;
}
@@ -708,13 +708,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
/* set up the passive connection */
- portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC);
+ portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart);
if (!portno) {
goto opendir_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
@@ -735,13 +735,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_context_set(datastream, context TSRMLS_CC);
+ php_stream_context_set(datastream, context);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) {
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(datastream);
datastream = NULL;
goto opendir_errexit;
@@ -765,7 +765,7 @@ opendir_errexit:
php_stream_close(stream);
}
if (tmp_line[0] != '\0') {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line);
}
return NULL;
}
@@ -773,7 +773,7 @@ opendir_errexit:
/* {{{ php_stream_ftp_url_stat
*/
-static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -783,13 +783,13 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
/* If ssb is NULL then someone is misbehaving */
if (!ssb) return -1;
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL);
if (!stream) {
goto stat_errexit;
}
ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so approximate one based on being readable */
- php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
+ php_stream_printf(stream, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
ssb->sb.st_mode |= S_IFREG;
@@ -805,7 +805,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
goto stat_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
/* Failure either means it doesn't exist
@@ -820,7 +820,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
ssb->sb.st_size = atoi(tmp_line + 4);
}
- php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result == 213) {
char *p = tmp_line + 4;
@@ -896,35 +896,35 @@ stat_errexit:
/* {{{ php_stream_ftp_unlink
*/
-static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto unlink_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto unlink_errexit;
}
/* Attempt to delete the file */
- php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Deleting file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Deleting file: %s", tmp_line);
}
goto unlink_errexit;
}
@@ -946,7 +946,7 @@ unlink_errexit:
/* {{{ php_stream_ftp_rename
*/
-static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource_from = NULL, *resource_to = NULL;
@@ -974,32 +974,32 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
goto rename_errexit;
}
- stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", resource_from->host);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", resource_from->host);
}
goto rename_errexit;
}
/* Rename FROM */
- php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
+ php_stream_printf(stream, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line);
}
goto rename_errexit;
}
/* Rename TO */
- php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
+ php_stream_printf(stream, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line);
}
goto rename_errexit;
}
@@ -1025,30 +1025,30 @@ rename_errexit:
/* {{{ php_stream_ftp_mkdir
*/
-static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result, recursive = options & PHP_STREAM_MKDIR_RECURSIVE;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto mkdir_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto mkdir_errexit;
}
if (!recursive) {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
} else {
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
@@ -1060,7 +1060,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
/* find a top level directory we need to create */
while ((p = strrchr(buf, '/'))) {
*p = '\0';
- php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", buf);
+ php_stream_printf(stream, "CWD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result >= 200 && result <= 299) {
*p = '/';
@@ -1068,10 +1068,10 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
}
}
if (p == buf) {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
} else {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf);
+ php_stream_printf(stream, "MKD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result >= 200 && result <= 299) {
if (!p) {
@@ -1081,11 +1081,11 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
while (++p != e) {
if (*p == '\0' && *(p + 1) != '\0') {
*p = '/';
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf);
+ php_stream_printf(stream, "MKD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_line);
}
break;
}
@@ -1119,34 +1119,34 @@ mkdir_errexit:
/* {{{ php_stream_ftp_rmdir
*/
-static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto rmdir_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto rmdir_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "RMD %s\r\n", resource->path);
+ php_stream_printf(stream, "RMD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_line);
}
goto rmdir_errexit;
}
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 56f02a3989..6a7f8582a0 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -42,12 +42,12 @@ PHP_FUNCTION(header)
sapi_header_line ctr = {0};
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &ctr.line,
&len, &rep, &ctr.response_code) == FAILURE)
return;
ctr.line_len = (uint)len;
- sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr TSRMLS_CC);
+ sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr);
}
/* }}} */
@@ -58,18 +58,18 @@ PHP_FUNCTION(header_remove)
sapi_header_line ctr = {0};
size_t len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ctr.line,
&len) == FAILURE)
return;
ctr.line_len = (uint)len;
- sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr TSRMLS_CC);
+ sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr);
}
/* }}} */
-PHPAPI int php_header(TSRMLS_D)
+PHPAPI int php_header(void)
{
- if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) {
+ if (sapi_send_headers()==FAILURE || SG(request_info).headers_only) {
return 0; /* don't allow output */
} else {
return 1; /* allow output */
@@ -77,7 +77,7 @@ PHPAPI int php_header(TSRMLS_D)
}
-PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly)
{
char *cookie;
size_t len=sizeof("Set-Cookie: ");
@@ -120,7 +120,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
* so in order to force cookies to be deleted, even on MSIE, we
* pick an expiry date in the past
*/
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0);
snprintf(cookie, len + 100, "Set-Cookie: %s=deleted; expires=%s; Max-Age=0", name, dt->val);
zend_string_free(dt);
} else {
@@ -129,7 +129,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
const char *p;
char tsdelta[13];
strlcat(cookie, COOKIE_EXPIRES, len + 100);
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0);
/* check to make sure that the year does not exceed 4 digits in length */
p = zend_memrchr(dt->val, '-', dt->len);
if (!p || *(p + 5) != ' ') {
@@ -170,7 +170,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
ctr.line = cookie;
ctr.line_len = (uint)strlen(cookie);
- result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC);
+ result = sapi_header_op(SAPI_HEADER_ADD, &ctr);
efree(cookie);
return result;
}
@@ -186,13 +186,13 @@ PHP_FUNCTION(setcookie)
zend_bool secure = 0, httponly = 0;
size_t name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -209,13 +209,13 @@ PHP_FUNCTION(setrawcookie)
zend_bool secure = 0, httponly = 0;
size_t name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -232,12 +232,12 @@ PHP_FUNCTION(headers_sent)
const char *file="";
int line=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/z/", &arg1, &arg2) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z/z/", &arg1, &arg2) == FAILURE)
return;
if (SG(headers_sent)) {
- line = php_output_get_start_lineno(TSRMLS_C);
- file = php_output_get_start_filename(TSRMLS_C);
+ line = php_output_get_start_lineno();
+ file = php_output_get_start_filename();
}
switch(ZEND_NUM_ARGS()) {
@@ -264,7 +264,7 @@ PHP_FUNCTION(headers_sent)
/* {{{ php_head_apply_header_list_to_hash
Turn an llist of sapi_header_struct headers into a numerically indexed zval hash */
-static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC)
+static void php_head_apply_header_list_to_hash(void *data, void *arg)
{
sapi_header_struct *sapi_header = (sapi_header_struct *)data;
@@ -285,7 +285,7 @@ PHP_FUNCTION(headers_list)
RETURN_FALSE;
}
array_init(return_value);
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value);
}
/* }}} */
@@ -295,7 +295,7 @@ PHP_FUNCTION(http_response_code)
{
zend_long response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &response_code) == FAILURE) {
return;
}
diff --git a/ext/standard/head.h b/ext/standard/head.h
index 850a71dc74..1f272e0238 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -37,7 +37,7 @@ PHP_FUNCTION(headers_sent);
PHP_FUNCTION(headers_list);
PHP_FUNCTION(http_response_code);
-PHPAPI int php_header(TSRMLS_D);
-PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
+PHPAPI int php_header(void);
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly);
#endif
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 516bcc4ef7..18bab7d090 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -86,7 +86,7 @@
/* {{{ get_default_charset
*/
-static char *get_default_charset(TSRMLS_D) {
+static char *get_default_charset(void) {
if (PG(internal_encoding) && PG(internal_encoding)[0]) {
return PG(internal_encoding);
} else if (SG(default_charset) && SG(default_charset)[0] ) {
@@ -373,7 +373,7 @@ static inline unsigned int get_next_char(
/* {{{ entity_charset determine_charset
* returns the charset identifier based on current locale or a hint.
* defaults to UTF-8 */
-static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
+static enum entity_charset determine_charset(char *charset_hint)
{
int i;
enum entity_charset charset = cs_utf_8;
@@ -388,7 +388,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
goto det_charset;
}
- zenc = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ zenc = zend_multibyte_get_internal_encoding();
if (zenc != NULL) {
charset_hint = (char *)zend_multibyte_get_encoding_name(zenc);
if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) {
@@ -459,7 +459,7 @@ det_charset:
}
}
if (!found) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "charset `%s' not supported, assuming utf-8",
+ php_error_docref(NULL, E_WARNING, "charset `%s' not supported, assuming utf-8",
charset_hint);
}
}
@@ -1094,7 +1094,7 @@ static entity_table_opt determine_entity_table(int all, int doctype)
* only the basic ones, i.e., those in basic_entities_ex + the numeric entities
* that correspond to quotes.
*/
-PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC)
+PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset)
{
size_t retlen;
zend_string *ret;
@@ -1103,7 +1103,7 @@ PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen
size_t new_size = TRAVERSE_FOR_ENTITIES_EXPAND_SIZE(oldlen);
if (all) {
- charset = determine_charset(hint_charset TSRMLS_CC);
+ charset = determine_charset(hint_charset);
} else {
charset = cs_8859_1; /* charset shouldn't matter, use ISO-8859-1 for performance */
}
@@ -1134,9 +1134,9 @@ empty_source:
}
/* }}} */
-PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC)
+PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset)
{
- return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1 TSRMLS_CC);
+ return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1);
}
/* {{{ find_entity_for_char */
@@ -1222,11 +1222,11 @@ static inline void find_entity_for_char_basic(
/* {{{ php_escape_html_entities
*/
-PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC)
+PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode)
{
size_t cursor, maxlen, len;
zend_string *replaced;
- enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC);
+ enum entity_charset charset = determine_charset(hint_charset);
int doctype = flags & ENT_HTML_DOC_TYPE_MASK;
entity_table_opt entity_table;
const enc_to_uni *to_uni_table = NULL;
@@ -1237,7 +1237,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle
if (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) {
- php_error_docref0(NULL TSRMLS_CC, E_STRICT, "Only basic entities "
+ php_error_docref0(NULL, E_STRICT, "Only basic entities "
"substitution is supported for multi-byte encodings other than UTF-8; "
"functionality is equivalent to htmlspecialchars");
}
@@ -1449,7 +1449,7 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
zend_bool double_encode = 1;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) {
return;
}
#else
@@ -1463,9 +1463,9 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
#endif
if (!hint_charset) {
- default_charset = get_default_charset(TSRMLS_C);
+ default_charset = get_default_charset();
}
- replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode TSRMLS_CC);
+ replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode);
RETVAL_STR(replaced);
}
/* }}} */
@@ -1509,11 +1509,11 @@ PHP_FUNCTION(htmlspecialchars_decode)
zend_long quote_style = ENT_COMPAT;
zend_string *replaced;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &quote_style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &quote_style) == FAILURE) {
return;
}
- replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL TSRMLS_CC);
+ replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL);
if (replaced) {
RETURN_STR(replaced);
}
@@ -1531,7 +1531,7 @@ PHP_FUNCTION(html_entity_decode)
zend_string *replaced;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS", &str,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS", &str,
&quote_style, &hint_charset) == FAILURE) {
return;
}
@@ -1545,9 +1545,9 @@ PHP_FUNCTION(html_entity_decode)
#endif
if (!hint_charset) {
- default_charset = get_default_charset(TSRMLS_C);
+ default_charset = get_default_charset();
}
- replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset) TSRMLS_CC);
+ replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset));
if (replaced) {
RETURN_STR(replaced);
@@ -1638,12 +1638,12 @@ PHP_FUNCTION(get_html_translation_table)
* getting the translated table from data structures that are optimized for
* random access, not traversal */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls",
&all, &flags, &charset_hint, &charset_hint_len) == FAILURE) {
return;
}
- charset = determine_charset(charset_hint TSRMLS_CC);
+ charset = determine_charset(charset_hint);
doctype = flags & ENT_HTML_DOC_TYPE_MASK;
LIMIT_ALL(all, doctype, charset);
diff --git a/ext/standard/html.h b/ext/standard/html.h
index c7c297c90b..6fcea6b380 100644
--- a/ext/standard/html.h
+++ b/ext/standard/html.h
@@ -54,9 +54,9 @@ PHP_FUNCTION(htmlspecialchars_decode);
PHP_FUNCTION(html_entity_decode);
PHP_FUNCTION(get_html_translation_table);
-PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC);
-PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC);
-PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC);
+PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset);
+PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode);
+PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset);
PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status);
#endif /* HTML_H */
diff --git a/ext/standard/http.c b/ext/standard/http.c
index e5ba87d870..9c9d1dc530 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -29,7 +29,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, size_t num_prefix_len,
const char *key_prefix, size_t key_prefix_len,
const char *key_suffix, size_t key_suffix_len,
- zval *type, char *arg_sep, int enc_type TSRMLS_DC)
+ zval *type, char *arg_sep, int enc_type)
{
zend_string *key = NULL;
char *newprefix, *p;
@@ -62,7 +62,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *tmp;
zend_object *zobj = Z_OBJ_P(type);
- if (zend_check_property_access(zobj, key TSRMLS_CC) != SUCCESS) {
+ if (zend_check_property_access(zobj, key) != SUCCESS) {
/* private or protected property access outside of the class */
continue;
}
@@ -138,7 +138,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
ht->u.v.nApplyCount++;
}
- php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type TSRMLS_CC);
+ php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type);
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
ht->u.v.nApplyCount--;
}
@@ -233,16 +233,16 @@ PHP_FUNCTION(http_build_query)
smart_str formstr = {0};
zend_long enc_type = PHP_QUERY_RFC1738;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
RETURN_FALSE;
}
if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given");
+ php_error_docref(NULL, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given");
RETURN_FALSE;
}
- if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type TSRMLS_CC) == FAILURE) {
+ if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type) == FAILURE) {
if (formstr.s) {
smart_str_free(&formstr);
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index e1f8653c8d..032c6c7e36 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -111,7 +111,7 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
const char *path, const char *mode, int options, char **opened_path,
- php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
+ php_stream_context *context, int redirect_max, int flags STREAMS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -149,7 +149,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
tmp_line[0] = '\0';
if (redirect_max < 1) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Redirection limit reached, aborting");
+ php_stream_wrapper_log_error(wrapper, options, "Redirection limit reached, aborting");
return NULL;
}
@@ -177,7 +177,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
/* Normal http request (possibly with proxy) */
if (strpbrk(mode, "awx+")) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not support writeable connections");
php_url_free(resource);
return NULL;
}
@@ -228,7 +228,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
}
if (errstr) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", errstr->val);
+ php_stream_wrapper_log_error(wrapper, options, "%s", errstr->val);
zend_string_release(errstr);
errstr = NULL;
}
@@ -310,7 +310,7 @@ finish:
smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1);
if (php_stream_write(stream, header.s->val, header.s->len) != header.s->len) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -331,9 +331,9 @@ finish:
/* enable SSL transport layer */
if (stream) {
- if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -352,7 +352,7 @@ finish:
eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
@@ -389,7 +389,7 @@ finish:
/* Should we send the entire path in the request line, default to no. */
if (!request_fulluri && context &&
(tmpzval = php_stream_context_get_option(context, "http", "request_fulluri")) != NULL) {
- request_fulluri = zend_is_true(tmpzval TSRMLS_CC);
+ request_fulluri = zend_is_true(tmpzval);
}
if (request_fulluri) {
@@ -440,13 +440,13 @@ finish:
smart_str_0(&tmpstr);
/* Remove newlines and spaces from start and end. there's at least one extra \r\n at the end that needs to go. */
if (tmpstr.s) {
- tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3);
smart_str_free(&tmpstr);
}
}
if (Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval)) {
/* Remove newlines and spaces from start and end php_trim will estrndup() */
- tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3);
}
if (tmp && tmp[0] != '\0') {
char *s;
@@ -602,7 +602,7 @@ finish:
ua[ua_len] = 0;
php_stream_write(stream, ua, ua_len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot construct User-agent header");
+ php_error_docref(NULL, E_WARNING, "Cannot construct User-agent header");
}
if (ua) {
@@ -643,7 +643,7 @@ finish:
if (!(have_header & HTTP_HEADER_TYPE)) {
php_stream_write(stream, "Content-Type: application/x-www-form-urlencoded\r\n",
sizeof("Content-Type: application/x-www-form-urlencoded\r\n") - 1);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
+ php_error_docref(NULL, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
}
php_stream_write(stream, "\r\n", sizeof("\r\n")-1);
php_stream_write(stream, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval));
@@ -653,12 +653,12 @@ finish:
location[0] = '\0';
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
if (header_init) {
zval ztmp;
array_init(&ztmp);
- zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0 TSRMLS_CC);
+ zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0);
}
response_header = zend_hash_str_find_ind(&symbol_table->ht, "http_response_header", sizeof("http_response_header")-1);
@@ -676,7 +676,7 @@ finish:
response_code = 0;
}
if (context && NULL != (tmpzval = php_stream_context_get_option(context, "http", "ignore_errors"))) {
- ignore_errors = zend_is_true(tmpzval TSRMLS_CC);
+ ignore_errors = zend_is_true(tmpzval);
}
/* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) {
@@ -712,7 +712,7 @@ finish:
zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_response);
}
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed, unexpected end of socket!");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed, unexpected end of socket!");
goto out;
}
@@ -727,7 +727,7 @@ finish:
if (*e != '\n') {
do { /* partial header */
if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers");
+ php_stream_wrapper_log_error(wrapper, options, "Failed to read HTTP headers");
goto out;
}
e = http_header_line + http_header_line_length - 1;
@@ -763,10 +763,10 @@ finish:
zend_long decode = 1;
if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) {
- decode = zend_is_true(tmpzval TSRMLS_CC);
+ decode = zend_is_true(tmpzval);
}
if (decode) {
- transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream) TSRMLS_CC);
+ transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream));
if (transfer_encoding) {
/* don't store transfer-encodeing header */
continue;
@@ -847,7 +847,7 @@ finish:
php_url_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_url_parse(new_path)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path);
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path);
goto out;
}
@@ -859,7 +859,7 @@ finish:
s = (unsigned char*)val; e = s + l; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \
goto out; \
} \
s++; \
@@ -872,9 +872,9 @@ finish:
CHECK_FOR_CNTRL_CHARS(resource->pass)
CHECK_FOR_CNTRL_CHARS(resource->path)
}
- stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC TSRMLS_CC);
+ stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed! %s", tmp_line);
}
}
out:
@@ -918,20 +918,20 @@ out:
php_stream_filter_append(&stream->readfilters, transfer_encoding);
}
} else if (transfer_encoding) {
- php_stream_filter_free(transfer_encoding TSRMLS_CC);
+ php_stream_filter_free(transfer_encoding);
}
return stream;
}
/* }}} */
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
- return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC);
+ return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC);
}
/* }}} */
-static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
/* one day, we could fill in the details based on Date: and Content-Length:
* headers. For now, we return with a failure code to prevent the underlying
diff --git a/ext/standard/image.c b/ext/standard/image.c
index adeb1c5be6..4828a48623 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -100,7 +100,7 @@ PHP_MINIT_FUNCTION(imagetypes)
/* {{{ php_handle_gif
* routine to handle GIF files. If only everything were that easy... ;} */
-static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_gif (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[5];
@@ -123,7 +123,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_psd
*/
-static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_psd (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[8];
@@ -144,7 +144,7 @@ static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_bmp
*/
-static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_bmp (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[16];
@@ -195,7 +195,7 @@ static unsigned long int php_swf_get_bits (unsigned char* buffer, unsigned int p
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
/* {{{ php_handle_swc
*/
-static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_swc(php_stream * stream)
{
struct gfxinfo *result = NULL;
@@ -268,7 +268,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_swf
*/
-static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_swf (php_stream * stream)
{
struct gfxinfo *result = NULL;
long bits;
@@ -294,7 +294,7 @@ static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_png
* routine to handle PNG files */
-static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_png (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[9];
@@ -362,7 +362,7 @@ static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
/* {{{ php_read2
*/
-static unsigned short php_read2(php_stream * stream TSRMLS_DC)
+static unsigned short php_read2(php_stream * stream)
{
unsigned char a[2];
@@ -375,7 +375,7 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC)
/* {{{ php_next_marker
* get next marker byte from file */
-static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read TSRMLS_DC)
+static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read)
{
int a=0, marker;
@@ -423,9 +423,9 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co
/* {{{ php_skip_variable
* skip over a variable-length block; assumes proper length marker */
-static int php_skip_variable(php_stream * stream TSRMLS_DC)
+static int php_skip_variable(php_stream * stream)
{
- zend_off_t length = ((unsigned int)php_read2(stream TSRMLS_CC));
+ zend_off_t length = ((unsigned int)php_read2(stream));
if (length < 2) {
return 0;
@@ -438,14 +438,14 @@ static int php_skip_variable(php_stream * stream TSRMLS_DC)
/* {{{ php_read_APP
*/
-static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSRMLS_DC)
+static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
{
unsigned short length;
char *buffer;
char markername[16];
zval *tmp;
- length = php_read2(stream TSRMLS_CC);
+ length = php_read2(stream);
if (length < 2) {
return 0;
}
@@ -472,14 +472,14 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
/* {{{ php_handle_jpeg
main loop to parse JPEG structure */
-static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_DC)
+static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info)
{
struct gfxinfo *result = NULL;
unsigned int marker = M_PSEUDO;
unsigned short length, ff_read=1;
for (;;) {
- marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC);
+ marker = php_next_marker(stream, marker, 1, ff_read);
ff_read = 0;
switch (marker) {
case M_SOF0:
@@ -498,10 +498,10 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
if (result == NULL) {
/* handle SOFn block */
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
- length = php_read2(stream TSRMLS_CC);
+ length = php_read2(stream);
result->bits = php_stream_getc(stream);
- result->height = php_read2(stream TSRMLS_CC);
- result->width = php_read2(stream TSRMLS_CC);
+ result->height = php_read2(stream);
+ result->width = php_read2(stream);
result->channels = php_stream_getc(stream);
if (!info || length < 8) { /* if we don't want an extanded info -> return */
return result;
@@ -510,7 +510,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
return result;
}
} else {
- if (!php_skip_variable(stream TSRMLS_CC)) {
+ if (!php_skip_variable(stream)) {
return result;
}
}
@@ -533,11 +533,11 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
case M_APP14:
case M_APP15:
if (info) {
- if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */
+ if (!php_read_APP(stream, marker, info)) { /* read all the app marks... */
return result;
}
} else {
- if (!php_skip_variable(stream TSRMLS_CC)) {
+ if (!php_skip_variable(stream)) {
return result;
}
}
@@ -548,7 +548,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
return result; /* we're about to hit image data, or are at EOF. stop processing. */
default:
- if (!php_skip_variable(stream TSRMLS_CC)) { /* anything else isn't interesting */
+ if (!php_skip_variable(stream)) { /* anything else isn't interesting */
return result;
}
break;
@@ -561,7 +561,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
/* {{{ php_read4
*/
-static unsigned int php_read4(php_stream * stream TSRMLS_DC)
+static unsigned int php_read4(php_stream * stream)
{
unsigned char a[4];
@@ -601,7 +601,7 @@ static unsigned int php_read4(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_jpc
Main loop to parse JPEG2000 raw codestream structure */
-static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_jpc(php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned short dummy_short;
@@ -621,24 +621,24 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
/* Ensure that this marker is SIZ (as is mandated by the standard) */
if (first_marker_id != JPEG2000_MARKER_SIZ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)");
+ php_error_docref(NULL, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)");
return NULL;
}
result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo));
- dummy_short = php_read2(stream TSRMLS_CC); /* Lsiz */
- dummy_short = php_read2(stream TSRMLS_CC); /* Rsiz */
- result->width = php_read4(stream TSRMLS_CC); /* Xsiz */
- result->height = php_read4(stream TSRMLS_CC); /* Ysiz */
+ dummy_short = php_read2(stream); /* Lsiz */
+ dummy_short = php_read2(stream); /* Rsiz */
+ result->width = php_read4(stream); /* Xsiz */
+ result->height = php_read4(stream); /* Ysiz */
#if MBO_0
- php_read4(stream TSRMLS_CC); /* XOsiz */
- php_read4(stream TSRMLS_CC); /* YOsiz */
- php_read4(stream TSRMLS_CC); /* XTsiz */
- php_read4(stream TSRMLS_CC); /* YTsiz */
- php_read4(stream TSRMLS_CC); /* XTOsiz */
- php_read4(stream TSRMLS_CC); /* YTOsiz */
+ php_read4(stream); /* XOsiz */
+ php_read4(stream); /* YOsiz */
+ php_read4(stream); /* XTsiz */
+ php_read4(stream); /* YTsiz */
+ php_read4(stream); /* XTOsiz */
+ php_read4(stream); /* YTOsiz */
#else
if (php_stream_seek(stream, 24, SEEK_CUR)) {
efree(result);
@@ -646,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
}
#endif
- result->channels = php_read2(stream TSRMLS_CC); /* Csiz */
+ result->channels = php_read2(stream); /* Csiz */
if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
efree(result);
return NULL;
@@ -673,7 +673,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_jp2
main loop to parse JPEG 2000 JP2 wrapper format structure */
-static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
+static struct gfxinfo *php_handle_jp2(php_stream *stream)
{
struct gfxinfo *result = NULL;
unsigned int box_length;
@@ -691,7 +691,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
for (;;)
{
- box_length = php_read4(stream TSRMLS_CC); /* LBox */
+ box_length = php_read4(stream); /* LBox */
/* TBox */
if (php_stream_read(stream, (void *)&box_type, sizeof(box_type)) != sizeof(box_type)) {
/* Use this as a general "out of stream" error */
@@ -708,7 +708,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
/* Skip the first 3 bytes to emulate the file type examination */
php_stream_seek(stream, 3, SEEK_CUR);
- result = php_handle_jpc(stream TSRMLS_CC);
+ result = php_handle_jpc(stream);
break;
}
@@ -724,7 +724,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
}
if (result == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "JP2 file has no codestreams at root level");
+ php_error_docref(NULL, E_WARNING, "JP2 file has no codestreams at root level");
}
return result;
@@ -800,7 +800,7 @@ static unsigned php_ifd_get32u(void *Long, int motorola_intel)
/* {{{ php_handle_tiff
main loop to parse TIFF structure */
-static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel TSRMLS_DC)
+static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel)
{
struct gfxinfo *result = NULL;
int i, num_entries;
@@ -881,7 +881,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int mot
/* {{{ php_handle_psd
*/
-static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_iff(php_stream * stream)
{
struct gfxinfo * result;
unsigned char a[10];
@@ -942,7 +942,7 @@ static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC)
* int Number of columns
* int Number of rows
*/
-static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check TSRMLS_DC)
+static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check)
{
int i, width = 0, height = 0;
@@ -997,11 +997,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T
/* {{{ php_handle_wbmp
*/
-static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_wbmp(php_stream * stream)
{
struct gfxinfo *result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
- if (!php_get_wbmp(stream, &result, 0 TSRMLS_CC)) {
+ if (!php_get_wbmp(stream, &result, 0)) {
efree(result);
return NULL;
}
@@ -1012,7 +1012,7 @@ static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC)
/* {{{ php_get_xbm
*/
-static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC)
+static int php_get_xbm(php_stream *stream, struct gfxinfo **result)
{
char *fline;
char *iname;
@@ -1072,17 +1072,17 @@ static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC)
/* {{{ php_handle_xbm
*/
-static struct gfxinfo *php_handle_xbm(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_xbm(php_stream * stream)
{
struct gfxinfo *result;
- php_get_xbm(stream, &result TSRMLS_CC);
+ php_get_xbm(stream, &result);
return result;
}
/* }}} */
/* {{{ php_handle_ico
*/
-static struct gfxinfo *php_handle_ico(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_ico(php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[16];
@@ -1162,7 +1162,7 @@ PHP_FUNCTION(image_type_to_mime_type)
{
zend_long p_image_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &p_image_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &p_image_type) == FAILURE) {
return;
}
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(image_type_to_extension)
zend_long image_type;
zend_bool inc_dot=1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", &image_type, &inc_dot) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &image_type, &inc_dot) == FAILURE) {
RETURN_FALSE;
}
@@ -1221,13 +1221,13 @@ PHP_FUNCTION(image_type_to_extension)
/* {{{ php_imagetype
detect filetype from first bytes */
-PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
+PHPAPI int php_getimagetype(php_stream * stream, char *filetype)
{
char tmp[12];
if ( !filetype) filetype = tmp;
if((php_stream_read(stream, filetype, 3)) != 3) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
@@ -1238,13 +1238,13 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
return IMAGE_FILETYPE_JPEG;
} else if (!memcmp(filetype, php_sig_png, 3)) {
if (php_stream_read(stream, filetype+3, 5) != 5) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
if (!memcmp(filetype, php_sig_png, 8)) {
return IMAGE_FILETYPE_PNG;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PNG file corrupted by ASCII conversion");
+ php_error_docref(NULL, E_WARNING, "PNG file corrupted by ASCII conversion");
return IMAGE_FILETYPE_UNKNOWN;
}
} else if (!memcmp(filetype, php_sig_swf, 3)) {
@@ -1260,7 +1260,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
if (php_stream_read(stream, filetype+3, 1) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
/* BYTES READ: 4 */
@@ -1275,7 +1275,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
if (php_stream_read(stream, filetype+4, 8) != 8) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
/* BYTES READ: 12 */
@@ -1284,10 +1284,10 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
/* AFTER ALL ABOVE FAILED */
- if (php_get_wbmp(stream, NULL, 1 TSRMLS_CC)) {
+ if (php_get_wbmp(stream, NULL, 1)) {
return IMAGE_FILETYPE_WBMP;
}
- if (php_get_xbm(stream, NULL TSRMLS_CC)) {
+ if (php_get_xbm(stream, NULL)) {
return IMAGE_FILETYPE_XBM;
}
return IMAGE_FILETYPE_UNKNOWN;
@@ -1303,60 +1303,60 @@ static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNA
RETURN_FALSE;
}
- itype = php_getimagetype(stream, NULL TSRMLS_CC);
+ itype = php_getimagetype(stream, NULL);
switch( itype) {
case IMAGE_FILETYPE_GIF:
- result = php_handle_gif(stream TSRMLS_CC);
+ result = php_handle_gif(stream);
break;
case IMAGE_FILETYPE_JPEG:
if (info) {
- result = php_handle_jpeg(stream, info TSRMLS_CC);
+ result = php_handle_jpeg(stream, info);
} else {
- result = php_handle_jpeg(stream, NULL TSRMLS_CC);
+ result = php_handle_jpeg(stream, NULL);
}
break;
case IMAGE_FILETYPE_PNG:
- result = php_handle_png(stream TSRMLS_CC);
+ result = php_handle_png(stream);
break;
case IMAGE_FILETYPE_SWF:
- result = php_handle_swf(stream TSRMLS_CC);
+ result = php_handle_swf(stream);
break;
case IMAGE_FILETYPE_SWC:
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
- result = php_handle_swc(stream TSRMLS_CC);
+ result = php_handle_swc(stream);
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
+ php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
#endif
break;
case IMAGE_FILETYPE_PSD:
- result = php_handle_psd(stream TSRMLS_CC);
+ result = php_handle_psd(stream);
break;
case IMAGE_FILETYPE_BMP:
- result = php_handle_bmp(stream TSRMLS_CC);
+ result = php_handle_bmp(stream);
break;
case IMAGE_FILETYPE_TIFF_II:
- result = php_handle_tiff(stream, NULL, 0 TSRMLS_CC);
+ result = php_handle_tiff(stream, NULL, 0);
break;
case IMAGE_FILETYPE_TIFF_MM:
- result = php_handle_tiff(stream, NULL, 1 TSRMLS_CC);
+ result = php_handle_tiff(stream, NULL, 1);
break;
case IMAGE_FILETYPE_JPC:
- result = php_handle_jpc(stream TSRMLS_CC);
+ result = php_handle_jpc(stream);
break;
case IMAGE_FILETYPE_JP2:
- result = php_handle_jp2(stream TSRMLS_CC);
+ result = php_handle_jp2(stream);
break;
case IMAGE_FILETYPE_IFF:
- result = php_handle_iff(stream TSRMLS_CC);
+ result = php_handle_iff(stream);
break;
case IMAGE_FILETYPE_WBMP:
- result = php_handle_wbmp(stream TSRMLS_CC);
+ result = php_handle_wbmp(stream);
break;
case IMAGE_FILETYPE_XBM:
- result = php_handle_xbm(stream TSRMLS_CC);
+ result = php_handle_xbm(stream);
break;
case IMAGE_FILETYPE_ICO:
- result = php_handle_ico(stream TSRMLS_CC);
+ result = php_handle_ico(stream);
break;
default:
case IMAGE_FILETYPE_UNKNOWN:
@@ -1396,7 +1396,7 @@ static void php_getimagesize_from_any(INTERNAL_FUNCTION_PARAMETERS, int mode) {
size_t input_len;
const int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|z/", &input, &input_len, &info) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|z/", &input, &input_len, &info) == FAILURE) {
return;
}
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index bb1b9c5a6a..6d5ef77e2d 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -34,24 +34,24 @@ static zend_object_handlers php_incomplete_object_handlers;
/* {{{ incomplete_class_message
*/
-static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
+static void incomplete_class_message(zval *object, int error_type)
{
zend_string *class_name;
class_name = php_lookup_class_name(object);
if (class_name) {
- php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name->val);
+ php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, class_name->val);
zend_string_release(class_name);
} else {
- php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, "unknown");
+ php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, "unknown");
}
}
/* }}} */
-static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
if (type == BP_VAR_W || type == BP_VAR_RW) {
return &EG(error_zval);
@@ -61,49 +61,49 @@ static zval *incomplete_class_get_property(zval *object, zval *member, int type,
}
/* }}} */
-static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
}
/* }}} */
-static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
return &EG(error_zval);
}
/* }}} */
-static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
}
/* }}} */
-static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) /* {{{ */
+static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
return 0;
}
/* }}} */
-static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
+static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
zval zobject;
ZVAL_OBJ(&zobject, *object);
- incomplete_class_message(&zobject, E_ERROR TSRMLS_CC);
+ incomplete_class_message(&zobject, E_ERROR);
return NULL;
}
/* }}} */
/* {{{ php_create_incomplete_class
*/
-static zend_object *php_create_incomplete_object(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
{
zend_object *object;
- object = zend_objects_new( class_type TSRMLS_CC);
+ object = zend_objects_new( class_type);
object->handlers = &php_incomplete_object_handlers;
object_properties_init(object, class_type);
@@ -111,7 +111,7 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type TS
return object;
}
-PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D)
+PHPAPI zend_class_entry *php_create_incomplete_class(void)
{
zend_class_entry incomplete_class;
@@ -126,7 +126,7 @@ PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D)
php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr;
php_incomplete_object_handlers.get_method = incomplete_class_get_method;
- return zend_register_internal_class(&incomplete_class TSRMLS_CC);
+ return zend_register_internal_class(&incomplete_class);
}
/* }}} */
@@ -136,7 +136,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
{
zval *val;
HashTable *object_properties;
- TSRMLS_FETCH();
object_properties = Z_OBJPROP_P(object);
@@ -153,7 +152,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
PHPAPI void php_store_class_name(zval *object, const char *name, size_t len)
{
zval val;
- TSRMLS_FETCH();
ZVAL_STRINGL(&val, name, len);
diff --git a/ext/standard/info.c b/ext/standard/info.c
index bd0770919f..cc332721a4 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -66,10 +66,9 @@ static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */
{
size_t written;
zend_string *new_str;
- TSRMLS_FETCH();
- new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC);
- written = php_output_write(new_str->val, new_str->len TSRMLS_CC);
+ new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8");
+ written = php_output_write(new_str->val, new_str->len);
zend_string_free(new_str);
return written;
}
@@ -80,13 +79,12 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
char *buf;
size_t len, written;
va_list argv;
- TSRMLS_FETCH();
va_start(argv, fmt);
len = vspprintf(&buf, 0, fmt, argv);
va_end(argv);
- written = php_output_write(buf, len TSRMLS_CC);
+ written = php_output_write(buf, len);
efree(buf);
return written;
}
@@ -94,12 +92,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
static int php_info_print(const char *str) /* {{{ */
{
- TSRMLS_FETCH();
- return php_output_write(str, strlen(str) TSRMLS_CC);
+ return php_output_write(str, strlen(str));
}
/* }}} */
-static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC) /* {{{ */
+static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */
{
zend_string *key;
@@ -143,7 +140,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
}
/* }}} */
-PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {{{ */
+PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */
{
if (zend_module->info_func || zend_module->version) {
if (!sapi_module.phpinfo_as_text) {
@@ -159,7 +156,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
php_info_print_table_end();
}
if (zend_module->info_func) {
- zend_module->info_func(zend_module TSRMLS_CC);
+ zend_module->info_func(zend_module);
} else {
php_info_print_table_start();
php_info_print_table_row(2, "Version", zend_module->version);
@@ -176,21 +173,21 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
}
/* }}} */
-static int _display_module_info_func(zval *el TSRMLS_DC) /* {{{ */
+static int _display_module_info_func(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
if (module->info_func || module->version) {
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */
+static int _display_module_info_def(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
if (!module->info_func && !module->version) {
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
return ZEND_HASH_APPLY_KEEP;
}
@@ -198,7 +195,7 @@ static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */
/* {{{ php_print_gpcse_array
*/
-static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
+static void php_print_gpcse_array(char *name, uint name_length)
{
zval *data, *tmp, tmp2;
zend_string *string_key;
@@ -206,7 +203,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
zend_string *key;
key = zend_string_init(name, name_length, 0);
- zend_is_auto_global(key TSRMLS_CC);
+ zend_is_auto_global(key);
if ((data = zend_hash_find(&EG(symbol_table).ht, key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_key, string_key, tmp) {
@@ -237,10 +234,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_TYPE_P(tmp) == IS_ARRAY) {
if (!sapi_module.phpinfo_as_text) {
php_info_print("<pre>");
- zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0 TSRMLS_CC);
+ zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0);
php_info_print("</pre>");
} else {
- zend_print_zval_r(tmp, 0 TSRMLS_CC);
+ zend_print_zval_r(tmp, 0);
}
} else {
ZVAL_COPY_VALUE(&tmp2, tmp);
@@ -277,19 +274,19 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
/* {{{ php_info_print_style
*/
-void php_info_print_style(TSRMLS_D)
+void php_info_print_style(void)
{
php_info_printf("<style type=\"text/css\">\n");
- php_info_print_css(TSRMLS_C);
+ php_info_print_css();
php_info_printf("</style>\n");
}
/* }}} */
/* {{{ php_info_html_esc
*/
-PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC)
+PHPAPI zend_string *php_info_html_esc(char *string)
{
- return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL TSRMLS_CC);
+ return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL);
}
/* }}} */
@@ -670,12 +667,12 @@ PHPAPI zend_string *php_get_uname(char mode)
/* {{{ php_print_info_htmlhead
*/
-PHPAPI void php_print_info_htmlhead(TSRMLS_D)
+PHPAPI void php_print_info_htmlhead(void)
{
php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
php_info_print("<head>\n");
- php_info_print_style(TSRMLS_C);
+ php_info_print_style();
php_info_print("<title>phpinfo()</title>");
php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
php_info_print("</head>\n");
@@ -684,7 +681,7 @@ PHPAPI void php_print_info_htmlhead(TSRMLS_D)
/* }}} */
/* {{{ module_name_cmp */
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
+static int module_name_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -696,13 +693,13 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
/* {{{ php_print_info
*/
-PHPAPI void php_print_info(int flag TSRMLS_DC)
+PHPAPI void php_print_info(int flag)
{
char **env, *tmp1, *tmp2;
zend_string *php_uname;
if (!sapi_module.phpinfo_as_text) {
- php_print_info_htmlhead(TSRMLS_C);
+ php_print_info_htmlhead();
} else {
php_info_print("phpinfo()\n");
}
@@ -796,10 +793,10 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "Zend Signal Handling", "disabled" );
#endif
- php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" );
+ php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm() ? "enabled" : "disabled" );
{
- const zend_multibyte_functions *functions = zend_multibyte_get_functions(TSRMLS_C);
+ const zend_multibyte_functions *functions = zend_multibyte_get_functions();
char *descr;
if (functions) {
spprintf(&descr, 0, "provided by %s", functions->provider_name);
@@ -822,9 +819,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "DTrace Support", "disabled" );
#endif
- php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC);
- php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC);
- php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC);
+ php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash());
+ php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash());
+ php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash());
php_info_print_table_end();
@@ -839,13 +836,13 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (sapi_module.phpinfo_as_text) {
php_info_print(zend_version);
} else {
- zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC);
+ zend_html_puts(zend_version, strlen(zend_version));
}
php_info_print_box_end();
zend_string_free(php_uname);
}
- zend_ini_sort_entries(TSRMLS_C);
+ zend_ini_sort_entries();
if (flag & PHP_INFO_CONFIGURATION) {
php_info_print_hr();
@@ -865,14 +862,14 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
- zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
+ zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0);
- zend_hash_apply(&sorted_registry, _display_module_info_func TSRMLS_CC);
+ zend_hash_apply(&sorted_registry, _display_module_info_func);
SECTION("Additional Modules");
php_info_print_table_start();
php_info_print_table_header(1, "Module Name");
- zend_hash_apply(&sorted_registry, _display_module_info_def TSRMLS_CC);
+ zend_hash_apply(&sorted_registry, _display_module_info_def);
php_info_print_table_end();
zend_hash_destroy(&sorted_registry);
@@ -915,20 +912,20 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if ((data = zend_hash_str_find(&EG(symbol_table).ht, "PHP_AUTH_PW", sizeof("PHP_AUTH_PW")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_P(data));
}
- php_print_gpcse_array(ZEND_STRL("_REQUEST") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_GET") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_POST") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_FILES") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_COOKIE") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_SERVER") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_ENV") TSRMLS_CC);
+ php_print_gpcse_array(ZEND_STRL("_REQUEST"));
+ php_print_gpcse_array(ZEND_STRL("_GET"));
+ php_print_gpcse_array(ZEND_STRL("_POST"));
+ php_print_gpcse_array(ZEND_STRL("_FILES"));
+ php_print_gpcse_array(ZEND_STRL("_COOKIE"));
+ php_print_gpcse_array(ZEND_STRL("_SERVER"));
+ php_print_gpcse_array(ZEND_STRL("_ENV"));
php_info_print_table_end();
}
if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
php_info_print_hr();
- php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC);
+ php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE);
}
if (flag & PHP_INFO_LICENSE) {
@@ -1177,14 +1174,14 @@ PHP_FUNCTION(phpinfo)
{
zend_long flag = PHP_INFO_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
return;
}
/* Andale! Andale! Yee-Hah! */
- php_output_start_default(TSRMLS_C);
- php_print_info((int)flag TSRMLS_CC);
- php_output_end(TSRMLS_C);
+ php_output_start_default();
+ php_print_info((int)flag);
+ php_output_end();
RETURN_TRUE;
}
@@ -1198,7 +1195,7 @@ PHP_FUNCTION(phpversion)
char *ext_name = NULL;
size_t ext_name_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext_name, &ext_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext_name, &ext_name_len) == FAILURE) {
return;
}
@@ -1221,11 +1218,11 @@ PHP_FUNCTION(phpcredits)
{
zend_long flag = PHP_CREDITS_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
return;
}
- php_print_credits((int)flag TSRMLS_CC);
+ php_print_credits((int)flag);
RETURN_TRUE;
}
/* }}} */
@@ -1254,7 +1251,7 @@ PHP_FUNCTION(php_uname)
char *mode = "a";
size_t modelen = sizeof("a")-1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &mode, &modelen) == FAILURE) {
return;
}
RETURN_STR(php_get_uname(*mode));
diff --git a/ext/standard/info.h b/ext/standard/info.h
index a28ac564ab..f54325fdaf 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -63,12 +63,12 @@ PHP_FUNCTION(php_sapi_name);
PHP_FUNCTION(php_uname);
PHP_FUNCTION(php_ini_scanned_files);
PHP_FUNCTION(php_ini_loaded_file);
-PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC);
-PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC);
-PHPAPI void php_print_info_htmlhead(TSRMLS_D);
-PHPAPI void php_print_info(int flag TSRMLS_DC);
+PHPAPI zend_string *php_info_html_esc(char *string);
+PHPAPI void php_info_html_esc_write(char *string, int str_len);
+PHPAPI void php_print_info_htmlhead(void);
+PHPAPI void php_print_info(int flag);
PHPAPI void php_print_style(void);
-PHPAPI void php_info_print_style(TSRMLS_D);
+PHPAPI void php_info_print_style(void);
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header);
PHPAPI void php_info_print_table_header(int num_cols, ...);
PHPAPI void php_info_print_table_row(int num_cols, ...);
@@ -78,7 +78,7 @@ PHPAPI void php_info_print_table_end(void);
PHPAPI void php_info_print_box_start(int bg);
PHPAPI void php_info_print_box_end(void);
PHPAPI void php_info_print_hr(void);
-PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC);
+PHPAPI void php_info_print_module(zend_module_entry *module);
PHPAPI zend_string *php_get_uname(char mode);
void register_phpinfo_constants(INIT_FUNC_ARGS);
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 75bbdd22ce..c536f4b19f 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -75,7 +75,7 @@
/* {{{ php_iptc_put1
*/
-static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf)
{
if (spool > 0)
PUTC(c);
@@ -88,7 +88,7 @@ static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **s
/* {{{ php_iptc_get1
*/
-static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf)
{
int c;
char cc;
@@ -110,9 +110,9 @@ static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC
/* {{{ php_iptc_read_remaining
*/
-static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf)
{
- while (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) != EOF) continue;
+ while (php_iptc_get1(fp, spool, spoolbuf) != EOF) continue;
return M_EOI;
}
@@ -120,21 +120,21 @@ static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf
/* {{{ php_iptc_skip_variable
*/
-static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf)
{
unsigned int length;
int c1, c2;
- if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
+ if ((c1 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI;
- if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
+ if ((c2 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI;
length = (((unsigned char) c1) << 8) + ((unsigned char) c2);
length -= 2;
while (length--)
- if (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) == EOF) return M_EOI;
+ if (php_iptc_get1(fp, spool, spoolbuf) == EOF) return M_EOI;
return 0;
}
@@ -142,29 +142,29 @@ static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf
/* {{{ php_iptc_next_marker
*/
-static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf)
{
int c;
/* skip unimportant stuff */
- c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC);
+ c = php_iptc_get1(fp, spool, spoolbuf);
if (c == EOF) return M_EOI;
while (c != 0xff) {
- if ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF)
+ if ((c = php_iptc_get1(fp, spool, spoolbuf)) == EOF)
return M_EOI; /* we hit EOF */
}
/* get marker byte, swallowing possible padding */
do {
- c = php_iptc_get1(fp, 0, 0 TSRMLS_CC);
+ c = php_iptc_get1(fp, 0, 0);
if (c == EOF)
return M_EOI; /* we hit EOF */
else
if (c == 0xff)
- php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf);
} while (c == 0xff);
return (unsigned int) c;
@@ -187,16 +187,16 @@ PHP_FUNCTION(iptcembed)
zend_stat_t sb;
zend_bool written = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
return;
}
- if (php_check_open_basedir(jpeg_file TSRMLS_CC)) {
+ if (php_check_open_basedir(jpeg_file)) {
RETURN_FALSE;
}
if ((fp = VCWD_FOPEN(jpeg_file, "rb")) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open %s", jpeg_file);
+ php_error_docref(NULL, E_WARNING, "Unable to open %s", jpeg_file);
RETURN_FALSE;
}
@@ -207,7 +207,7 @@ PHP_FUNCTION(iptcembed)
memset(poi, 0, iptcdata_len + sizeof(psheader) + sb.st_size + 1024 + 1);
}
- if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
+ if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xFF) {
fclose(fp);
if (spoolbuf) {
efree(spoolbuf);
@@ -215,7 +215,7 @@ PHP_FUNCTION(iptcembed)
RETURN_FALSE;
}
- if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
+ if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xD8) {
fclose(fp);
if (spoolbuf) {
efree(spoolbuf);
@@ -224,19 +224,19 @@ PHP_FUNCTION(iptcembed)
}
while (!done) {
- marker = php_iptc_next_marker(fp, spool, poi?&poi:0 TSRMLS_CC);
+ marker = php_iptc_next_marker(fp, spool, poi?&poi:0);
if (marker == M_EOI) { /* EOF */
break;
} else if (marker != M_APP13) {
- php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0);
}
switch (marker) {
case M_APP13:
/* we are going to write a new APP13 marker, so don't output the old one */
- php_iptc_skip_variable(fp, 0, 0 TSRMLS_CC);
- php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, 0, 0);
+ php_iptc_read_remaining(fp, spool, poi?&poi:0);
done = 1;
break;
@@ -249,7 +249,7 @@ PHP_FUNCTION(iptcembed)
}
written = 1;
- php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, spool, poi?&poi:0);
if (iptcdata_len & 1) {
iptcdata_len++; /* make the length even */
@@ -259,25 +259,25 @@ PHP_FUNCTION(iptcembed)
psheader[ 3 ] = (iptcdata_len+28)&0xff;
for (inx = 0; inx < 28; inx++) {
- php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0);
}
- php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0 TSRMLS_CC);
- php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0);
+ php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0);
for (inx = 0; inx < iptcdata_len; inx++) {
- php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0);
}
break;
case M_SOS:
/* we hit data, no more marker-inserting can be done! */
- php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_read_remaining(fp, spool, poi?&poi:0);
done = 1;
break;
default:
- php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, spool, poi?&poi:0);
break;
}
}
@@ -305,7 +305,7 @@ PHP_FUNCTION(iptcparse)
size_t str_len;
zval values, *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) != SUCCESS) {
return;
}
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 8bfa05555b..424604c0e9 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -50,15 +50,15 @@ static php_lcg_globals lcg_globals;
#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m
-static void lcg_seed(TSRMLS_D);
+static void lcg_seed(void);
-PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */
+PHPAPI double php_combined_lcg(void) /* {{{ */
{
php_int32 q;
php_int32 z;
if (!LCG(seeded)) {
- lcg_seed(TSRMLS_C);
+ lcg_seed();
}
MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1));
@@ -73,7 +73,7 @@ PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void lcg_seed(TSRMLS_D) /* {{{ */
+static void lcg_seed(void) /* {{{ */
{
struct timeval tv;
@@ -97,7 +97,7 @@ static void lcg_seed(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) /* {{{ */
+static void lcg_init_globals(php_lcg_globals *lcg_globals_p) /* {{{ */
{
LCG(seeded) = 0;
}
@@ -118,7 +118,7 @@ PHP_MINIT_FUNCTION(lcg) /* {{{ */
Returns a value from the combined linear congruential generator */
PHP_FUNCTION(lcg_value)
{
- RETURN_DOUBLE(php_combined_lcg(TSRMLS_C));
+ RETURN_DOUBLE(php_combined_lcg());
}
/* }}} */
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index e776934e1f..0723781c49 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -79,9 +79,9 @@ static zend_long reference_levdist(const char *s1, size_t l1, const char *s2, si
/* {{{ custom_levdist
*/
-static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC)
+static int custom_levdist(char *str1, char *str2, char *callback_name)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet");
+ php_error_docref(NULL, E_WARNING, "The general Levenshtein support is not there yet");
/* not there yet */
return -1;
@@ -101,24 +101,24 @@ PHP_FUNCTION(levenshtein)
switch (argc) {
case 2: /* just two strings: use maximum performance version */
- if (zend_parse_parameters(2 TSRMLS_CC, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) {
+ if (zend_parse_parameters(2, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, 1, 1, 1);
break;
case 5: /* more general version: calc cost by ins/rep/del weights */
- if (zend_parse_parameters(5 TSRMLS_CC, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
+ if (zend_parse_parameters(5, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, cost_ins, cost_rep, cost_del);
break;
case 3: /* most general version: calc cost by user-supplied function */
- if (zend_parse_parameters(3 TSRMLS_CC, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) {
+ if (zend_parse_parameters(3, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) {
return;
}
- distance = custom_levdist(str1, str2, callback_name TSRMLS_CC);
+ distance = custom_levdist(str1, str2, callback_name);
break;
default:
@@ -126,7 +126,7 @@ PHP_FUNCTION(levenshtein)
}
if (distance < 0 && /* TODO */ ZEND_NUM_ARGS() != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument string(s) too long");
+ php_error_docref(NULL, E_WARNING, "Argument string(s) too long");
}
RETURN_LONG(distance);
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 4618ffe983..7bdb48e973 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -59,18 +59,18 @@ PHP_FUNCTION(readlink)
char buff[MAXPATHLEN];
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &link, &link_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(link TSRMLS_CC)) {
+ if (php_check_open_basedir(link)) {
RETURN_FALSE;
}
ret = php_sys_readlink(link, buff, MAXPATHLEN-1);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
/* Append NULL to the end of the string */
@@ -90,21 +90,21 @@ PHP_FUNCTION(linkinfo)
zend_stat_t sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
dirname = estrndup(link, link_len);
dir_len = php_dirname(dirname, link_len);
- if (php_check_open_basedir(dirname TSRMLS_CC)) {
+ if (php_check_open_basedir(dirname)) {
efree(dirname);
RETURN_FALSE;
}
ret = VCWD_LSTAT(link, &sb);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
efree(dirname);
RETURN_LONG(-1L);
}
@@ -126,35 +126,35 @@ PHP_FUNCTION(symlink)
char dirname[MAXPATHLEN];
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
memcpy(dirname, source_p, sizeof(source_p));
len = php_dirname(dirname, strlen(dirname));
- if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_ex(topath, dest_p, dirname, len)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL");
RETURN_FALSE;
}
- if (php_check_open_basedir(dest_p TSRMLS_CC)) {
+ if (php_check_open_basedir(dest_p)) {
RETURN_FALSE;
}
- if (php_check_open_basedir(source_p TSRMLS_CC)) {
+ if (php_check_open_basedir(source_p)) {
RETURN_FALSE;
}
@@ -164,7 +164,7 @@ PHP_FUNCTION(symlink)
ret = symlink(topath, source_p);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -182,27 +182,27 @@ PHP_FUNCTION(link)
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}
- if (php_check_open_basedir(dest_p TSRMLS_CC)) {
+ if (php_check_open_basedir(dest_p)) {
RETURN_FALSE;
}
- if (php_check_open_basedir(source_p TSRMLS_CC)) {
+ if (php_check_open_basedir(source_p)) {
RETURN_FALSE;
}
@@ -212,7 +212,7 @@ PHP_FUNCTION(link)
ret = link(dest_p, source_p);
#endif
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index ab904d9571..9fa60a1c3d 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(readlink)
size_t link_len;
char target[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
@@ -75,7 +75,7 @@ PHP_FUNCTION(readlink)
}
if (php_sys_readlink(link, target, MAXPATHLEN) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError());
+ php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError());
RETURN_FALSE;
}
RETURN_STRING(target);
@@ -91,13 +91,13 @@ PHP_FUNCTION(linkinfo)
zend_stat_t sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
ret = VCWD_STAT(link, &sb);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_LONG(Z_L(-1));
}
@@ -126,35 +126,35 @@ PHP_FUNCTION(symlink)
if (kernel32) {
pCreateSymbolicLinkA = (csla_func)GetProcAddress(kernel32, "CreateSymbolicLinkA");
if (pCreateSymbolicLinkA == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call CreateSymbolicLinkA");
+ php_error_docref(NULL, E_WARNING, "Can't call CreateSymbolicLinkA");
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call get a handle on kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Can't call get a handle on kernel32.dll");
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
memcpy(dirname, source_p, sizeof(source_p));
len = php_dirname(dirname, strlen(dirname));
- if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_ex(topath, dest_p, dirname, len)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL");
RETURN_FALSE;
}
@@ -167,7 +167,7 @@ PHP_FUNCTION(symlink)
}
if ((attr = GetFileAttributes(topath)) == INVALID_FILE_ATTRIBUTES) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch file information(error %d)", GetLastError());
+ php_error_docref(NULL, E_WARNING, "Could not fetch file information(error %d)", GetLastError());
RETURN_FALSE;
}
@@ -177,7 +177,7 @@ PHP_FUNCTION(symlink)
ret = pCreateSymbolicLinkA(source_p, topath, (attr & FILE_ATTRIBUTE_DIRECTORY ? 1 : 0));
if (!ret) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError());
+ php_error_docref(NULL, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError());
RETURN_FALSE;
}
@@ -197,19 +197,19 @@ PHP_FUNCTION(link)
/*First argument to link function is the target and hence should go to frompath
Second argument to link function is the link itself and hence should go to topath */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}
@@ -228,7 +228,7 @@ PHP_FUNCTION(link)
#endif
if (ret == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 5d2b576c7e..69b80e7baa 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -72,7 +72,7 @@
*p = ' '; \
} \
-extern zend_long php_getuid(TSRMLS_D);
+extern zend_long php_getuid(void);
/* {{{ proto int ezmlm_hash(string addr)
Calculate EZMLM list hash value. */
@@ -82,7 +82,7 @@ PHP_FUNCTION(ezmlm_hash)
unsigned int h = 5381;
size_t j, str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -109,7 +109,7 @@ PHP_FUNCTION(mail)
char *to_r, *subject_r;
char *p, *e;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
return;
}
@@ -119,7 +119,7 @@ PHP_FUNCTION(mail)
MAIL_ASCIIZ_CHECK(message, message_len);
if (headers) {
MAIL_ASCIIZ_CHECK(headers, headers_len);
- headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2 TSRMLS_CC);
+ headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2);
}
if (extra_cmd) {
MAIL_ASCIIZ_CHECK(extra_cmd->val, extra_cmd->len);
@@ -171,7 +171,7 @@ PHP_FUNCTION(mail)
extra_cmd = php_escape_shell_cmd(extra_cmd->val);
}
- if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL TSRMLS_CC)) {
+ if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -213,7 +213,7 @@ void php_mail_log_to_syslog(char *message) {
}
-void php_mail_log_to_file(char *filename, char *message, size_t message_size TSRMLS_DC) {
+void php_mail_log_to_file(char *filename, char *message, size_t message_size) {
/* Write 'message' to the given file. */
uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR;
php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL);
@@ -226,7 +226,7 @@ void php_mail_log_to_file(char *filename, char *message, size_t message_size TSR
/* {{{ php_mail
*/
-PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC)
+PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd)
{
#if (defined PHP_WIN32 || defined NETWARE)
int tsm_err;
@@ -255,9 +255,9 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
zend_string *date_str;
time(&curtime);
- date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1 TSRMLS_CC);
+ date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1);
- l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : "");
+ l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(), zend_get_executed_lineno(), to, hdr ? hdr : "");
zend_string_free(date_str);
@@ -273,21 +273,21 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
else {
/* Convert the final space to a newline when logging to file. */
tmp[l - 1] = '\n';
- php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC);
+ php_mail_log_to_file(mail_log, tmp, l);
}
efree(tmp);
}
if (PG(mail_x_header)) {
- const char *tmp = zend_get_executed_filename(TSRMLS_C);
+ const char *tmp = zend_get_executed_filename();
zend_string *f;
- f = php_basename(tmp, strlen(tmp), NULL, 0 TSRMLS_CC);
+ f = php_basename(tmp, strlen(tmp), NULL, 0);
if (headers != NULL) {
- spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers);
+ spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(), f->val, headers);
} else {
- spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(TSRMLS_C), f->val);
+ spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(), f->val);
}
zend_string_release(f);
}
@@ -295,12 +295,12 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (!sendmail_path) {
#if (defined PHP_WIN32 || defined NETWARE)
/* handle old style win smtp sending */
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL) == FAILURE) {
if (tsm_errmsg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
+ php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err));
+ php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err));
}
MAIL_RET(0);
}
@@ -326,7 +326,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
#endif
#ifdef PHP_WIN32
- sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC);
+ sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL);
#else
/* Since popen() doesn't indicate if the internal fork() doesn't work
* (e.g. the shell can't be executed) we explicitly set it to 0 to be
@@ -341,7 +341,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (sendmail) {
#ifndef PHP_WIN32
if (EACCES == errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path);
+ php_error_docref(NULL, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path);
pclose(sendmail);
#if PHP_SIGCHILD
/* Restore handler in case of error on Windows
@@ -384,7 +384,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
MAIL_RET(1);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
+ php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
#if PHP_SIGCHILD
if (sig_handler) {
signal(SIGCHLD, sig_handler);
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 31eb259829..6d18c0b2dd 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -295,7 +295,7 @@ PHP_FUNCTION(abs)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -319,7 +319,7 @@ PHP_FUNCTION(ceil)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -339,7 +339,7 @@ PHP_FUNCTION(floor)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -363,7 +363,7 @@ PHP_FUNCTION(round)
zend_long mode = PHP_ROUND_HALF_UP;
double return_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &value, &precision, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &value, &precision, &mode) == FAILURE) {
return;
}
@@ -400,7 +400,7 @@ PHP_FUNCTION(sin)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -419,7 +419,7 @@ PHP_FUNCTION(cos)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -438,7 +438,7 @@ PHP_FUNCTION(tan)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -457,7 +457,7 @@ PHP_FUNCTION(asin)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -476,7 +476,7 @@ PHP_FUNCTION(acos)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -495,7 +495,7 @@ PHP_FUNCTION(atan)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -514,7 +514,7 @@ PHP_FUNCTION(atan2)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -534,7 +534,7 @@ PHP_FUNCTION(sinh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -553,7 +553,7 @@ PHP_FUNCTION(cosh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -572,7 +572,7 @@ PHP_FUNCTION(tanh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -591,7 +591,7 @@ PHP_FUNCTION(asinh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -610,7 +610,7 @@ PHP_FUNCTION(acosh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -629,7 +629,7 @@ PHP_FUNCTION(atanh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -656,7 +656,7 @@ PHP_FUNCTION(is_finite)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -675,7 +675,7 @@ PHP_FUNCTION(is_infinite)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -694,7 +694,7 @@ PHP_FUNCTION(is_nan)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -712,11 +712,11 @@ PHP_FUNCTION(pow)
{
zval *zbase, *zexp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &zbase, &zexp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &zbase, &zexp) == FAILURE) {
return;
}
- pow_function(return_value, zbase, zexp TSRMLS_CC);
+ pow_function(return_value, zbase, zexp);
}
/* }}} */
@@ -727,7 +727,7 @@ PHP_FUNCTION(exp)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -751,7 +751,7 @@ PHP_FUNCTION(expm1)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -775,7 +775,7 @@ PHP_FUNCTION(log1p)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -795,7 +795,7 @@ PHP_FUNCTION(log)
double num, base = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|d", &num, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|d", &num, &base) == FAILURE) {
return;
}
#else
@@ -825,7 +825,7 @@ PHP_FUNCTION(log)
}
if (base <= 0.0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "base must be greater than 0");
RETURN_FALSE;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(log10)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -860,7 +860,7 @@ PHP_FUNCTION(sqrt)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -880,7 +880,7 @@ PHP_FUNCTION(hypot)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -907,7 +907,7 @@ PHP_FUNCTION(deg2rad)
double deg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &deg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &deg) == FAILURE) {
return;
}
#else
@@ -926,7 +926,7 @@ PHP_FUNCTION(rad2deg)
double rad;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &rad) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &rad) == FAILURE) {
return;
}
#else
@@ -973,9 +973,8 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base)
continue;
{
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is too big to fit in long", s);
+
+ php_error_docref(NULL, E_WARNING, "Number '%s' is too big to fit in long", s);
return ZEND_LONG_MAX;
}
}
@@ -1052,7 +1051,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
* Convert a long to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[(sizeof(zend_ulong) << 3) + 1];
@@ -1082,7 +1081,7 @@ PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
* Convert a zval to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
+PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -1097,7 +1096,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
/* Don't try to convert +/- infinity */
if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large");
+ php_error_docref(NULL, E_WARNING, "Number too large");
return STR_EMPTY_ALLOC();
}
@@ -1112,7 +1111,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
return zend_string_init(ptr, end - ptr, 0);
}
- return _php_math_longtobase(arg, base TSRMLS_CC);
+ return _php_math_longtobase(arg, base);
}
/* }}} */
@@ -1122,7 +1121,7 @@ PHP_FUNCTION(bindec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1138,7 +1137,7 @@ PHP_FUNCTION(hexdec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1154,7 +1153,7 @@ PHP_FUNCTION(octdec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1171,11 +1170,11 @@ PHP_FUNCTION(decbin)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 2 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 2);
RETURN_STR(result);
}
/* }}} */
@@ -1187,11 +1186,11 @@ PHP_FUNCTION(decoct)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 8 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 8);
RETURN_STR(result);
}
/* }}} */
@@ -1203,11 +1202,11 @@ PHP_FUNCTION(dechex)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 16 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 16);
RETURN_STR(result);
}
/* }}} */
@@ -1220,24 +1219,24 @@ PHP_FUNCTION(base_convert)
zend_long frombase, tobase;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &number, &frombase, &tobase) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &number, &frombase, &tobase) == FAILURE) {
return;
}
convert_to_string_ex(number);
if (frombase < 2 || frombase > 36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%pd)", frombase);
+ php_error_docref(NULL, E_WARNING, "Invalid `from base' (%pd)", frombase);
RETURN_FALSE;
}
if (tobase < 2 || tobase > 36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%pd)", tobase);
+ php_error_docref(NULL, E_WARNING, "Invalid `to base' (%pd)", tobase);
RETURN_FALSE;
}
if(_php_math_basetozval(number, (int)frombase, &temp) == FAILURE) {
RETURN_FALSE;
}
- result = _php_math_zvaltobase(&temp, (int)tobase TSRMLS_CC);
+ result = _php_math_zvaltobase(&temp, (int)tobase);
RETVAL_STR(result);
}
/* }}} */
@@ -1373,7 +1372,7 @@ PHP_FUNCTION(number_format)
size_t thousand_sep_len = 0, dec_point_len = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
return;
}
#else
@@ -1421,7 +1420,7 @@ PHP_FUNCTION(fmod)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -1441,12 +1440,12 @@ PHP_FUNCTION(intdiv)
{
zend_long numerator, divisor;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &numerator, &divisor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) {
return;
}
if (divisor == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
RETURN_BOOL(0);
} else if (divisor == -1 && numerator == ZEND_LONG_MIN) {
/* Prevent overflow error/crash
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index e5359c2bcf..1a06e95b40 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -52,7 +52,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
PHP_MD5_CTX context;
unsigned char digest[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) {
return;
}
@@ -84,7 +84,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
size_t n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 55b8509f04..8ce43c6710 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -35,7 +35,7 @@ PHP_FUNCTION(metaphone)
zend_string *result = NULL;
zend_long phones = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &phones) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &phones) == FAILURE) {
return;
}
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 811731ee20..d8f72b20d4 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -55,7 +55,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_bool get_as_float = 0;
struct timeval tp = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &get_as_float) == FAILURE) {
return;
}
@@ -70,7 +70,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (mode) {
timelib_time_offset *offset;
- offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C));
+ offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info());
array_init(return_value);
add_assoc_long(return_value, "sec", tp.tv_sec);
@@ -114,7 +114,7 @@ PHP_FUNCTION(getrusage)
zend_long pwho = 0;
int who = RUSAGE_SELF;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &pwho) == FAILURE) {
return;
}
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index f773eb26c5..d1c7cf9e0b 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -57,7 +57,7 @@
if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \
efree(formatcodes); \
efree(formatargs); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \
+ php_error_docref(NULL, E_WARNING, "Type %c: integer overflow in format string", code); \
RETURN_FALSE; \
} \
outputpos += (a)*(b);
@@ -122,7 +122,7 @@ PHP_FUNCTION(pack)
int outputpos = 0, outputsize = 0;
char *output;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &argv, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &argv, &num_args) == FAILURE) {
return;
}
@@ -168,7 +168,7 @@ PHP_FUNCTION(pack)
case 'X':
case '@':
if (arg < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: '*' ignored", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", code);
arg = 1;
}
break;
@@ -182,7 +182,7 @@ PHP_FUNCTION(pack)
if (currentarg >= num_args) {
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough arguments", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough arguments", code);
RETURN_FALSE;
}
@@ -211,7 +211,7 @@ PHP_FUNCTION(pack)
#if SIZEOF_ZEND_LONG < 8
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
RETURN_FALSE;
#endif
case 'c':
@@ -237,7 +237,7 @@ PHP_FUNCTION(pack)
if (currentarg > num_args) {
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: too few arguments", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: too few arguments", code);
RETURN_FALSE;
}
break;
@@ -245,7 +245,7 @@ PHP_FUNCTION(pack)
default:
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: unknown format code", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: unknown format code", code);
RETURN_FALSE;
}
@@ -254,7 +254,7 @@ PHP_FUNCTION(pack)
}
if (currentarg < num_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d arguments unused", (num_args - currentarg));
+ php_error_docref(NULL, E_WARNING, "%d arguments unused", (num_args - currentarg));
}
/* Calculate output length and upper bound while processing*/
@@ -317,7 +317,7 @@ PHP_FUNCTION(pack)
outputpos -= arg;
if (outputpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", code);
outputpos = 0;
}
break;
@@ -368,7 +368,7 @@ PHP_FUNCTION(pack)
outputpos--;
if(arg > str->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough characters in string", code);
arg = str->len;
}
@@ -382,7 +382,7 @@ PHP_FUNCTION(pack)
} else if (n >= 'a' && n <= 'f') {
n -= ('a' - 10);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: illegal hex digit %c", code, n);
+ php_error_docref(NULL, E_WARNING, "Type %c: illegal hex digit %c", code, n);
n = 0;
}
@@ -563,7 +563,7 @@ PHP_FUNCTION(unpack)
zend_long formatlen, inputpos, inputlen;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &formatarg,
&inputarg) == FAILURE) {
return;
}
@@ -677,7 +677,7 @@ PHP_FUNCTION(unpack)
size = 8;
break;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
zval_dtor(return_value);
RETURN_FALSE;
#endif
@@ -693,7 +693,7 @@ PHP_FUNCTION(unpack)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format type %c", type);
+ php_error_docref(NULL, E_WARNING, "Invalid format type %c", type);
zval_dtor(return_value);
RETURN_FALSE;
break;
@@ -713,7 +713,7 @@ PHP_FUNCTION(unpack)
}
if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type);
inputpos = 0;
}
@@ -963,7 +963,7 @@ PHP_FUNCTION(unpack)
i = arg - 1; /* Break out of for loop */
if (arg >= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
}
break;
@@ -972,7 +972,7 @@ PHP_FUNCTION(unpack)
if (arg <= inputlen) {
inputpos = arg;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
i = arg - 1; /* Done, break out of for loop */
@@ -982,7 +982,7 @@ PHP_FUNCTION(unpack)
inputpos += size;
if (inputpos < 0) {
if (size != -1) { /* only print warning if not working with * */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
inputpos = 0;
}
@@ -990,7 +990,7 @@ PHP_FUNCTION(unpack)
/* Reached end of input for '*' repeater */
break;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);
zval_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c
index 8db9995d27..de13dd399f 100644
--- a/ext/standard/pageinfo.c
+++ b/ext/standard/pageinfo.c
@@ -57,11 +57,11 @@
/* {{{ php_statpage
*/
-PHPAPI void php_statpage(TSRMLS_D)
+PHPAPI void php_statpage(void)
{
zend_stat_t *pstat;
- pstat = sapi_get_stat(TSRMLS_C);
+ pstat = sapi_get_stat();
if (BG(page_uid)==-1 || BG(page_gid)==-1) {
if(pstat) {
@@ -79,16 +79,16 @@ PHPAPI void php_statpage(TSRMLS_D)
/* {{{ php_getuid
*/
-zend_long php_getuid(TSRMLS_D)
+zend_long php_getuid(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return (BG(page_uid));
}
/* }}} */
-zend_long php_getgid(TSRMLS_D)
+zend_long php_getgid(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return (BG(page_gid));
}
@@ -102,7 +102,7 @@ PHP_FUNCTION(getmyuid)
return;
}
- uid = php_getuid(TSRMLS_C);
+ uid = php_getuid();
if (uid < 0) {
RETURN_FALSE;
} else {
@@ -121,7 +121,7 @@ PHP_FUNCTION(getmygid)
return;
}
- gid = php_getgid(TSRMLS_C);
+ gid = php_getgid();
if (gid < 0) {
RETURN_FALSE;
} else {
@@ -157,7 +157,7 @@ PHP_FUNCTION(getmyinode)
return;
}
- php_statpage(TSRMLS_C);
+ php_statpage();
if (BG(page_inode) < 0) {
RETURN_FALSE;
} else {
@@ -166,9 +166,9 @@ PHP_FUNCTION(getmyinode)
}
/* }}} */
-PHPAPI time_t php_getlastmod(TSRMLS_D)
+PHPAPI time_t php_getlastmod(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return BG(page_mtime);
}
@@ -182,7 +182,7 @@ PHP_FUNCTION(getlastmod)
return;
}
- lm = php_getlastmod(TSRMLS_C);
+ lm = php_getlastmod();
if (lm < 0) {
RETURN_FALSE;
} else {
diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h
index ec5823246a..338d162cfe 100644
--- a/ext/standard/pageinfo.h
+++ b/ext/standard/pageinfo.h
@@ -27,9 +27,9 @@ PHP_FUNCTION(getmypid);
PHP_FUNCTION(getmyinode);
PHP_FUNCTION(getlastmod);
-PHPAPI void php_statpage(TSRMLS_D);
-PHPAPI time_t php_getlastmod(TSRMLS_D);
-extern zend_long php_getuid(TSRMLS_D);
-extern zend_long php_getgid(TSRMLS_D);
+PHPAPI void php_statpage(void);
+PHPAPI time_t php_getlastmod(void);
+extern zend_long php_getuid(void);
+extern zend_long php_getgid(void);
#endif
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 087b3ace76..5e1c26de54 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -107,7 +107,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s
}
/* }}} */
-static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
+static int php_password_make_salt(size_t length, char *ret) /* {{{ */
{
int buffer_valid = 0;
size_t i, raw_length;
@@ -115,7 +115,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
char *result;
if (length > (INT_MAX / 3)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length is too large to safely generate");
+ php_error_docref(NULL, E_WARNING, "Length is too large to safely generate");
return FAILURE;
}
@@ -152,13 +152,13 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
#endif
if (!buffer_valid) {
for (i = 0; i < raw_length; i++) {
- buffer[i] ^= (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX);
+ buffer[i] ^= (char) (255.0 * php_rand() / RAND_MAX);
}
}
result = safe_emalloc(length, 1, 1);
if (php_password_salt_to64(buffer, raw_length, length, result) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Generated salt too short");
+ php_error_docref(NULL, E_WARNING, "Generated salt too short");
efree(buffer);
efree(result);
return FAILURE;
@@ -178,7 +178,7 @@ PHP_FUNCTION(password_get_info)
char *hash, *algo_name;
zval options;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hash, &hash_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hash, &hash_len) == FAILURE) {
return;
}
@@ -216,7 +216,7 @@ PHP_FUNCTION(password_needs_rehash)
HashTable *options = 0;
zval *option_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
return;
}
@@ -265,7 +265,7 @@ PHP_FUNCTION(password_verify)
char *password, *hash;
zend_string *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &password, &password_len, &hash, &hash_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &password, &password_len, &hash, &hash_len) == FAILURE) {
RETURN_FALSE;
}
if ((ret = php_crypt(password, (int)password_len, hash, (int)hash_len)) == NULL) {
@@ -305,7 +305,7 @@ PHP_FUNCTION(password_hash)
zval *option_buffer;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
return;
}
@@ -327,7 +327,7 @@ PHP_FUNCTION(password_hash)
}
if (cost < 4 || cost > 31) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost);
+ php_error_docref(NULL, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost);
RETURN_NULL();
}
@@ -339,7 +339,7 @@ PHP_FUNCTION(password_hash)
break;
case PHP_PASSWORD_UNKNOWN:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo);
+ php_error_docref(NULL, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo);
RETURN_NULL();
}
@@ -373,7 +373,7 @@ PHP_FUNCTION(password_hash)
case IS_ARRAY:
default:
efree(hash_format);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-string salt parameter supplied");
+ php_error_docref(NULL, E_WARNING, "Non-string salt parameter supplied");
RETURN_NULL();
}
@@ -383,12 +383,12 @@ PHP_FUNCTION(password_hash)
if (buffer_len > INT_MAX) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long");
+ php_error_docref(NULL, E_WARNING, "Supplied salt is too long");
RETURN_NULL();
} else if (buffer_len < required_salt_len) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
+ php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
RETURN_NULL();
} else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) {
salt = safe_emalloc(required_salt_len, 1, 1);
@@ -396,7 +396,7 @@ PHP_FUNCTION(password_hash)
efree(hash_format);
efree(buffer);
efree(salt);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd", buffer_len);
+ php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd", buffer_len);
RETURN_NULL();
}
salt_len = required_salt_len;
@@ -408,7 +408,7 @@ PHP_FUNCTION(password_hash)
efree(buffer);
} else {
salt = safe_emalloc(required_salt_len, 1, 1);
- if (php_password_make_salt(required_salt_len, salt TSRMLS_CC) == FAILURE) {
+ if (php_password_make_salt(required_salt_len, salt) == FAILURE) {
efree(hash_format);
efree(salt);
RETURN_FALSE;
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index 31955042eb..b35ce30c8b 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -104,11 +104,11 @@ PHP_FUNCTION(array_chunk);
PHP_FUNCTION(array_combine);
PHPAPI HashTable* php_splice(HashTable *, int, int, zval *, int, HashTable *);
-PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC);
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC);
+PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
+PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
+PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
+PHPAPI int php_multisort_compare(const void *a, const void *b);
+PHPAPI zend_long php_count_recursive(zval *array, zend_long mode);
#define PHP_SORT_REGULAR 0
#define PHP_SORT_NUMERIC 1
@@ -127,11 +127,11 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC);
ZEND_BEGIN_MODULE_GLOBALS(array)
int *multisort_flags[2];
- int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ int (*compare_func)(zval *result, zval *op1, zval *op2);
ZEND_END_MODULE_GLOBALS(array)
#ifdef ZTS
-#define ARRAYG(v) TSRMG(array_globals_id, zend_array_globals *, v)
+#define ARRAYG(v) ZEND_TSRMG(array_globals_id, zend_array_globals *, v)
#else
#define ARRAYG(v) (array_globals.v)
#endif
diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h
index e32c4a2cb9..2018694e65 100644
--- a/ext/standard/php_filestat.h
+++ b/ext/standard/php_filestat.h
@@ -84,8 +84,8 @@ typedef unsigned int php_stat_len;
typedef int php_stat_len;
#endif
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC);
-PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC);
+PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len);
+PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value);
/* Switches for various filestat functions: */
#define FS_PERMS 0
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 8026b08d45..9239b37032 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -31,21 +31,21 @@
#include "php_fopen_wrappers.h"
#include "SAPI.h"
-static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
PHPWRITE(buf, count);
return count;
}
/* }}} */
-static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
stream->eof = 1;
return 0;
}
/* }}} */
-static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_stream_output_close(php_stream *stream, int close_handle) /* {{{ */
{
return 0;
}
@@ -69,20 +69,20 @@ typedef struct php_stream_input { /* {{{ */
} php_stream_input_t;
/* }}} */
-static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return -1;
}
/* }}} */
-static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
php_stream_input_t *input = stream->abstract;
size_t read;
if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) {
/* read requested data from SAPI */
- int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC);
+ int read_bytes = sapi_read_post_block(buf, count);
if (read_bytes > 0) {
php_stream_seek(input->body, 0, SEEK_END);
@@ -103,7 +103,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
}
/* }}} */
-static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_stream_input_close(php_stream *stream, int close_handle) /* {{{ */
{
efree(stream->abstract);
stream->abstract = NULL;
@@ -112,13 +112,13 @@ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC
}
/* }}} */
-static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_stream_input_flush(php_stream *stream) /* {{{ */
{
return -1;
}
/* }}} */
-static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
php_stream_input_t *input = stream->abstract;
@@ -144,7 +144,7 @@ php_stream_ops php_stream_input_ops = {
NULL /* set_option */
};
-static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */
+static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain) /* {{{ */
{
char *p, *token;
php_stream_filter *temp_filter;
@@ -153,17 +153,17 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
while (p) {
php_url_decode(p, strlen(p));
if (read_chain) {
- if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
+ if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) {
php_stream_filter_append(&stream->readfilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
+ php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p);
}
}
if (write_chain) {
- if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
+ if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) {
php_stream_filter_append(&stream->writefilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
+ php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p);
}
}
p = php_strtok_r(NULL, "|", &token);
@@ -172,7 +172,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
/* }}} */
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+ char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
int fd = -1;
int mode_rw = 0;
@@ -192,7 +192,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
path += 11;
max_memory = ZEND_STRTOL(path, NULL, 10);
if (max_memory < 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
return NULL;
}
}
@@ -222,7 +222,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -241,7 +241,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if (!strcasecmp(path, "stdin")) {
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -291,14 +291,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if (strcmp(sapi_module.name, "cli")) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
+ php_error_docref(NULL, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
}
return NULL;
}
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -306,7 +306,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
start = &path[3];
fildes_ori = ZEND_STRTOL(start, &end, 10);
if (end == start || *end != '\0') {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"php://fd/ stream must be specified in the form php://fd/<orig fd>");
return NULL;
}
@@ -318,14 +318,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
#endif
if (fildes_ori < 0 || fildes_ori >= dtablesize) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"The file descriptors must be non-negative numbers smaller than %d", dtablesize);
return NULL;
}
fd = dup((int)fildes_ori);
if (fd == -1) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: "
"[%d]: %s", fildes_ori, errno, strerror(errno));
return NULL;
@@ -341,7 +341,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
pathdup = estrndup(path + 6, strlen(path + 6));
p = strstr(pathdup, "/resource=");
if (!p) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "No URL resource specified");
efree(pathdup);
return NULL;
}
@@ -355,11 +355,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
p = php_strtok_r(pathdup + 1, "/", &token);
while (p) {
if (!strncasecmp(p, "read=", 5)) {
- php_stream_apply_filter_list(stream, p + 5, 1, 0 TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p + 5, 1, 0);
} else if (!strncasecmp(p, "write=", 6)) {
- php_stream_apply_filter_list(stream, p + 6, 0, 1 TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p + 6, 0, 1);
} else {
- php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE);
}
p = php_strtok_r(NULL, "/", &token);
}
@@ -368,7 +368,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
return stream;
} else {
/* invalid php://thingy */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid php:// URL specified");
+ php_error_docref(NULL, E_WARNING, "Invalid php:// URL specified");
return NULL;
}
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 6d6a5bde27..b82a1f8913 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -23,8 +23,8 @@
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
extern PHPAPI php_stream_wrapper php_stream_php_wrapper;
diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h
index 712e297fe3..81a5b45bb6 100644
--- a/ext/standard/php_http.h
+++ b/ext/standard/php_http.h
@@ -28,8 +28,8 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, size_t num_prefix_len,
const char *key_prefix, size_t key_prefix_len,
const char *key_suffix, size_t key_suffix_len,
- zval *type, char *arg_sep, int enc_type TSRMLS_DC);
-#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL TSRMLS_CC)
+ zval *type, char *arg_sep, int enc_type);
+#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL)
PHP_FUNCTION(http_build_query);
diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h
index 3853b0e6c3..de6527ebb2 100644
--- a/ext/standard/php_image.h
+++ b/ext/standard/php_image.h
@@ -59,7 +59,7 @@ typedef enum
PHP_MINIT_FUNCTION(imagetypes);
-PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC);
+PHPAPI int php_getimagetype(php_stream *stream, char *filetype);
PHPAPI char * php_image_type_to_mime_type(int image_type);
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index fa2747f3bf..6fb97e9d77 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -52,7 +52,7 @@
extern "C" {
#endif
-PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
+PHPAPI zend_class_entry *php_create_incomplete_class(void);
PHPAPI zend_string *php_lookup_class_name(zval *object);
PHPAPI void php_store_class_name(zval *object, const char *name, size_t len);
diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h
index dcc82e9511..c89f4f3034 100644
--- a/ext/standard/php_lcg.h
+++ b/ext/standard/php_lcg.h
@@ -29,13 +29,13 @@ typedef struct {
int seeded;
} php_lcg_globals;
-PHPAPI double php_combined_lcg(TSRMLS_D);
+PHPAPI double php_combined_lcg(void);
PHP_FUNCTION(lcg_value);
PHP_MINIT_FUNCTION(lcg);
#ifdef ZTS
-#define LCG(v) TSRMG(lcg_globals_id, php_lcg_globals *, v)
+#define LCG(v) ZEND_TSRMG(lcg_globals_id, php_lcg_globals *, v)
#else
#define LCG(v) (lcg_globals.v)
#endif
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index f7ee5e983a..68f806db5d 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -25,6 +25,6 @@ PHP_FUNCTION(mail);
PHP_MINFO_FUNCTION(mail);
PHP_FUNCTION(ezmlm_hash);
-PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC);
+PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd);
#endif /* PHP_MAIL_H */
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 7fb6909e7f..075e69058d 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -24,10 +24,10 @@
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC);
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);
PHPAPI zend_long _php_math_basetolong(zval *arg, int base);
PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret);
-PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC);
+PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base);
PHP_FUNCTION(sin);
PHP_FUNCTION(cos);
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index bbdf16d385..e775d1b465 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -48,14 +48,14 @@
#define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */
#ifdef PHP_WIN32
-#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C))))
+#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#else
-#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C))))
+#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#endif
-PHPAPI void php_srand(zend_long seed TSRMLS_DC);
-PHPAPI zend_long php_rand(TSRMLS_D);
-PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC);
-PHPAPI php_uint32 php_mt_rand(TSRMLS_D);
+PHPAPI void php_srand(zend_long seed);
+PHPAPI zend_long php_rand(void);
+PHPAPI void php_mt_srand(php_uint32 seed);
+PHPAPI php_uint32 php_mt_rand(void);
#endif /* PHP_RAND_H */
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 0b655bfbdf..c79bfb20fe 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -121,31 +121,31 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out);
PHPAPI char *php_strtoupper(char *s, size_t len);
PHPAPI char *php_strtolower(char *s, size_t len);
PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen);
-PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC);
-PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength TSRMLS_DC);
-PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC);
+PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free);
+PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength);
+PHPAPI void php_stripslashes(char *str, size_t *len);
PHPAPI void php_stripcslashes(char *str, size_t *len);
-PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC);
+PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen);
PHPAPI size_t php_dirname(char *str, size_t len);
PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
PHPAPI zend_string *php_str_to_str_ex(char *haystack, size_t length, char *needle,
size_t needle_len, char *str, size_t str_len, int case_sensitivity, size_t *replace_count);
PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
size_t needle_len, char *str, size_t str_len);
-PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC);
+PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode);
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, char *allow, size_t allow_len);
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len, zend_bool allow_tag_spaces);
PHPAPI size_t php_char_to_str_ex(char *str, size_t len, char from, char *to, size_t to_len, zval *result, int case_sensitivity, size_t *replace_count);
PHPAPI size_t php_char_to_str(char *str, size_t len, char from, char *to, size_t to_len, zval *result);
-PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC);
+PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value);
PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit);
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC);
-PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive);
+PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2);
+PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2);
#ifndef HAVE_STRERROR
PHPAPI char *php_strerror(int errnum);
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index a4df8f51f9..a3b0dbf94f 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -32,11 +32,11 @@ PHP_FUNCTION(unserialize);
PHP_FUNCTION(memory_get_usage);
PHP_FUNCTION(memory_get_peak_usage);
-PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC);
-PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC);
-PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC);
+PHPAPI void php_var_dump(zval *struc, int level);
+PHPAPI void php_var_export(zval *struc, int level);
+PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf);
-PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC);
+PHPAPI void php_debug_zval_dump(zval *struc, int level);
struct php_serialize_data {
HashTable ht;
@@ -53,11 +53,11 @@ struct php_unserialize_data {
typedef struct php_serialize_data *php_serialize_data_t;
typedef struct php_unserialize_data *php_unserialize_data_t;
-PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC);
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC);
+PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data);
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes);
#define PHP_VAR_SERIALIZE_INIT(d) \
do { \
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index d6a6f2be50..6f2516bca6 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -73,7 +73,7 @@
static int le_proc_open;
/* {{{ _php_array_to_envp */
-static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent TSRMLS_DC)
+static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent)
{
zval *element;
php_process_env_t env;
@@ -186,7 +186,7 @@ static void _php_free_envp(php_process_env_t env, int is_persistent)
/* }}} */
/* {{{ proc_open_rsrc_dtor */
-static void proc_open_rsrc_dtor(zend_resource *rsrc TSRMLS_DC)
+static void proc_open_rsrc_dtor(zend_resource *rsrc)
{
struct php_process_handle *proc = (struct php_process_handle*)rsrc->ptr;
int i;
@@ -262,7 +262,7 @@ PHP_FUNCTION(proc_terminate)
struct php_process_handle *proc;
zend_long sig_no = SIGTERM;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zproc, &sig_no) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zproc, &sig_no) == FAILURE) {
RETURN_FALSE;
}
@@ -291,7 +291,7 @@ PHP_FUNCTION(proc_close)
zval *zproc;
struct php_process_handle *proc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) {
RETURN_FALSE;
}
@@ -319,7 +319,7 @@ PHP_FUNCTION(proc_get_status)
int running = 1, signaled = 0, stopped = 0;
int exitcode = -1, termsig = 0, stopsig = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) {
RETURN_FALSE;
}
@@ -459,7 +459,7 @@ PHP_FUNCTION(proc_open)
php_file_descriptor_t slave_pty = -1;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz/|s!a!a!", &command,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "saz/|s!a!a!", &command,
&command_len, &descriptorspec, &pipes, &cwd, &cwd_len, &environment,
&other_options) == FAILURE) {
RETURN_FALSE;
@@ -488,7 +488,7 @@ PHP_FUNCTION(proc_open)
command_len = strlen(command);
if (environment) {
- env = _php_array_to_envp(environment, is_persistent TSRMLS_CC);
+ env = _php_array_to_envp(environment, is_persistent);
} else {
memset(&env, 0, sizeof(env));
}
@@ -508,7 +508,7 @@ PHP_FUNCTION(proc_open)
zval *ztype;
if (str_index) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor spec must be an integer indexed array");
+ php_error_docref(NULL, E_WARNING, "descriptor spec must be an integer indexed array");
goto exit_fail;
}
@@ -528,27 +528,27 @@ PHP_FUNCTION(proc_open)
#ifdef PHP_WIN32
descriptors[ndesc].childend = dup_fd_as_handle((int)fd);
if (descriptors[ndesc].childend == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex);
+ php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex);
goto exit_fail;
}
#else
descriptors[ndesc].childend = dup(fd);
if (descriptors[ndesc].childend < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno));
goto exit_fail;
}
#endif
descriptors[ndesc].mode = DESC_FILE;
} else if (Z_TYPE_P(descitem) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor item must be either an array or a File-Handle");
+ php_error_docref(NULL, E_WARNING, "Descriptor item must be either an array or a File-Handle");
goto exit_fail;
} else {
if ((ztype = zend_hash_index_find(Z_ARRVAL_P(descitem), 0)) != NULL) {
convert_to_string_ex(ztype);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing handle qualifier in array");
+ php_error_docref(NULL, E_WARNING, "Missing handle qualifier in array");
goto exit_fail;
}
@@ -559,14 +559,14 @@ PHP_FUNCTION(proc_open)
if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) {
convert_to_string_ex(zmode);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'");
+ php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'pipe'");
goto exit_fail;
}
descriptors[ndesc].mode = DESC_PIPE;
if (0 != pipe(newpipe)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create pipe %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to create pipe %s", strerror(errno));
goto exit_fail;
}
@@ -598,14 +598,14 @@ PHP_FUNCTION(proc_open)
if ((zfile = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) {
convert_to_string_ex(zfile);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'");
+ php_error_docref(NULL, E_WARNING, "Missing file name parameter for 'file'");
goto exit_fail;
}
if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 2)) != NULL) {
convert_to_string_ex(zmode);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'");
+ php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'file'");
goto exit_fail;
}
@@ -638,7 +638,7 @@ PHP_FUNCTION(proc_open)
/* open things up */
dev_ptmx = open("/dev/ptmx", O_RDWR);
if (dev_ptmx == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open /dev/ptmx, errno %d", errno);
+ php_error_docref(NULL, E_WARNING, "failed to open /dev/ptmx, errno %d", errno);
goto exit_fail;
}
grantpt(dev_ptmx);
@@ -646,7 +646,7 @@ PHP_FUNCTION(proc_open)
slave_pty = open(ptsname(dev_ptmx), O_RDWR);
if (slave_pty == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open slave pty, errno %d", errno);
+ php_error_docref(NULL, E_WARNING, "failed to open slave pty, errno %d", errno);
goto exit_fail;
}
}
@@ -655,11 +655,11 @@ PHP_FUNCTION(proc_open)
descriptors[ndesc].parentend = dup(dev_ptmx);
descriptors[ndesc].mode_flags = O_RDWR;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal not supported on this system");
+ php_error_docref(NULL, E_WARNING, "pty pseudo terminal not supported on this system");
goto exit_fail;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype));
+ php_error_docref(NULL, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype));
goto exit_fail;
}
}
@@ -673,7 +673,7 @@ PHP_FUNCTION(proc_open)
char *getcwd_result;
getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
if (!getcwd_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get current directory");
+ php_error_docref(NULL, E_WARNING, "Cannot get current directory");
goto exit_fail;
}
cwd = cur_cwd;
@@ -738,7 +738,7 @@ PHP_FUNCTION(proc_open)
CloseHandle(descriptors[i].parentend);
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed, error code - %u", dw);
+ php_error_docref(NULL, E_WARNING, "CreateProcess failed, error code - %u", dw);
goto exit_fail;
}
@@ -787,7 +787,7 @@ PHP_FUNCTION(proc_open)
if (descriptors[i].parentend)
close(descriptors[i].parentend);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "procve failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "procve failed - %s", strerror(errno));
goto exit_fail;
}
#elif HAVE_FORK
@@ -856,7 +856,7 @@ PHP_FUNCTION(proc_open)
close(descriptors[i].parentend);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "fork failed - %s", strerror(errno));
goto exit_fail;
diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c
index 441b65288c..6699566863 100644
--- a/ext/standard/quot_print.c
+++ b/ext/standard/quot_print.c
@@ -206,7 +206,7 @@ PHP_FUNCTION(quoted_printable_decode)
zend_string *str_out;
size_t i = 0, j = 0, k;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg1) == FAILURE) {
return;
}
@@ -267,7 +267,7 @@ PHP_FUNCTION(quoted_printable_encode)
zend_string *str;
zend_string *new_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) != SUCCESS) {
return;
}
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 47b55af466..528b38fd41 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -38,7 +38,7 @@
/* {{{ php_srand
*/
-PHPAPI void php_srand(zend_long seed TSRMLS_DC)
+PHPAPI void php_srand(zend_long seed)
{
#ifdef ZTS
BG(rand_seed) = (unsigned int) seed;
@@ -59,12 +59,12 @@ PHPAPI void php_srand(zend_long seed TSRMLS_DC)
/* {{{ php_rand
*/
-PHPAPI zend_long php_rand(TSRMLS_D)
+PHPAPI zend_long php_rand(void)
{
zend_long ret;
if (!BG(rand_is_seeded)) {
- php_srand(GENERATE_SEED() TSRMLS_CC);
+ php_srand(GENERATE_SEED());
}
#ifdef ZTS
@@ -171,7 +171,7 @@ static inline void php_mt_initialize(php_uint32 seed, php_uint32 *state)
/* {{{ php_mt_reload
*/
-static inline void php_mt_reload(TSRMLS_D)
+static inline void php_mt_reload(void)
{
/* Generate N new values in state
Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) */
@@ -192,11 +192,11 @@ static inline void php_mt_reload(TSRMLS_D)
/* {{{ php_mt_srand
*/
-PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC)
+PHPAPI void php_mt_srand(php_uint32 seed)
{
/* Seed the generator with a simple uint32 */
php_mt_initialize(seed, BG(state));
- php_mt_reload(TSRMLS_C);
+ php_mt_reload();
/* Seed only once */
BG(mt_rand_is_seeded) = 1;
@@ -205,7 +205,7 @@ PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC)
/* {{{ php_mt_rand
*/
-PHPAPI php_uint32 php_mt_rand(TSRMLS_D)
+PHPAPI php_uint32 php_mt_rand(void)
{
/* Pull a 32-bit integer from the generator state
Every other access function simply transforms the numbers extracted here */
@@ -213,7 +213,7 @@ PHPAPI php_uint32 php_mt_rand(TSRMLS_D)
register php_uint32 s1;
if (BG(left) == 0) {
- php_mt_reload(TSRMLS_C);
+ php_mt_reload();
}
--BG(left);
@@ -231,13 +231,13 @@ PHP_FUNCTION(srand)
{
zend_long seed = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE)
return;
if (ZEND_NUM_ARGS() == 0)
seed = GENERATE_SEED();
- php_srand(seed TSRMLS_CC);
+ php_srand(seed);
}
/* }}} */
@@ -247,13 +247,13 @@ PHP_FUNCTION(mt_srand)
{
zend_long seed = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE)
return;
if (ZEND_NUM_ARGS() == 0)
seed = GENERATE_SEED();
- php_mt_srand(seed TSRMLS_CC);
+ php_mt_srand(seed);
}
/* }}} */
@@ -293,10 +293,10 @@ PHP_FUNCTION(rand)
zend_long number;
int argc = ZEND_NUM_ARGS();
- if (argc != 0 && zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE)
+ if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE)
return;
- number = php_rand(TSRMLS_C);
+ number = php_rand();
if (argc == 2) {
RAND_RANGE(number, min, max, PHP_RAND_MAX);
}
@@ -315,16 +315,16 @@ PHP_FUNCTION(mt_rand)
int argc = ZEND_NUM_ARGS();
if (argc != 0) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) {
+ if (zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) {
return;
} else if (max < min) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min);
+ php_error_docref(NULL, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min);
RETURN_FALSE;
}
}
if (!BG(mt_rand_is_seeded)) {
- php_mt_srand(GENERATE_SEED() TSRMLS_CC);
+ php_mt_srand(GENERATE_SEED());
}
/*
@@ -335,7 +335,7 @@ PHP_FUNCTION(mt_rand)
* Update:
* I talked with Cokus via email and it won't ruin the algorithm
*/
- number = (zend_long) (php_mt_rand(TSRMLS_C) >> 1);
+ number = (zend_long) (php_mt_rand() >> 1);
if (argc == 2) {
RAND_RANGE(number, min, max, PHP_MT_RAND_MAX);
}
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index 62437831bb..ad5e2d1850 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -316,7 +316,6 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
int staticAssign[STATIC_LIST_SIZE];
int *nassign = staticAssign;
int objIndex, xpgSize, nspace = STATIC_LIST_SIZE;
- TSRMLS_FETCH();
/*
* Initialize an array that records the number of times a variable
@@ -394,7 +393,7 @@ notXpg:
gotSequential = 1;
if (gotXpg) {
mixedXPG:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers");
goto error;
}
@@ -445,7 +444,7 @@ xpgCheckDone:
/* problem - cc */
/*
if (flags & SCAN_WIDTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field width may not be specified in %c conversion");
+ php_error_docref(NULL, E_WARNING, "Field width may not be specified in %c conversion");
goto error;
}
*/
@@ -476,11 +475,11 @@ xpgCheckDone:
}
break;
badSet:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unmatched [ in format string");
+ php_error_docref(NULL, E_WARNING, "Unmatched [ in format string");
goto error;
default: {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", *ch);
+ php_error_docref(NULL, E_WARNING, "Bad scan conversion character \"%c\"", *ch);
goto error;
}
}
@@ -530,14 +529,14 @@ badSet:
}
for (i = 0; i < numVars; i++) {
if (nassign[i] > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers");
goto error;
} else if (!xpgSize && (nassign[i] == 0)) {
/*
* If the space is empty, and xpgSize is 0 (means XPG wasn't
* used, and/or numVars != 0), then too many vars were given
*/
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is not assigned by any conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "Variable is not assigned by any conversion specifiers");
goto error;
}
}
@@ -549,9 +548,9 @@ badSet:
badIndex:
if (gotXpg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "\"%n$\" argument index out of range");
+ php_error_docref(NULL, E_WARNING, "%s", "\"%n$\" argument index out of range");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of variable names and field specifiers");
+ php_error_docref(NULL, E_WARNING, "Different numbers of variable names and field specifiers");
}
error:
@@ -578,7 +577,7 @@ error:
PHPAPI int php_sscanf_internal( char *string, char *format,
int argCount, zval *args,
- int varStart, zval *return_value TSRMLS_DC)
+ int varStart, zval *return_value)
{
int numVars, nconversions, totalVars = -1;
int i, result;
@@ -625,7 +624,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
if (numVars) {
for (i = varStart;i < argCount;i++){
if ( ! Z_ISREF(args[ i ] ) ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d must be passed by reference", i);
+ php_error_docref(NULL, E_WARNING, "Parameter %d must be passed by reference", i);
scan_set_error_return(numVars, return_value);
return SCAN_ERROR_VAR_PASSED_BYVAL;
}
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index 6d9e8a443c..a94e8006de 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -43,7 +43,7 @@
*/
PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars);
PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval *args,
- int varStart, zval *return_value TSRMLS_DC);
+ int varStart, zval *return_value);
#endif /* SCANF_H */
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index 249828fb3d..e966149e76 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -40,7 +40,7 @@ PHP_FUNCTION(sha1)
PHP_SHA1_CTX context;
unsigned char digest[20];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) {
return;
}
@@ -74,7 +74,7 @@ PHP_FUNCTION(sha1_file)
size_t n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c
index d882f5cab6..b9f89a8ac1 100644
--- a/ext/standard/soundex.c
+++ b/ext/standard/soundex.c
@@ -60,7 +60,7 @@ PHP_FUNCTION(soundex)
0, /* Y */
'2'}; /* Z */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
if (str_len == 0) {
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 51e3c14e7a..3a28a2d576 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -42,7 +42,7 @@ typedef unsigned __int64 php_timeout_ull;
#define GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), wrapper, name)))
-static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
+static php_stream_context *decode_context_param(zval *contextresource);
/* Streams based network functions */
@@ -55,14 +55,14 @@ PHP_FUNCTION(stream_socket_pair)
php_stream *s1, *s2;
php_socket_t pair[2];
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lll",
&domain, &type, &protocol)) {
RETURN_FALSE;
}
if (0 != socketpair((int)domain, (int)type, (int)protocol, pair)) {
char errbuf[256];
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create sockets: [%d]: %s",
+ php_error_docref(NULL, E_WARNING, "failed to create sockets: [%d]: %s",
php_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf)));
RETURN_FALSE;
}
@@ -102,7 +102,7 @@ PHP_FUNCTION(stream_socket_client)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -138,9 +138,9 @@ PHP_FUNCTION(stream_socket_client)
if (stream == NULL) {
/* host might contain binary characters */
- zend_string *quoted_host = php_addslashes(host, host_len, 0 TSRMLS_CC);
+ zend_string *quoted_host = php_addslashes(host, host_len, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val);
zend_string_release(quoted_host);
}
@@ -186,7 +186,7 @@ PHP_FUNCTION(stream_socket_server)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -210,7 +210,7 @@ PHP_FUNCTION(stream_socket_server)
NULL, NULL, context, &errstr, &err);
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val);
}
if (stream == NULL) {
@@ -248,7 +248,7 @@ PHP_FUNCTION(stream_socket_accept)
zval *zstream;
zend_string *errstr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) {
RETURN_FALSE;
}
@@ -272,14 +272,14 @@ PHP_FUNCTION(stream_socket_accept)
zpeername ? &peername : NULL,
NULL, NULL,
&tv, &errstr
- TSRMLS_CC) && clistream) {
+ ) && clistream) {
if (peername) {
ZVAL_STR(zpeername, peername);
}
php_stream_to_zval(clistream, return_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error");
+ php_error_docref(NULL, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error");
RETVAL_FALSE;
}
@@ -298,7 +298,7 @@ PHP_FUNCTION(stream_socket_get_name)
zend_bool want_peer;
zend_string *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &zstream, &want_peer) == FAILURE) {
RETURN_FALSE;
}
@@ -307,7 +307,7 @@ PHP_FUNCTION(stream_socket_get_name)
if (0 != php_stream_xport_get_name(stream, want_peer,
&name,
NULL, NULL
- TSRMLS_CC)) {
+ )) {
RETURN_FALSE;
}
@@ -327,20 +327,20 @@ PHP_FUNCTION(stream_socket_sendto)
php_sockaddr_storage sa;
socklen_t sl = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, zstream);
if (target_addr_len) {
/* parse the address */
- if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr);
+ if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl)) {
+ php_error_docref(NULL, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr);
RETURN_FALSE;
}
}
- RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl TSRMLS_CC));
+ RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl));
}
/* }}} */
@@ -356,7 +356,7 @@ PHP_FUNCTION(stream_socket_recvfrom)
zend_long flags = 0;
int recvd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
RETURN_FALSE;
}
@@ -368,7 +368,7 @@ PHP_FUNCTION(stream_socket_recvfrom)
}
if (to_read <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -376,7 +376,7 @@ PHP_FUNCTION(stream_socket_recvfrom)
recvd = php_stream_xport_recvfrom(stream, read_buf->val, to_read, (int)flags, NULL, NULL,
zremote ? &remote_addr : NULL
- TSRMLS_CC);
+ );
if (recvd >= 0) {
if (zremote) {
@@ -402,7 +402,7 @@ PHP_FUNCTION(stream_get_contents)
desiredpos = -1L;
zend_string *contents;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
RETURN_FALSE;
}
@@ -422,14 +422,14 @@ PHP_FUNCTION(stream_get_contents)
}
if (seek_res != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to seek to position %pd in the stream", desiredpos);
RETURN_FALSE;
}
}
if (maxlen > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+ php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
maxlen = INT_MAX;
}
if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) {
@@ -450,7 +450,7 @@ PHP_FUNCTION(stream_copy_to_stream)
size_t len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
@@ -458,7 +458,7 @@ PHP_FUNCTION(stream_copy_to_stream)
php_stream_from_zval(dest, zdest);
if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos);
RETURN_FALSE;
}
@@ -478,7 +478,7 @@ PHP_FUNCTION(stream_get_meta_data)
zval *arg1;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
php_stream_from_zval(stream, arg1);
@@ -575,7 +575,7 @@ PHP_FUNCTION(stream_get_wrappers)
/* }}} */
/* {{{ stream_select related functions */
-static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd TSRMLS_DC)
+static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd)
{
zval *elem;
php_stream *stream;
@@ -613,7 +613,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
return cnt ? 1 : 0;
}
-static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
+static int stream_array_from_fd_set(zval *stream_array, fd_set *fds)
{
zval *elem, *dest_elem, new_array;
php_stream *stream;
@@ -666,7 +666,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
return ret;
}
-static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
+static int stream_array_emulate_read_fd_set(zval *stream_array)
{
zval *elem, *dest_elem, new_array;
php_stream *stream;
@@ -726,7 +726,7 @@ PHP_FUNCTION(stream_select)
zend_long usec = 0;
int set_count, max_set_count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
FD_ZERO(&rfds);
@@ -734,28 +734,28 @@ PHP_FUNCTION(stream_select)
FD_ZERO(&efds);
if (r_array != NULL) {
- set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (w_array != NULL) {
- set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (e_array != NULL) {
- set_count = stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(e_array, &efds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, "No stream arrays were passed");
RETURN_FALSE;
}
@@ -766,10 +766,10 @@ PHP_FUNCTION(stream_select)
convert_to_long_ex(sec);
if (Z_LVAL_P(sec) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The seconds parameter must be greater than 0");
RETURN_FALSE;
} else if (usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The microseconds parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The microseconds parameter must be greater than 0");
RETURN_FALSE;
}
@@ -794,7 +794,7 @@ PHP_FUNCTION(stream_select)
* that we selected, but return only the readable sockets */
if (r_array != NULL) {
- retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC);
+ retval = stream_array_emulate_read_fd_set(r_array);
if (retval > 0) {
if (w_array != NULL) {
zend_hash_clean(Z_ARRVAL_P(w_array));
@@ -809,14 +809,14 @@ PHP_FUNCTION(stream_select)
retval = php_select(max_fd+1, &rfds, &wfds, &efds, tv_p);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
errno, strerror(errno), max_fd);
RETURN_FALSE;
}
- if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds TSRMLS_CC);
- if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds TSRMLS_CC);
- if (e_array != NULL) stream_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds);
+ if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds);
+ if (e_array != NULL) stream_array_from_fd_set(e_array, &efds);
RETURN_LONG(retval);
}
@@ -824,7 +824,7 @@ PHP_FUNCTION(stream_select)
/* {{{ stream_context related functions */
static void user_space_stream_notifier(php_stream_context *context, int notifycode, int severity,
- char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC)
+ char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr)
{
zval *callback = &context->notifier->ptr;
zval retval;
@@ -842,8 +842,8 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco
ZVAL_LONG(&zvs[4], bytes_sofar);
ZVAL_LONG(&zvs[5], bytes_max);
- if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier");
+ if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL)) {
+ php_error_docref(NULL, E_WARNING, "failed to call user notifier");
}
for (i = 0; i < 6; i++) {
zval_ptr_dtor(&zvs[i]);
@@ -859,7 +859,7 @@ static void user_space_stream_notifier_dtor(php_stream_notifier *notifier)
}
}
-static int parse_context_options(php_stream_context *context, zval *options TSRMLS_DC)
+static int parse_context_options(php_stream_context *context, zval *options)
{
zval *wval, *oval;
zend_string *wkey, *okey;
@@ -875,14 +875,14 @@ static int parse_context_options(php_stream_context *context, zval *options TSRM
} ZEND_HASH_FOREACH_END();
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value");
+ php_error_docref(NULL, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value");
}
} ZEND_HASH_FOREACH_END();
return ret;
}
-static int parse_context_params(php_stream_context *context, zval *params TSRMLS_DC)
+static int parse_context_params(php_stream_context *context, zval *params)
{
int ret = SUCCESS;
zval *tmp;
@@ -901,9 +901,9 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
}
if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(params), "options", sizeof("options")-1))) {
if (Z_TYPE_P(tmp) == IS_ARRAY) {
- parse_context_options(context, tmp TSRMLS_CC);
+ parse_context_options(context, tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
}
}
@@ -913,15 +913,15 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
/* given a zval which is either a stream or a context, return the underlying
* stream_context. If it is a stream that does not have a context assigned, it
* will create and assign a context and return that. */
-static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
+static php_stream_context *decode_context_param(zval *contextresource)
{
php_stream_context *context = NULL;
- context = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context(TSRMLS_C));
+ context = zend_fetch_resource(contextresource, -1, NULL, NULL, 1, php_le_stream_context());
if (context == NULL) {
php_stream *stream;
- stream = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream);
+ stream = zend_fetch_resource(contextresource, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream);
if (stream) {
context = PHP_STREAM_CONTEXT(stream);
@@ -930,7 +930,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
param, but then something is called which requires a context.
Don't give them the default one though since they already said they
didn't want it. */
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
stream->ctx = context->res;
}
}
@@ -947,12 +947,12 @@ PHP_FUNCTION(stream_context_get_options)
zval *zcontext;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
@@ -969,26 +969,26 @@ PHP_FUNCTION(stream_context_set_option)
char *wrappername, *optionname;
size_t wrapperlen, optionlen;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"rssz", &zcontext, &wrappername, &wrapperlen,
&optionname, &optionlen, &zvalue) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"ra", &zcontext, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "called with wrong number or type of parameters; please RTM");
+ php_error_docref(NULL, E_WARNING, "called with wrong number or type of parameters; please RTM");
RETURN_FALSE;
}
}
/* figure out where the context is coming from exactly */
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
if (options) {
/* handle the array syntax */
- RETVAL_BOOL(parse_context_options(context, options TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(parse_context_options(context, options) == SUCCESS);
} else {
php_stream_context_set_option(context, wrappername, optionname, zvalue);
RETVAL_TRUE;
@@ -1003,17 +1003,17 @@ PHP_FUNCTION(stream_context_set_params)
zval *params, *zcontext;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &zcontext, &params) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
- RETVAL_BOOL(parse_context_params(context, params TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(parse_context_params(context, params) == SUCCESS);
}
/* }}} */
@@ -1024,13 +1024,13 @@ PHP_FUNCTION(stream_context_get_params)
zval *zcontext, options;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
@@ -1051,17 +1051,17 @@ PHP_FUNCTION(stream_context_get_default)
zval *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a", &params) == FAILURE) {
RETURN_FALSE;
}
if (FG(default_context) == NULL) {
- FG(default_context) = php_stream_context_alloc(TSRMLS_C);
+ FG(default_context) = php_stream_context_alloc();
}
context = FG(default_context);
if (params) {
- parse_context_options(context, params TSRMLS_CC);
+ parse_context_options(context, params);
}
php_stream_context_to_zval(context, return_value);
@@ -1075,16 +1075,16 @@ PHP_FUNCTION(stream_context_set_default)
zval *options = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &options) == FAILURE) {
return;
}
if (FG(default_context) == NULL) {
- FG(default_context) = php_stream_context_alloc(TSRMLS_C);
+ FG(default_context) = php_stream_context_alloc();
}
context = FG(default_context);
- parse_context_options(context, options TSRMLS_CC);
+ parse_context_options(context, options);
php_stream_context_to_zval(context, return_value);
}
@@ -1097,18 +1097,18 @@ PHP_FUNCTION(stream_context_create)
zval *options = NULL, *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &options, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!a!", &options, &params) == FAILURE) {
RETURN_FALSE;
}
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
if (options) {
- parse_context_options(context, options TSRMLS_CC);
+ parse_context_options(context, options);
}
if (params) {
- parse_context_params(context, params TSRMLS_CC);
+ parse_context_params(context, params);
}
RETURN_RES(context->res);
@@ -1127,7 +1127,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
php_stream_filter *filter = NULL;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|lz", &zstream,
&filtername, &filternamelen, &read_write, &filterparams) == FAILURE) {
RETURN_FALSE;
}
@@ -1149,35 +1149,35 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
}
if (read_write & PHP_STREAM_FILTER_READ) {
- filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream));
if (filter == NULL) {
RETURN_FALSE;
}
if (append) {
- ret = php_stream_filter_append_ex(&stream->readfilters, filter TSRMLS_CC);
+ ret = php_stream_filter_append_ex(&stream->readfilters, filter);
} else {
- ret = php_stream_filter_prepend_ex(&stream->readfilters, filter TSRMLS_CC);
+ ret = php_stream_filter_prepend_ex(&stream->readfilters, filter);
}
if (ret != SUCCESS) {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_FALSE;
}
}
if (read_write & PHP_STREAM_FILTER_WRITE) {
- filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream));
if (filter == NULL) {
RETURN_FALSE;
}
if (append) {
- ret = php_stream_filter_append_ex(&stream->writefilters, filter TSRMLS_CC);
+ ret = php_stream_filter_append_ex(&stream->writefilters, filter);
} else {
- ret = php_stream_filter_prepend_ex(&stream->writefilters, filter TSRMLS_CC);
+ ret = php_stream_filter_prepend_ex(&stream->writefilters, filter);
}
if (ret != SUCCESS) {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_FALSE;
}
}
@@ -1215,26 +1215,26 @@ PHP_FUNCTION(stream_filter_remove)
zval *zfilter;
php_stream_filter *filter;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zfilter) == FAILURE) {
RETURN_FALSE;
}
- filter = zend_fetch_resource(zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter());
+ filter = zend_fetch_resource(zfilter, -1, NULL, NULL, 1, php_file_le_stream_filter());
if (!filter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid resource given, not a stream filter");
+ php_error_docref(NULL, E_WARNING, "Invalid resource given, not a stream filter");
RETURN_FALSE;
}
if (php_stream_filter_flush(filter, 1) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to flush filter, not removing");
+ php_error_docref(NULL, E_WARNING, "Unable to flush filter, not removing");
RETURN_FALSE;
}
if (zend_list_close(Z_RES_P(zfilter)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not invalidate filter, not removing");
+ php_error_docref(NULL, E_WARNING, "Could not invalidate filter, not removing");
RETURN_FALSE;
} else {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_TRUE;
}
}
@@ -1251,12 +1251,12 @@ PHP_FUNCTION(stream_get_line)
zend_string *buf;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
if (max_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The maximum allowed length must be greater than or equal to zero");
RETURN_FALSE;
}
if (!max_length) {
@@ -1265,7 +1265,7 @@ PHP_FUNCTION(stream_get_line)
php_stream_from_zval(stream, zstream);
- if ((buf = php_stream_get_record(stream, max_length, str, str_len TSRMLS_CC))) {
+ if ((buf = php_stream_get_record(stream, max_length, str, str_len))) {
RETURN_STR(buf);
} else {
RETURN_FALSE;
@@ -1282,7 +1282,7 @@ PHP_FUNCTION(stream_set_blocking)
zend_long block;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &block) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &block) == FAILURE) {
return;
}
@@ -1308,7 +1308,7 @@ PHP_FUNCTION(stream_set_timeout)
php_stream *stream;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &socket, &seconds, &microseconds) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &socket, &seconds, &microseconds) == FAILURE) {
return;
}
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(stream_set_write_buffer)
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1381,12 +1381,12 @@ PHP_FUNCTION(stream_set_chunk_size)
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &csize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &csize) == FAILURE) {
RETURN_FALSE;
}
if (csize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize);
+ php_error_docref(NULL, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize);
RETURN_FALSE;
}
/* stream.chunk_size is actually a size_t, but php_stream_set_option
@@ -1394,7 +1394,7 @@ PHP_FUNCTION(stream_set_chunk_size)
* In any case, values larger than INT_MAX for a chunk size make no sense.
*/
if (csize > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX);
RETURN_FALSE;
}
@@ -1416,7 +1416,7 @@ PHP_FUNCTION(stream_set_read_buffer)
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(stream_socket_enable_crypto)
zend_bool enable, cryptokindnull;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
RETURN_FALSE;
}
@@ -1456,7 +1456,7 @@ PHP_FUNCTION(stream_socket_enable_crypto)
zval *val;
if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
+ php_error_docref(NULL, E_WARNING, "When enabling encryption you must specify the crypto type");
RETURN_FALSE;
}
@@ -1467,12 +1467,12 @@ PHP_FUNCTION(stream_socket_enable_crypto)
php_stream_from_zval(sessstream, zsessstream);
}
- if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {
+ if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) {
RETURN_FALSE;
}
}
- ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);
+ ret = php_stream_xport_crypto_enable(stream, enable);
switch (ret) {
case -1:
RETURN_FALSE;
@@ -1493,11 +1493,11 @@ PHP_FUNCTION(stream_resolve_include_path)
char *filename, *resolved_path;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
- resolved_path = zend_resolve_path(filename, (int)filename_len TSRMLS_CC);
+ resolved_path = zend_resolve_path(filename, (int)filename_len);
if (resolved_path) {
// TODO: avoid reallocation ???
@@ -1517,7 +1517,7 @@ PHP_FUNCTION(stream_is_local)
php_stream *stream = NULL;
php_stream_wrapper *wrapper = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zstream) == FAILURE) {
RETURN_FALSE;
}
@@ -1530,7 +1530,7 @@ PHP_FUNCTION(stream_is_local)
} else {
convert_to_string_ex(zstream);
- wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0);
}
if (!wrapper) {
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(stream_supports_lock)
php_stream *stream;
zval *zsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zsrc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zsrc) == FAILURE) {
RETURN_FALSE;
}
@@ -1574,7 +1574,7 @@ PHP_FUNCTION(stream_socket_shutdown)
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &how) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &how) == FAILURE) {
RETURN_FALSE;
}
@@ -1586,7 +1586,7 @@ PHP_FUNCTION(stream_socket_shutdown)
php_stream_from_zval(stream, zstream);
- RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how TSRMLS_CC) == 0);
+ RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0);
}
/* }}} */
#endif
diff --git a/ext/standard/string.c b/ext/standard/string.c
index ec86b08d3c..c686cdd56a 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -249,7 +249,7 @@ PHP_FUNCTION(bin2hex)
zend_string *result;
zend_string *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) {
return;
}
@@ -269,19 +269,19 @@ PHP_FUNCTION(hex2bin)
{
zend_string *result, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) {
return;
}
if (data->len % 2 != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hexadecimal input string must have an even length");
+ php_error_docref(NULL, E_WARNING, "Hexadecimal input string must have an even length");
RETURN_FALSE;
}
result = php_hex2bin((unsigned char *)data->val, data->len);
if (!result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input string must be hexadecimal string");
+ php_error_docref(NULL, E_WARNING, "Input string must be hexadecimal string");
RETURN_FALSE;
}
@@ -294,7 +294,7 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) /
zend_string *s11, *s22;
zend_long start = 0, len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &s11,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", &s11,
&s22, &start, &len) == FAILURE) {
return;
}
@@ -537,7 +537,7 @@ PHP_FUNCTION(nl_langinfo)
zend_long item;
char *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &item) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &item) == FAILURE) {
return;
}
@@ -702,7 +702,7 @@ PHP_FUNCTION(nl_langinfo)
#endif
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item);
+ php_error_docref(NULL, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item);
RETURN_FALSE;
}
/* }}} */
@@ -724,7 +724,7 @@ PHP_FUNCTION(strcoll)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -739,7 +739,7 @@ PHP_FUNCTION(strcoll)
* it needs to be incrementing.
* Returns: FAILURE/SUCCESS whether the input was correct (i.e. no range errors)
*/
-static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRMLS_DC)
+static inline int php_charmask(unsigned char *input, size_t len, char *mask)
{
unsigned char *end;
unsigned char c;
@@ -756,22 +756,22 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM
/* Error, try to be as helpful as possible:
(a range ending/starting with '.' won't be captured here) */
if (end-len >= input) { /* there was no 'left' char */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the left of '..'");
result = FAILURE;
continue;
}
if (input+2 >= end) { /* there is no 'right' char */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the right of '..'");
result = FAILURE;
continue;
}
if (input[-1] > input[2]) { /* wrong order */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing");
result = FAILURE;
continue;
}
/* FIXME: better error (a..b..c is the only left possibility?) */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range");
result = FAILURE;
continue;
} else {
@@ -788,16 +788,16 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM
* mode 3 : trim left and right
* what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0')
*/
-PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC)
+PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode)
{
register size_t i;
size_t trimmed = 0;
char mask[256];
if (what) {
- php_charmask((unsigned char*)what, what_len, mask TSRMLS_CC);
+ php_charmask((unsigned char*)what, what_len, mask);
} else {
- php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask TSRMLS_CC);
+ php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask);
}
if (mode & 1) {
@@ -842,7 +842,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_string *what = NULL;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &what) == FAILURE) {
return;
}
#else
@@ -853,7 +853,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
ZEND_PARSE_PARAMETERS_END();
#endif
- php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode TSRMLS_CC);
+ php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode);
}
/* }}} */
@@ -894,7 +894,7 @@ PHP_FUNCTION(wordwrap)
zend_bool docut = 0;
zend_string *newtext;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) {
return;
}
@@ -903,12 +903,12 @@ PHP_FUNCTION(wordwrap)
}
if (breakchar_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Break string cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Break string cannot be empty");
RETURN_FALSE;
}
if (linelength == 0 && docut) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero");
+ php_error_docref(NULL, E_WARNING, "Can't force cut when width is zero");
RETURN_FALSE;
}
@@ -1094,7 +1094,7 @@ PHP_FUNCTION(explode)
zend_long limit = ZEND_LONG_MAX; /* No limit */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &delim, &str, &limit) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &delim, &str, &limit) == FAILURE) {
return;
}
#else
@@ -1107,7 +1107,7 @@ PHP_FUNCTION(explode)
#endif
if (delim->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
@@ -1136,7 +1136,7 @@ PHP_FUNCTION(explode)
/* {{{ php_implode
*/
-PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC)
+PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value)
{
zval *tmp;
smart_str implstr = {0};
@@ -1212,7 +1212,7 @@ PHP_FUNCTION(implode)
zend_string *delim;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|z", &arg1, &arg2) == FAILURE) {
return;
}
#else
@@ -1225,7 +1225,7 @@ PHP_FUNCTION(implode)
if (arg2 == NULL) {
if (Z_TYPE_P(arg1) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument must be an array");
+ php_error_docref(NULL, E_WARNING, "Argument must be an array");
return;
}
@@ -1239,12 +1239,12 @@ PHP_FUNCTION(implode)
delim = zval_get_string(arg1);
arr = arg2;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments passed");
+ php_error_docref(NULL, E_WARNING, "Invalid arguments passed");
return;
}
}
- php_implode(delim, arr, return_value TSRMLS_CC);
+ php_implode(delim, arr, return_value);
zend_string_release(delim);
}
/* }}} */
@@ -1262,7 +1262,7 @@ PHP_FUNCTION(strtok)
char *pe;
size_t skipped = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &tok) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &tok) == FAILURE) {
return;
}
@@ -1350,7 +1350,7 @@ PHP_FUNCTION(strtoupper)
zend_string *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
@@ -1385,7 +1385,7 @@ PHP_FUNCTION(strtolower)
zend_string *result;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -1402,7 +1402,7 @@ PHP_FUNCTION(strtolower)
/* {{{ php_basename
*/
-PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC)
+PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen)
{
char *c, *comp, *cend;
size_t inc_len, cnt;
@@ -1487,11 +1487,11 @@ PHP_FUNCTION(basename)
char *string, *suffix = NULL;
size_t string_len, suffix_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) {
return;
}
- RETURN_STR(php_basename(string, string_len, suffix, suffix_len TSRMLS_CC));
+ RETURN_STR(php_basename(string, string_len, suffix, suffix_len));
}
/* }}} */
@@ -1511,7 +1511,7 @@ PHP_FUNCTION(dirname)
zend_string *ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -1533,7 +1533,7 @@ PHP_FUNCTION(pathinfo)
zend_long opt = PHP_PATHINFO_ALL;
zend_string *ret = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &path_len, &opt) == FAILURE) {
return;
}
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(pathinfo)
}
if (have_basename) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
add_assoc_str(&tmp, "basename", zend_string_copy(ret));
}
@@ -1560,7 +1560,7 @@ PHP_FUNCTION(pathinfo)
ptrdiff_t idx;
if (!have_basename) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
}
p = zend_memrchr(ret->val, '.', ret->len);
@@ -1577,7 +1577,7 @@ PHP_FUNCTION(pathinfo)
/* Have we already looked up the basename? */
if (!have_basename && !ret) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
}
p = zend_memrchr(ret->val, '.', ret->len);
@@ -1655,7 +1655,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
/* {{{ php_needle_char
*/
-static int php_needle_char(zval *needle, char *target TSRMLS_DC)
+static int php_needle_char(zval *needle, char *target)
{
switch (Z_TYPE_P(needle)) {
case IS_LONG:
@@ -1675,7 +1675,7 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC)
*target = (char) zval_get_long(needle);
return SUCCESS;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer");
+ php_error_docref(NULL, E_WARNING, "needle is not a string or an integer");
return FAILURE;
}
}
@@ -1693,7 +1693,7 @@ PHP_FUNCTION(stristr)
char needle_char[2];
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) {
return;
}
@@ -1702,7 +1702,7 @@ PHP_FUNCTION(stristr)
if (Z_TYPE_P(needle) == IS_STRING) {
char *orig_needle;
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1710,7 +1710,7 @@ PHP_FUNCTION(stristr)
found = php_stristr(haystack_dup, orig_needle, haystack->len, Z_STRLEN_P(needle));
efree(orig_needle);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1745,19 +1745,19 @@ PHP_FUNCTION(strstr)
zend_long found_offset;
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) {
return;
}
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
RETURN_FALSE;
}
found = (char*)php_memnstr(haystack->val, Z_STRVAL_P(needle), Z_STRLEN_P(needle), haystack->val + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
RETURN_FALSE;
}
needle_char[1] = 0;
@@ -1792,7 +1792,7 @@ PHP_FUNCTION(strpos)
zend_long offset = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) {
return;
}
#else
@@ -1805,13 +1805,13 @@ PHP_FUNCTION(strpos)
#endif
if (offset < 0 || (size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
RETURN_FALSE;
}
@@ -1820,7 +1820,7 @@ PHP_FUNCTION(strpos)
Z_STRLEN_P(needle),
haystack->val + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
RETURN_FALSE;
}
needle_char[1] = 0;
@@ -1850,12 +1850,12 @@ PHP_FUNCTION(stripos)
char needle_char[2];
zval *needle;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) {
return;
}
if (offset < 0 || (size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
@@ -1876,7 +1876,7 @@ PHP_FUNCTION(stripos)
php_strtolower(needle_dup, Z_STRLEN_P(needle));
found = (char*)php_memnstr(haystack_dup + offset, needle_dup, Z_STRLEN_P(needle), haystack_dup + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1913,7 +1913,7 @@ PHP_FUNCTION(strrpos)
char *p, *e, ord_needle[2];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
#else
@@ -1929,7 +1929,7 @@ PHP_FUNCTION(strrpos)
needle = Z_STRVAL_P(zneedle);
needle_len = Z_STRLEN_P(zneedle);
} else {
- if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(zneedle, ord_needle) != SUCCESS) {
RETURN_FALSE;
}
ord_needle[1] = '\0';
@@ -1943,14 +1943,14 @@ PHP_FUNCTION(strrpos)
if (offset >= 0) {
if ((size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack->val + (size_t)offset;
e = haystack->val + haystack->len - needle_len;
} else {
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
@@ -1996,7 +1996,7 @@ PHP_FUNCTION(strripos)
char *p, *e, ord_needle[2];
char *needle_dup, *haystack_dup;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
@@ -2004,7 +2004,7 @@ PHP_FUNCTION(strripos)
needle = Z_STRVAL_P(zneedle);
needle_len = Z_STRLEN_P(zneedle);
} else {
- if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(zneedle, ord_needle) != SUCCESS) {
RETURN_FALSE;
}
ord_needle[1] = '\0';
@@ -2021,7 +2021,7 @@ PHP_FUNCTION(strripos)
Can also avoid tolower emallocs */
if (offset >= 0) {
if ((size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack->val + offset;
@@ -2029,7 +2029,7 @@ PHP_FUNCTION(strripos)
} else {
p = haystack->val;
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
e = haystack->val + haystack->len + offset;
@@ -2054,7 +2054,7 @@ PHP_FUNCTION(strripos)
if ((size_t)offset > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack_dup + offset;
@@ -2063,7 +2063,7 @@ PHP_FUNCTION(strripos)
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack_dup;
@@ -2098,7 +2098,7 @@ PHP_FUNCTION(strrchr)
const char *found = NULL;
zend_long found_offset;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &haystack, &needle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &haystack, &needle) == FAILURE) {
return;
}
@@ -2106,7 +2106,7 @@ PHP_FUNCTION(strrchr)
found = zend_memrchr(haystack->val, *Z_STRVAL_P(needle), haystack->len);
} else {
char needle_chr;
- if (php_needle_char(needle, &needle_chr TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, &needle_chr) != SUCCESS) {
RETURN_FALSE;
}
@@ -2182,12 +2182,12 @@ PHP_FUNCTION(chunk_split)
zend_long chunklen = 76;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) {
return;
}
if (chunklen <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Chunk length should be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Chunk length should be greater than zero");
RETURN_FALSE;
}
@@ -2223,7 +2223,7 @@ PHP_FUNCTION(substr)
int argc = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &str, &f, &l) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &str, &f, &l) == FAILURE) {
return;
}
#else
@@ -2303,7 +2303,7 @@ PHP_FUNCTION(substr_replace)
HashPosition pos_from, pos_repl, pos_len;
zval *tmp_str = NULL, *tmp_from = NULL, *tmp_repl = NULL, *tmp_len= NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &str, &repl, &from, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &str, &repl, &from, &len) == FAILURE) {
return;
}
@@ -2332,12 +2332,12 @@ PHP_FUNCTION(substr_replace)
(argc == 3 && Z_TYPE_P(from) == IS_ARRAY) ||
(argc == 4 && Z_TYPE_P(from) != Z_TYPE_P(len))
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should be of same type - numerical or array ");
+ php_error_docref(NULL, E_WARNING, "'from' and 'len' should be of same type - numerical or array ");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
if (argc == 4 && Z_TYPE_P(from) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(from)) != zend_hash_num_elements(Z_ARRVAL_P(len))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should have the same number of elements");
+ php_error_docref(NULL, E_WARNING, "'from' and 'len' should have the same number of elements");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
}
@@ -2399,7 +2399,7 @@ PHP_FUNCTION(substr_replace)
result->val[result->len] = '\0';
RETURN_NEW_STR(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented");
+ php_error_docref(NULL, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
} else { /* str is array of strings */
@@ -2511,7 +2511,7 @@ PHP_FUNCTION(substr_replace)
}
/*???
if (Z_REFCOUNT_P(orig_str) != refcount) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument was modified while replacing");
+ php_error_docref(NULL, E_WARNING, "Argument was modified while replacing");
if (Z_TYPE_P(tmp_repl) != IS_STRING) {
zval_dtor(repl_str);
}
@@ -2576,7 +2576,7 @@ PHP_FUNCTION(quotemeta)
char c;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &old) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &old) == FAILURE) {
return;
}
@@ -2623,7 +2623,7 @@ PHP_FUNCTION(ord)
size_t str_len;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
#else
@@ -2647,7 +2647,7 @@ PHP_FUNCTION(chr)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "l", &c) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l", &c) == FAILURE) {
c = 0;
}
@@ -2675,7 +2675,7 @@ PHP_FUNCTION(ucfirst)
zend_string *str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -2709,7 +2709,7 @@ PHP_FUNCTION(lcfirst)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -2733,7 +2733,7 @@ PHP_FUNCTION(ucwords)
char mask[256];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s", &str, &delims, &delims_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s", &str, &delims, &delims_len) == FAILURE) {
return;
}
#else
@@ -2748,7 +2748,7 @@ PHP_FUNCTION(ucwords)
RETURN_EMPTY_STRING();
}
- php_charmask((unsigned char *)delims, delims_len, mask TSRMLS_CC);
+ php_charmask((unsigned char *)delims, delims_len, mask);
ZVAL_STRINGL(return_value, str->val, str->len);
r = Z_STRVAL_P(return_value);
@@ -2787,7 +2787,7 @@ PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size
}
/* }}} */
-static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_strtr_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -2797,7 +2797,7 @@ static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
/* }}} */
/* {{{ php_strtr_array */
-static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats TSRMLS_DC)
+static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats)
{
zend_ulong num_key;
zend_string *str_key;
@@ -2887,7 +2887,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl
len = zend_hash_num_elements(&num_hash);
if ((maxlen - (minlen - 1) - len > 0) &&
/* smart algorithm, sort key lengths first */
- zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0 TSRMLS_CC) == SUCCESS) {
+ zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0) == SUCCESS) {
pos = 0;
while (pos <= slen - minlen) {
@@ -2956,7 +2956,7 @@ PHP_FUNCTION(strtr)
int ac = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) {
return;
}
#else
@@ -2969,7 +2969,7 @@ PHP_FUNCTION(strtr)
#endif
if (ac == 2 && Z_TYPE_P(from) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument is not an array");
+ php_error_docref(NULL, E_WARNING, "The second argument is not an array");
RETURN_FALSE;
}
@@ -2979,7 +2979,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2) {
- php_strtr_array(return_value, str, str_len, HASH_OF(from) TSRMLS_CC);
+ php_strtr_array(return_value, str, str_len, HASH_OF(from));
} else {
convert_to_string_ex(from);
@@ -3003,7 +3003,7 @@ PHP_FUNCTION(strrev)
char *e, *p;
zend_string *n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -3077,7 +3077,7 @@ PHP_FUNCTION(similar_text)
int ac = ZEND_NUM_ARGS();
size_t sim;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/", &t1, &t2, &percent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/", &t1, &t2, &percent) == FAILURE) {
return;
}
@@ -3106,7 +3106,7 @@ PHP_FUNCTION(similar_text)
/* {{{ php_stripslashes
*
* be careful, this edits the string in-place */
-PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC)
+PHPAPI void php_stripslashes(char *str, size_t *len)
{
char *s, *t;
size_t l;
@@ -3152,7 +3152,7 @@ PHP_FUNCTION(addcslashes)
{
zend_string *str, *what;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &str, &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &str, &what) == FAILURE) {
return;
}
@@ -3164,7 +3164,7 @@ PHP_FUNCTION(addcslashes)
RETURN_STRINGL(str->val, str->len);
}
- RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len TSRMLS_CC));
+ RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len));
}
/* }}} */
@@ -3175,7 +3175,7 @@ PHP_FUNCTION(addslashes)
zend_string *str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -3188,7 +3188,7 @@ PHP_FUNCTION(addslashes)
RETURN_EMPTY_STRING();
}
- RETURN_STR(php_addslashes(str->val, str->len, 0 TSRMLS_CC));
+ RETURN_STR(php_addslashes(str->val, str->len, 0));
}
/* }}} */
@@ -3198,7 +3198,7 @@ PHP_FUNCTION(stripcslashes)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -3213,12 +3213,12 @@ PHP_FUNCTION(stripslashes)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
ZVAL_STRINGL(return_value, str->val, str->len);
- php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC);
+ php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value));
}
/* }}} */
@@ -3229,7 +3229,6 @@ char *php_strerror(int errnum)
{
extern int sys_nerr;
extern char *sys_errlist[];
- TSRMLS_FETCH();
if ((unsigned int) errnum < sys_nerr) {
return(sys_errlist[errnum]);
@@ -3306,7 +3305,7 @@ PHPAPI void php_stripcslashes(char *str, size_t *len)
/* {{{ php_addcslashes
*/
-PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength TSRMLS_DC)
+PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength)
{
char flags[256];
char *source, *target;
@@ -3319,7 +3318,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f
wlength = strlen(what);
}
- php_charmask((unsigned char *)what, wlength, flags TSRMLS_CC);
+ php_charmask((unsigned char *)what, wlength, flags);
for (source = (char*)str, end = source + length, target = new_str->val; source < end; source++) {
c = *source;
@@ -3356,7 +3355,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f
/* {{{ php_addslashes
*/
-PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC)
+PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free)
{
/* maximum string length, worst case situation */
char *source, *target;
@@ -3663,7 +3662,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
/* {{{ php_str_replace_in_subject
*/
-static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count TSRMLS_DC)
+static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count)
{
zval *search_entry,
*replace_entry = NULL,
@@ -3792,7 +3791,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
int argc = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) {
return;
}
#else
@@ -3826,7 +3825,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
and add the result to the return_value array. */
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) {
- php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
+ php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL);
} else {
ZVAL_COPY(&result, subject_entry);
}
@@ -3838,7 +3837,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
}
} ZEND_HASH_FOREACH_END();
} else { /* if subject is not an array */
- php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
+ php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL);
}
if (argc > 3) {
zval_dtor(zcount);
@@ -3878,7 +3877,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
size_t str_len;
zend_string *broken_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &max_chars) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &max_chars) == FAILURE) {
return;
}
@@ -4063,7 +4062,7 @@ PHP_FUNCTION(nl2br)
zend_bool is_xhtml = 1;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &str, &is_xhtml) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &str, &is_xhtml) == FAILURE) {
return;
}
@@ -4142,7 +4141,7 @@ PHP_FUNCTION(strip_tags)
char *allowed_tags=NULL;
size_t allowed_tags_len=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|z", &str, &allow) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &str, &allow) == FAILURE) {
return;
}
@@ -4180,7 +4179,7 @@ PHP_FUNCTION(setlocale)
char *loc, *retval;
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z+", &pcategory, &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z+", &pcategory, &args, &num_args) == FAILURE) {
return;
}
@@ -4192,7 +4191,7 @@ PHP_FUNCTION(setlocale)
char *category;
zval tmp;
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
+ php_error_docref(NULL, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
ZVAL_DUP(&tmp, pcategory);
convert_to_string_ex(&tmp);
@@ -4215,7 +4214,7 @@ PHP_FUNCTION(setlocale)
} else if (!strcasecmp("LC_TIME", category)) {
cat = LC_TIME;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category);
+ php_error_docref(NULL, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category);
zval_dtor(&tmp);
RETURN_FALSE;
@@ -4248,7 +4247,7 @@ PHP_FUNCTION(setlocale)
} else {
loc = Z_STRVAL(tmp);
if (Z_STRLEN(tmp) >= 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Specified locale name is too long");
+ php_error_docref(NULL, E_WARNING, "Specified locale name is too long");
zval_dtor(&tmp);
break;
}
@@ -4292,7 +4291,7 @@ PHP_FUNCTION(parse_str)
char *res = NULL;
size_t arglen;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &arg, &arglen, &arrayArg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &arg, &arglen, &arrayArg) == FAILURE) {
return;
}
@@ -4300,17 +4299,17 @@ PHP_FUNCTION(parse_str)
if (arrayArg == NULL) {
zval tmp;
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
ZVAL_ARR(&tmp, symbol_table);
- sapi_module.treat_data(PARSE_STRING, res, &tmp TSRMLS_CC);
+ sapi_module.treat_data(PARSE_STRING, res, &tmp);
} else {
zval ret;
/* Clear out the array that was passed in. */
zval_dtor(arrayArg);
array_init(&ret);
- sapi_module.treat_data(PARSE_STRING, res, &ret TSRMLS_CC);
+ sapi_module.treat_data(PARSE_STRING, res, &ret);
ZVAL_COPY_VALUE(arrayArg, &ret);
}
}
@@ -4692,7 +4691,7 @@ PHP_FUNCTION(str_getcsv)
char *delim_str = NULL, *enc_str = NULL, *esc_str = NULL;
size_t delim_len = 0, enc_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|sss", &str, &delim_str, &delim_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|sss", &str, &delim_str, &delim_len,
&enc_str, &enc_len, &esc_str, &esc_len) == FAILURE) {
return;
}
@@ -4701,7 +4700,7 @@ PHP_FUNCTION(str_getcsv)
enc = enc_len ? enc_str[0] : enc;
esc = esc_len ? esc_str[0] : esc;
- php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value TSRMLS_CC);
+ php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value);
}
/* }}} */
@@ -4714,12 +4713,12 @@ PHP_FUNCTION(str_repeat)
zend_string *result; /* Resulting string */
size_t result_len; /* Length of the resulting string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl", &input_str, &mult) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl", &input_str, &mult) == FAILURE) {
return;
}
if (mult < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Second argument has to be greater than or equal to 0");
return;
}
@@ -4769,12 +4768,12 @@ PHP_FUNCTION(count_chars)
size_t retlen=0;
size_t tmp = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &input, &mymode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &input, &mymode) == FAILURE) {
return;
}
if (mymode < 0 || mymode > 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown mode");
+ php_error_docref(NULL, E_WARNING, "Unknown mode");
RETURN_FALSE;
}
@@ -4831,7 +4830,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -4841,7 +4840,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
}
/* }}} */
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
{
zend_string *str1 = zval_get_string(op1);
zend_string *str2 = zval_get_string(op2);
@@ -4854,15 +4853,15 @@ PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2
}
/* }}} */
-PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- return string_natural_compare_function_ex(result, op1, op2, 1 TSRMLS_CC);
+ return string_natural_compare_function_ex(result, op1, op2, 1);
}
/* }}} */
-PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- return string_natural_compare_function_ex(result, op1, op2, 0 TSRMLS_CC);
+ return string_natural_compare_function_ex(result, op1, op2, 0);
}
/* }}} */
@@ -4976,12 +4975,12 @@ PHP_FUNCTION(substr_count)
size_t haystack_len, needle_len;
char *p, *endp, cmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) {
return;
}
if (needle_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring");
+ php_error_docref(NULL, E_WARNING, "Empty substring");
RETURN_FALSE;
}
@@ -4989,12 +4988,12 @@ PHP_FUNCTION(substr_count)
endp = p + haystack_len;
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset should be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset should be greater than or equal to 0");
RETURN_FALSE;
}
if ((size_t)offset > haystack_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset);
+ php_error_docref(NULL, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset);
RETURN_FALSE;
}
p += offset;
@@ -5002,11 +5001,11 @@ PHP_FUNCTION(substr_count)
if (ac == 4) {
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length should be greater than 0");
RETURN_FALSE;
}
if (length > (haystack_len - offset)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length);
+ php_error_docref(NULL, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length);
RETURN_FALSE;
}
endp = p + length;
@@ -5046,7 +5045,7 @@ PHP_FUNCTION(str_pad)
size_t i, left_pad=0, right_pad=0;
zend_string *result = NULL; /* Resulting string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) {
return;
}
@@ -5057,18 +5056,18 @@ PHP_FUNCTION(str_pad)
}
if (pad_str_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Padding string cannot be empty");
return;
}
if (pad_type_val < STR_PAD_LEFT || pad_type_val > STR_PAD_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH");
+ php_error_docref(NULL, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH");
return;
}
num_pad_chars = pad_length - input->len;
if (num_pad_chars >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding length is too long");
+ php_error_docref(NULL, E_WARNING, "Padding length is too long");
return;
}
@@ -5120,12 +5119,12 @@ PHP_FUNCTION(sscanf)
size_t str_len, format_len;
int result, num_args = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss*", &str, &str_len, &format, &format_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss*", &str, &str_len, &format, &format_len,
&args, &num_args) == FAILURE) {
return;
}
- result = php_sscanf_internal(str, format, num_args, args, 0, return_value TSRMLS_CC);
+ result = php_sscanf_internal(str, format, num_args, args, 0, return_value);
if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
WRONG_PARAM_COUNT;
@@ -5142,7 +5141,7 @@ PHP_FUNCTION(str_rot13)
{
zend_string *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
@@ -5152,7 +5151,7 @@ PHP_FUNCTION(str_rot13)
}
/* }}} */
-static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */
+static void php_string_shuffle(char *str, zend_long len) /* {{{ */
{
zend_long n_elems, rnd_idx, n_left;
char temp;
@@ -5167,7 +5166,7 @@ static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */
n_left = n_elems;
while (--n_left) {
- rnd_idx = php_rand(TSRMLS_C);
+ rnd_idx = php_rand();
RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX);
if (rnd_idx != n_left) {
temp = str[n_left];
@@ -5184,13 +5183,13 @@ PHP_FUNCTION(str_shuffle)
{
zend_string *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
RETVAL_STRINGL(arg->val, arg->len);
if (Z_STRLEN_P(return_value) > 1) {
- php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value) TSRMLS_CC);
+ php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value));
}
}
/* }}} */
@@ -5213,7 +5212,7 @@ PHP_FUNCTION(str_word_count)
size_t char_list_len = 0, word_count = 0;
zend_long type = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) {
return;
}
@@ -5232,12 +5231,12 @@ PHP_FUNCTION(str_word_count)
/* nothing to be done */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type);
+ php_error_docref(NULL, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type);
RETURN_FALSE;
}
if (char_list) {
- php_charmask((unsigned char *)char_list, char_list_len, ch TSRMLS_CC);
+ php_charmask((unsigned char *)char_list, char_list_len, ch);
}
p = str->val;
@@ -5292,7 +5291,7 @@ PHP_FUNCTION(money_format)
zend_bool check = 0;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sd", &format, &format_len, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sd", &format, &format_len, &value) == FAILURE) {
return;
}
@@ -5305,7 +5304,7 @@ PHP_FUNCTION(money_format)
check = 1;
p++;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a single %%i or %%n token can be used");
+ php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used");
RETURN_FALSE;
}
}
@@ -5331,12 +5330,12 @@ PHP_FUNCTION(str_split)
char *p;
size_t n_reg_segments;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &split_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &split_length) == FAILURE) {
return;
}
if (split_length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length of each segment must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "The length of each segment must be greater than zero");
RETURN_FALSE;
}
@@ -5370,12 +5369,12 @@ PHP_FUNCTION(strpbrk)
zend_string *haystack, *char_list;
char *haystack_ptr, *cl_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &haystack, &char_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &haystack, &char_list) == FAILURE) {
RETURN_FALSE;
}
if (!char_list->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The character list cannot be empty");
+ php_error_docref(NULL, E_WARNING, "The character list cannot be empty");
RETURN_FALSE;
}
@@ -5400,7 +5399,7 @@ PHP_FUNCTION(substr_compare)
zend_bool cs=0;
size_t cmp_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) {
RETURN_FALSE;
}
@@ -5408,7 +5407,7 @@ PHP_FUNCTION(substr_compare)
if (len == 0) {
RETURN_LONG(0L);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The length must be greater than or equal to zero");
RETURN_FALSE;
}
}
@@ -5419,7 +5418,7 @@ PHP_FUNCTION(substr_compare)
}
if ((size_t)offset >= s1->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
+ php_error_docref(NULL, E_WARNING, "The start position cannot exceed initial string length");
RETURN_FALSE;
}
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 036c189e75..49bb871ca5 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -138,7 +138,7 @@ PHP_FUNCTION(openlog)
zend_long option, facility;
size_t ident_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &ident,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll", &ident,
&ident_len, &option, &facility) == FAILURE) {
return;
}
@@ -179,7 +179,7 @@ PHP_FUNCTION(syslog)
char *message;
size_t message_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &priority,
&message, &message_len) == FAILURE) {
return;
}
diff --git a/ext/standard/type.c b/ext/standard/type.c
index 41177f0b09..2aa5c49f87 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -27,7 +27,7 @@ PHP_FUNCTION(gettype)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -74,7 +74,7 @@ PHP_FUNCTION(gettype)
case IS_RESOURCE:
{
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg));
if (type_name) {
RETVAL_STRING("resource");
@@ -96,7 +96,7 @@ PHP_FUNCTION(settype)
char *type;
size_t type_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &var, &type, &type_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &var, &type, &type_len) == FAILURE) {
return;
}
@@ -123,10 +123,10 @@ PHP_FUNCTION(settype)
} else if (!strcasecmp(type, "null")) {
convert_to_null(var);
} else if (!strcasecmp(type, "resource")) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type");
+ php_error_docref(NULL, E_WARNING, "Cannot convert to resource type");
RETURN_FALSE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type");
+ php_error_docref(NULL, E_WARNING, "Invalid type");
RETURN_FALSE;
}
RETVAL_TRUE;
@@ -144,7 +144,7 @@ PHP_FUNCTION(intval)
WRONG_PARAM_COUNT;
}
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &num, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &num, &base) == FAILURE) {
return;
}
#else
@@ -166,7 +166,7 @@ PHP_FUNCTION(floatval)
{
zval *num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) {
return;
}
@@ -181,11 +181,11 @@ PHP_FUNCTION(boolval)
{
zval *val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) == FAILURE) {
return;
}
- RETURN_BOOL(zend_is_true(val TSRMLS_CC));
+ RETURN_BOOL(zend_is_true(val));
}
/* }}} */
@@ -194,7 +194,7 @@ PHP_FUNCTION(boolval)
PHP_FUNCTION(strval)
{
zval *num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) {
return;
}
@@ -207,7 +207,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
zval *arg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
RETURN_FALSE;
}
ZVAL_DEREF(arg);
@@ -225,7 +225,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
RETURN_FALSE;
}
} else if (type == IS_RESOURCE) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg));
if (!type_name) {
RETURN_FALSE;
}
@@ -262,7 +262,7 @@ PHP_FUNCTION(is_bool)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
RETURN_FALSE;
}
@@ -322,7 +322,7 @@ PHP_FUNCTION(is_numeric)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -354,7 +354,7 @@ PHP_FUNCTION(is_scalar)
zval *arg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
#else
@@ -390,7 +390,7 @@ PHP_FUNCTION(is_callable)
zend_bool syntax_only = 0;
int check_flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|bz/", &var,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|bz/", &var,
&syntax_only, &callable_name) == FAILURE) {
return;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION(is_callable)
check_flags |= IS_CALLABLE_CHECK_SYNTAX_ONLY;
}
if (ZEND_NUM_ARGS() > 2) {
- retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error TSRMLS_CC);
+ retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error);
zval_dtor(callable_name);
//??? is it necessary to be consistent with old PHP ("\0" support)
if (UNEXPECTED(name->len) != strlen(name->val)) {
@@ -409,7 +409,7 @@ PHP_FUNCTION(is_callable)
ZVAL_STR(callable_name, name);
}
} else {
- retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error TSRMLS_CC);
+ retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error);
}
if (error) {
/* ignore errors */
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 1014f5d9ba..1030d97410 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -54,7 +54,7 @@ PHP_FUNCTION(uniqid)
size_t prefix_len = 0;
struct timeval tv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sb", &prefix, &prefix_len,
&more_entropy)) {
return;
}
@@ -62,7 +62,7 @@ PHP_FUNCTION(uniqid)
#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!more_entropy) {
#if defined(__CYGWIN__)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN");
+ php_error_docref(NULL, E_WARNING, "You must use 'more entropy' under CYGWIN");
RETURN_FALSE;
#else
usleep(1);
@@ -77,7 +77,7 @@ PHP_FUNCTION(uniqid)
* digits for usecs.
*/
if (more_entropy) {
- uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg(TSRMLS_C) * 10);
+ uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg() * 10);
} else {
uniqid = strpprintf(0, "%s%08x%05x", prefix, sec, usec);
}
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 7d408ef88a..ebd2c4108e 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -375,7 +375,7 @@ PHP_FUNCTION(parse_url)
php_url *resource;
zend_long key = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &key) == FAILURE) {
return;
}
@@ -412,7 +412,7 @@ PHP_FUNCTION(parse_url)
if (resource->fragment != NULL) RETVAL_STRING(resource->fragment);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key);
+ php_error_docref(NULL, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key);
RETVAL_FALSE;
}
goto done;
@@ -534,7 +534,7 @@ PHP_FUNCTION(urlencode)
zend_string *in_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -554,7 +554,7 @@ PHP_FUNCTION(urldecode)
zend_string *in_str, *out_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -641,7 +641,7 @@ PHP_FUNCTION(rawurlencode)
zend_string *in_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -661,7 +661,7 @@ PHP_FUNCTION(rawurldecode)
zend_string *in_str, *out_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -717,10 +717,10 @@ PHP_FUNCTION(get_headers)
HashTable *hashT;
zend_long format = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &url, &url_len, &format) == FAILURE) {
return;
}
- context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc(TSRMLS_C));
+ context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc());
if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) {
RETURN_FALSE;
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 6b406e673f..a24fb1ee8b 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -218,7 +218,7 @@ done:
#undef YYLIMIT
#undef YYMARKER
-static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC)
+static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type)
{
char f = 0;
@@ -252,8 +252,8 @@ enum {
#define YYMARKER q
#define STATE ctx->state
-#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC
-#define STD_ARGS ctx, start, xp TSRMLS_CC
+#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR
+#define STD_ARGS ctx, start, xp
#if SCANNER_DEBUG
#define scdebug(x) printf x
@@ -343,10 +343,10 @@ static inline void handle_arg(STD_PARA)
static inline void handle_val(STD_PARA, char quotes, char type)
{
smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2);
- tag_arg(ctx, quotes, type TSRMLS_CC);
+ tag_arg(ctx, quotes, type);
}
-static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC)
+static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
char *xp;
@@ -918,7 +918,7 @@ stop:
ctx->buf.s->len = rest;
}
-char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC)
+char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen)
{
char *result;
smart_str surl = {0};
@@ -944,14 +944,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}
-static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
+static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush)
{
url_adapt_state_ex_t *ctx;
char *retval;
ctx = &BG(url_adapt_state_ex);
- xx_mainloop(ctx, src, srclen TSRMLS_CC);
+ xx_mainloop(ctx, src, srclen);
if (!ctx->result.s) {
smart_str_appendl(&ctx->result, "", 0);
@@ -971,7 +971,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_
return retval;
}
-static int php_url_scanner_ex_activate(TSRMLS_D)
+static int php_url_scanner_ex_activate(void)
{
url_adapt_state_ex_t *ctx;
@@ -982,7 +982,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D)
return SUCCESS;
}
-static int php_url_scanner_ex_deactivate(TSRMLS_D)
+static int php_url_scanner_ex_deactivate(void)
{
url_adapt_state_ex_t *ctx;
@@ -996,12 +996,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)
{
size_t len;
if (BG(url_adapt_state_ex).url_app.s->len != 0) {
- *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC);
+ *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0));
if (sizeof(uint) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
@@ -1026,14 +1026,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char
}
}
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode)
{
smart_str val = {0};
zend_string *encoded;
if (!BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_activate(TSRMLS_C);
- php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_url_scanner_ex_activate();
+ php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
BG(url_adapt_state_ex).active = 1;
}
@@ -1067,7 +1067,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz
return SUCCESS;
}
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D)
+PHPAPI int php_url_scanner_reset_vars(void)
{
if (BG(url_adapt_state_ex).form_app.s) {
BG(url_adapt_state_ex).form_app.s->len = 0;
@@ -1106,7 +1106,7 @@ PHP_RINIT_FUNCTION(url_scanner)
PHP_RSHUTDOWN_FUNCTION(url_scanner)
{
if (BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_deactivate(TSRMLS_C);
+ php_url_scanner_ex_deactivate();
BG(url_adapt_state_ex).active = 0;
}
diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h
index 2a9b6921bf..ff0e644d01 100644
--- a/ext/standard/url_scanner_ex.h
+++ b/ext/standard/url_scanner_ex.h
@@ -27,9 +27,9 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner_ex);
PHP_RINIT_FUNCTION(url_scanner_ex);
PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
-PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC);
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC);
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D);
+PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen);
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode);
+PHPAPI int php_url_scanner_reset_vars(void);
#include "zend_smart_str_public.h"
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index fed628f089..e374b76195 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -154,7 +154,7 @@ done:
#undef YYLIMIT
#undef YYMARKER
-static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC)
+static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type)
{
char f = 0;
@@ -188,8 +188,8 @@ enum {
#define YYMARKER q
#define STATE ctx->state
-#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC
-#define STD_ARGS ctx, start, xp TSRMLS_CC
+#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR
+#define STD_ARGS ctx, start, xp
#if SCANNER_DEBUG
#define scdebug(x) printf x
@@ -279,10 +279,10 @@ static inline void handle_arg(STD_PARA)
static inline void handle_val(STD_PARA, char quotes, char type)
{
smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2);
- tag_arg(ctx, quotes, type TSRMLS_CC);
+ tag_arg(ctx, quotes, type);
}
-static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC)
+static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
char *xp;
@@ -370,7 +370,7 @@ stop:
ctx->buf.s->len = rest;
}
-char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC)
+char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen)
{
char *result;
smart_str surl = {0};
@@ -396,14 +396,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}
-static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
+static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush)
{
url_adapt_state_ex_t *ctx;
char *retval;
ctx = &BG(url_adapt_state_ex);
- xx_mainloop(ctx, src, srclen TSRMLS_CC);
+ xx_mainloop(ctx, src, srclen);
if (!ctx->result.s) {
smart_str_appendl(&ctx->result, "", 0);
@@ -423,7 +423,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_
return retval;
}
-static int php_url_scanner_ex_activate(TSRMLS_D)
+static int php_url_scanner_ex_activate(void)
{
url_adapt_state_ex_t *ctx;
@@ -434,7 +434,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D)
return SUCCESS;
}
-static int php_url_scanner_ex_deactivate(TSRMLS_D)
+static int php_url_scanner_ex_deactivate(void)
{
url_adapt_state_ex_t *ctx;
@@ -448,12 +448,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)
{
size_t len;
if (BG(url_adapt_state_ex).url_app.s->len != 0) {
- *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC);
+ *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0));
if (sizeof(uint) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
@@ -478,14 +478,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char
}
}
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode)
{
smart_str val = {0};
zend_string *encoded;
if (!BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_activate(TSRMLS_C);
- php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_url_scanner_ex_activate();
+ php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
BG(url_adapt_state_ex).active = 1;
}
@@ -519,7 +519,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz
return SUCCESS;
}
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D)
+PHPAPI int php_url_scanner_reset_vars(void)
{
if (BG(url_adapt_state_ex).form_app.s) {
BG(url_adapt_state_ex).form_app.s->len = 0;
@@ -558,7 +558,7 @@ PHP_RINIT_FUNCTION(url_scanner)
PHP_RSHUTDOWN_FUNCTION(url_scanner)
{
if (BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_deactivate(TSRMLS_C);
+ php_url_scanner_ex_deactivate();
BG(url_adapt_state_ex).active = 0;
}
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index f310e64ae9..225381ffd5 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -43,7 +43,7 @@ static int le_bucket;
#define GET_FILTER_FROM_OBJ() { \
zval **tmp; \
if (FAILURE == zend_hash_index_find(Z_OBJPROP_P(this_ptr), 0, (void**)&tmp)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "filter property vanished"); \
+ php_error_docref(NULL, E_WARNING, "filter property vanished"); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(filter, php_stream_filter*, tmp, -1, "filter", le_userfilters); \
@@ -80,7 +80,7 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
{
php_stream_bucket *bucket = (php_stream_bucket *)res->ptr;
if (bucket) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
bucket = NULL;
}
}
@@ -90,11 +90,11 @@ PHP_MINIT_FUNCTION(user_filters)
zend_class_entry *php_user_filter;
/* init the filter class ancestor */
INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs);
- if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) {
+ if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry)) == NULL) {
return FAILURE;
}
- zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC);
/* init the filter resource; it has no dtor, as streams will always clean it up
* at the correct time */
@@ -135,7 +135,7 @@ PHP_RSHUTDOWN_FUNCTION(user_filters)
return SUCCESS;
}
-static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void userfilter_dtor(php_stream_filter *thisfilter)
{
zval *obj = &thisfilter->abstract;
zval func_name;
@@ -153,7 +153,7 @@ static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
&func_name,
&retval,
0, NULL,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&func_name);
@@ -169,7 +169,7 @@ php_stream_filter_status_t userfilter_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
int ret = PSFS_ERR_FATAL;
zval *obj = &thisfilter->abstract;
@@ -215,7 +215,7 @@ php_stream_filter_status_t userfilter_filter(
&func_name,
&retval,
4, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&func_name);
@@ -223,7 +223,7 @@ php_stream_filter_status_t userfilter_filter(
convert_to_long(&retval);
ret = (int)Z_LVAL(retval);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function");
+ php_error_docref(NULL, E_WARNING, "failed to call filter function");
}
if (bytes_consumed) {
@@ -233,18 +233,18 @@ php_stream_filter_status_t userfilter_filter(
if (buckets_in->head) {
php_stream_bucket *bucket = buckets_in->head;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unprocessed filter buckets remaining on input brigade");
+ php_error_docref(NULL, E_WARNING, "Unprocessed filter buckets remaining on input brigade");
while ((bucket = buckets_in->head)) {
/* Remove unconsumed buckets from the brigade */
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
}
if (ret != PSFS_PASS_ON) {
php_stream_bucket *bucket = buckets_out->head;
while (bucket != NULL) {
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
bucket = buckets_out->head;
}
}
@@ -253,7 +253,7 @@ php_stream_filter_status_t userfilter_filter(
* keeping a reference to the stream resource here would prevent it
* from being destroyed properly */
ZVAL_STRINGL(&zpropname, "stream", sizeof("stream")-1);
- Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL);
zval_ptr_dtor(&zpropname);
zval_ptr_dtor(&args[3]);
@@ -271,7 +271,7 @@ static php_stream_filter_ops userfilter_ops = {
};
static php_stream_filter *user_filter_factory_create(const char *filtername,
- zval *filterparams, int persistent TSRMLS_DC)
+ zval *filterparams, int persistent)
{
struct php_user_filter_data *fdat = NULL;
php_stream_filter *filter;
@@ -282,7 +282,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* some sanity checks */
if (persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"cannot use a user-space filter with a persistent stream");
return NULL;
}
@@ -317,7 +317,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
efree(wildcard);
}
if (fdat == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Err, filter \"%s\" is not in the user-filter map, but somehow the user-filter-factory was invoked for it!?", filtername);
return NULL;
}
@@ -325,8 +325,8 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* bind the classname to the actual class */
if (fdat->ce == NULL) {
- if (NULL == (fdat->ce = zend_lookup_class(fdat->classname TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (NULL == (fdat->ce = zend_lookup_class(fdat->classname))) {
+ php_error_docref(NULL, E_WARNING,
"user-filter \"%s\" requires class \"%s\", but that class is not defined",
filtername, fdat->classname->val);
return NULL;
@@ -359,7 +359,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
&func_name,
&retval,
0, NULL,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
@@ -368,7 +368,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* Kill the filter (safely) */
ZVAL_UNDEF(&filter->abstract);
- php_stream_filter_free(filter TSRMLS_CC);
+ php_stream_filter_free(filter);
/* Kill the object */
zval_ptr_dtor(&obj);
@@ -409,7 +409,7 @@ PHP_FUNCTION(stream_bucket_make_writeable)
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zbrigade) == FAILURE) {
RETURN_FALSE;
}
@@ -417,7 +417,7 @@ PHP_FUNCTION(stream_bucket_make_writeable)
ZVAL_NULL(return_value);
- if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) {
+ if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head))) {
ZEND_REGISTER_RESOURCE(&zbucket, bucket, le_bucket);
object_init(return_value);
add_property_zval(return_value, "bucket", &zbucket);
@@ -437,12 +437,12 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zo", &zbrigade, &zobject) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zo", &zbrigade, &zobject) == FAILURE) {
RETURN_FALSE;
}
if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has no bucket property");
+ php_error_docref(NULL, E_WARNING, "Object has no bucket property");
RETURN_FALSE;
}
@@ -451,7 +451,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
if (NULL != (pzdata = zend_hash_str_find(Z_OBJPROP_P(zobject), "data", sizeof("data")-1)) && Z_TYPE_P(pzdata) == IS_STRING) {
if (!bucket->own_buf) {
- bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(bucket);
}
if ((int)bucket->buflen != Z_STRLEN_P(pzdata)) {
bucket->buf = perealloc(bucket->buf, Z_STRLEN_P(pzdata), bucket->is_persistent);
@@ -461,9 +461,9 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
}
if (append) {
- php_stream_bucket_append(brigade, bucket TSRMLS_CC);
+ php_stream_bucket_append(brigade, bucket);
} else {
- php_stream_bucket_prepend(brigade, bucket TSRMLS_CC);
+ php_stream_bucket_prepend(brigade, bucket);
}
/* This is a hack necessary to accommodate situations where bucket is appended to the stream
* multiple times. See bug35916.phpt for reference.
@@ -501,7 +501,7 @@ PHP_FUNCTION(stream_bucket_new)
size_t buffer_len;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
RETURN_FALSE;
}
@@ -513,7 +513,7 @@ PHP_FUNCTION(stream_bucket_new)
memcpy(pbuffer, buffer, buffer_len);
- bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream) TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream));
if (bucket == NULL) {
RETURN_FALSE;
@@ -562,19 +562,19 @@ PHP_FUNCTION(stream_filter_register)
zend_string *filtername, *classname;
struct php_user_filter_data *fdat;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &filtername, &classname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &filtername, &classname) == FAILURE) {
RETURN_FALSE;
}
RETVAL_FALSE;
if (!filtername->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Filter name cannot be empty");
return;
}
if (!classname->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Class name cannot be empty");
return;
}
@@ -587,7 +587,7 @@ PHP_FUNCTION(stream_filter_register)
fdat->classname = zend_string_copy(classname);
if (zend_hash_add_ptr(BG(user_filter_map), filtername, fdat) != NULL &&
- php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory TSRMLS_CC) == SUCCESS) {
+ php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory) == SUCCESS) {
RETVAL_TRUE;
} else {
zend_string_release(classname);
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index ea171a658a..0a25b770f6 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -202,7 +202,7 @@ PHP_FUNCTION(convert_uuencode)
{
zend_string *src;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) {
RETURN_FALSE;
}
@@ -217,12 +217,12 @@ PHP_FUNCTION(convert_uudecode)
zend_string *src;
zend_string *dest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) {
RETURN_FALSE;
}
if ((dest = php_uudecode(src->val, src->len)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The given parameter is not a valid uuencoded string");
+ php_error_docref(NULL, E_WARNING, "The given parameter is not a valid uuencoded string");
RETURN_FALSE;
}
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 24bdd385a5..94b43ca399 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -54,7 +54,7 @@ static uint zend_obj_num_elements(HashTable *ht)
return num;
}
-static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
@@ -63,11 +63,11 @@ static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key,
PHPWRITE(key->val, key->len);
php_printf("\"]=>\n");
}
- php_var_dump(zv, level + 2 TSRMLS_CC);
+ php_var_dump(zv, level + 2);
}
/* }}} */
-static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
const char *prop_name, *class_name;
@@ -90,11 +90,11 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke
}
ZEND_PUTS("]=>\n");
}
- php_var_dump(zv, level + 2 TSRMLS_CC);
+ php_var_dump(zv, level + 2);
}
/* }}} */
-PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_dump(zval *struc, int level) /* {{{ */
{
HashTable *myht;
zend_string *class_name;
@@ -141,7 +141,7 @@ again:
is_temp = 0;
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
- php_array_element_dump(val, num, key, level TSRMLS_CC);
+ php_array_element_dump(val, num, key, level);
} ZEND_HASH_FOREACH_END();
if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
--myht->u.v.nApplyCount;
@@ -163,7 +163,7 @@ again:
return;
}
- class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC);
+ class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0);
zend_string_release(class_name);
@@ -173,7 +173,7 @@ again:
zval *val;
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
- php_object_property_dump(val, num, key, level TSRMLS_CC);
+ php_object_property_dump(val, num, key, level);
} ZEND_HASH_FOREACH_END();
--myht->u.v.nApplyCount;
if (is_temp) {
@@ -187,7 +187,7 @@ again:
PUTS("}\n");
break;
case IS_RESOURCE: {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
php_printf("%sresource(%pd) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown");
break;
}
@@ -214,17 +214,17 @@ PHP_FUNCTION(var_dump)
int argc;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
- php_var_dump(&args[i], 1 TSRMLS_CC);
+ php_var_dump(&args[i], 1);
}
}
/* }}} */
-static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
@@ -233,11 +233,11 @@ static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key
PHPWRITE(key->val, key->len);
php_printf("\"]=>\n");
}
- php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
+ php_debug_zval_dump(zv, level + 2);
}
/* }}} */
-static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
const char *prop_name, *class_name;
@@ -258,11 +258,11 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k
}
ZEND_PUTS("]=>\n");
}
- php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
+ php_debug_zval_dump(zv, level + 2);
}
/* }}} */
-PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_debug_zval_dump(zval *struc, int level) /* {{{ */
{
HashTable *myht = NULL;
zend_string *class_name;
@@ -307,7 +307,7 @@ again:
}
php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- zval_array_element_dump(val, index, key, level TSRMLS_CC);
+ zval_array_element_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
myht->u.v.nApplyCount--;
@@ -331,12 +331,12 @@ again:
myht->u.v.nApplyCount++;
}
}
- class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC);
+ class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
zend_string_release(class_name);
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- zval_object_property_dump(val, index, key, level TSRMLS_CC);
+ zval_object_property_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
myht->u.v.nApplyCount--;
if (is_temp) {
@@ -350,7 +350,7 @@ again:
PUTS("}\n");
break;
case IS_RESOURCE: {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
php_printf("%sresource(" ZEND_LONG_FMT ") of type (%s) refcount(%u)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown", Z_REFCOUNT_P(struc));
break;
}
@@ -376,12 +376,12 @@ PHP_FUNCTION(debug_zval_dump)
int argc;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
- php_debug_zval_dump(&args[i], 1 TSRMLS_CC);
+ php_debug_zval_dump(&args[i], 1);
}
}
/* }}} */
@@ -395,7 +395,7 @@ PHP_FUNCTION(debug_zval_dump)
efree(tmp_spaces); \
} while(0);
-static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */
{
if (key == NULL) { /* numeric key */
buffer_append_spaces(buf, level+1);
@@ -404,7 +404,7 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke
} else { /* string key */
zend_string *tmp_str;
- zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2 TSRMLS_CC);
+ zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2);
tmp_str = php_str_to_str_ex(ckey->val, ckey->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL);
buffer_append_spaces(buf, level + 1);
@@ -416,14 +416,14 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke
zend_string_free(ckey);
zend_string_free(tmp_str);
}
- php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
+ php_var_export_ex(zv, level + 2, buf);
smart_str_appendc(buf, ',');
smart_str_appendc(buf, '\n');
}
/* }}} */
-static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */
{
buffer_append_spaces(buf, level + 2);
if (key != NULL) {
@@ -432,7 +432,7 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k
zend_string *pname_esc;
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
- pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2 TSRMLS_CC);
+ pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2);
smart_str_appendc(buf, '\'');
smart_str_append(buf, pname_esc);
@@ -442,13 +442,13 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k
smart_str_append_long(buf, (zend_long) index);
}
smart_str_appendl(buf, " => ", 4);
- php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
+ php_var_export_ex(zv, level + 2, buf);
smart_str_appendc(buf, ',');
smart_str_appendc(buf, '\n');
}
/* }}} */
-PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */
{
HashTable *myht;
char *tmp_str;
@@ -478,7 +478,7 @@ again:
efree(tmp_str);
break;
case IS_STRING:
- ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2 TSRMLS_CC);
+ ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2);
ztmp2 = php_str_to_str_ex(ztmp->val, ztmp->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL);
smart_str_appendc(buf, '\'');
@@ -502,7 +502,7 @@ again:
}
smart_str_appendl(buf, "array (\n", 8);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- php_array_element_export(val, index, key, level, buf TSRMLS_CC);
+ php_array_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(myht)) {
myht->u.v.nApplyCount--;
@@ -535,7 +535,7 @@ again:
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- php_object_element_export(val, index, key, level, buf TSRMLS_CC);
+ php_object_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
myht->u.v.nApplyCount--;
}
@@ -557,10 +557,10 @@ again:
/* }}} */
/* FOR BC reasons, this will always perform and then print */
-PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_export(zval *struc, int level) /* {{{ */
{
smart_str buf = {0};
- php_var_export_ex(struc, level, &buf TSRMLS_CC);
+ php_var_export_ex(struc, level, &buf);
smart_str_0(&buf);
PHPWRITE(buf.s->val, buf.s->len);
smart_str_free(&buf);
@@ -576,11 +576,11 @@ PHP_FUNCTION(var_export)
zend_bool return_output = 0;
smart_str buf = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &return_output) == FAILURE) {
return;
}
- php_var_export_ex(var, 1, &buf TSRMLS_CC);
+ php_var_export_ex(var, 1, &buf);
smart_str_0 (&buf);
if (return_output) {
@@ -592,9 +592,9 @@ PHP_FUNCTION(var_export)
}
/* }}} */
-static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC);
+static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash);
-static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var TSRMLS_DC) /* {{{ */
+static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var) /* {{{ */
{
zval *zv;
zend_ulong key;
@@ -658,7 +658,7 @@ static inline void php_var_serialize_string(smart_str *buf, char *str, size_t le
}
/* }}} */
-static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc TSRMLS_DC) /* {{{ */
+static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */
{
PHP_CLASS_ATTRIBUTES;
@@ -673,12 +673,12 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc
}
/* }}} */
-static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */
+static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash) /* {{{ */
{
uint32_t count;
zend_bool incomplete_class;
- incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
+ incomplete_class = php_var_serialize_class_name(buf, struc);
/* count after serializing name, since php_var_serialize_class_name
* changes the count if the variable is incomplete class */
count = zend_hash_num_elements(HASH_OF(retval_ptr));
@@ -704,7 +704,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
if (Z_TYPE_P(name) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
smart_str_appendl(buf,"N;", 2);
@@ -719,7 +719,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
}
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
} else {
zend_class_entry *ce = Z_OBJ_P(struc)->ce;
if (ce) {
@@ -736,7 +736,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
php_var_serialize_string(buf, priv_name->val, priv_name->len);
zend_string_free(priv_name);
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(priv_name);
@@ -751,17 +751,17 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
php_var_serialize_string(buf, prot_name->val, prot_name->len);
zend_string_free(prot_name);
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(prot_name);
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name));
+ php_var_serialize_intern(buf, nvalp, var_hash);
+ php_error_docref(NULL, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name));
} while (0);
} else {
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, nvalp, var_hash);
}
}
} ZEND_HASH_FOREACH_END();
@@ -770,7 +770,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
/* }}} */
-static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */
+static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash) /* {{{ */
{
zend_long var_already;
HashTable *myht;
@@ -779,7 +779,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_
return;
}
- if (var_hash && (var_already = php_add_var_hash(var_hash, struc TSRMLS_CC))) {
+ if (var_hash && (var_already = php_add_var_hash(var_hash, struc))) {
if (Z_ISREF_P(struc)) {
smart_str_appendl(buf, "R:", 2);
smart_str_append_long(buf, var_already);
@@ -838,7 +838,7 @@ again:
unsigned char *serialized_data = NULL;
size_t serialized_length;
- if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) {
+ if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash) == SUCCESS) {
smart_str_appendl(buf, "C:", 2);
smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len);
smart_str_appendl(buf, ":\"", 2);
@@ -861,7 +861,7 @@ again:
if (ce && ce != PHP_IC_ENTRY && zend_hash_str_exists(&ce->function_table, "__sleep", sizeof("__sleep")-1)) {
ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1);
BG(serialize_lock)++;
- res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
@@ -873,9 +873,9 @@ again:
if (res == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (HASH_OF(&retval)) {
- php_var_serialize_class(buf, struc, &retval, var_hash TSRMLS_CC);
+ php_var_serialize_class(buf, struc, &retval, var_hash);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize");
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
smart_str_appendl(buf,"N;", 2);
@@ -896,7 +896,7 @@ again:
smart_str_appendl(buf, "a:", 2);
myht = HASH_OF(struc);
} else {
- incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
+ incomplete_class = php_var_serialize_class_name(buf, struc);
myht = Z_OBJPROP_P(struc);
}
/* count after serializing name, since php_var_serialize_class_name
@@ -934,7 +934,7 @@ again:
if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
Z_ARRVAL_P(data)->u.v.nApplyCount++;
}
- php_var_serialize_intern(buf, data, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, data, var_hash);
if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
Z_ARRVAL_P(data)->u.v.nApplyCount--;
}
@@ -954,9 +954,9 @@ again:
}
/* }}} */
-PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data) /* {{{ */
{
- php_var_serialize_intern(buf, struc, *data TSRMLS_CC);
+ php_var_serialize_intern(buf, struc, *data);
smart_str_0(buf);
}
/* }}} */
@@ -969,12 +969,12 @@ PHP_FUNCTION(serialize)
php_serialize_data_t var_hash;
smart_str buf = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &struc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &struc) == FAILURE) {
return;
}
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
if (EG(exception)) {
@@ -1001,7 +1001,7 @@ PHP_FUNCTION(unserialize)
zval *options = NULL, *classes = NULL;
HashTable *class_hash = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &buf, &buf_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &options) == FAILURE) {
RETURN_FALSE;
}
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(unserialize)
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if(options != NULL) {
classes = zend_hash_str_find(Z_ARRVAL_P(options), "allowed_classes", sizeof("allowed_classes")-1);
- if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes TSRMLS_CC))) {
+ if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes))) {
ALLOC_HASHTABLE(class_hash);
zend_hash_init(class_hash, (Z_TYPE_P(classes) == IS_ARRAY)?zend_hash_num_elements(Z_ARRVAL_P(classes)):0, NULL, NULL, 0);
}
@@ -1031,7 +1031,7 @@ PHP_FUNCTION(unserialize)
}
}
- if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if(class_hash) {
zend_hash_destroy(class_hash);
@@ -1039,7 +1039,7 @@ PHP_FUNCTION(unserialize)
}
zval_dtor(return_value);
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ php_error_docref(NULL, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
}
RETURN_FALSE;
}
@@ -1056,11 +1056,11 @@ PHP_FUNCTION(unserialize)
PHP_FUNCTION(memory_get_usage) {
zend_bool real_usage = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) {
RETURN_FALSE;
}
- RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
+ RETURN_LONG(zend_memory_usage(real_usage));
}
/* }}} */
@@ -1069,11 +1069,11 @@ PHP_FUNCTION(memory_get_usage) {
PHP_FUNCTION(memory_get_peak_usage) {
zend_bool real_usage = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) {
RETURN_FALSE;
}
- RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
+ RETURN_LONG(zend_memory_peak_usage(real_usage));
}
/* }}} */
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index a6d3f9190a..bcd00a6eba 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -319,8 +319,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -329,7 +329,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
ZVAL_UNDEF(&key);
- if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
@@ -373,7 +373,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) {
return 0;
}
@@ -413,7 +413,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
if (ce->unserialize == NULL) {
zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val);
object_init_ex(rval, ce);
- } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) {
return 0;
}
@@ -464,7 +464,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) {
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1);
BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
zval_dtor(&retval);
@@ -481,7 +481,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash)
{
HashTable *classes = NULL;
return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
@@ -615,7 +615,7 @@ yy14:
#line 852 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
+ php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
#line 622 "ext/standard/var_unserializer.c"
@@ -707,7 +707,7 @@ yy20:
/* Try to find class directly */
BG(serialize_lock)++;
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (ce) {
BG(serialize_lock)--;
if (EG(exception)) {
@@ -735,7 +735,7 @@ yy20:
ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
- if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) {
BG(serialize_lock)--;
if (EG(exception)) {
zend_string_release(class_name);
@@ -743,7 +743,7 @@ yy20:
zval_ptr_dtor(&args[0]);
return 0;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
+ php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
zval_ptr_dtor(&user_func);
@@ -760,8 +760,8 @@ yy20:
}
/* The callback function may have defined the class */
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 43361a9ff0..0efd6347de 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -323,8 +323,8 @@ static inline size_t parse_uiv(const unsigned char *p)
return result;
}
-#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC
-#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes TSRMLS_CC
+#define UNSERIALIZE_PARAMETER zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes
+#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash, classes
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend_long elements, int objprops)
{
@@ -333,7 +333,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
ZVAL_UNDEF(&key);
- if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
@@ -377,7 +377,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) {
return 0;
}
@@ -417,7 +417,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
if (ce->unserialize == NULL) {
zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val);
object_init_ex(rval, ce);
- } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) {
return 0;
}
@@ -468,7 +468,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) {
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1);
BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
zval_dtor(&retval);
@@ -485,7 +485,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash)
{
HashTable *classes = NULL;
return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
@@ -761,7 +761,7 @@ object ":" uiv ":" ["] {
/* Try to find class directly */
BG(serialize_lock)++;
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (ce) {
BG(serialize_lock)--;
if (EG(exception)) {
@@ -789,7 +789,7 @@ object ":" uiv ":" ["] {
ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
- if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) {
BG(serialize_lock)--;
if (EG(exception)) {
zend_string_release(class_name);
@@ -797,7 +797,7 @@ object ":" uiv ":" ["] {
zval_ptr_dtor(&args[0]);
return 0;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
+ php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
zval_ptr_dtor(&user_func);
@@ -814,8 +814,8 @@ object ":" uiv ":" ["] {
}
/* The callback function may have defined the class */
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
@@ -851,7 +851,7 @@ object ":" uiv ":" ["] {
"}" {
/* this is the case where we have less data than planned */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
+ php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index ffdd5abf0d..1823e1646e 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -215,7 +215,7 @@ PHP_FUNCTION(version_compare)
int compare, argc;
argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2,
+ if (zend_parse_parameters(argc, "ss|s", &v1, &v1_len, &v2,
&v2_len, &op, &op_len) == FAILURE) {
return;
}
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index c079ff383d..16b6db01ca 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -232,10 +232,10 @@ ZEND_GET_MODULE(sybase)
ZEND_DECLARE_MODULE_GLOBALS(sybase)
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } }
-static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC)
+static int _clean_invalid_results(zend_rsrc_list_entry *le)
{
if (Z_TYPE_P(le) == le_result) {
sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr;
@@ -304,9 +304,9 @@ static void _free_sybase_result(sybase_result *result)
}
/* Forward declaration */
-static int php_sybase_finish_results (sybase_result *result TSRMLS_DC);
+static int php_sybase_finish_results (sybase_result *result);
-static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_free_sybase_result(zend_rsrc_list_entry *rsrc)
{
sybase_result *result = (sybase_result *)rsrc->ptr;
@@ -315,13 +315,13 @@ static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
if (result->sybase_ptr->cmd) {
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
}
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
FREE_SYBASE_RESULT(result);
}
-static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
CS_INT con_status;
@@ -331,7 +331,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
zval_ptr_dtor(&sybase_ptr->callback_name);
sybase_ptr->callback_name= NULL;
}
- zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC);
+ zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results);
/* Non-persistent connections will always be connected or we wouldn't
* get here, but since we want to check the death status anyway
@@ -339,7 +339,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status on close");
/* Assume the worst. */
con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;
}
@@ -356,7 +356,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
-static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_sybase_plink(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
CS_INT con_status;
@@ -366,7 +366,7 @@ static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status on close");
/* Assume the worst. */
con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;
}
@@ -385,10 +385,9 @@ static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_CLIENTMSG *errmsg)
{
- TSRMLS_FETCH();
if (CS_SEVERITY(errmsg->msgnumber) >= SybCtG(min_client_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Client message: %s (severity %ld)", errmsg->msgstring, (long)CS_SEVERITY(errmsg->msgnumber));
+ php_error_docref(NULL, E_WARNING, "Sybase: Client message: %s (severity %ld)", errmsg->msgstring, (long)CS_SEVERITY(errmsg->msgnumber));
}
zend_string_free(SybCtG(server_message));
SybCtG(server_message) = estrdup(errmsg->msgstring);
@@ -408,7 +407,7 @@ static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONN
return CS_SUCCEED;
}
-static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC)
+static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg)
{
int handled = 0;
zval *msgnumber, *severity, *state, *line, *text, *retval = NULL;
@@ -438,12 +437,12 @@ static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRML
ZVAL_STRING(text, srvmsg->text, 1);
args[4] = &text;
- if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) {
+ if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL) == FAILURE) {
zval expr_copy;
int use_copy;
- use_copy = zend_make_printable_zval(callback_name, &expr_copy TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL(expr_copy));
+ use_copy = zend_make_printable_zval(callback_name, &expr_copy);
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL(expr_copy));
zval_dtor(&expr_copy);
}
@@ -467,7 +466,6 @@ static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONN
{
sybase_link *sybase;
int handled = 0;
- TSRMLS_FETCH();
/* Remember the last server message in any case */
zend_string_free(SybCtG(server_message));
@@ -492,16 +490,16 @@ static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONN
}
/* Call global message handler */
- handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg TSRMLS_CC);
+ handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg);
/* Call link specific message handler */
if (sybase) {
- handled = handled | _call_message_handler(sybase->callback_name, srvmsg TSRMLS_CC);
+ handled = handled | _call_message_handler(sybase->callback_name, srvmsg);
}
/* Spit out a warning if neither of them has handled this message */
if (!handled) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Server message: %s (severity %ld, procedure %s)",
+ php_error_docref(NULL, E_WARNING, "Sybase: Server message: %s (severity %ld, procedure %s)",
srvmsg->text, (long)srvmsg->severity, ((srvmsg->proclen>0) ? srvmsg->proc : "N/A"));
}
@@ -531,11 +529,11 @@ static PHP_GINIT_FUNCTION(sybase)
/* Initialize message handlers */
if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)_server_message_handler)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set server message handler");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set server message handler");
}
if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set client message handler");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set client message handler");
}
/* Set datetime conversion format to "Nov 3 1998 8:06PM".
@@ -547,7 +545,7 @@ static PHP_GINIT_FUNCTION(sybase)
{
CS_INT dt_convfmt = CS_DATES_SHORT;
if (cs_dt_info(sybase_globals->context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set datetime conversion format");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set datetime conversion format");
}
}
@@ -562,7 +560,7 @@ static PHP_GINIT_FUNCTION(sybase)
if (cfg_get_long("sybct.timeout", &opt)==SUCCESS) {
CS_INT cs_timeout = opt;
if (ct_config(sybase_globals->context, CS_SET, CS_TIMEOUT, &cs_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the timeout");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update the timeout");
}
}
@@ -626,20 +624,20 @@ PHP_RSHUTDOWN_FUNCTION(sybase)
}
-static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname TSRMLS_DC)
+static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname)
{
CS_LOCALE *tmp_locale;
long packetsize;
/* set a CS_CONNECTION record */
if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate connection record");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate connection record");
return 0;
}
/* Note - this saves a copy of sybase, not a pointer to it. */
if (ct_con_props(sybase->connection, CS_SET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set userdata");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set userdata");
ct_con_drop(sybase->connection);
return 0;
}
@@ -662,16 +660,16 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (charset) {
if (cs_loc_alloc(SybCtG(context), &tmp_locale)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate locale information");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate locale information");
} else {
if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_LC_ALL, NULL, CS_NULLTERM, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to load default locale data");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to load default locale data");
} else {
if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update character set");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update character set");
} else {
if (ct_con_props(sybase->connection, CS_SET, CS_LOC_PROP, tmp_locale, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection properties");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update connection properties");
}
}
}
@@ -680,7 +678,7 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) {
if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update connection packetsize");
}
}
@@ -699,7 +697,7 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (SybCtG(login_timeout) != -1) {
CS_INT cs_login_timeout = SybCtG(login_timeout);
if (ct_config(SybCtG(context), CS_SET, CS_LOGIN_TIMEOUT, &cs_login_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the login timeout");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update the login timeout");
}
}
@@ -710,13 +708,13 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
/* create the link */
if (ct_connect(sybase->connection, host, CS_NULLTERM)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to connect");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to connect");
ct_con_drop(sybase->connection);
return 0;
}
if (ct_cmd_alloc(sybase->connection, &sybase->cmd)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate command record");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate command record");
ct_close(sybase->connection, CS_UNUSED);
ct_con_drop(sybase->connection);
return 0;
@@ -736,11 +734,11 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
host= user= passwd= charset= appname= NULL;
if (persistent) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!s!s!", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!s!s!", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!s!s!b", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len, &new) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!s!s!b", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len, &new) == FAILURE) {
return;
}
}
@@ -766,12 +764,12 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_rsrc_list_entry new_le;
if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (SybCtG(max_persistent)!=-1 && SybCtG(num_persistent)>=SybCtG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
@@ -781,7 +779,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(hashed_details);
RETURN_FALSE;
}
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
free(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -813,7 +811,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status");
efree(hashed_details);
RETURN_FALSE;
}
@@ -835,7 +833,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* NULL before trying to use it elsewhere . . .)
*/
memcpy(&sybase, sybase_ptr, sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
memcpy(sybase_ptr, &sybase, sizeof(sybase_link));
efree(hashed_details);
RETURN_FALSE;
@@ -873,13 +871,13 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
efree(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -934,7 +932,7 @@ PHP_FUNCTION(sybase_pconnect)
/* }}} */
-inline static int php_sybase_connection_id(zval *sybase_link_index, int *id TSRMLS_DC)
+inline static int php_sybase_connection_id(zval *sybase_link_index, int *id)
{
if (NULL == sybase_link_index) {
if (-1 == SybCtG(default_link)) {
@@ -955,12 +953,12 @@ PHP_FUNCTION(sybase_close)
sybase_link *sybase_ptr;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection to close");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection to close");
RETURN_FALSE;
}
@@ -1064,12 +1062,12 @@ PHP_FUNCTION(sybase_select_db)
int id, len;
sybase_link *sybase_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &len, &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &len, &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -1087,7 +1085,7 @@ PHP_FUNCTION(sybase_select_db)
/* }}} */
-static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
+static int php_sybase_finish_results(sybase_result *result)
{
int i, fail;
CS_RETCODE retcode;
@@ -1121,7 +1119,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
break;
case CS_CMD_FAIL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, canceling rest");
+ php_error_docref(NULL, E_WARNING, "Sybase: Command failed, canceling rest");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
fail = 1;
break;
@@ -1131,7 +1129,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
/* Unexpected results, cancel them. */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling current");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Unexpected results, canceling current");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT);
break;
@@ -1141,7 +1139,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling all");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Unexpected results, canceling all");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
break;
}
@@ -1191,7 +1189,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
ZVAL_STRINGL(&result, buf, length- 1, 1); \
}
-static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS_DC)
+static int php_sybase_fetch_result_row(sybase_result *result, int numrows)
{
int i, j;
CS_INT retcode;
@@ -1270,13 +1268,13 @@ static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS
}
if (retcode==CS_ROW_FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Error reading row %d", result->num_rows);
+ php_error_docref(NULL, E_WARNING, "Sybase: Error reading row %d", result->num_rows);
return retcode;
}
result->last_retcode= retcode;
switch (retcode) {
case CS_END_DATA:
- retcode = php_sybase_finish_results(result TSRMLS_CC);
+ retcode = php_sybase_finish_results(result);
break;
case CS_ROW_FAIL:
@@ -1293,7 +1291,7 @@ static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS
return retcode;
}
-static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store TSRMLS_DC)
+static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store)
{
int num_fields;
sybase_result *result;
@@ -1412,7 +1410,7 @@ static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int
if (buffered) {
retcode = CS_SUCCEED;
} else {
- if ((retcode = php_sybase_fetch_result_row(result, -1 TSRMLS_CC)) == CS_FAIL) {
+ if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) {
return NULL;
}
}
@@ -1437,17 +1435,17 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
Q_FAILURE, /* Failure, no results. */
} status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|rb", &query, &len, &sybase_link_index, &store) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|rb", &query, &len, &sybase_link_index, &store) == FAILURE) {
return;
}
if (!store && !buffered) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Cannot use non-storing mode with buffered queries");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Cannot use non-storing mode with buffered queries");
store = 1;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -1462,7 +1460,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
if (sybase_ptr->active_result_index) {
zval *tmp = NULL;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Called without first fetching all rows from a previous unbuffered query");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Called without first fetching all rows from a previous unbuffered query");
if (sybase_ptr->cmd) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
}
@@ -1475,7 +1473,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
ZEND_FETCH_RESOURCE(result, sybase_result *, &tmp, -1, "Sybase result", le_result);
if (result) {
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
zval_ptr_dtor(&tmp);
@@ -1501,14 +1499,14 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
* CS_BUSY for some reason.
*/
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Connection is dead");
+ php_error_docref(NULL, E_WARNING, "Sybase: Connection is dead");
RETURN_FALSE;
}
if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot send command");
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot send command");
RETURN_FALSE;
}
@@ -1521,7 +1519,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
if (ct_results(sybase_ptr->cmd, &restype)!=CS_SUCCEED) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot read results");
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot read results");
RETURN_FALSE;
}
switch ((int) restype) {
@@ -1549,7 +1547,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
case CS_STATUS_RESULT:
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
RETURN_FALSE;
@@ -1575,7 +1573,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
if (status != Q_RESULT) {
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
@@ -1630,7 +1628,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
/* Retry deadlocks up until deadlock_retry_count times */
if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlock_retry_count)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count));
+ php_error_docref(NULL, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count));
FREE_SYBASE_RESULT(result);
break;
}
@@ -1689,16 +1687,16 @@ PHP_FUNCTION(sybase_free_result)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Did we fetch up until the end? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: canceling the rest of the results"); */
+ /* php_error_docref(NULL, E_WARNING, "Sybase: canceling the rest of the results"); */
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
zend_list_delete(Z_LVAL_P(sybase_result_index));
@@ -1722,7 +1720,7 @@ PHP_FUNCTION(sybase_num_rows)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1740,7 +1738,7 @@ PHP_FUNCTION(sybase_num_fields)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1760,14 +1758,14 @@ PHP_FUNCTION(sybase_fetch_row)
sybase_result *result;
zval *field_content;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, 1);
}
/* At the end? */
@@ -1796,14 +1794,14 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics)
zval *tmp;
char name[32];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? Fetch next row */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, 1);
}
/* At the end? */
@@ -1845,7 +1843,7 @@ PHP_FUNCTION(sybase_fetch_object)
sybase_result *result;
/* Was a second parameter given? */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z", &sybase_result_index, &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z", &sybase_result_index, &object) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1867,8 +1865,8 @@ PHP_FUNCTION(sybase_fetch_object)
zend_class_entry **pce = NULL;
convert_to_string(object);
- if (zend_lookup_class(Z_STRVAL_P(object), Z_STRLEN_P(object), &pce TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_P(object));
+ if (zend_lookup_class(Z_STRVAL_P(object), Z_STRLEN_P(object), &pce) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_P(object));
/* Use default (ZEND_STANDARD_CLASS_DEF_PTR) */
} else {
ce = *pce;
@@ -1910,18 +1908,18 @@ PHP_FUNCTION(sybase_data_seek)
long offset;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &sybase_result_index, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &sybase_result_index, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && offset >= result->num_rows) {
- php_sybase_fetch_result_row(result, offset+ 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, offset+ 1);
}
if (offset < 0 || offset >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", offset, result->num_rows - 1);
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", offset, result->num_rows - 1);
RETURN_FALSE;
}
@@ -1982,7 +1980,7 @@ PHP_FUNCTION(sybase_fetch_field)
long field_offset = -1;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &sybase_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &sybase_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1994,7 +1992,7 @@ PHP_FUNCTION(sybase_fetch_field)
if (field_offset < 0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS() == 2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset");
}
RETURN_FALSE;
}
@@ -2018,13 +2016,13 @@ PHP_FUNCTION(sybase_field_seek)
long field_offset;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &sybase_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &sybase_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
if (field_offset < 0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset");
RETURN_FALSE;
}
@@ -2044,18 +2042,18 @@ PHP_FUNCTION(sybase_result)
int field_offset = 0;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &sybase_result_index, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &sybase_result_index, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && row >= result->num_rows) {
- php_sybase_fetch_result_row(result, row TSRMLS_CC);
+ php_sybase_fetch_result_row(result, row);
}
if (row < 0 || row >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%ld)", row);
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad row offset (%ld)", row);
RETURN_FALSE;
}
@@ -2070,7 +2068,7 @@ PHP_FUNCTION(sybase_result)
}
}
if (i >= result->num_fields) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_P(field));
+ php_error_docref(NULL, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_P(field));
RETURN_FALSE;
}
break;
@@ -2079,7 +2077,7 @@ PHP_FUNCTION(sybase_result)
convert_to_long(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -2099,12 +2097,12 @@ PHP_FUNCTION(sybase_affected_rows)
sybase_link *sybase_ptr;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -2145,7 +2143,7 @@ PHP_FUNCTION(sybase_min_client_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -2160,7 +2158,7 @@ PHP_FUNCTION(sybase_min_server_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -2174,7 +2172,7 @@ PHP_FUNCTION(sybase_deadlock_retry_count)
{
long retry_count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &retry_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &retry_count) == FAILURE) {
return;
}
@@ -2195,11 +2193,11 @@ PHP_FUNCTION(sybase_set_message_handler)
zval **callback;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!|r", &fci, &cache, &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!|r", &fci, &cache, &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
/* Doesn't matter if we're not connected yet, use default */
callback= &SybCtG(callback_name);
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index d158366ea5..3727d234c1 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -119,7 +119,7 @@ zend_module_entry sysvmsg_module_entry = {
ZEND_GET_MODULE(sysvmsg)
#endif
-static void sysvmsg_release(zend_resource *rsrc TSRMLS_DC)
+static void sysvmsg_release(zend_resource *rsrc)
{
sysvmsg_queue_t *mq = (sysvmsg_queue_t *) rsrc->ptr;
efree(mq);
@@ -160,7 +160,7 @@ PHP_FUNCTION(msg_set_queue)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &queue, &data) == FAILURE) {
return;
}
@@ -203,7 +203,7 @@ PHP_FUNCTION(msg_stat_queue)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &queue) == FAILURE) {
return;
}
@@ -232,7 +232,7 @@ PHP_FUNCTION(msg_queue_exists)
{
zend_long key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &key) == FAILURE) {
return;
}
@@ -252,7 +252,7 @@ PHP_FUNCTION(msg_get_queue)
zend_long perms = 0666;
sysvmsg_queue_t *mq;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &key, &perms) == FAILURE) {
return;
}
@@ -264,12 +264,12 @@ PHP_FUNCTION(msg_get_queue)
/* doesn't already exist; create it */
mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms);
if (mq->id < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
efree(mq);
RETURN_FALSE;
}
}
- RETVAL_ZVAL(zend_list_insert(mq, le_sysvmsg TSRMLS_CC), 0, 0);
+ RETVAL_ZVAL(zend_list_insert(mq, le_sysvmsg), 0, 0);
}
/* }}} */
@@ -280,7 +280,7 @@ PHP_FUNCTION(msg_remove_queue)
zval *queue;
sysvmsg_queue_t *mq = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &queue) == FAILURE) {
return;
}
@@ -308,21 +308,21 @@ PHP_FUNCTION(msg_receive)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz/lz/|blz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz/lz/|blz/",
&queue, &desiredmsgtype, &out_msgtype, &maxsize,
&out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) {
return;
}
if (maxsize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maximum size of the message has to be greater than zero");
+ php_error_docref(NULL, E_WARNING, "maximum size of the message has to be greater than zero");
return;
}
if (flags != 0) {
if (flags & PHP_MSG_EXCEPT) {
#ifndef MSG_EXCEPT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system");
+ php_error_docref(NULL, E_WARNING, "MSG_EXCEPT is not supported on your system");
RETURN_FALSE;
#else
realflags |= MSG_EXCEPT;
@@ -364,8 +364,8 @@ PHP_FUNCTION(msg_receive)
const unsigned char *p = (const unsigned char *) messagebuffer->mtext;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted");
+ if (!php_var_unserialize(&tmp, &p, p + result, &var_hash)) {
+ php_error_docref(NULL, E_WARNING, "message corrupted");
RETVAL_FALSE;
} else {
ZVAL_COPY_VALUE(out_message, &tmp);
@@ -395,7 +395,7 @@ PHP_FUNCTION(msg_send)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz|bbz/",
&queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) {
return;
}
@@ -407,7 +407,7 @@ PHP_FUNCTION(msg_send)
php_serialize_data_t var_hash;
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&msg_var, message, &var_hash TSRMLS_CC);
+ php_var_serialize(&msg_var, message, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
/* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
@@ -437,7 +437,7 @@ PHP_FUNCTION(msg_send)
message_len = spprintf(&p, 0, "%F", Z_DVAL_P(message));
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number.");
+ php_error_docref(NULL, E_WARNING, "Message parameter must be either a string or a number.");
RETURN_FALSE;
}
@@ -457,7 +457,7 @@ PHP_FUNCTION(msg_send)
efree(messagebuffer);
if (result == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno));
if (zerror) {
ZVAL_LONG(zerror, errno);
}
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 299c725c6b..3319bdb4fb 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -133,7 +133,7 @@ THREAD_LS sysvsem_module php_sysvsem_module;
/* {{{ release_sysvsem_sem
*/
-static void release_sysvsem_sem(zend_resource *rsrc TSRMLS_DC)
+static void release_sysvsem_sem(zend_resource *rsrc)
{
sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr;
struct sembuf sop[2];
@@ -194,7 +194,7 @@ PHP_FUNCTION(sem_get)
int count;
sysvsem_sem *sem_ptr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|lll", &key, &max_acquire, &perm, &auto_release)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|lll", &key, &max_acquire, &perm, &auto_release)) {
RETURN_FALSE;
}
@@ -206,7 +206,7 @@ PHP_FUNCTION(sem_get)
semid = semget(key, 3, perm|IPC_CREAT);
if (semid == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
RETURN_FALSE;
}
@@ -238,7 +238,7 @@ PHP_FUNCTION(sem_get)
sop[2].sem_flg = SEM_UNDO;
while (semop(semid, sop, 3) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
break;
}
}
@@ -246,7 +246,7 @@ PHP_FUNCTION(sem_get)
/* Get the usage count. */
count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
if (count == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
/* If we are the only user, then take this opportunity to set the max. */
@@ -257,17 +257,17 @@ PHP_FUNCTION(sem_get)
union semun semarg;
semarg.val = max_acquire;
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#elif defined(SETVAL_WANTS_PTR)
/* This is correct for Solaris 2.6 which does not have union semun. */
if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#else
/* This works for i.e. AIX */
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#endif
}
@@ -279,7 +279,7 @@ PHP_FUNCTION(sem_get)
sop[0].sem_flg = SEM_UNDO;
while (semop(semid, sop, 1) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
break;
}
}
@@ -305,11 +305,11 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
struct sembuf sop;
if (acquire) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &arg_id, &nowait) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &arg_id, &nowait) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg_id) == FAILURE) {
return;
}
}
@@ -317,7 +317,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem);
if (!acquire && sem_ptr->count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
+ php_error_docref(NULL, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
RETURN_FALSE;
}
@@ -328,7 +328,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
while (semop(sem_ptr->semid, &sop, 1) == -1) {
if (errno != EINTR) {
if (errno != EAGAIN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
}
RETURN_FALSE;
}
@@ -372,7 +372,7 @@ PHP_FUNCTION(sem_remove)
struct semid_ds buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg_id) == FAILURE) {
return;
}
@@ -384,7 +384,7 @@ PHP_FUNCTION(sem_remove)
#else
if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id));
+ php_error_docref(NULL, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id));
RETURN_FALSE;
}
@@ -393,7 +393,7 @@ PHP_FUNCTION(sem_remove)
#else
if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index c87be09e4f..a8cfb02f1d 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -122,7 +122,7 @@ static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos);
/* {{{ php_release_sysvshm
*/
-static void php_release_sysvshm(zend_resource *rsrc TSRMLS_DC)
+static void php_release_sysvshm(zend_resource *rsrc)
{
sysvshm_shm *shm_ptr = (sysvshm_shm *) rsrc->ptr;
shmdt((void *) shm_ptr->ptr);
@@ -152,12 +152,12 @@ PHP_FUNCTION(shm_attach)
sysvshm_chunk_head *chunk_ptr;
zend_long shm_key, shm_id, shm_size = php_sysvshm.init_mem, shm_flag = 0666;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &shm_key, &shm_size, &shm_flag)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &shm_key, &shm_size, &shm_flag)) {
return;
}
if (shm_size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Segment size must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Segment size must be greater than zero");
RETURN_FALSE;
}
@@ -166,19 +166,19 @@ PHP_FUNCTION(shm_attach)
/* get the id from a specified key or create new shared memory */
if ((shm_id = shmget(shm_key, 0, 0)) < 0) {
if (shm_size < sizeof(sysvshm_chunk_head)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: memorysize too small", shm_key);
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: memorysize too small", shm_key);
efree(shm_list_ptr);
RETURN_FALSE;
}
if ((shm_id = shmget(shm_key, shm_size, shm_flag | IPC_CREAT | IPC_EXCL)) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
efree(shm_list_ptr);
RETURN_FALSE;
}
}
if ((shm_ptr = shmat(shm_id, NULL, 0)) == (void *) -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
efree(shm_list_ptr);
RETURN_FALSE;
}
@@ -208,7 +208,7 @@ PHP_FUNCTION(shm_detach)
zval *shm_id;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &shm_id)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &shm_id)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -223,13 +223,13 @@ PHP_FUNCTION(shm_remove)
zval *shm_id;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &shm_id)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &shm_id)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
if (shmctl(shm_list_ptr->id, IPC_RMID, NULL) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
RETURN_FALSE;
}
@@ -248,16 +248,16 @@ PHP_FUNCTION(shm_put_var)
smart_str shm_var = {0};
php_serialize_data_t var_hash;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &shm_id, &shm_key, &arg_var)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &shm_id, &shm_key, &arg_var)) {
return;
}
/* setup string-variable and serialize */
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&shm_var, arg_var, &var_hash TSRMLS_CC);
+ php_var_serialize(&shm_var, arg_var, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
- shm_list_ptr = zend_fetch_resource(shm_id TSRMLS_CC, -1, PHP_SHM_RSRC_NAME, NULL, 1, php_sysvshm.le_shm);
+ shm_list_ptr = zend_fetch_resource(shm_id, -1, PHP_SHM_RSRC_NAME, NULL, 1, php_sysvshm.le_shm);
if (!shm_list_ptr) {
smart_str_free(&shm_var);
RETURN_FALSE;
@@ -270,7 +270,7 @@ PHP_FUNCTION(shm_put_var)
smart_str_free(&shm_var);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not enough shared memory left");
+ php_error_docref(NULL, E_WARNING, "not enough shared memory left");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -289,7 +289,7 @@ PHP_FUNCTION(shm_get_var)
sysvshm_chunk *shm_var;
php_unserialize_data_t var_hash;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -299,15 +299,15 @@ PHP_FUNCTION(shm_get_var)
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
if (shm_varpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %pd doesn't exist", shm_key);
+ php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
RETURN_FALSE;
}
shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos);
shm_data = &shm_var->mem;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (php_var_unserialize(return_value, (const unsigned char **) &shm_data, (unsigned char *) shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corrupted");
+ if (php_var_unserialize(return_value, (const unsigned char **) &shm_data, (unsigned char *) shm_data + shm_var->length, &var_hash) != 1) {
+ php_error_docref(NULL, E_WARNING, "variable data in shared memory is corrupted");
RETVAL_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
@@ -322,7 +322,7 @@ PHP_FUNCTION(shm_has_var)
zend_long shm_key;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -338,7 +338,7 @@ PHP_FUNCTION(shm_remove_var)
zend_long shm_key, shm_varpos;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -346,7 +346,7 @@ PHP_FUNCTION(shm_remove_var)
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
if (shm_varpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %pd doesn't exist", shm_key);
+ php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
RETURN_FALSE;
}
php_remove_shm_data((shm_list_ptr->ptr), shm_varpos);
diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4
index 102f6a827e..ff27bd1aaa 100644
--- a/ext/tidy/config.m4
+++ b/ext/tidy/config.m4
@@ -38,7 +38,7 @@ if test "$PHP_TIDY" != "no"; then
],[],[])
- PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
+ PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(TIDY_SHARED_LIBADD)
AC_DEFINE(HAVE_TIDY,1,[ ])
fi
diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32
index 41f217588d..a87a833f92 100644
--- a/ext/tidy/config.w32
+++ b/ext/tidy/config.w32
@@ -12,6 +12,7 @@ if (PHP_TIDY != "no") {
)) {
EXTENSION("tidy", "tidy.c");
AC_DEFINE('HAVE_TIDY', 1, 'Have TIDY library');
+ ADD_FLAG('CFLAGS_TIDY', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
if (!PHP_TIDY_SHARED) {
ADD_DEF_FILE("ext\\tidy\\php_tidy.def");
}
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
index cd78f37a17..77de84de9c 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -40,7 +40,10 @@ ZEND_BEGIN_MODULE_GLOBALS(tidy)
ZEND_END_MODULE_GLOBALS(tidy)
#ifdef ZTS
-#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v)
+#define TG(v) ZEND_TSRMG(tidy_globals_id, zend_tidy_globals *, v)
+#ifdef COMPILE_DL_TIDY
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define TG(v) (tidy_globals.v)
#endif
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 23531e9ae3..ba3486478e 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -55,7 +55,7 @@
return; \
} \
} else { \
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, tidy_ce_doc) == FAILURE) { \
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "O", &object, tidy_ce_doc) == FAILURE) { \
RETURN_FALSE; \
} \
} \
@@ -72,16 +72,16 @@
#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \
if(_val) { \
if(Z_TYPE_P(_val) == IS_ARRAY) { \
- _php_tidy_apply_config_array(_doc, HASH_OF(_val) TSRMLS_CC); \
+ _php_tidy_apply_config_array(_doc, HASH_OF(_val)); \
} else { \
convert_to_string_ex(_val); \
TIDY_OPEN_BASE_DIR_CHECK(Z_STRVAL_P(_val)); \
switch (tidyLoadConfig(_doc, Z_STRVAL_P(_val))) { \
case -1: \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \
+ php_error_docref(NULL, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \
break; \
case 1: \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(_val)); \
+ php_error_docref(NULL, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(_val)); \
break; \
} \
} \
@@ -92,7 +92,7 @@
zend_class_entry ce; \
INIT_CLASS_ENTRY(ce, # classname, tidy_funcs_ ## name); \
ce.create_object = tidy_object_new_ ## name; \
- tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent TSRMLS_CC); \
+ tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent); \
tidy_ce_ ## name->ce_flags |= __flags; \
memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \
tidy_object_handlers_ ## name.clone_obj = NULL; \
@@ -153,14 +153,14 @@
}
#define TIDY_OPEN_BASE_DIR_CHECK(filename) \
-if (php_check_open_basedir(filename TSRMLS_CC)) { \
+if (php_check_open_basedir(filename)) { \
RETURN_FALSE; \
} \
#define TIDY_SET_DEFAULT_CONFIG(_doc) \
if (TG(default_config) && TG(default_config)[0]) { \
if (tidyLoadConfig(_doc, TG(default_config)) < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \
+ php_error_docref(NULL, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \
} \
}
/* }}} */
@@ -205,24 +205,24 @@ static inline PHPTidyObj *php_tidy_fetch_object(zend_object *obj) {
/* {{{ ext/tidy prototypes
*/
-static zend_string *php_tidy_file_to_mem(char *, zend_bool TSRMLS_DC);
-static void tidy_object_free_storage(zend_object * TSRMLS_DC);
-static zend_object *tidy_object_new_node(zend_class_entry * TSRMLS_DC);
-static zend_object *tidy_object_new_doc(zend_class_entry * TSRMLS_DC);
-static zval * tidy_instanciate(zend_class_entry *, zval * 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);
+static zend_string *php_tidy_file_to_mem(char *, zend_bool);
+static void tidy_object_free_storage(zend_object *);
+static zend_object *tidy_object_new_node(zend_class_entry *);
+static zend_object *tidy_object_new_doc(zend_class_entry *);
+static zval * tidy_instanciate(zend_class_entry *, zval *);
+static int tidy_doc_cast_handler(zval *, zval *, int);
+static int tidy_node_cast_handler(zval *, zval *, int);
+static void tidy_doc_update_properties(PHPTidyObj *);
+static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type);
+static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType *);
static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes);
-static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval * TSRMLS_DC);
-static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC);
+static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval *);
+static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options);
static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS);
static void _php_tidy_register_tags(INIT_FUNC_ARGS);
static PHP_INI_MH(php_tidy_set_clean_output);
-static void php_tidy_clean_output_start(const char *name, size_t name_len TSRMLS_DC);
-static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC);
+static void php_tidy_clean_output_start(const char *name, size_t name_len);
+static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags);
static int php_tidy_output_handler(void **nothing, php_output_context *output_context);
static PHP_MINIT_FUNCTION(tidy);
@@ -467,6 +467,9 @@ zend_module_entry tidy_module_entry = {
};
#ifdef COMPILE_DL_TIDY
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(tidy)
#endif
@@ -487,11 +490,10 @@ static void TIDY_CALL php_tidy_free(void *buf)
static void TIDY_CALL php_tidy_panic(ctmbstr msg)
{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
+ php_error_docref(NULL, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
}
-static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS_DC)
+static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value)
{
TidyOption opt = tidyGetOptionByName(doc, optname);
zval conv;
@@ -499,12 +501,12 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
ZVAL_COPY_VALUE(&conv, value);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname);
return FAILURE;
}
if (tidyOptIsReadOnly(opt)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Attempting to set read-only option '%s'", optname);
+ php_error_docref(NULL, E_NOTICE, "Attempting to set read-only option '%s'", optname);
return FAILURE;
}
@@ -546,7 +548,7 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option");
+ php_error_docref(NULL, E_WARNING, "Unable to determine type of configuration option");
break;
}
@@ -564,14 +566,14 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
zval *config = NULL;
if (is_file) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- if (!(data = php_tidy_file_to_mem(arg1->val, use_include_path TSRMLS_CC))) {
+ if (!(data = php_tidy_file_to_mem(arg1->val, use_include_path))) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
data = arg1;
@@ -585,7 +587,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyBufFree(errbuf);
efree(errbuf);
tidyRelease(doc);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer");
+ php_error_docref(NULL, E_ERROR, "Could not set Tidy error buffer");
}
tidyOptSetBool(doc, TidyForceOutput, yes);
@@ -599,7 +601,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
if(enc_len) {
if (tidySetCharEncoding(doc, enc) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc);
+ php_error_docref(NULL, E_WARNING, "Could not set encoding '%s'", enc);
RETVAL_FALSE;
}
}
@@ -611,7 +613,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyBufAttach(&buf, (byte *) data->val, data->len);
if (tidyParseBuffer(doc, &buf) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf->bp);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf->bp);
RETVAL_FALSE;
} else {
if (tidyCleanAndRepair(doc) >= 0) {
@@ -637,7 +639,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyRelease(doc);
}
-static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_path TSRMLS_DC)
+static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_path)
{
php_stream *stream;
zend_string *data = NULL;
@@ -653,11 +655,11 @@ static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_p
return data;
}
-static void tidy_object_free_storage(zend_object *object TSRMLS_DC)
+static void tidy_object_free_storage(zend_object *object)
{
PHPTidyObj *intern = php_tidy_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->ptdoc) {
intern->ptdoc->ref_count--;
@@ -671,12 +673,12 @@ static void tidy_object_free_storage(zend_object *object TSRMLS_DC)
}
}
-static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, tidy_obj_type objtype TSRMLS_DC)
+static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, tidy_obj_type objtype)
{
PHPTidyObj *intern;
intern = ecalloc(1, sizeof(PHPTidyObj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
switch(objtype) {
@@ -697,7 +699,7 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
tidyRelease(intern->ptdoc->doc);
efree(intern->ptdoc);
efree(intern);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer");
+ php_error_docref(NULL, E_ERROR, "Could not set Tidy error buffer");
}
tidyOptSetBool(intern->ptdoc->doc, TidyForceOutput, yes);
@@ -705,7 +707,7 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
TIDY_SET_DEFAULT_CONFIG(intern->ptdoc->doc);
- tidy_add_default_properties(intern, is_doc TSRMLS_CC);
+ tidy_add_default_properties(intern, is_doc);
break;
}
@@ -714,23 +716,23 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
return &intern->std;
}
-static zend_object *tidy_object_new_node(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *tidy_object_new_node(zend_class_entry *class_type)
{
- return tidy_object_new(class_type, &tidy_object_handlers_node, is_node TSRMLS_CC);
+ return tidy_object_new(class_type, &tidy_object_handlers_node, is_node);
}
-static zend_object *tidy_object_new_doc(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *tidy_object_new_doc(zend_class_entry *class_type)
{
- return tidy_object_new(class_type, &tidy_object_handlers_doc, is_doc TSRMLS_CC);
+ return tidy_object_new(class_type, &tidy_object_handlers_doc, is_doc);
}
-static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
+static zval * tidy_instanciate(zend_class_entry *pce, zval *object)
{
object_init_ex(object, pce);
return object;
}
-static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
+static int tidy_doc_cast_handler(zval *in, zval *out, int type)
{
TidyBuffer output;
PHPTidyObj *obj;
@@ -763,7 +765,7 @@ static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
return SUCCESS;
}
-static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
+static int tidy_node_cast_handler(zval *in, zval *out, int type)
{
TidyBuffer buf;
PHPTidyObj *obj;
@@ -800,7 +802,7 @@ static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
return SUCCESS;
}
-static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
+static void tidy_doc_update_properties(PHPTidyObj *obj)
{
TidyBuffer output;
@@ -828,7 +830,7 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
}
}
-static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRMLS_DC)
+static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type)
{
TidyBuffer buf;
@@ -888,14 +890,14 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
if (tempnode) {
array_init(&children);
do {
- tidy_instanciate(tidy_ce_node, &temp TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, &temp);
newobj = Z_TIDY_P(&temp);
newobj->node = tempnode;
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
add_next_index_zval(&children, &temp);
} while((tempnode = tidyGetNext(tempnode)));
@@ -918,7 +920,7 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
}
}
-static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type TSRMLS_DC)
+static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type)
{
*type = tidyOptGetType(opt);
@@ -978,17 +980,17 @@ static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetyp
RETURN_NULL();
}
- tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, return_value);
newobj = Z_TIDY_P(return_value);
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->node = node;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
}
-static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC)
+static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options)
{
zval *opt_val;
ulong opt_indx;
@@ -998,19 +1000,19 @@ static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRML
if (opt_name == NULL) {
continue;
}
- _php_tidy_set_tidy_opt(doc, opt_name->val, opt_val TSRMLS_CC);
+ _php_tidy_set_tidy_opt(doc, opt_name->val, opt_val);
} ZEND_HASH_FOREACH_END();
return SUCCESS;
}
-static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc TSRMLS_DC)
+static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc)
{
TidyBuffer buf;
if(enc) {
if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc);
+ php_error_docref(NULL, E_WARNING, "Could not set encoding '%s'", enc);
return FAILURE;
}
}
@@ -1020,10 +1022,10 @@ static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *e
tidyBufInit(&buf);
tidyBufAttach(&buf, (byte *) string, len);
if (tidyParseBuffer(obj->ptdoc->doc, &buf) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", obj->ptdoc->errbuf->bp);
+ php_error_docref(NULL, E_WARNING, "%s", obj->ptdoc->errbuf->bp);
return FAILURE;
}
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
return SUCCESS;
}
@@ -1048,14 +1050,18 @@ static PHP_MINIT_FUNCTION(tidy)
_php_tidy_register_tags(INIT_FUNC_ARGS_PASSTHRU);
_php_tidy_register_nodetypes(INIT_FUNC_ARGS_PASSTHRU);
- php_output_handler_alias_register(ZEND_STRL("ob_tidyhandler"), php_tidy_output_handler_init TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_tidyhandler"), php_tidy_output_handler_init);
return SUCCESS;
}
static PHP_RINIT_FUNCTION(tidy)
{
- php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler") TSRMLS_CC);
+#if defined(COMPILE_DL_TIDY) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
+ php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler"));
return SUCCESS;
}
@@ -1093,23 +1099,23 @@ static PHP_INI_MH(php_tidy_set_clean_output)
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- status = php_output_get_status(TSRMLS_C);
+ status = php_output_get_status();
if (value && (status & PHP_OUTPUT_WRITTEN)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot enable tidy.clean_output - there has already been output");
+ php_error_docref(NULL, E_WARNING, "Cannot enable tidy.clean_output - there has already been output");
return FAILURE;
}
if (status & PHP_OUTPUT_SENT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot change tidy.clean_output - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot change tidy.clean_output - headers already sent");
return FAILURE;
}
}
- status = OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ status = OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
if (stage == PHP_INI_STAGE_RUNTIME && value) {
- if (!php_output_handler_started(ZEND_STRL("ob_tidyhandler") TSRMLS_CC)) {
- php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler") TSRMLS_CC);
+ if (!php_output_handler_started(ZEND_STRL("ob_tidyhandler"))) {
+ php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler"));
}
}
@@ -1120,25 +1126,25 @@ static PHP_INI_MH(php_tidy_set_clean_output)
* NOTE: tidy does not support iterative/cumulative parsing, so chunk-sized output handler is not possible
*/
-static void php_tidy_clean_output_start(const char *name, size_t name_len TSRMLS_DC)
+static void php_tidy_clean_output_start(const char *name, size_t name_len)
{
php_output_handler *h;
- if (TG(clean_output) && (h = php_tidy_output_handler_init(name, name_len, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC))) {
- php_output_handler_start(h TSRMLS_CC);
+ if (TG(clean_output) && (h = php_tidy_output_handler_init(name, name_len, 0, PHP_OUTPUT_HANDLER_STDFLAGS))) {
+ php_output_handler_start(h);
}
}
-static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
if (chunk_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot use a chunk size for ob_tidyhandler");
+ php_error_docref(NULL, E_WARNING, "Cannot use a chunk size for ob_tidyhandler");
return NULL;
}
if (!TG(clean_output)) {
TG(clean_output) = 1;
}
- return php_output_handler_create_internal(handler_name, handler_name_len, php_tidy_output_handler, chunk_size, flags TSRMLS_CC);
+ return php_output_handler_create_internal(handler_name, handler_name_len, php_tidy_output_handler, chunk_size, flags);
}
static int php_tidy_output_handler(void **nothing, php_output_context *output_context)
@@ -1189,16 +1195,16 @@ static PHP_FUNCTION(tidy_parse_string)
zval *options = NULL;
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
- tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, input->val, input->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, input->val, input->len, enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -1246,22 +1252,22 @@ static PHP_FUNCTION(tidy_parse_file)
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETVAL_FALSE;
}
@@ -1277,7 +1283,7 @@ static PHP_FUNCTION(tidy_clean_repair)
TIDY_FETCH_OBJECT;
if (tidyCleanAndRepair(obj->ptdoc->doc) >= 0) {
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
RETURN_TRUE;
}
@@ -1308,7 +1314,7 @@ static PHP_FUNCTION(tidy_diagnose)
TIDY_FETCH_OBJECT;
if (obj->ptdoc->initialized && tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
RETURN_TRUE;
}
@@ -1342,11 +1348,11 @@ static PHP_FUNCTION(tidy_get_opt_doc)
TIDY_SET_CONTEXT;
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1356,7 +1362,7 @@ static PHP_FUNCTION(tidy_get_opt_doc)
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
RETURN_FALSE;
}
@@ -1389,7 +1395,7 @@ static PHP_FUNCTION(tidy_get_config)
TidyOption opt = tidyGetNextOption(obj->ptdoc->doc, &itOpt);
opt_name = (char *)tidyOptGetName(opt);
- opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
+ opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt);
switch (optt) {
case TidyString:
// TODO: avoid reallocation ???
@@ -1505,11 +1511,11 @@ static PHP_FUNCTION(tidy_getopt)
TIDY_SET_CONTEXT;
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1519,11 +1525,11 @@ static PHP_FUNCTION(tidy_getopt)
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
RETURN_FALSE;
}
- optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
+ optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt);
switch (optt) {
case TidyString:
RETVAL_STRING((char *)optval);
@@ -1543,7 +1549,7 @@ static PHP_FUNCTION(tidy_getopt)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option");
+ php_error_docref(NULL, E_WARNING, "Unable to determine type of configuration option");
break;
}
@@ -1562,7 +1568,7 @@ static TIDY_DOC_METHOD(__construct)
PHPTidyObj *obj;
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Pzsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|Pzsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1570,14 +1576,14 @@ static TIDY_DOC_METHOD(__construct)
obj = Z_TIDY_P(object);
if (inputfile) {
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
return;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC);
+ php_tidy_parse_string(obj, contents->val, contents->len, enc);
zend_string_release(contents);
}
@@ -1596,19 +1602,19 @@ static TIDY_DOC_METHOD(parseFile)
obj = Z_TIDY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1627,7 +1633,7 @@ static TIDY_DOC_METHOD(parseString)
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1635,7 +1641,7 @@ static TIDY_DOC_METHOD(parseString)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, input->val, input->len, enc TSRMLS_CC) == SUCCESS) {
+ if(php_tidy_parse_string(obj, input->val, input->len, enc) == SUCCESS) {
RETURN_TRUE;
}
@@ -1797,13 +1803,13 @@ static TIDY_NODE_METHOD(getParent)
parent_node = tidyGetParent(obj->node);
if(parent_node) {
- tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, return_value);
newobj = Z_TIDY_P(return_value);
newobj->node = parent_node;
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
} else {
ZVAL_NULL(return_value);
}
@@ -1815,7 +1821,7 @@ static TIDY_NODE_METHOD(getParent)
__constructor for tidyNode. */
static TIDY_NODE_METHOD(__construct)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a tidyNode manually");
+ php_error_docref(NULL, E_ERROR, "You should not create a tidyNode manually");
}
/* }}} */
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 26e05c2be3..379fe5db7e 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -101,7 +101,7 @@ PHP_MINFO_FUNCTION(tokenizer)
}
/* }}} */
-static void tokenize(zval *return_value TSRMLS_DC)
+static void tokenize(zval *return_value)
{
zval token;
zval keyword;
@@ -113,7 +113,7 @@ static void tokenize(zval *return_value TSRMLS_DC)
array_init(return_value);
ZVAL_NULL(&token);
- while ((token_type = lex_scan(&token TSRMLS_CC))) {
+ while ((token_type = lex_scan(&token))) {
destroy = 1;
switch (token_type) {
case T_CLOSE_TAG:
@@ -181,23 +181,23 @@ PHP_FUNCTION(token_get_all)
zval source_zval;
zend_lex_state original_lex_state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &source) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &source) == FAILURE) {
return;
}
ZVAL_STR_COPY(&source_zval, source);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
- if (zend_prepare_string_for_scanning(&source_zval, "" TSRMLS_CC) == FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ if (zend_prepare_string_for_scanning(&source_zval, "") == FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
RETURN_FALSE;
}
LANG_SCNG(yy_state) = yycINITIAL;
- tokenize(return_value TSRMLS_CC);
+ tokenize(return_value);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(&source_zval);
}
/* }}} */
@@ -208,7 +208,7 @@ PHP_FUNCTION(token_name)
{
zend_long type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
return;
}
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index edbd013342..84f6279a76 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -60,7 +60,7 @@ void php_wddx_destructor(wddx_packet *packet);
void php_wddx_packet_start(wddx_packet *packet, char *comment, size_t comment_len);
void php_wddx_packet_end(wddx_packet *packet);
-void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC);
+void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name);
int php_wddx_deserialize_ex(const char *, size_t, zval *return_value);
#define php_wddx_gather(packet) estrndup(packet->c, packet->len)
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 43deb15afd..89329f9677 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -244,7 +244,7 @@ static int wddx_stack_destroy(wddx_stack *stack)
/* {{{ release_wddx_packet_rsrc
*/
-static void release_wddx_packet_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void release_wddx_packet_rsrc(zend_resource *rsrc)
{
smart_str *str = (smart_str *)rsrc->ptr;
smart_str_free(str);
@@ -269,7 +269,7 @@ PS_SERIALIZER_ENCODE_FUNC(wddx)
php_wddx_add_chunk_static(packet, WDDX_STRUCT_S);
PS_ENCODE_LOOP(
- php_wddx_serialize_var(packet, struc, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, struc, key);
);
php_wddx_add_chunk_static(packet, WDDX_STRUCT_E);
@@ -304,7 +304,7 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
} else {
zend_string_addref(key);
}
- if (php_set_session_var(key, ent, NULL TSRMLS_CC)) {
+ if (php_set_session_var(key, ent, NULL)) {
if (Z_REFCOUNTED_P(ent)) Z_ADDREF_P(ent);
}
PS_ADD_VAR(key);
@@ -385,14 +385,14 @@ void php_wddx_packet_end(wddx_packet *packet)
/* {{{ php_wddx_serialize_string
*/
-static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC)
+static void php_wddx_serialize_string(wddx_packet *packet, zval *var)
{
php_wddx_add_chunk_static(packet, WDDX_STRING_S);
if (Z_STRLEN_P(var) > 0) {
zend_string *buf;
- buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), 0, ENT_QUOTES, NULL TSRMLS_CC);
+ buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), 0, ENT_QUOTES, NULL);
php_wddx_add_chunk_ex(packet, buf->val, buf->len);
@@ -445,14 +445,13 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
zend_ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
- TSRMLS_FETCH();
ZVAL_STRING(&fname, "__sleep");
/*
* We try to call __sleep() method on object. It's supposed to return an
* array of property names to be serialized.
*/
- if (call_user_function_ex(CG(function_table), obj, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC) == SUCCESS) {
+ if (call_user_function_ex(CG(function_table), obj, &fname, &retval, 0, 0, 1, NULL) == SUCCESS) {
if (!Z_ISUNDEF(retval) && (sleephash = HASH_OF(&retval))) {
PHP_CLASS_ATTRIBUTES;
@@ -472,12 +471,12 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
ZEND_HASH_FOREACH_VAL(sleephash, varname) {
if (Z_TYPE_P(varname) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
continue;
}
if ((ent = zend_hash_find(objhash, Z_STR_P(varname))) != NULL) {
- php_wddx_serialize_var(packet, ent, Z_STR_P(varname) TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, Z_STR_P(varname));
}
} ZEND_HASH_FOREACH_END();
@@ -510,11 +509,11 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
tmp = zend_string_init(prop_name, prop_name_len, 0);
- php_wddx_serialize_var(packet, ent, tmp TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, tmp);
zend_string_release(tmp);
} else {
key = zend_long_to_str(idx);
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
zend_string_release(key);
}
} ZEND_HASH_FOREACH_END();
@@ -537,7 +536,6 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
zend_ulong ind = 0;
- TSRMLS_FETCH();
target_hash = HASH_OF(arr);
ZEND_HASH_FOREACH_KEY(target_hash, idx, key) {
@@ -567,14 +565,14 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
if (is_struct) {
if (key) {
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
} else {
key = zend_long_to_str(idx);
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
zend_string_release(key);
}
} else {
- php_wddx_serialize_var(packet, ent, NULL TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, NULL);
}
} ZEND_HASH_FOREACH_END();
@@ -588,7 +586,7 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
/* {{{ php_wddx_serialize_var
*/
-void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC)
+void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name)
{
HashTable *ht;
@@ -596,7 +594,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
char *tmp_buf;
zend_string *name_esc;
- name_esc = php_escape_html_entities(name->val, name->len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ name_esc = php_escape_html_entities(name->val, name->len, 0, ENT_QUOTES, NULL);
tmp_buf = emalloc(name_esc->len + sizeof(WDDX_VAR_S));
snprintf(tmp_buf, name_esc->len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc->val);
php_wddx_add_chunk(packet, tmp_buf);
@@ -610,7 +608,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
ZVAL_DEREF(var);
switch (Z_TYPE_P(var)) {
case IS_STRING:
- php_wddx_serialize_string(packet, var TSRMLS_CC);
+ php_wddx_serialize_string(packet, var);
break;
case IS_LONG:
@@ -630,7 +628,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
case IS_ARRAY:
ht = Z_ARRVAL_P(var);
if (ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
@@ -645,7 +643,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
case IS_OBJECT:
ht = Z_OBJPROP_P(var);
if (ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
ht->u.v.nApplyCount++;
@@ -666,15 +664,14 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval *val;
HashTable *target_hash;
- TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING) {
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
if ((val = zend_hash_find(&symbol_table->ht, Z_STR_P(name_var))) != NULL) {
if (Z_TYPE_P(val) == IS_INDIRECT) {
val = Z_INDIRECT_P(val);
}
- php_wddx_serialize_var(packet, val, Z_STR_P(name_var) TSRMLS_CC);
+ php_wddx_serialize_var(packet, val, Z_STR_P(name_var));
}
} else if (Z_TYPE_P(name_var) == IS_ARRAY || Z_TYPE_P(name_var) == IS_OBJECT) {
int is_array = Z_TYPE_P(name_var) == IS_ARRAY;
@@ -682,7 +679,7 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
target_hash = HASH_OF(name_var);
if (is_array && target_hash->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return;
}
@@ -714,7 +711,6 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
- TSRMLS_FETCH();
if (!strcmp((char *)name, EL_PACKET)) {
int i;
@@ -870,7 +866,6 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
HashTable *target_hash;
zend_class_entry *pce;
zval obj;
- TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
@@ -898,7 +893,7 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
ZVAL_STRING(&fname, "__wakeup");
- call_user_function_ex(NULL, &ent1->data, &fname, &retval, 0, 0, 0, NULL TSRMLS_CC);
+ call_user_function_ex(NULL, &ent1->data, &fname, &retval, 0, 0, 0, NULL);
zval_ptr_dtor(&fname);
zval_ptr_dtor(&retval);
@@ -986,7 +981,6 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
{
st_entry *ent;
wddx_stack *stack = (wddx_stack *)user_data;
- TSRMLS_FETCH();
if (!wddx_stack_is_empty(stack) && !stack->done) {
wddx_stack_top(stack, (void**)&ent);
@@ -1004,7 +998,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
break;
case ST_NUMBER:
ZVAL_STRINGL(&ent->data, (char *)s, len);
- convert_scalar_to_number(&ent->data TSRMLS_CC);
+ convert_scalar_to_number(&ent->data);
break;
case ST_BOOLEAN:
@@ -1088,14 +1082,14 @@ PHP_FUNCTION(wddx_serialize_value)
size_t comment_len = 0;
wddx_packet *packet;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &var, &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &var, &comment, &comment_len) == FAILURE) {
return;
}
packet = php_wddx_constructor();
php_wddx_packet_start(packet, comment, comment_len);
- php_wddx_serialize_var(packet, var, NULL TSRMLS_CC);
+ php_wddx_serialize_var(packet, var, NULL);
php_wddx_packet_end(packet);
smart_str_0(packet);
@@ -1112,7 +1106,7 @@ PHP_FUNCTION(wddx_serialize_vars)
wddx_packet *packet;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -1174,7 +1168,7 @@ PHP_FUNCTION(wddx_packet_start)
comment = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &comment, &comment_len) == FAILURE) {
return;
}
@@ -1194,7 +1188,7 @@ PHP_FUNCTION(wddx_packet_end)
zval *packet_id;
wddx_packet *packet = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &packet_id) == FAILURE) {
return;
}
@@ -1220,7 +1214,7 @@ PHP_FUNCTION(wddx_add_vars)
zval *packet_id;
wddx_packet *packet = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r+", &packet_id, &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r+", &packet_id, &args, &num_args) == FAILURE) {
return;
}
@@ -1257,7 +1251,7 @@ PHP_FUNCTION(wddx_deserialize)
php_stream *stream = NULL;
zend_string *payload = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &packet) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &packet) == FAILURE) {
return;
}
@@ -1269,7 +1263,7 @@ PHP_FUNCTION(wddx_deserialize)
payload = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expecting parameter 1 to be a string or a stream");
+ php_error_docref(NULL, E_WARNING, "Expecting parameter 1 to be a string or a stream");
return;
}
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index ebfc0471e0..812032bc6a 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -52,7 +52,7 @@ if test "$PHP_XML" != "no"; then
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
fi
- PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
+ PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(XML_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/xml/])
AC_DEFINE(HAVE_XML, 1, [ ])
diff --git a/ext/xml/config.w32 b/ext/xml/config.w32
index 4ee0bd1602..20b5c8dfe5 100644
--- a/ext/xml/config.w32
+++ b/ext/xml/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("xml", "XML support", "yes");
if (PHP_XML == "yes") {
if (PHP_LIBXML == "yes"
&& ADD_EXTENSION_DEP('xml', 'libxml')) {
- EXTENSION("xml", "xml.c compat.c");
+ EXTENSION("xml", "xml.c compat.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_XML", 1, "XML support");
if (!PHP_XML_SHARED) {
ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index cdb08f812e..d7f0d6d046 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -142,7 +142,10 @@ PHPAPI zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *);
#define phpext_xml_ptr xml_module_ptr
#ifdef ZTS
-#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
+#define XML(v) ZEND_TSRMG(xml_globals_id, zend_xml_globals *, v)
+#ifdef COMPILE_DL_XML
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define XML(v) (xml_globals.v)
#endif
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index f1a3442b6d..026c4555bb 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -62,6 +62,9 @@ ZEND_DECLARE_MODULE_GLOBALS(xml)
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_XML
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(xml)
#endif /* COMPILE_DL_XML */
/* }}} */
@@ -71,7 +74,7 @@ PHP_MINIT_FUNCTION(xml);
PHP_MINFO_FUNCTION(xml);
static PHP_GINIT_FUNCTION(xml);
-static void xml_parser_dtor(zend_resource *rsrc TSRMLS_DC);
+static void xml_parser_dtor(zend_resource *rsrc);
static void xml_set_handler(zval *, zval *);
inline static unsigned short xml_encode_iso_8859_1(unsigned char);
inline static char xml_decode_iso_8859_1(unsigned short);
@@ -290,6 +293,9 @@ static int le_xml_parser;
/* {{{ startup, shutdown and info functions */
static PHP_GINIT_FUNCTION(xml)
{
+#if defined(COMPILE_DL_XML) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
xml_globals->default_encoding = (XML_Char*)"UTF-8";
}
@@ -388,7 +394,7 @@ static void _xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encodi
/* }}} */
/* {{{ xml_parser_dtor() */
-static void xml_parser_dtor(zend_resource *rsrc TSRMLS_DC)
+static void xml_parser_dtor(zend_resource *rsrc)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
@@ -470,7 +476,6 @@ static void xml_set_handler(zval *handler, zval *data)
static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval *argv, zval *retval)
{
int i;
- TSRMLS_FETCH();
ZVAL_UNDEF(retval);
if (parser && handler && !EG(exception)) {
@@ -488,20 +493,20 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f
fci.no_separation = 0;
/*fci.function_handler_cache = &function_ptr;*/
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == FAILURE) {
zval *method;
zval *obj;
if (Z_TYPE_P(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler));
} else if ((obj = zend_hash_index_find(Z_ARRVAL_P(handler), 0)) != NULL &&
(method = zend_hash_index_find(Z_ARRVAL_P(handler), 1)) != NULL &&
Z_TYPE_P(obj) == IS_OBJECT &&
Z_TYPE_P(method) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
} else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler");
+ php_error_docref(NULL, E_WARNING, "Unable to call handler");
}
}
for (i = 0; i < argc; i++) {
@@ -786,8 +791,7 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch
parser->ctag = zend_hash_next_index_insert(Z_ARRVAL(parser->data), &tag);
} else if (parser->level == (XML_MAXLEVEL + 1)) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated");
+ php_error_docref(NULL, E_WARNING, "Maximum depth exceeded - Results truncated");
}
}
@@ -928,8 +932,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
zend_hash_next_index_insert(Z_ARRVAL(parser->data), &tag);
} else if (parser->level == (XML_MAXLEVEL + 1)) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated");
+ php_error_docref(NULL, E_WARNING, "Maximum depth exceeded - Results truncated");
}
}
} else {
@@ -1099,7 +1102,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
XML_Char *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1117,7 +1120,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
} else if (strcasecmp(encoding_param, "US-ASCII") == 0) {
encoding = (XML_Char*)"US-ASCII";
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported source encoding \"%s\"", encoding_param);
+ php_error_docref(NULL, E_WARNING, "unsupported source encoding \"%s\"", encoding_param);
RETURN_FALSE;
}
} else {
@@ -1166,7 +1169,7 @@ PHP_FUNCTION(xml_set_object)
xml_parser *parser;
zval *pind, *mythis;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ro/", &pind, &mythis) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ro/", &pind, &mythis) == FAILURE) {
return;
}
@@ -1195,7 +1198,7 @@ PHP_FUNCTION(xml_set_element_handler)
xml_parser *parser;
zval *pind, *shdl, *ehdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzz", &pind, &shdl, &ehdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rzz", &pind, &shdl, &ehdl) == FAILURE) {
return;
}
@@ -1215,7 +1218,7 @@ PHP_FUNCTION(xml_set_character_data_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1234,7 +1237,7 @@ PHP_FUNCTION(xml_set_processing_instruction_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1253,7 +1256,7 @@ PHP_FUNCTION(xml_set_default_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1272,7 +1275,7 @@ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1291,7 +1294,7 @@ PHP_FUNCTION(xml_set_notation_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1309,7 +1312,7 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1327,7 +1330,7 @@ PHP_FUNCTION(xml_set_start_namespace_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1346,7 +1349,7 @@ PHP_FUNCTION(xml_set_end_namespace_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1369,7 +1372,7 @@ PHP_FUNCTION(xml_parse)
int ret;
zend_long isFinal = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1393,7 +1396,7 @@ PHP_FUNCTION(xml_parse_into_struct)
size_t data_len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
return;
}
@@ -1435,7 +1438,7 @@ PHP_FUNCTION(xml_get_error_code)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1452,7 +1455,7 @@ PHP_FUNCTION(xml_error_string)
zend_long code;
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -1470,7 +1473,7 @@ PHP_FUNCTION(xml_get_current_line_number)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1487,7 +1490,7 @@ PHP_FUNCTION(xml_get_current_column_number)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1504,7 +1507,7 @@ PHP_FUNCTION(xml_get_current_byte_index)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1522,14 +1525,14 @@ PHP_FUNCTION(xml_parser_free)
xml_parser *parser;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
if (parser->isparsing == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parser cannot be freed while it is parsing.");
+ php_error_docref(NULL, E_WARNING, "Parser cannot be freed while it is parsing.");
RETURN_FALSE;
}
@@ -1548,7 +1551,7 @@ PHP_FUNCTION(xml_parser_set_option)
zval *pind, *val;
zend_long opt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &pind, &opt, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &pind, &opt, &val) == FAILURE) {
return;
}
@@ -1572,14 +1575,14 @@ PHP_FUNCTION(xml_parser_set_option)
convert_to_string_ex(val);
enc = xml_get_encoding((XML_Char*)Z_STRVAL_P(val));
if (enc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_P(val));
+ php_error_docref(NULL, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_P(val));
RETURN_FALSE;
}
parser->target_encoding = enc->name;
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option");
+ php_error_docref(NULL, E_WARNING, "Unknown option");
RETURN_FALSE;
break;
}
@@ -1595,7 +1598,7 @@ PHP_FUNCTION(xml_parser_get_option)
zval *pind;
zend_long opt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pind, &opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pind, &opt) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1608,7 +1611,7 @@ PHP_FUNCTION(xml_parser_get_option)
RETURN_STRING((char *)parser->target_encoding);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option");
+ php_error_docref(NULL, E_WARNING, "Unknown option");
RETURN_FALSE;
break;
}
@@ -1625,7 +1628,7 @@ PHP_FUNCTION(utf8_encode)
size_t arg_len;
zend_string *encoded;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -1645,7 +1648,7 @@ PHP_FUNCTION(utf8_decode)
size_t arg_len;
zend_string *decoded;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 43e585dd33..a297e0de38 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -42,7 +42,7 @@ static HashTable xmlreader_prop_handlers;
typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader);
typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader);
typedef const unsigned char *(*xmlreader_read_const_char_t)(xmlTextReaderPtr reader);
-typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval TSRMLS_DC);
+typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval);
typedef unsigned char *(*xmlreader_read_one_char_t)(xmlTextReaderPtr reader, const unsigned char *);
@@ -57,7 +57,7 @@ typedef struct _xmlreader_prop_handler {
#define XMLREADER_LOAD_FILE 1
/* {{{ xmlreader_register_prop_handler */
-static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype TSRMLS_DC)
+static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype)
{
xmlreader_prop_handler hnd;
@@ -69,7 +69,7 @@ static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name,
/* }}} */
/* {{{ xmlreader_property_reader */
-static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval *rv TSRMLS_DC)
+static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval *rv)
{
const xmlChar *retchar = NULL;
int retint = 0;
@@ -81,7 +81,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl
if (hnd->read_int_func) {
retint = hnd->read_int_func(obj->ptr);
if (retint == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal libxml error returned");
+ php_error_docref(NULL, E_WARNING, "Internal libxml error returned");
return FAILURE;
}
}
@@ -112,7 +112,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl
/* }}} */
/* {{{ xmlreader_get_property_ptr_ptr */
-zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC)
+zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
xmlreader_object *obj;
zval tmp_member;
@@ -135,7 +135,7 @@ zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void
if (hnd == NULL) {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -147,7 +147,7 @@ zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void
/* }}} */
/* {{{ xmlreader_read_property */
-zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
xmlreader_object *obj;
zval tmp_member;
@@ -169,14 +169,14 @@ zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache
}
if (hnd != NULL) {
- if (xmlreader_property_reader(obj, hnd, rv TSRMLS_CC) == FAILURE) {
+ if (xmlreader_property_reader(obj, hnd, rv) == FAILURE) {
retval = &EG(uninitialized_zval);
} else {
retval = rv;
}
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -187,7 +187,7 @@ zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache
/* }}} */
/* {{{ xmlreader_write_property */
-void xmlreader_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void xmlreader_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
xmlreader_object *obj;
zval tmp_member;
@@ -207,10 +207,10 @@ void xmlreader_write_property(zval *object, zval *member, zval *value, void **ca
hnd = zend_hash_find_ptr(obj->prop_handler, Z_STR_P(member));
}
if (hnd != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write to read-only property");
+ php_error_docref(NULL, E_WARNING, "Cannot write to read-only property");
} else {
std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -222,7 +222,7 @@ void xmlreader_write_property(zval *object, zval *member, zval *value, void **ca
/* {{{ _xmlreader_get_valid_file_path */
/* _xmlreader_get_valid_file_path and _xmlreader_get_relaxNG should be made a
common function in libxml extension as code is common to a few xml extensions */
-char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
+char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) {
xmlURI *uri;
xmlChar *escsource;
char *file_dest;
@@ -255,7 +255,7 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
file_dest = source;
if ((uri->scheme == NULL || isFileUri)) {
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -272,7 +272,7 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
/* {{{ _xmlreader_get_relaxNG */
static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, size_t type,
xmlRelaxNGValidityErrorFunc error_func,
- xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC)
+ xmlRelaxNGValidityWarningFunc warn_func)
{
char *valid_file = NULL;
xmlRelaxNGParserCtxtPtr parser = NULL;
@@ -281,7 +281,7 @@ static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, siz
switch (type) {
case XMLREADER_LOAD_FILE:
- valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
return NULL;
}
@@ -341,7 +341,7 @@ ZEND_GET_MODULE(xmlreader)
#endif
/* {{{ xmlreader_objects_clone */
-void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC)
+void xmlreader_objects_clone(void *object, void **object_clone)
{
/* TODO */
}
@@ -370,23 +370,23 @@ static void xmlreader_free_resources(xmlreader_object *intern) {
/* }}} */
/* {{{ xmlreader_objects_free_storage */
-void xmlreader_objects_free_storage(zend_object *object TSRMLS_DC)
+void xmlreader_objects_free_storage(zend_object *object)
{
xmlreader_object *intern = php_xmlreader_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
xmlreader_free_resources(intern);
}
/* }}} */
/* {{{ xmlreader_objects_new */
-zend_object *xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *xmlreader_objects_new(zend_class_entry *class_type)
{
xmlreader_object *intern;
intern = ecalloc(1, sizeof(xmlreader_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->prop_handler = &xmlreader_prop_handlers;
intern->std.handlers = &xmlreader_object_handlers;
@@ -403,12 +403,12 @@ static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_rea
xmlreader_object *intern;
char *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument cannot be an empty string");
+ php_error_docref(NULL, E_WARNING, "Argument cannot be an empty string");
RETURN_FALSE;
}
@@ -486,12 +486,12 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
xmlRelaxNGPtr schema = NULL;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p!", &source, &source_len) == FAILURE) {
return;
}
if (source != NULL && !source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required");
+ php_error_docref(NULL, E_WARNING, "Schema data source is required");
RETURN_FALSE;
}
@@ -500,7 +500,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
if (source) {
- schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC);
+ schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL);
if (schema) {
retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, schema);
}
@@ -520,11 +520,11 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
+ php_error_docref(NULL, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml.");
+ php_error_docref(NULL, E_WARNING, "No Schema support built into libxml.");
RETURN_FALSE;
#endif
@@ -566,7 +566,7 @@ PHP_METHOD(xmlreader, getAttributeNo)
char *retchar = NULL;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr_pos) == FAILURE) {
return;
}
@@ -592,12 +592,12 @@ PHP_METHOD(xmlreader, getAttributeNs)
xmlreader_object *intern;
char *name, *ns_uri, *retchar = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
if (name_len == 0 || ns_uri_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
RETURN_FALSE;
}
@@ -623,7 +623,7 @@ PHP_METHOD(xmlreader, getParserProperty)
int retval = -1;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &property) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &property) == FAILURE) {
return;
}
@@ -634,7 +634,7 @@ PHP_METHOD(xmlreader, getParserProperty)
retval = xmlTextReaderGetParserProp(intern->ptr,property);
}
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ php_error_docref(NULL, E_WARNING, "Invalid parser property");
RETURN_FALSE;
}
@@ -670,12 +670,12 @@ PHP_METHOD(xmlreader, moveToAttribute)
xmlreader_object *intern;
char *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
@@ -703,7 +703,7 @@ PHP_METHOD(xmlreader, moveToAttributeNo)
int retval;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr_pos) == FAILURE) {
return;
}
@@ -732,12 +732,12 @@ PHP_METHOD(xmlreader, moveToAttributeNs)
xmlreader_object *intern;
char *name, *ns_uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
if (name_len == 0 || ns_uri_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
RETURN_FALSE;
}
@@ -798,7 +798,7 @@ PHP_METHOD(xmlreader, read)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to read");
RETURN_FALSE;
}
/* }}} */
@@ -813,7 +813,7 @@ PHP_METHOD(xmlreader, next)
xmlreader_object *intern;
char *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
@@ -840,7 +840,7 @@ PHP_METHOD(xmlreader, next)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to read");
RETURN_FALSE;
}
/* }}} */
@@ -858,13 +858,13 @@ PHP_METHOD(xmlreader, open)
char resolved_path[MAXPATHLEN + 1];
xmlTextReaderPtr reader = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
id = getThis();
if (id != NULL) {
- if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry)) {
id = NULL;
} else {
intern = Z_XMLREADER_P(id);
@@ -873,18 +873,18 @@ PHP_METHOD(xmlreader, open)
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
- valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (valid_file) {
reader = xmlReaderForFile(valid_file, encoding, options);
}
if (reader == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open source data");
+ php_error_docref(NULL, E_WARNING, "Unable to open source data");
RETURN_FALSE;
}
@@ -945,12 +945,12 @@ PHP_METHOD(xmlreader, setSchema)
xmlreader_object *intern;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p!", &source, &source_len) == FAILURE) {
return;
}
if (source != NULL && !source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required");
+ php_error_docref(NULL, E_WARNING, "Schema data source is required");
RETURN_FALSE;
}
@@ -965,11 +965,11 @@ PHP_METHOD(xmlreader, setSchema)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
+ php_error_docref(NULL, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml.");
+ php_error_docref(NULL, E_WARNING, "No Schema support built into libxml.");
RETURN_FALSE;
#endif
@@ -988,7 +988,7 @@ PHP_METHOD(xmlreader, setParserProperty)
zend_bool value;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &property, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &property, &value) == FAILURE) {
return;
}
@@ -999,7 +999,7 @@ PHP_METHOD(xmlreader, setParserProperty)
retval = xmlTextReaderSetParserProp(intern->ptr,property, value);
}
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ php_error_docref(NULL, E_WARNING, "Invalid parser property");
RETURN_FALSE;
}
@@ -1043,12 +1043,12 @@ PHP_METHOD(xmlreader, XML)
xmlParserInputBufferPtr inputbfr;
xmlTextReaderPtr reader;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
id = getThis();
- if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry)) {
id = NULL;
}
if (id != NULL) {
@@ -1057,7 +1057,7 @@ PHP_METHOD(xmlreader, XML)
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
@@ -1110,7 +1110,7 @@ PHP_METHOD(xmlreader, XML)
if (inputbfr) {
xmlFreeParserInputBuffer(inputbfr);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load source data");
+ php_error_docref(NULL, E_WARNING, "Unable to load source data");
RETURN_FALSE;
}
/* }}} */
@@ -1127,7 +1127,7 @@ PHP_METHOD(xmlreader, expand)
xmlDocPtr docp = NULL;
php_libxml_node_object *domobj = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!", &id, xmlreader_class_entry, &basenode, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!", &id, xmlreader_class_entry, &basenode, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1142,19 +1142,19 @@ PHP_METHOD(xmlreader, expand)
node = xmlTextReaderExpand(intern->ptr);
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while expanding ");
+ php_error_docref(NULL, E_WARNING, "An Error Occurred while expanding ");
RETURN_FALSE;
} else {
nodec = xmlDocCopyNode(node, docp, 1);
if (nodec == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot expand this node type");
+ php_error_docref(NULL, E_NOTICE, "Cannot expand this node type");
RETURN_FALSE;
} else {
DOM_RET_OBJ(nodec, &ret, (dom_object *)domobj);
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to expand");
RETURN_FALSE;
}
#else
@@ -1315,23 +1315,23 @@ PHP_MINIT_FUNCTION(xmlreader)
INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions);
ce.create_object = xmlreader_objects_new;
- xmlreader_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ xmlreader_class_entry = zend_register_internal_class(&ce);
zend_hash_init(&xmlreader_prop_handlers, 0, NULL, php_xmlreader_free_prop_handler, 1);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING TSRMLS_CC);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING);
/* Constants for NodeType - cannot define common types to share with dom as there are differences in these types */
diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h
index 7a721dcc6f..f9e1a228e7 100644
--- a/ext/xmlreader/php_xmlreader.h
+++ b/ext/xmlreader/php_xmlreader.h
@@ -51,7 +51,7 @@ PHP_MSHUTDOWN_FUNCTION(xmlreader);
PHP_MINFO_FUNCTION(xmlreader);
#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
#ifdef ZTS
#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
index 13976077be..eedf255dc8 100644
--- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
@@ -228,8 +228,7 @@ xml_element* XMLRPC_to_xml_element_worker(XMLRPC_VALUE current_vector, XMLRPC_VA
break;
case xmlrpc_double:
{
- TSRMLS_FETCH();
- elem_val->name = strdup(ELEM_DOUBLE);
+ elem_val->name = strdup(ELEM_DOUBLE);
ap_php_snprintf(buf, BUF_SIZE, "%.*G", (int) EG(precision), XMLRPC_GetValueDouble(node));
simplestring_add(&elem_val->text, buf);
}
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index d43a31be11..f3c562c829 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -264,7 +264,7 @@ int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type);
* startup / shutdown *
*********************/
-static void destroy_server_data(xmlrpc_server_data *server TSRMLS_DC)
+static void destroy_server_data(xmlrpc_server_data *server)
{
if (server) {
XMLRPC_ServerDestroy(server->server_ptr);
@@ -278,11 +278,11 @@ static void destroy_server_data(xmlrpc_server_data *server TSRMLS_DC)
/* called when server is being destructed. either when xmlrpc_server_destroy
* is called, or when request ends. */
-static void xmlrpc_server_destructor(zend_resource *rsrc TSRMLS_DC)
+static void xmlrpc_server_destructor(zend_resource *rsrc)
{
if (rsrc && rsrc->ptr) {
rsrc->gc.refcount++;
- destroy_server_data((xmlrpc_server_data*) rsrc->ptr TSRMLS_CC);
+ destroy_server_data((xmlrpc_server_data*) rsrc->ptr);
rsrc->gc.refcount--;
}
}
@@ -498,7 +498,7 @@ static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht)
}
/* recursively convert php values into xmlrpc values */
-static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC)
+static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth)
{
XMLRPC_VALUE xReturn = NULL;
@@ -550,7 +550,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
ht = HASH_OF(&val);
if (ht && ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "XML-RPC doesn't support circular references");
+ php_error_docref(NULL, E_ERROR, "XML-RPC doesn't support circular references");
return NULL;
}
@@ -572,12 +572,12 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
spprintf(&num_str, 0, "%ld", num_index);
}
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(num_str, pIter, depth++ TSRMLS_CC));
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(num_str, pIter, depth++));
if (num_str) {
efree(num_str);
}
} else {
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key->val, pIter, depth++ TSRMLS_CC));
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key->val, pIter, depth++));
}
if (ht) {
ht->u.v.nApplyCount--;
@@ -594,9 +594,9 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
return xReturn;
}
-static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC)
+static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val)
{
- return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC);
+ return PHP_to_XMLRPC_worker(NULL, root_val, 0);
}
/* recursively convert xmlrpc values into php values */
@@ -669,7 +669,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
size_t method_len;
php_output_options out;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
return;
}
@@ -687,7 +687,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call);
}
if (Z_TYPE_P(vals) != IS_NULL) {
- XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals TSRMLS_CC));
+ XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals));
}
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
@@ -713,13 +713,13 @@ PHP_FUNCTION(xmlrpc_encode)
zval *arg1;
char *outBuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg1) == FAILURE) {
return;
}
if (USED_RET()) {
/* convert native php type to xmlrpc type */
- xOut = PHP_to_XMLRPC(arg1 TSRMLS_CC);
+ xOut = PHP_to_XMLRPC(arg1);
/* generate raw xml from xmlrpc data */
outBuf = XMLRPC_VALUE_ToXML(xOut, 0);
@@ -777,7 +777,7 @@ PHP_FUNCTION(xmlrpc_decode_request)
zval *method;
size_t xml_len, encoding_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -794,7 +794,7 @@ PHP_FUNCTION(xmlrpc_decode)
char *arg1, *arg2 = NULL;
size_t arg1_len, arg2_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
return;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(xmlrpc_server_destroy)
int bSuccess = FAILURE;
xmlrpc_server_data *server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -865,7 +865,6 @@ static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRe
zval* php_function;
zval xmlrpc_params;
zval callback_params[3];
- TSRMLS_FETCH();
zval_ptr_dtor(&pData->xmlrpc_method);
zval_ptr_dtor(&pData->return_data);
@@ -887,13 +886,13 @@ static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRe
/* Use same C function for all methods */
/* php func prototype: function user_func($method_name, $xmlrpc_params, $user_params) */
- call_user_function(CG(function_table), NULL, &pData->php_function, &pData->return_data, 3, callback_params TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &pData->php_function, &pData->return_data, 3, callback_params);
pData->php_executed = 1;
zval_ptr_dtor(&xmlrpc_params);
- return PHP_to_XMLRPC(&pData->return_data TSRMLS_CC);
+ return PHP_to_XMLRPC(&pData->return_data);
}
/* }}} */
@@ -906,15 +905,14 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
zval callback_params[1];
zend_string *php_function_name;
xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data;
- TSRMLS_FETCH();
/* setup data hoojum */
ZVAL_COPY_VALUE(&callback_params[0], &pData->caller_params);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL(pData->server->introspection_map), php_function) {
- if (zend_is_callable(php_function, 0, &php_function_name TSRMLS_CC)) {
+ if (zend_is_callable(php_function, 0, &php_function_name)) {
/* php func prototype: function string user_func($user_params) */
- if (call_user_function(CG(function_table), NULL, php_function, &retval, 1, callback_params TSRMLS_CC) == SUCCESS) {
+ if (call_user_function(CG(function_table), NULL, php_function, &retval, 1, callback_params) == SUCCESS) {
XMLRPC_VALUE xData;
STRUCT_XMLRPC_ERROR err = {0};
@@ -925,25 +923,25 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
if (xData) {
if (!XMLRPC_ServerAddIntrospectionData(server, xData)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", php_function_name->val);
}
XMLRPC_CleanupValue(xData);
} else {
/* could not create description */
if (err.xml_elem_error.parser_code) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()",
+ php_error_docref(NULL, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()",
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, php_function_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s()", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Unable to add introspection data returned from %s()", php_function_name->val);
}
}
zval_ptr_dtor(&retval);
} else {
/* user func failed */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling user introspection callback: %s()", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Error calling user introspection callback: %s()", php_function_name->val);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid callback '%s' passed", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid callback '%s' passed", php_function_name->val);
}
zend_string_release(php_function_name);
} ZEND_HASH_FOREACH_END();
@@ -962,7 +960,7 @@ PHP_FUNCTION(xmlrpc_server_register_method)
zval *handle, *method_name;
xmlrpc_server_data* server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz", &handle, &method_key, &method_key_len, &method_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz", &handle, &method_key, &method_key_len, &method_name) == FAILURE) {
return;
}
@@ -992,7 +990,7 @@ PHP_FUNCTION(xmlrpc_server_register_introspection_callback)
zval *method_name, *handle;
xmlrpc_server_data* server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &handle, &method_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &handle, &method_name) == FAILURE) {
return;
}
@@ -1024,7 +1022,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
php_output_options out;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz|a", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|a", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
return;
}
/* user output options */
@@ -1063,7 +1061,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
if (xAnswer && out.b_php_out) {
XMLRPC_to_PHP(xAnswer, &data.return_data);
} else if (data.php_executed && !out.b_php_out && !xAnswer) {
- xAnswer = PHP_to_XMLRPC(&data.return_data TSRMLS_CC);
+ xAnswer = PHP_to_XMLRPC(&data.return_data);
}
/* should we return data as xml? */
@@ -1120,13 +1118,13 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data)
xmlrpc_server_data* server;
XMLRPC_VALUE xDesc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &handle, &desc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &handle, &desc) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(server, xmlrpc_server_data*, handle, -1, "xmlrpc server", le_xmlrpc_server);
- xDesc = PHP_to_XMLRPC(desc TSRMLS_CC);
+ xDesc = PHP_to_XMLRPC(desc);
if (xDesc) {
int retval = XMLRPC_ServerAddIntrospectionData(server->server_ptr, xDesc);
XMLRPC_CleanupValue(xDesc);
@@ -1143,7 +1141,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
char *arg1;
size_t arg1_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1, &arg1_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg1, &arg1_len) == FAILURE) {
return;
}
@@ -1157,13 +1155,13 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
} else {
/* could not create description */
if (err.xml_elem_error.parser_code) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data",
+ php_error_docref(NULL, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data",
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data");
+ php_error_docref(NULL, E_WARNING, "Invalid xml structure. Unable to create introspection data");
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error. no method description created");
+ php_error_docref(NULL, E_WARNING, "xml parse error. no method description created");
}
}
}
@@ -1257,7 +1255,6 @@ XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str) /* {{{ */
int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) /* {{{ */
{
int bSuccess = FAILURE;
- TSRMLS_FETCH();
/* we only really care about strings because they can represent
* base64 and datetime. all other types have corresponding php types
@@ -1304,7 +1301,6 @@ int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) /* {{{ */
XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval* newvalue) /* {{{ */
{
XMLRPC_VALUE_TYPE type = xmlrpc_none;
- TSRMLS_FETCH();
if (value) {
switch (Z_TYPE_P(value)) {
@@ -1378,7 +1374,7 @@ PHP_FUNCTION(xmlrpc_set_type)
size_t type_len;
XMLRPC_VALUE_TYPE vtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/s", &arg, &type, &type_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/s", &arg, &type, &type_len) == FAILURE) {
return;
}
@@ -1402,7 +1398,7 @@ PHP_FUNCTION(xmlrpc_get_type)
XMLRPC_VALUE_TYPE type;
XMLRPC_VECTOR_TYPE vtype = xmlrpc_vector_none;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -1421,7 +1417,7 @@ PHP_FUNCTION(xmlrpc_is_fault)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &arg) == FAILURE) {
return;
}
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 6e3475e8d0..455116ba22 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -83,14 +83,14 @@ static PHP_FUNCTION(xmlwriter_flush);
static zend_class_entry *xmlwriter_class_entry_ce;
-static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC);
-static void xmlwriter_dtor(zend_resource *rsrc TSRMLS_DC);
+static void xmlwriter_free_resource_ptr(xmlwriter_object *intern);
+static void xmlwriter_dtor(zend_resource *rsrc);
typedef int (*xmlwriter_read_one_char_t)(xmlTextWriterPtr writer, const xmlChar *content);
typedef int (*xmlwriter_read_int_t)(xmlTextWriterPtr writer);
/* {{{ xmlwriter_object_free_storage */
-static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
+static void xmlwriter_free_resource_ptr(xmlwriter_object *intern)
{
if (intern) {
if (intern->ptr) {
@@ -112,7 +112,7 @@ static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
ze_xmlwriter_object *obj = Z_XMLWRITER_P(object); \
intern = obj->xmlwriter_ptr; \
if (!intern) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized XMLWriter object"); \
+ php_error_docref(NULL, E_WARNING, "Invalid or unitialized XMLWriter object"); \
RETURN_FALSE; \
} \
}
@@ -121,28 +121,28 @@ static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
static zend_object_handlers xmlwriter_object_handlers;
/* {{{ xmlwriter_object_free_storage */
-static void xmlwriter_object_free_storage(zend_object *object TSRMLS_DC)
+static void xmlwriter_object_free_storage(zend_object *object)
{
ze_xmlwriter_object *intern = php_xmlwriter_fetch_object(object);
if (!intern) {
return;
}
if (intern->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(intern->xmlwriter_ptr);
}
intern->xmlwriter_ptr = NULL;
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
/* {{{ xmlwriter_object_new */
-static zend_object *xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *xmlwriter_object_new(zend_class_entry *class_type)
{
ze_xmlwriter_object *intern;
intern = ecalloc(1, sizeof(ze_xmlwriter_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &xmlwriter_object_handlers;
@@ -152,7 +152,7 @@ static zend_object *xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC)
#define XMLW_NAME_CHK(__err) \
if (xmlValidateName((xmlChar *) name, 0) != 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", __err); \
+ php_error_docref(NULL, E_WARNING, "%s", __err); \
RETURN_FALSE; \
} \
@@ -583,7 +583,7 @@ static int le_xmlwriter;
/* _xmlwriter_get_valid_file_path should be made a
common function in libxml extension as code is common to a few xml extensions */
/* {{{ _xmlwriter_get_valid_file_path */
-static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
+static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) {
xmlURI *uri;
xmlChar *escsource;
char *file_dest;
@@ -626,7 +626,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
char file_dirname[MAXPATHLEN];
size_t dir_len;
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -674,18 +674,18 @@ ZEND_GET_MODULE(xmlwriter)
#endif
/* {{{ xmlwriter_objects_clone
-static void xmlwriter_objects_clone(void *object, void **object_clone TSRMLS_DC)
+static void xmlwriter_objects_clone(void *object, void **object_clone)
{
TODO
}
}}} */
/* {{{ xmlwriter_dtor */
-static void xmlwriter_dtor(zend_resource *rsrc TSRMLS_DC) {
+static void xmlwriter_dtor(zend_resource *rsrc) {
xmlwriter_object *intern;
intern = (xmlwriter_object *) rsrc->ptr;
- xmlwriter_free_resource_ptr(intern TSRMLS_CC);
+ xmlwriter_free_resource_ptr(intern);
}
/* }}} */
@@ -700,12 +700,12 @@ static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_rea
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pind, &name, &name_len) == FAILURE) {
return;
}
@@ -742,7 +742,7 @@ static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -774,12 +774,12 @@ static PHP_FUNCTION(xmlwriter_set_indent)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &indent) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &pind, &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &pind, &indent) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -838,13 +838,13 @@ static PHP_FUNCTION(xmlwriter_start_attribute_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
@@ -880,13 +880,13 @@ static PHP_FUNCTION(xmlwriter_write_attribute)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -923,13 +923,13 @@ static PHP_FUNCTION(xmlwriter_write_attribute_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss!s",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!s", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss!s", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
@@ -973,13 +973,13 @@ static PHP_FUNCTION(xmlwriter_start_element_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1031,13 +1031,13 @@ static PHP_FUNCTION(xmlwriter_write_element)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1083,13 +1083,13 @@ static PHP_FUNCTION(xmlwriter_write_element_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss!|s!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!|s!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss!|s!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1152,13 +1152,13 @@ static PHP_FUNCTION(xmlwriter_write_pi)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1193,7 +1193,7 @@ static PHP_FUNCTION(xmlwriter_start_cdata)
if (self) {
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1258,7 +1258,7 @@ static PHP_FUNCTION(xmlwriter_start_comment)
if (self) {
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1309,12 +1309,12 @@ static PHP_FUNCTION(xmlwriter_start_document)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1354,13 +1354,13 @@ static PHP_FUNCTION(xmlwriter_start_dtd)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
return;
}
@@ -1400,13 +1400,13 @@ static PHP_FUNCTION(xmlwriter_write_dtd)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
return;
}
@@ -1455,12 +1455,12 @@ static PHP_FUNCTION(xmlwriter_write_dtd_element)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &content, &content_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1512,13 +1512,13 @@ static PHP_FUNCTION(xmlwriter_write_dtd_attlist)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1553,12 +1553,12 @@ static PHP_FUNCTION(xmlwriter_start_dtd_entity)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &name, &name_len, &isparm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sb", &name, &name_len, &isparm) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &pind, &name, &name_len, &isparm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsb", &pind, &name, &name_len, &isparm) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1604,14 +1604,14 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bsss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bsss",
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|bsss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|bsss", &pind,
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
@@ -1648,7 +1648,7 @@ static PHP_FUNCTION(xmlwriter_open_uri)
zval *self = getThis();
ze_xmlwriter_object *ze_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &source, &source_len) == FAILURE) {
return;
}
@@ -1658,13 +1658,13 @@ static PHP_FUNCTION(xmlwriter_open_uri)
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
- valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN);
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to resolve file path");
+ php_error_docref(NULL, E_WARNING, "Unable to resolve file path");
RETURN_FALSE;
}
@@ -1679,7 +1679,7 @@ static PHP_FUNCTION(xmlwriter_open_uri)
intern->output = NULL;
if (self) {
if (ze_obj->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr);
}
ze_obj->xmlwriter_ptr = intern;
RETURN_TRUE;
@@ -1707,7 +1707,7 @@ static PHP_FUNCTION(xmlwriter_open_memory)
buffer = xmlBufferCreate();
if (buffer == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to create output buffer");
RETURN_FALSE;
}
@@ -1722,7 +1722,7 @@ static PHP_FUNCTION(xmlwriter_open_memory)
intern->output = buffer;
if (self) {
if (ze_obj->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr);
}
ze_obj->xmlwriter_ptr = intern;
RETURN_TRUE;
@@ -1744,12 +1744,12 @@ static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &empty) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &pind, &empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &pind, &empty) == FAILURE) {
return;
}
@@ -1807,7 +1807,7 @@ static PHP_MINIT_FUNCTION(xmlwriter)
xmlwriter_object_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "XMLWriter", xmlwriter_class_functions);
ce.create_object = xmlwriter_object_new;
- xmlwriter_class_entry_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ xmlwriter_class_entry_ce = zend_register_internal_class(&ce);
return SUCCESS;
}
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 2763d83326..b96a07d1ea 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -72,11 +72,11 @@ ZEND_GET_MODULE(xsl)
#endif
/* {{{ xsl_objects_free_storage */
-void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
+void xsl_objects_free_storage(zend_object *object)
{
xsl_object *intern = php_xsl_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zend_hash_destroy(intern->parameter);
FREE_HASHTABLE(intern->parameter);
@@ -90,7 +90,7 @@ void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
}
if (intern->doc) {
- php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ php_libxml_decrement_doc_ref(intern->doc);
efree(intern->doc);
}
@@ -110,14 +110,14 @@ void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
/* }}} */
/* {{{ xsl_objects_new */
-zend_object *xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *xsl_objects_new(zend_class_entry *class_type)
{
xsl_object *intern;
intern = ecalloc(1, sizeof(xsl_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->securityPrefs = XSL_SECPREF_DEFAULT;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
ALLOC_HASHTABLE(intern->parameter);
zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
@@ -197,25 +197,25 @@ zval *xsl_object_get_data(void *obj)
/* }}} */
/* {{{ xsl_object_set_data */
-static void xsl_object_set_data(void *obj, zval *wrapper TSRMLS_DC)
+static void xsl_object_set_data(void *obj, zval *wrapper)
{
((xsltStylesheetPtr) obj)->_private = wrapper;
}
/* }}} */
/* {{{ php_xsl_set_object */
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC)
+void php_xsl_set_object(zval *wrapper, void *obj)
{
xsl_object *object;
object = Z_XSL_P(wrapper);
object->ptr = obj;
- xsl_object_set_data(obj, wrapper TSRMLS_CC);
+ xsl_object_set_data(obj, wrapper);
}
/* }}} */
/* {{{ php_xsl_create_object */
-void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value TSRMLS_DC)
+void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value )
{
zval *wrapper;
zend_class_entry *ce;
@@ -243,7 +243,7 @@ void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return
if (!wrapper_in) {
object_init_ex(wrapper, ce);
}
- php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC);
+ php_xsl_set_object(wrapper, (void *) obj);
return;
}
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index b6603321a3..eb6b2330c7 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -75,9 +75,9 @@ static inline xsl_object *php_xsl_fetch_object(zend_object *obj) {
#define Z_XSL_P(zv) php_xsl_fetch_object(Z_OBJ_P((zv)))
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
-void xsl_objects_free_storage(zend_object *object TSRMLS_DC);
-void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value TSRMLS_DC);
+void php_xsl_set_object(zval *wrapper, void *obj);
+void xsl_objects_free_storage(zend_object *object);
+void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value );
void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
@@ -85,12 +85,12 @@ void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = xsl_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+entry = zend_register_internal_class_ex(&ce, parent_ce);
#define XSL_DOMOBJ_NEW(zval, obj, ret) \
- zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC); \
+ zval = php_xsl_create_object(obj, ret, zval, return_value); \
if (ZVAL_IS_NULL(zval)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
+ php_error_docref(NULL, E_WARNING, "Cannot create required DOM object"); \
RETURN_FALSE; \
}
@@ -114,9 +114,9 @@ ZEND_END_MODULE_GLOBALS(xsl)
/* In every utility function you add that needs to use variables
in php_xsl_globals, call TSRM_FETCH(); after declaring other
- variables used by that function, or better yet, pass in TSRMLS_CC
+ variables used by that function, or better yet, pass in
after the last function argument and declare your utility function
- with TSRMLS_DC after the last declared argument. Always refer to
+ with after the last declared argument. Always refer to
the globals in your function as XSL_G(variable). You are
encouraged to rename these macros something shorter, see
examples in any other php module directory.
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 20af855aa4..487585892e 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -105,7 +105,7 @@ const zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
/* {{{ php_xsl_xslt_string_to_xpathexpr()
Translates a string to a XPath Expression */
-static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
+static char *php_xsl_xslt_string_to_xpathexpr(const char *str)
{
const xmlChar *string = (const xmlChar *)str;
@@ -116,7 +116,7 @@ static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
if (xmlStrchr(string, '"')) {
if (xmlStrchr(string, '\'')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
+ php_error_docref(NULL, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
return NULL;
}
value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
@@ -131,7 +131,7 @@ static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
/* {{{ php_xsl_xslt_make_params()
Translates a PHP array to a libxslt parameters array */
-static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS_DC)
+static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params)
{
int parsize;
@@ -148,7 +148,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
ZEND_HASH_FOREACH_KEY_VAL(parht, num_key, string_key, value) {
if (string_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array");
+ php_error_docref(NULL, E_WARNING, "Invalid argument or parameter array");
efree(params);
return NULL;
} else {
@@ -158,7 +158,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
}
if (!xpath_params) {
- xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value) TSRMLS_CC);
+ xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value));
} else {
xpath_expr = estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value));
}
@@ -189,9 +189,8 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
xsl_object *intern;
zend_string *callable = NULL;
- TSRMLS_FETCH();
- if (! zend_is_executing(TSRMLS_C)) {
+ if (! zend_is_executing()) {
xsltGenericError(xsltGenericErrorContext,
"xsltExtFunctionTest: Function called from outside of PHP\n");
error = 1;
@@ -276,7 +275,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
node = xmlDocCopyNodeList(domintern->document->ptr, node);
}
- php_dom_create_object(node, &child, domintern TSRMLS_CC);
+ php_dom_create_object(node, &child, domintern);
add_next_index_zval(&args[i], &child);
}
}
@@ -301,7 +300,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
+ php_error_docref(NULL, E_WARNING, "Handler name must be a string");
xmlXPathFreeObject(obj);
valuePush(ctxt, xmlXPathNewString(""));
if (fci.param_count > 0) {
@@ -321,24 +320,24 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
fci.retval = &retval;
fci.no_separation = 0;
/*fci.function_handler_cache = &function_ptr;*/
- if (!zend_make_callable(&handler, &callable TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable->val);
+ if (!zend_make_callable(&handler, &callable)) {
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", callable->val);
valuePush(ctxt, xmlXPathNewString(""));
} else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'", callable->val);
+ php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'", callable->val);
/* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString(""));
} else {
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == FAILURE) {
if (Z_TYPE(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL(handler));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", Z_STRVAL(handler));
valuePush(ctxt, xmlXPathNewString(""));
}
/* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
} else if (Z_ISUNDEF(retval)) {
} else {
- if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry TSRMLS_CC)) {
+ if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry)) {
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
@@ -353,7 +352,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
} else if (Z_TYPE(retval) == IS_TRUE || Z_TYPE(retval) == IS_FALSE) {
valuePush(ctxt, xmlXPathNewBoolean(Z_LVAL(retval)));
} else if (Z_TYPE(retval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
+ php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString(""));
} else {
convert_to_string_ex(&retval);
@@ -400,11 +399,11 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
zend_object_handlers *std_hnd;
zval *cloneDocu, member, rv;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
RETURN_FALSE;
}
- nodep = php_libxml_import_node(docp TSRMLS_CC);
+ nodep = php_libxml_import_node(docp);
if (nodep) {
doc = nodep->doc;
@@ -435,7 +434,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
std_hnd = zend_get_std_object_handlers();
ZVAL_STRING(&member, "cloneDocument");
- cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
+ cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
convert_to_long(cloneDocu);
clone_docu = Z_LVAL_P(cloneDocu);
@@ -466,12 +465,12 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
intern->ptr = NULL;
}
- php_xsl_set_object(id, sheetp TSRMLS_CC);
+ php_xsl_set_object(id, sheetp);
RETVAL_TRUE;
}
/* }}} end xsl_xsltprocessor_import_stylesheet */
-static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */
+static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp) /* {{{ */
{
xmlDocPtr newdocp = NULL;
xmlDocPtr doc = NULL;
@@ -487,23 +486,23 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
int secPrefsValue, secPrefsIni;
xsltSecurityPrefsPtr secPrefs = NULL;
- node = php_libxml_import_node(docp TSRMLS_CC);
+ node = php_libxml_import_node(docp);
if (node) {
doc = node->doc;
}
if (doc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document");
+ php_error_docref(NULL, E_WARNING, "Invalid Document");
return NULL;
}
if (style == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stylesheet associated to this object");
+ php_error_docref(NULL, E_WARNING, "No stylesheet associated to this object");
return NULL;
}
if (intern->profiling) {
- if (php_check_open_basedir(intern->profiling TSRMLS_CC)) {
+ if (php_check_open_basedir(intern->profiling)) {
f = NULL;
} else {
f = VCWD_FOPEN(intern->profiling, "w");
@@ -513,7 +512,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
}
if (intern->parameter) {
- params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
+ params = php_xsl_xslt_make_params(intern->parameter, 0);
}
intern->doc = emalloc(sizeof(php_libxml_node_object));
@@ -526,7 +525,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
intern->doc->document = object->document;
}
- php_libxml_increment_doc_ref(intern->doc, doc TSRMLS_CC);
+ php_libxml_increment_doc_ref(intern->doc, doc);
ctxt = xsltNewTransformContext(style, doc);
ctxt->_private = (void *) intern;
@@ -534,7 +533,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
std_hnd = zend_get_std_object_handlers();
ZVAL_STRING(&member, "doXInclude");
- doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
+ 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);
@@ -549,13 +548,13 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
if (secPrefsIni != secPrefsValue) {
if (secPrefsIni != XSL_SECPREF_DEFAULT) {
/* if the ini value is not set to the default, throw an E_DEPRECATED warning */
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The xsl.security_prefs php.ini option is deprecated; use XsltProcessor->setSecurityPrefs() instead");
+ php_error_docref(NULL, E_DEPRECATED, "The xsl.security_prefs php.ini option is deprecated; use XsltProcessor->setSecurityPrefs() instead");
if (intern->securityPrefsSet == 0) {
/* if securityPrefs were not set through the setSecurityPrefs method, take the ini setting */
secPrefsValue = secPrefsIni;
} else {
/* else throw a notice, that the ini setting was not used */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The xsl.security_prefs php.ini was not used, since the XsltProcessor->setSecurityPrefs() method was used");
+ php_error_docref(NULL, E_NOTICE, "The xsl.security_prefs php.ini was not used, since the XsltProcessor->setSecurityPrefs() method was used");
}
}
}
@@ -595,7 +594,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
}
if (secPrefsError == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't set libxslt security properties, not doing transformation for security reasons");
+ 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);
}
@@ -614,7 +613,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
intern->node_list = NULL;
}
- php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ php_libxml_decrement_doc_ref(intern->doc);
efree(intern->doc);
intern->doc = NULL;
@@ -647,11 +646,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|S!", &docp, &ret_class) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|S!", &docp, &ret_class) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
if (newdocp) {
if (ret_class) {
@@ -665,10 +664,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
curce = curce->parent;
}
- ce = zend_lookup_class(ret_class TSRMLS_CC);
- if (ce == NULL || !instanceof_function(ce, curce TSRMLS_CC)) {
+ ce = zend_lookup_class(ret_class);
+ if (ce == NULL || !instanceof_function(ce, curce)) {
xmlFreeDoc(newdocp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expecting class compatible with %s, '%s' given", curclass_name->val, ret_class->val);
RETURN_FALSE;
}
@@ -676,10 +675,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
object_init_ex(return_value, ce);
interndoc = Z_LIBXML_NODE_P(return_value);
- php_libxml_increment_doc_ref(interndoc, newdocp TSRMLS_CC);
- php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc TSRMLS_CC);
+ php_libxml_increment_doc_ref(interndoc, newdocp);
+ php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc);
} else {
- php_dom_create_object((xmlNodePtr) newdocp, return_value, NULL TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) newdocp, return_value, NULL);
}
} else {
RETURN_FALSE;
@@ -704,11 +703,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "op", &docp, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "op", &docp, &uri, &uri_len) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
ret = -1;
if (newdocp) {
@@ -736,11 +735,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &docp) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
ret = -1;
if (newdocp) {
@@ -772,11 +771,11 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
zend_string *string_key, *name, *value;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
intern = Z_XSL_P(id);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array_value), idx, string_key, entry) {
if (string_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter array");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter array");
RETURN_FALSE;
}
SEPARATE_ZVAL(entry);
@@ -787,7 +786,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
zend_hash_update(intern->parameter, string_key, entry);
} ZEND_HASH_FOREACH_END();
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sSS", &namespace, &namespace_len, &name, &value) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sSS", &namespace, &namespace_len, &name, &value) == SUCCESS) {
intern = Z_XSL_P(id);
@@ -815,7 +814,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &namespace, &namespace_len, &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
RETURN_FALSE;
}
intern = Z_XSL_P(id);
@@ -840,7 +839,7 @@ PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &namespace, &namespace_len, &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
RETURN_FALSE;
}
intern = Z_XSL_P(id);
@@ -863,7 +862,7 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
intern = Z_XSL_P(id);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {
@@ -874,7 +873,7 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
} ZEND_HASH_FOREACH_END();
intern->registerPhpFunctions = 2;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
intern = Z_XSL_P(id);
ZVAL_LONG(&new_string,1);
@@ -898,7 +897,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
size_t filename_len;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p!", &filename, &filename_len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p!", &filename, &filename_len) == SUCCESS) {
intern = Z_XSL_P(id);
if (intern->profiling) {
efree(intern->profiling);
@@ -923,7 +922,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_security_prefs)
zend_long securityPrefs, oldSecurityPrefs;
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &securityPrefs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &securityPrefs) == FAILURE) {
return;
}
intern = Z_XSL_P(id);
@@ -942,7 +941,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_security_prefs)
xsl_object *intern;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "") == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "") == SUCCESS) {
intern = Z_XSL_P(id);
RETURN_LONG(intern->securityPrefs);
} else {
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index b50e240656..0b1fffbacd 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -68,7 +68,7 @@ static int le_zip_entry;
/* {{{ PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) */
#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \
if (path_len < 1) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); \
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name"); \
RETURN_FALSE; \
} \
if (zip_stat(za, path, flags, &sb) != 0) { \
@@ -133,7 +133,7 @@ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */
# define CWD_STATE_FREE(s) efree(s)
/* {{{ php_zip_extract_file */
-static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len TSRMLS_DC)
+static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len)
{
php_stream_statbuf ssb;
struct zip_file *zf;
@@ -158,7 +158,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
/* Clean/normlize the path and then transform any path (absolute or relative)
to a path relative to cwd (../../mydir/foo.txt > mydir/foo.txt)
*/
- virtual_file_ex(&new_state, file, NULL, CWD_EXPAND TSRMLS_CC);
+ virtual_file_ex(&new_state, file, NULL, CWD_EXPAND);
path_cleaned = php_zip_make_relative_path(new_state.cwd, new_state.cwd_length);
if(!path_cleaned) {
return 0;
@@ -183,7 +183,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname);
}
- file_basename = php_basename(path_cleaned, path_cleaned_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename(path_cleaned, path_cleaned_len, NULL, 0);
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) {
efree(file_dirname_fullpath);
@@ -220,7 +220,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
CWD_STATE_FREE(new_state.cwd);
return 0;
} else if (len > MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
efree(file_dirname_fullpath);
zend_string_release(file_basename);
CWD_STATE_FREE(new_state.cwd);
@@ -277,7 +277,7 @@ done:
/* }}} */
static int php_zip_add_file(struct zip *za, const char *filename, size_t filename_len,
- char *entry_name, size_t entry_name_len, long offset_start, long offset_len TSRMLS_DC) /* {{{ */
+ char *entry_name, size_t entry_name_len, long offset_start, long offset_len) /* {{{ */
{
struct zip_source *zs;
char resolved_path[MAXPATHLEN];
@@ -288,11 +288,11 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
return -1;
}
- if (!expand_filepath(filename, resolved_path TSRMLS_CC)) {
+ if (!expand_filepath(filename, resolved_path)) {
return -1;
}
- php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag TSRMLS_CC);
+ php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag);
if (Z_TYPE(exists_flag) == IS_FALSE) {
return -1;
}
@@ -311,7 +311,7 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
}
/* }}} */
-static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len TSRMLS_DC) /* {{{ */
+static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len) /* {{{ */
{
zval *option;
if ((option = zend_hash_str_find(HASH_OF(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
@@ -330,17 +330,17 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
/* If I add more options, it would make sense to create a nice static struct and loop over it. */
if ((option = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path option expected to be a string");
+ php_error_docref(NULL, E_WARNING, "remove_path option expected to be a string");
return -1;
}
if (Z_STRLEN_P(option) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as remove_path option");
+ php_error_docref(NULL, E_NOTICE, "Empty string given as remove_path option");
return -1;
}
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path string is too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "remove_path string is too long (max: %i, %i given)",
MAXPATHLEN - 1, Z_STRLEN_P(option));
return -1;
}
@@ -350,17 +350,17 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
if ((option = zend_hash_str_find(HASH_OF(options), "add_path", sizeof("add_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path option expected to be a string");
+ php_error_docref(NULL, E_WARNING, "add_path option expected to be a string");
return -1;
}
if (Z_STRLEN_P(option) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as the add_path option");
+ php_error_docref(NULL, E_NOTICE, "Empty string given as the add_path option");
return -1;
}
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path string too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "add_path string too long (max: %i, %i given)",
MAXPATHLEN - 1, Z_STRLEN_P(option));
return -1;
}
@@ -373,7 +373,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */
#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
/* }}} */
/* {{{ ZIP_FROM_OBJECT */
@@ -382,7 +382,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
ze_zip_object *obj = Z_ZIP_P(object); \
intern = obj->za; \
if (!intern) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or uninitialized Zip object"); \
+ php_error_docref(NULL, E_WARNING, "Invalid or uninitialized Zip object"); \
RETURN_FALSE; \
} \
}
@@ -402,7 +402,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
}
/* }}} */
-static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_status(struct zip *za) /* {{{ */
{
int zep, syp;
@@ -411,7 +411,7 @@ static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_status_sys(struct zip *za) /* {{{ */
{
int zep, syp;
@@ -420,13 +420,13 @@ static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_get_num_files(struct zip *za) /* {{{ */
{
return zip_get_num_files(za);
}
/* }}} */
-static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */
+static char * php_zipobj_get_filename(ze_zip_object *obj) /* {{{ */
{
if (!obj) {
@@ -440,7 +440,7 @@ static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
-static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /* {{{ */
+static char * php_zipobj_get_zip_comment(struct zip *za, int *len) /* {{{ */
{
if (za) {
return (char *)zip_get_archive_comment(za, len, 0);
@@ -481,7 +481,7 @@ static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /*
#endif /* }}} */
-int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value TSRMLS_DC) /* {{{ */
+int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value) /* {{{ */
{
#ifdef HAVE_GLOB
char cwd[MAXPATHLEN];
@@ -495,12 +495,12 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
int ret;
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
return -1;
}
if ((GLOB_AVAILABLE_FLAGS & flags) != flags) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
return -1;
}
@@ -581,13 +581,13 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
globfree(&globbuf);
return globbuf.gl_pathc;
#else
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available");
+ php_error_docref(NULL, E_ERROR, "Glob support is not available");
return 0;
#endif /* HAVE_GLOB */
}
/* }}} */
-int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_value TSRMLS_DC) /* {{{ */
+int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_value) /* {{{ */
{
#ifdef ZTS
char cwd[MAXPATHLEN];
@@ -627,9 +627,9 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
pcre_extra *pcre_extra = NULL;
int preg_options = 0, i;
- re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options);
if (!re) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid expression");
+ php_error_docref(NULL, E_WARNING, "Invalid expression");
return -1;
}
@@ -650,7 +650,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
}
if ((path_len + namelist_len + 1) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path string too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "add_path string too long (max: %i, %i given)",
MAXPATHLEN - 1, (path_len + namelist_len + 1));
zend_string_release(namelist[i]);
break;
@@ -659,7 +659,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
snprintf(fullpath, MAXPATHLEN, "%s%c%s", path, DEFAULT_SLASH, namelist[i]->val);
if (0 != VCWD_STAT(fullpath, &s)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot read <%s>", fullpath);
+ php_error_docref(NULL, E_WARNING, "Cannot read <%s>", fullpath);
zend_string_release(namelist[i]);
continue;
}
@@ -756,9 +756,9 @@ static zend_object_handlers zip_object_handlers;
static HashTable zip_prop_handlers;
-typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC);
-typedef char *(*zip_read_const_char_t)(struct zip *za, int *len TSRMLS_DC);
-typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC);
+typedef int (*zip_read_int_t)(struct zip *za);
+typedef char *(*zip_read_const_char_t)(struct zip *za, int *len);
+typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj);
typedef struct _zip_prop_handler {
zip_read_int_t read_int_func;
@@ -769,7 +769,7 @@ typedef struct _zip_prop_handler {
} zip_prop_handler;
/* }}} */
-static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */
+static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype) /* {{{ */
{
zip_prop_handler hnd;
@@ -781,7 +781,7 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z
}
/* }}} */
-static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval *rv TSRMLS_DC) /* {{{ */
+static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval *rv) /* {{{ */
{
const char *retchar = NULL;
int retint = 0;
@@ -789,17 +789,17 @@ static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd,
if (obj && obj->za != NULL) {
if (hnd->read_const_char_func) {
- retchar = hnd->read_const_char_func(obj->za, &len TSRMLS_CC);
+ retchar = hnd->read_const_char_func(obj->za, &len);
} else {
if (hnd->read_int_func) {
- retint = hnd->read_int_func(obj->za TSRMLS_CC);
+ retint = hnd->read_int_func(obj->za);
if (retint == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned");
+ php_error_docref(NULL, E_WARNING, "Internal zip error returned");
return NULL;
}
} else {
if (hnd->read_const_char_from_obj_func) {
- retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC);
+ retchar = hnd->read_const_char_from_obj_func(obj);
len = strlen(retchar);
}
}
@@ -829,7 +829,7 @@ static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd,
}
/* }}} */
-static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -852,7 +852,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
if (hnd == NULL) {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -863,7 +863,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
}
/* }}} */
-static zval *php_zip_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *php_zip_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -885,13 +885,13 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
}
if (hnd != NULL) {
- retval = php_zip_property_reader(obj, hnd, rv TSRMLS_CC);
+ retval = php_zip_property_reader(obj, hnd, rv);
if (retval == NULL) {
retval = &EG(uninitialized_zval);
}
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -902,7 +902,7 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
}
/* }}} */
-static int php_zip_has_property(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static int php_zip_has_property(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -928,9 +928,9 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
if (type == 2) {
retval = 1;
- } else if ((prop = php_zip_property_reader(obj, hnd, &tmp TSRMLS_CC)) != NULL) {
+ } else if ((prop = php_zip_property_reader(obj, hnd, &tmp)) != NULL) {
if (type == 1) {
- retval = zend_is_true(&tmp TSRMLS_CC);
+ retval = zend_is_true(&tmp);
} else if (type == 0) {
retval = (Z_TYPE(tmp) != IS_NULL);
}
@@ -939,7 +939,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
zval_ptr_dtor(&tmp);
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->has_property(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -950,7 +950,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
}
/* }}} */
-static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
+static HashTable *php_zip_get_properties(zval *object)/* {{{ */
{
ze_zip_object *obj;
HashTable *props;
@@ -959,7 +959,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
zend_ulong num_key;
obj = Z_ZIP_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (obj->prop_handler == NULL) {
return NULL;
@@ -967,7 +967,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
ZEND_HASH_FOREACH_KEY_PTR(obj->prop_handler, num_key, key, hnd) {
zval *ret, val;
- ret = php_zip_property_reader(obj, hnd, &val TSRMLS_CC);
+ ret = php_zip_property_reader(obj, hnd, &val);
if (ret == NULL) {
ret = &EG(uninitialized_zval);
}
@@ -978,7 +978,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
}
/* }}} */
-static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_zip_object_free_storage(zend_object *object) /* {{{ */
{
ze_zip_object * intern = php_zip_fetch_object(object);
int i;
@@ -988,7 +988,7 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
if (intern->za) {
if (zip_close(intern->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot destroy the zip context");
+ php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context");
return;
}
intern->za = NULL;
@@ -1002,7 +1002,7 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
intern->za = NULL;
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
if (intern->filename) {
efree(intern->filename);
@@ -1010,13 +1010,13 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_object *php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
{
ze_zip_object *intern;
intern = ecalloc(1, sizeof(ze_zip_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->prop_handler = &zip_prop_handlers;
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &zip_object_handlers;
@@ -1027,14 +1027,14 @@ static zend_object *php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /
/* {{{ Resource dtors */
/* {{{ php_zip_free_dir */
-static void php_zip_free_dir(zend_resource *rsrc TSRMLS_DC)
+static void php_zip_free_dir(zend_resource *rsrc)
{
zip_rsrc * zip_int = (zip_rsrc *) rsrc->ptr;
if (zip_int) {
if (zip_int->za) {
if (zip_close(zip_int->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot destroy the zip context");
+ php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context");
}
zip_int->za = NULL;
}
@@ -1047,7 +1047,7 @@ static void php_zip_free_dir(zend_resource *rsrc TSRMLS_DC)
/* }}} */
/* {{{ php_zip_free_entry */
-static void php_zip_free_entry(zend_resource *rsrc TSRMLS_DC)
+static void php_zip_free_entry(zend_resource *rsrc)
{
zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr;
@@ -1102,12 +1102,12 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
int err = 0;
zend_string *filename;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P", &filename) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &filename) == FAILURE) {
return;
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
@@ -1115,7 +1115,7 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
RETURN_FALSE;
}
- if(!expand_filepath(filename->val, resolved_path TSRMLS_CC)) {
+ if(!expand_filepath(filename->val, resolved_path)) {
RETURN_FALSE;
}
@@ -1141,7 +1141,7 @@ static PHP_NAMED_FUNCTION(zif_zip_close)
zval * zip;
zip_rsrc *z_rsrc = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, zip, -1, le_zip_dir_name, le_zip_dir);
@@ -1160,7 +1160,7 @@ static PHP_NAMED_FUNCTION(zif_zip_read)
int ret;
zip_rsrc *rsrc_int;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_dp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_dp) == FAILURE) {
return;
}
@@ -1207,7 +1207,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
zip_read_rsrc * zr_rsrc;
zip_rsrc *z_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) {
return;
}
@@ -1229,7 +1229,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close)
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_entry) == FAILURE) {
return;
}
@@ -1249,7 +1249,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)
zend_string *buffer;
int n = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zip_entry, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zip_entry, &len) == FAILURE) {
return;
}
@@ -1281,7 +1281,7 @@ static void php_zip_entry_get_info(INTERNAL_FUNCTION_PARAMETERS, int opt) /* {{{
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_entry) == FAILURE) {
return;
}
@@ -1384,7 +1384,7 @@ static ZIPARCHIVE_METHOD(open)
zval *self = getThis();
ze_zip_object *ze_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &filename, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &filename, &flags) == FAILURE) {
return;
}
@@ -1394,7 +1394,7 @@ static ZIPARCHIVE_METHOD(open)
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
@@ -1402,14 +1402,14 @@ static ZIPARCHIVE_METHOD(open)
RETURN_FALSE;
}
- if (!(resolved_path = expand_filepath(filename->val, NULL TSRMLS_CC))) {
+ if (!(resolved_path = expand_filepath(filename->val, NULL))) {
RETURN_FALSE;
}
if (ze_obj->za) {
/* we already have an opened zip, free it */
if (zip_close(ze_obj->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
efree(resolved_path);
RETURN_FALSE;
}
@@ -1447,7 +1447,7 @@ static ZIPARCHIVE_METHOD(setPassword)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &password, &password_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &password, &password_len) == FAILURE) {
return;
}
@@ -1533,7 +1533,7 @@ static ZIPARCHIVE_METHOD(addEmptyDir)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&dirname, &dirname_len) == FAILURE) {
return;
}
@@ -1589,23 +1589,23 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
ZIP_FROM_OBJECT(intern, self);
/* 1 == glob, 2 == pcre */
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|la",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|la",
&pattern, &flags, &options) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|sa",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|sa",
&pattern, &path, &path_len, &options) == FAILURE) {
return;
}
}
if (pattern->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as pattern");
+ php_error_docref(NULL, E_NOTICE, "Empty string as pattern");
RETURN_FALSE;
}
if (options && (php_zip_parse_options(options, &remove_all_path, &remove_path, &remove_path_len,
- &add_path, &add_path_len TSRMLS_CC) < 0)) {
+ &add_path, &add_path_len) < 0)) {
RETURN_FALSE;
}
@@ -1617,9 +1617,9 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
}
if (type == 1) {
- found = php_zip_glob(pattern->val, pattern->len, flags, return_value TSRMLS_CC);
+ found = php_zip_glob(pattern->val, pattern->len, flags, return_value);
} else {
- found = php_zip_pcre(pattern, path, path_len, return_value TSRMLS_CC);
+ found = php_zip_pcre(pattern, path, path_len, return_value);
}
if (found > 0) {
@@ -1634,7 +1634,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
if ((zval_file = zend_hash_index_find(Z_ARRVAL_P(return_value), i)) != NULL) {
if (remove_all_path) {
- basename = php_basename(Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), NULL, 0 TSRMLS_CC);
+ basename = php_basename(Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), NULL, 0);
file_stripped = basename->val;
file_stripped_len = basename->len;
} else if (remove_path && strstr(Z_STRVAL_P(zval_file), remove_path) != NULL) {
@@ -1647,7 +1647,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
if (add_path) {
if ((add_path_len + file_stripped_len) > MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %d, %pd given)",
+ php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %pd given)",
MAXPATHLEN - 1, (add_path_len + file_stripped_len));
zval_ptr_dtor(return_value);
RETURN_FALSE;
@@ -1665,7 +1665,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
basename = NULL;
}
if (php_zip_add_file(intern, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file),
- entry_name, entry_name_len, 0, 0 TSRMLS_CC) < 0) {
+ entry_name, entry_name_len, 0, 0) < 0) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1708,13 +1708,13 @@ static ZIPARCHIVE_METHOD(addFile)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|sll",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|sll",
&filename, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
return;
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as filename");
+ php_error_docref(NULL, E_NOTICE, "Empty string as filename");
RETURN_FALSE;
}
@@ -1723,7 +1723,7 @@ static ZIPARCHIVE_METHOD(addFile)
entry_name_len = filename->len;
}
- if (php_zip_add_file(intern, filename->val, filename->len, entry_name, entry_name_len, 0, 0 TSRMLS_CC) < 0) {
+ if (php_zip_add_file(intern, filename->val, filename->len, entry_name, entry_name_len, 0, 0) < 0) {
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -1751,7 +1751,7 @@ static ZIPARCHIVE_METHOD(addFromString)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS",
&name, &name_len, &buffer) == FAILURE) {
return;
}
@@ -1809,7 +1809,7 @@ static ZIPARCHIVE_METHOD(statName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &name, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &name, &flags) == FAILURE) {
return;
}
@@ -1835,7 +1835,7 @@ static ZIPARCHIVE_METHOD(statIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -1863,7 +1863,7 @@ static ZIPARCHIVE_METHOD(locateName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &name, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &name, &flags) == FAILURE) {
return;
}
@@ -1896,7 +1896,7 @@ static ZIPARCHIVE_METHOD(getNameIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -1926,7 +1926,7 @@ static ZIPARCHIVE_METHOD(setArchiveComment)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &comment, &comment_len) == FAILURE) {
return;
}
if (zip_set_archive_comment(intern, (const char *)comment, (int)comment_len)) {
@@ -1953,7 +1953,7 @@ static ZIPARCHIVE_METHOD(getArchiveComment)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) {
return;
}
@@ -1981,13 +1981,13 @@ static ZIPARCHIVE_METHOD(setCommentName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &comment, &comment_len) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2015,7 +2015,7 @@ static ZIPARCHIVE_METHOD(setCommentIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls",
&index, &comment, &comment_len) == FAILURE) {
return;
}
@@ -2045,13 +2045,13 @@ static ZIPARCHIVE_METHOD(setExternalAttributesName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|l",
&name, &name_len, &opsys, &attr, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2081,7 +2081,7 @@ static ZIPARCHIVE_METHOD(setExternalAttributesIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll|l",
&index, &opsys, &attr, &flags) == FAILURE) {
return;
}
@@ -2114,13 +2114,13 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/|l",
&name, &name_len, &z_opsys, &z_attr, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2156,7 +2156,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/z/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz/z/|l",
&index, &z_opsys, &z_attr, &flags) == FAILURE) {
return;
}
@@ -2194,12 +2194,12 @@ static ZIPARCHIVE_METHOD(getCommentName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
&name, &name_len, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
RETURN_FALSE;
}
@@ -2230,7 +2230,7 @@ static ZIPARCHIVE_METHOD(getCommentIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -2255,7 +2255,7 @@ static ZIPARCHIVE_METHOD(deleteIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}
@@ -2287,7 +2287,7 @@ static ZIPARCHIVE_METHOD(deleteName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (name_len < 1) {
@@ -2319,7 +2319,7 @@ static ZIPARCHIVE_METHOD(renameIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &index, &new_name, &new_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &index, &new_name, &new_name_len) == FAILURE) {
return;
}
@@ -2328,7 +2328,7 @@ static ZIPARCHIVE_METHOD(renameIndex)
}
if (new_name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as new entry name");
RETURN_FALSE;
}
if (zip_rename(intern, index, (const char *)new_name) != 0) {
@@ -2354,12 +2354,12 @@ static ZIPARCHIVE_METHOD(renameName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
return;
}
if (new_name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as new entry name");
RETURN_FALSE;
}
@@ -2386,7 +2386,7 @@ static ZIPARCHIVE_METHOD(unchangeIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}
@@ -2418,7 +2418,7 @@ static ZIPARCHIVE_METHOD(unchangeName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -2503,7 +2503,7 @@ static ZIPARCHIVE_METHOD(extractTo)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
return;
}
@@ -2522,7 +2522,7 @@ static ZIPARCHIVE_METHOD(extractTo)
if (zval_files && (Z_TYPE_P(zval_files) != IS_NULL)) {
switch (Z_TYPE_P(zval_files)) {
case IS_STRING:
- if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_files), Z_STRLEN_P(zval_files) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_files), Z_STRLEN_P(zval_files))) {
RETURN_FALSE;
}
break;
@@ -2537,7 +2537,7 @@ static ZIPARCHIVE_METHOD(extractTo)
case IS_LONG:
break;
case IS_STRING:
- if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file))) {
RETURN_FALSE;
}
break;
@@ -2547,7 +2547,7 @@ static ZIPARCHIVE_METHOD(extractTo)
break;
case IS_LONG:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
break;
}
} else {
@@ -2555,13 +2555,13 @@ static ZIPARCHIVE_METHOD(extractTo)
int filecount = zip_get_num_files(intern);
if (filecount == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive");
+ php_error_docref(NULL, E_WARNING, "Illegal archive");
RETURN_FALSE;
}
for (i = 0; i < filecount; i++) {
char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED);
- if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, file, strlen(file))) {
RETURN_FALSE;
}
}
@@ -2594,12 +2594,12 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ZIP_FROM_OBJECT(intern, self);
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|ll", &filename, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|ll", &filename, &len, &flags) == FAILURE) {
return;
}
PHP_ZIP_STAT_PATH(intern, filename->val, filename->len, flags, sb);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &index, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &index, &len, &flags) == FAILURE) {
return;
}
PHP_ZIP_STAT_INDEX(intern, index, 0, sb);
@@ -2670,7 +2670,7 @@ static ZIPARCHIVE_METHOD(getStream)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P", &filename) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &filename) == FAILURE) {
return;
}
@@ -2680,7 +2680,7 @@ static ZIPARCHIVE_METHOD(getStream)
obj = Z_ZIP_P(self);
- stream = php_stream_zip_open(obj->filename, filename->val, mode STREAMS_CC TSRMLS_CC);
+ stream = php_stream_zip_open(obj->filename, filename->val, mode STREAMS_CC);
if (stream) {
php_stream_to_zval(stream, return_value);
}
@@ -2898,14 +2898,14 @@ static PHP_MINIT_FUNCTION(zip)
INIT_CLASS_ENTRY(ce, "ZipArchive", zip_class_functions);
ce.create_object = php_zip_object_new;
- zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ zip_class_entry = zend_register_internal_class(&ce);
zend_hash_init(&zip_prop_handlers, 0, NULL, php_zip_free_prop_handler, 1);
- php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING);
+ php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING);
REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);
@@ -2985,7 +2985,7 @@ static PHP_MINIT_FUNCTION(zip)
REGISTER_ZIP_CLASS_CONST_LONG("OPSYS_DEFAULT", ZIP_OPSYS_DEFAULT);
#endif /* ifdef ZIP_OPSYS_DEFAULT */
- php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper);
le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number);
le_zip_entry = zend_register_list_destructors_ex(php_zip_free_entry, NULL, le_zip_entry_name, module_number);
@@ -2999,7 +2999,7 @@ static PHP_MINIT_FUNCTION(zip)
static PHP_MSHUTDOWN_FUNCTION(zip)
{
zend_hash_destroy(&zip_prop_handlers);
- php_unregister_url_stream_wrapper("zip" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("zip");
return SUCCESS;
}
/* }}} */
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index 7fab823297..388f7efd1a 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -50,10 +50,10 @@ extern zend_module_entry zip_module_entry;
/* {{{ ZIP_OPENBASEDIR_CHECKPATH(filename) */
#if PHP_API_VERSION < 20100412
# define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
/* }}} */
@@ -90,8 +90,8 @@ static inline ze_zip_object *php_zip_fetch_object(zend_object *obj) {
#define Z_ZIP_P(zv) php_zip_fetch_object(Z_OBJ_P((zv)))
-php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC);
extern php_stream_wrapper php_stream_zip_wrapper;
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c
index f2537e49c3..a0c6ec2f6d 100644
--- a/ext/zip/zip_stream.c
+++ b/ext/zip/zip_stream.c
@@ -44,7 +44,7 @@ struct php_zip_stream_data_t {
/* {{{ php_zip_ops_read */
-static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count)
{
ssize_t n = 0;
STREAM_DATA_FROM_STREAM();
@@ -55,7 +55,7 @@ static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRML
int ze, se;
zip_file_error_get(self->zf, &ze, &se);
stream->eof = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
+ php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
return 0;
}
/* cast count to signed value to avoid possibly negative n
@@ -71,7 +71,7 @@ static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRML
/* }}} */
/* {{{ php_zip_ops_write */
-static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count)
{
if (!stream) {
return 0;
@@ -82,7 +82,7 @@ static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t coun
/* }}} */
/* {{{ php_zip_ops_close */
-static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_zip_ops_close(php_stream *stream, int close_handle)
{
STREAM_DATA_FROM_STREAM();
if (close_handle) {
@@ -103,7 +103,7 @@ static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC)
/* }}} */
/* {{{ php_zip_ops_flush */
-static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
+static int php_zip_ops_flush(php_stream *stream)
{
if (!stream) {
return 0;
@@ -113,7 +113,7 @@ static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
}
/* }}} */
-static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
struct zip_stat sb;
const char *path = stream->orig_path;
@@ -148,7 +148,7 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
memcpy(file_dirname, path, path_len - fragment_len);
file_dirname[path_len - fragment_len] = '\0';
- file_basename = php_basename((char *)path, path_len - fragment_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename((char *)path, path_len - fragment_len, NULL, 0);
fragment++;
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) {
@@ -200,7 +200,7 @@ php_stream_ops php_stream_zipio_ops = {
};
/* {{{ php_stream_zip_open */
-php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC)
+php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC)
{
struct zip_file *zf = NULL;
int err = 0;
@@ -254,7 +254,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
const char *mode,
int options,
char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
int path_len;
@@ -292,7 +292,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
memcpy(file_dirname, path, path_len - fragment_len);
file_dirname[path_len - fragment_len] = '\0';
- file_basename = php_basename(path, path_len - fragment_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename(path, path_len - fragment_len, NULL, 0);
fragment++;
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) {
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32
index 000b1ccabb..1a57aa6110 100644
--- a/ext/zlib/config.w32
+++ b/ext/zlib/config.w32
@@ -7,7 +7,7 @@ if (PHP_ZLIB == "yes") {
if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)) {
- EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS");
+ EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support");
if (!PHP_ZLIB_SHARED) {
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4
index ebf67cc001..ab94c15fe0 100644
--- a/ext/zlib/config0.m4
+++ b/ext/zlib/config0.m4
@@ -9,7 +9,7 @@ PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then
- PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared)
+ PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(ZLIB_SHARED_LIBADD)
if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index ba829b5888..a93e46d339 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -58,7 +58,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
int compression_coding;
ZEND_END_MODULE_GLOBALS(zlib);
-php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
extern php_stream_ops php_stream_gzio_ops;
extern php_stream_wrapper php_stream_gzip_wrapper;
extern php_stream_filter_factory php_zlib_filter_factory;
@@ -68,7 +68,7 @@ extern zend_module_entry php_zlib_module_entry;
#ifdef ZTS
# include "TSRM.h"
-# define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
+# define ZLIBG(v) ZEND_TSRMG(zlib_globals_id, zend_zlib_globals *, v)
#else
# define ZLIBG(v) (zlib_globals.v)
#endif
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index c3548eae53..3f66ed106d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -62,13 +62,13 @@ static void php_zlib_free(voidpf opaque, voidpf address)
/* }}} */
/* {{{ php_zlib_output_conflict_check() */
-static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C) > 0) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter") TSRMLS_CC)) {
+ if (php_output_get_level() > 0) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter"))) {
return FAILURE;
}
}
@@ -77,13 +77,13 @@ static int php_zlib_output_conflict_check(const char *handler_name, size_t handl
/* }}} */
/* {{{ php_zlib_output_encoding() */
-static int php_zlib_output_encoding(TSRMLS_D)
+static int php_zlib_output_encoding(void)
{
zval *enc;
if (!ZLIBG(compression_coding)) {
zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
(enc = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING") - 1))) {
@@ -191,7 +191,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
php_zlib_context *ctx = *(php_zlib_context **) handler_context;
PHP_OUTPUT_TSRMLS(output_context);
- if (!php_zlib_output_encoding(TSRMLS_C)) {
+ if (!php_zlib_output_encoding()) {
/* "Vary: Accept-Encoding" header sent along uncompressed content breaks caching in MSIE,
so let's just send it with successfully compressed content or unless the complete
buffer gets discarded, see http://bugs.php.net/40325;
@@ -205,7 +205,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if ((output_context->op & PHP_OUTPUT_HANDLER_START)
&& (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL))
) {
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
return FAILURE;
}
@@ -217,7 +217,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
int flags;
- if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags TSRMLS_CC)) {
+ if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags)) {
/* only run this once */
if (!(flags & PHP_OUTPUT_HANDLER_STARTED)) {
if (SG(headers_sent) || !ZLIBG(output_compression)) {
@@ -226,17 +226,17 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
}
switch (ZLIBG(compression_coding)) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
default:
deflateEnd(&ctx->Z);
return FAILURE;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -246,7 +246,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
/* }}} */
/* {{{ php_zlib_output_handler_context_init() */
-static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
+static php_zlib_context *php_zlib_output_handler_context_init(void)
{
php_zlib_context *ctx = (php_zlib_context *) ecalloc(1, sizeof(php_zlib_context));
ctx->Z.zalloc = php_zlib_alloc;
@@ -256,7 +256,7 @@ static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_output_handler_context_dtor() */
-static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
+static void php_zlib_output_handler_context_dtor(void *opaq)
{
php_zlib_context *ctx = (php_zlib_context *) opaq;
@@ -270,7 +270,7 @@ static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
/* }}} */
/* {{{ php_zlib_output_handler_init() */
-static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
php_output_handler *h = NULL;
@@ -280,8 +280,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
ZLIBG(handler_registered) = 1;
- if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) {
- php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC);
+ if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags))) {
+ php_output_handler_set_context(h, php_zlib_output_handler_context_init(), php_zlib_output_handler_context_dtor);
}
return h;
@@ -289,7 +289,7 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
/* }}} */
/* {{{ php_zlib_output_compression_start() */
-static void php_zlib_output_compression_start(TSRMLS_D)
+static void php_zlib_output_compression_start(void)
{
zval zoh;
php_output_handler *h;
@@ -301,12 +301,12 @@ static void php_zlib_output_compression_start(TSRMLS_D)
ZLIBG(output_compression) = PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
/* break omitted intentionally */
default:
- if ( php_zlib_output_encoding(TSRMLS_C) &&
- (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) &&
- (SUCCESS == php_output_handler_start(h TSRMLS_CC))) {
+ if ( php_zlib_output_encoding() &&
+ (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS)) &&
+ (SUCCESS == php_output_handler_start(h))) {
if (ZLIBG(output_handler) && *ZLIBG(output_handler)) {
ZVAL_STRING(&zoh, ZLIBG(output_handler));
- php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS);
zval_ptr_dtor(&zoh);
}
}
@@ -316,7 +316,7 @@ static void php_zlib_output_compression_start(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_encode() */
-static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level TSRMLS_DC)
+static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level)
{
int status;
z_stream Z;
@@ -347,7 +347,7 @@ static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encod
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return NULL;
}
/* }}} */
@@ -402,7 +402,7 @@ static inline int php_zlib_inflate_rounds(z_stream *Z, size_t max, char **buf, s
/* }}} */
/* {{{ php_zlib_decode() */
-static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len TSRMLS_DC)
+static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len)
{
int status = Z_DATA_ERROR;
z_stream Z;
@@ -438,17 +438,17 @@ retry_raw_inflate:
*out_buf = NULL;
*out_len = 0;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return FAILURE;
}
/* }}} */
/* {{{ php_zlib_cleanup_ob_gzhandler_mess() */
-static void php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_D)
+static void php_zlib_cleanup_ob_gzhandler_mess(void)
{
if (ZLIBG(ob_gzhandler)) {
deflateEnd(&(ZLIBG(ob_gzhandler)->Z));
- php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler) TSRMLS_CC);
+ php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler));
ZLIBG(ob_gzhandler) = NULL;
}
}
@@ -472,31 +472,30 @@ static PHP_FUNCTION(ob_gzhandler)
* - OG(running) is not set or set to any other output handler
* - we have to mess around with php_output_context */
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &in_str, &in_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &in_str, &in_len, &flags)) {
RETURN_FALSE;
}
- if (!(encoding = php_zlib_output_encoding(TSRMLS_C))) {
+ if (!(encoding = php_zlib_output_encoding())) {
RETURN_FALSE;
}
if (flags & PHP_OUTPUT_HANDLER_START) {
switch (encoding) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
if (!ZLIBG(ob_gzhandler)) {
- ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
+ ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init();
}
- TSRMLS_SET_CTX(ctx.tsrm_ls);
ctx.op = flags;
ctx.in.data = in_str;
ctx.in.used = in_len;
@@ -507,7 +506,7 @@ static PHP_FUNCTION(ob_gzhandler)
if (ctx.out.data && ctx.out.free) {
efree(ctx.out.data);
}
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
RETURN_FALSE;
}
@@ -552,7 +551,7 @@ static PHP_FUNCTION(gzfile)
zend_long use_include_path = 0;
php_stream *stream;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &use_include_path)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &use_include_path)) {
return;
}
@@ -561,7 +560,7 @@ static PHP_FUNCTION(gzfile)
}
/* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
/* Error reporting is already done by stream code */
@@ -592,7 +591,7 @@ static PHP_FUNCTION(gzopen)
php_stream *stream;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
return;
}
@@ -600,7 +599,7 @@ static PHP_FUNCTION(gzopen)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -620,7 +619,7 @@ static PHP_FUNCTION(readgzfile)
size_t size;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -628,7 +627,7 @@ static PHP_FUNCTION(readgzfile)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -646,16 +645,16 @@ static PHP_FUNCTION(name) \
zend_long level = -1; \
zend_long encoding = default_encoding; \
if (default_encoding) { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ll", &in, &level, &encoding)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S|ll", &in, &level, &encoding)) { \
return; \
} \
} else { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &in, &encoding, &level)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &in, &encoding, &level)) { \
return; \
} \
} \
if (level < -1 || level > 9) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%pd) must be within -1..9", level); \
+ php_error_docref(NULL, E_WARNING, "compression level (%pd) must be within -1..9", level); \
RETURN_FALSE; \
} \
switch (encoding) { \
@@ -664,10 +663,10 @@ static PHP_FUNCTION(name) \
case PHP_ZLIB_ENCODING_DEFLATE: \
break; \
default: \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
+ php_error_docref(NULL, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
RETURN_FALSE; \
} \
- if ((out = php_zlib_encode(in->val, in->len, encoding, level TSRMLS_CC)) == NULL) { \
+ if ((out = php_zlib_encode(in->val, in->len, encoding, level)) == NULL) { \
RETURN_FALSE; \
} \
RETURN_STR(out); \
@@ -680,14 +679,14 @@ static PHP_FUNCTION(name) \
size_t in_len; \
size_t out_len; \
zend_long max_len = 0; \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &in_buf, &in_len, &max_len)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &in_buf, &in_len, &max_len)) { \
return; \
} \
if (max_len < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
+ php_error_docref(NULL, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
RETURN_FALSE; \
} \
- if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len TSRMLS_CC)) { \
+ if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len)) { \
RETURN_FALSE; \
} \
RETVAL_STRINGL(out_buf, out_len); \
@@ -736,6 +735,9 @@ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE);
/* }}} */
#ifdef COMPILE_DL_ZLIB
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(php_zlib)
#endif
@@ -900,13 +902,13 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0);
if (ini_value && *ini_value && int_value) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
+ php_error_docref("ref.outcontrol", E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
return FAILURE;
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- int status = php_output_get_status(TSRMLS_C);
+ int status = php_output_get_status();
if (status & PHP_OUTPUT_SENT) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_compression - headers already sent");
return FAILURE;
}
}
@@ -916,8 +918,8 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ZLIBG(output_compression) = ZLIBG(output_compression_default);
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
- if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) {
- php_zlib_output_compression_start(TSRMLS_C);
+ if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))) {
+ php_zlib_output_compression_start();
}
}
@@ -928,12 +930,12 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
/* {{{ OnUpdate_zlib_output_handler */
static PHP_INI_MH(OnUpdate_zlib_output_handler)
{
- if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status(TSRMLS_C) & PHP_OUTPUT_SENT)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent");
+ if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status() & PHP_OUTPUT_SENT)) {
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_handler - headers already sent");
return FAILURE;
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
/* }}} */
@@ -949,12 +951,12 @@ PHP_INI_END()
/* {{{ PHP_MINIT_FUNCTION */
static PHP_MINIT_FUNCTION(zlib)
{
- php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
- php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper);
+ php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory);
- php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check);
+ php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check);
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);
@@ -970,8 +972,8 @@ static PHP_MINIT_FUNCTION(zlib)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
static PHP_MSHUTDOWN_FUNCTION(zlib)
{
- php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
- php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("zlib");
+ php_stream_filter_unregister_factory("zlib.*");
UNREGISTER_INI_ENTRIES();
@@ -985,7 +987,7 @@ static PHP_RINIT_FUNCTION(zlib)
ZLIBG(compression_coding) = 0;
if (!ZLIBG(handler_registered)) {
ZLIBG(output_compression) = ZLIBG(output_compression_default);
- php_zlib_output_compression_start(TSRMLS_C);
+ php_zlib_output_compression_start();
}
return SUCCESS;
@@ -995,7 +997,7 @@ static PHP_RINIT_FUNCTION(zlib)
/* {{{ PHP_RSHUTDOWN_FUNCTION */
static PHP_RSHUTDOWN_FUNCTION(zlib)
{
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
ZLIBG(handler_registered) = 0;
return SUCCESS;
@@ -1020,6 +1022,9 @@ static PHP_MINFO_FUNCTION(zlib)
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
static PHP_GINIT_FUNCTION(zlib)
{
+#if defined(COMPILE_DL_ZLIB) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
zlib_globals->ob_gzhandler = NULL;
zlib_globals->handler_registered = 0;
}
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 2f0d1f7706..6f7a872788 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -58,7 +58,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_zlib_filter_data *data;
php_stream_bucket *bucket;
@@ -76,7 +76,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < (unsigned int) bucket->buflen) {
@@ -98,7 +98,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
data->finished = '\1';
} else if (status != Z_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
/* reset these because despite the error the filter may be used again */
data->strm.next_in = data->inbuf;
data->strm.avail_in = 0;
@@ -112,20 +112,20 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
} else if (status == Z_STREAM_END && data->strm.avail_out >= data->outbuf_len) {
/* no more data to decompress, and nothing was spat out */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_PASS_ON;
}
}
consumed += bucket->buflen;
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (!data->finished && flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -136,8 +136,8 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -152,7 +152,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
return exit_status;
}
-static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_zlib_inflate_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_zlib_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -181,7 +181,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC)
+ )
{
php_zlib_filter_data *data;
php_stream_bucket *bucket;
@@ -201,7 +201,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
bucket = buckets_in->head;
- bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(bucket);
while (bin < (unsigned int) bucket->buflen) {
desired = bucket->buflen - bin;
@@ -214,7 +214,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH));
if (status != Z_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -226,15 +226,15 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
consumed += bucket->buflen;
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -245,8 +245,8 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -261,7 +261,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
return exit_status;
}
-static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_zlib_deflate_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_zlib_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -282,7 +282,7 @@ static php_stream_filter_ops php_zlib_deflate_ops = {
/* {{{ zlib.* common factory */
-static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_zlib_filter_data *data;
@@ -291,7 +291,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_zlib_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_zlib_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_zlib_filter_data));
return NULL;
}
@@ -303,14 +303,14 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
data->strm.avail_out = data->outbuf_len = data->inbuf_len = 0x8000;
data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent);
if (!data->inbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len);
pefree(data, persistent);
return NULL;
}
data->strm.avail_in = 0;
data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent);
if (!data->outbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->outbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
@@ -332,7 +332,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
ZVAL_DUP(&tmp, tmpzval);
convert_to_long(&tmp);
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 32) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
} else {
windowBits = Z_LVAL(tmp);
}
@@ -365,7 +365,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* Memory Level (1 - 9) */
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > MAX_MEM_LEVEL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for memory level. (%pd)", Z_LVAL(tmp));
} else {
memLevel = Z_LVAL(tmp);
}
@@ -377,7 +377,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* log-2 base of history window (9 - 15) */
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 16) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
} else {
windowBits = Z_LVAL(tmp);
}
@@ -400,13 +400,13 @@ factory_setlevel:
/* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
if (Z_LVAL(tmp) < -1 || Z_LVAL(tmp) > 9) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid compression level specified. (%pd)", Z_LVAL(tmp));
} else {
level = Z_LVAL(tmp);
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored");
+ php_error_docref(NULL, E_WARNING, "Invalid filter parameter, ignored");
}
}
status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0);
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index 796b8a54e0..329180bc3b 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -32,7 +32,7 @@ struct php_gz_stream_data_t {
php_stream *stream;
};
-static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_gziop_read(php_stream *stream, char *buf, size_t count)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int read;
@@ -47,7 +47,7 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_
return (size_t)((read < 0) ? 0 : read);
}
-static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int wrote;
@@ -58,14 +58,14 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count
return (size_t)((wrote < 0) ? 0 : wrote);
}
-static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
assert(self != NULL);
if (whence == SEEK_END) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SEEK_END is not supported");
+ php_error_docref(NULL, E_WARNING, "SEEK_END is not supported");
return -1;
}
*newoffs = gzseek(self->gz_file, offset, whence);
@@ -73,7 +73,7 @@ static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zen
return (*newoffs < 0) ? -1 : 0;
}
-static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_gziop_close(php_stream *stream, int close_handle)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int ret = EOF;
@@ -93,7 +93,7 @@ static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
return ret;
}
-static int php_gziop_flush(php_stream *stream TSRMLS_DC)
+static int php_gziop_flush(php_stream *stream)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
@@ -111,7 +111,7 @@ php_stream_ops php_stream_gzio_ops = {
};
php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ char **opened_path, php_stream_context *context STREAMS_DC)
{
struct php_gz_stream_data_t *self;
php_stream *stream = NULL, *innerstream = NULL;
@@ -119,7 +119,7 @@ php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, con
/* sanity check the stream: it can be either read-only or write-only */
if (strchr(mode, '+')) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!");
+ php_error_docref(NULL, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!");
}
return NULL;
}
@@ -152,7 +152,7 @@ php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, con
efree(self);
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzopen failed");
+ php_error_docref(NULL, E_WARNING, "gzopen failed");
}
}
diff --git a/main/SAPI.c b/main/SAPI.c
index b1be4443d2..b05b14be5e 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -62,14 +62,17 @@ static void _type_dtor(zval *zv)
free(Z_PTR_P(zv));
}
-static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC)
+static void sapi_globals_ctor(sapi_globals_struct *sapi_globals)
{
+#ifdef ZTS
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(sapi_globals, 0, sizeof(*sapi_globals));
zend_hash_init_ex(&sapi_globals->known_post_content_types, 8, NULL, _type_dtor, 1, 0);
- php_setup_sapi_content_types(TSRMLS_C);
+ php_setup_sapi_content_types();
}
-static void sapi_globals_dtor(sapi_globals_struct *sapi_globals TSRMLS_DC)
+static void sapi_globals_dtor(sapi_globals_struct *sapi_globals)
{
zend_hash_destroy(&sapi_globals->known_post_content_types);
}
@@ -130,11 +133,11 @@ PHP_FUNCTION(header_register_callback)
{
zval *callback_func;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callback_func) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callback_func) == FAILURE) {
return;
}
- if (!zend_is_callable(callback_func, 0, NULL TSRMLS_CC)) {
+ if (!zend_is_callable(callback_func, 0, NULL)) {
RETURN_FALSE;
}
@@ -149,17 +152,17 @@ PHP_FUNCTION(header_register_callback)
}
/* }}} */
-static void sapi_run_header_callback(TSRMLS_D)
+static void sapi_run_header_callback(void)
{
int error;
zend_fcall_info fci;
char *callback_error = NULL;
zval retval;
- if (zend_fcall_info_init(&SG(callback_func), 0, &fci, &SG(fci_cache), NULL, &callback_error TSRMLS_CC) == SUCCESS) {
+ if (zend_fcall_info_init(&SG(callback_func), 0, &fci, &SG(fci_cache), NULL, &callback_error) == SUCCESS) {
fci.retval = &retval;
- error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC);
+ error = zend_call_function(&fci, &SG(fci_cache));
if (error == FAILURE) {
goto callback_failed;
} else {
@@ -167,7 +170,7 @@ static void sapi_run_header_callback(TSRMLS_D)
}
} else {
callback_failed:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the sapi_header_callback");
+ php_error_docref(NULL, E_WARNING, "Could not call the sapi_header_callback");
}
if (callback_error) {
@@ -175,23 +178,23 @@ callback_failed:
}
}
-SAPI_API void sapi_handle_post(void *arg TSRMLS_DC)
+SAPI_API void sapi_handle_post(void *arg)
{
if (SG(request_info).post_entry && SG(request_info).content_type_dup) {
- SG(request_info).post_entry->post_handler(SG(request_info).content_type_dup, arg TSRMLS_CC);
+ SG(request_info).post_entry->post_handler(SG(request_info).content_type_dup, arg);
efree(SG(request_info).content_type_dup);
SG(request_info).content_type_dup = NULL;
}
}
-static void sapi_read_post_data(TSRMLS_D)
+static void sapi_read_post_data(void)
{
sapi_post_entry *post_entry;
uint content_type_length = (uint)strlen(SG(request_info).content_type);
char *content_type = estrndup(SG(request_info).content_type, content_type_length);
char *p;
char oldchar=0;
- void (*post_reader_func)(TSRMLS_D) = NULL;
+ void (*post_reader_func)(void) = NULL;
/* dedicated implementation for increased performance:
@@ -236,15 +239,15 @@ static void sapi_read_post_data(TSRMLS_D)
SG(request_info).content_type_dup = content_type;
if(post_reader_func) {
- post_reader_func(TSRMLS_C);
+ post_reader_func();
}
if(sapi_module.default_post_reader) {
- sapi_module.default_post_reader(TSRMLS_C);
+ sapi_module.default_post_reader();
}
}
-SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC)
+SAPI_API int sapi_read_post_block(char *buffer, size_t buflen)
{
int read_bytes;
@@ -252,7 +255,7 @@ SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC)
return -1;
}
- read_bytes = (int)sapi_module.read_post(buffer, buflen TSRMLS_CC);
+ read_bytes = (int)sapi_module.read_post(buffer, buflen);
if (read_bytes > 0) {
/* gogo */
@@ -269,7 +272,7 @@ SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC)
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
{
if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %pd bytes exceeds the limit of %pd bytes",
+ php_error_docref(NULL, E_WARNING, "POST Content-Length of %pd bytes exceeds the limit of %pd bytes",
SG(request_info).content_length, SG(post_max_size));
return;
}
@@ -283,14 +286,14 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
for (;;) {
char buffer[SAPI_POST_BLOCK_SIZE];
- read_bytes = sapi_read_post_block(buffer, SAPI_POST_BLOCK_SIZE TSRMLS_CC);
+ read_bytes = sapi_read_post_block(buffer, SAPI_POST_BLOCK_SIZE);
if (read_bytes > 0) {
php_stream_write(SG(request_info).request_body, buffer, read_bytes);
}
if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds " ZEND_LONG_FMT " bytes", SG(post_max_size));
+ php_error_docref(NULL, E_WARNING, "Actual POST length does not match Content-Length, and exceeds " ZEND_LONG_FMT " bytes", SG(post_max_size));
break;
}
@@ -304,7 +307,7 @@ SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
}
-static inline char *get_default_content_type(uint prefix_len, uint *len TSRMLS_DC)
+static inline char *get_default_content_type(uint prefix_len, uint *len)
{
char *mimetype, *charset, *content_type;
uint mimetype_len, charset_len;
@@ -344,19 +347,19 @@ static inline char *get_default_content_type(uint prefix_len, uint *len TSRMLS_D
}
-SAPI_API char *sapi_get_default_content_type(TSRMLS_D)
+SAPI_API char *sapi_get_default_content_type(void)
{
uint len;
- return get_default_content_type(0, &len TSRMLS_CC);
+ return get_default_content_type(0, &len);
}
-SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC)
+SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header)
{
uint len;
- default_header->header = get_default_content_type(sizeof("Content-type: ")-1, &len TSRMLS_CC);
+ default_header->header = get_default_content_type(sizeof("Content-type: ")-1, &len);
default_header->header_len = len;
memcpy(default_header->header, "Content-type: ", sizeof("Content-type: ") - 1);
}
@@ -372,7 +375,7 @@ SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_h
* unchanged, 0 is returned.
*
*/
-SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC)
+SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len)
{
char *charset, *newtype;
size_t newlen;
@@ -393,7 +396,7 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC
return 0;
}
-SAPI_API void sapi_activate_headers_only(TSRMLS_D)
+SAPI_API void sapi_activate_headers_only(void)
{
if (SG(request_info).headers_read == 1)
return;
@@ -423,13 +426,13 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D)
SG(request_info).headers_only = 0;
}
if (SG(server_context)) {
- SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C);
+ SG(request_info).cookie_data = sapi_module.read_cookies();
if (sapi_module.activate) {
- sapi_module.activate(TSRMLS_C);
+ sapi_module.activate();
}
}
if (sapi_module.input_filter_init ) {
- sapi_module.input_filter_init(TSRMLS_C);
+ sapi_module.input_filter_init();
}
}
@@ -437,7 +440,7 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D)
* Called from php_request_startup() for every request.
*/
-SAPI_API void sapi_activate(TSRMLS_D)
+SAPI_API void sapi_activate(void)
{
zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0);
SG(sapi_headers).send_default_content_type = 1;
@@ -475,25 +478,25 @@ SAPI_API void sapi_activate(TSRMLS_D)
&& !strcmp(SG(request_info).request_method, "POST")) {
/* HTTP POST may contain form data to be processed into variables
* depending on given content type */
- sapi_read_post_data(TSRMLS_C);
+ sapi_read_post_data();
} else {
SG(request_info).content_type_dup = NULL;
}
/* Cookies */
- SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C);
+ SG(request_info).cookie_data = sapi_module.read_cookies();
if (sapi_module.activate) {
- sapi_module.activate(TSRMLS_C);
+ sapi_module.activate();
}
}
if (sapi_module.input_filter_init) {
- sapi_module.input_filter_init(TSRMLS_C);
+ sapi_module.input_filter_init();
}
}
-static void sapi_send_headers_free(TSRMLS_D)
+static void sapi_send_headers_free(void)
{
if (SG(sapi_headers).http_status_line) {
efree(SG(sapi_headers).http_status_line);
@@ -501,7 +504,7 @@ static void sapi_send_headers_free(TSRMLS_D)
}
}
-SAPI_API void sapi_deactivate(TSRMLS_D)
+SAPI_API void sapi_deactivate(void)
{
zend_llist_destroy(&SG(sapi_headers).headers);
if (SG(request_info).request_body) {
@@ -513,7 +516,7 @@ SAPI_API void sapi_deactivate(TSRMLS_D)
int read_bytes;
do {
- read_bytes = sapi_read_post_block(dummy, SAPI_POST_BLOCK_SIZE TSRMLS_CC);
+ read_bytes = sapi_read_post_block(dummy, SAPI_POST_BLOCK_SIZE);
} while (SAPI_POST_BLOCK_SIZE == read_bytes);
}
}
@@ -533,16 +536,16 @@ SAPI_API void sapi_deactivate(TSRMLS_D)
efree(SG(request_info).current_user);
}
if (sapi_module.deactivate) {
- sapi_module.deactivate(TSRMLS_C);
+ sapi_module.deactivate();
}
if (SG(rfc1867_uploaded_files)) {
- destroy_uploaded_files_hash(TSRMLS_C);
+ destroy_uploaded_files_hash();
}
if (SG(sapi_headers).mimetype) {
efree(SG(sapi_headers).mimetype);
SG(sapi_headers).mimetype = NULL;
}
- sapi_send_headers_free(TSRMLS_C);
+ sapi_send_headers_free();
SG(sapi_started) = 0;
SG(headers_sent) = 0;
SG(callback_run) = 0;
@@ -552,7 +555,7 @@ SAPI_API void sapi_deactivate(TSRMLS_D)
}
-SAPI_API void sapi_initialize_empty_request(TSRMLS_D)
+SAPI_API void sapi_initialize_empty_request(void)
{
SG(server_context) = NULL;
SG(request_info).request_method = NULL;
@@ -577,7 +580,7 @@ static int sapi_extract_response_code(const char *header_line)
}
-static void sapi_update_response_code(int ncode TSRMLS_DC)
+static void sapi_update_response_code(int ncode)
{
/* if the status code did not change, we do not want
to change the status line, and no need to change the code */
@@ -624,7 +627,7 @@ static void sapi_remove_header(zend_llist *l, char *name, uint len) {
}
}
-SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC)
+SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace)
{
sapi_header_line ctr = {0};
int r;
@@ -633,7 +636,7 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo
ctr.line_len = header_line_len;
r = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD,
- &ctr TSRMLS_CC);
+ &ctr);
if (!duplicate)
efree(header_line);
@@ -641,10 +644,10 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo
return r;
}
-static void sapi_header_add_op(sapi_header_op_enum op, sapi_header_struct *sapi_header TSRMLS_DC)
+static void sapi_header_add_op(sapi_header_op_enum op, sapi_header_struct *sapi_header)
{
if (!sapi_module.header_handler ||
- (SAPI_HEADER_ADD & sapi_module.header_handler(sapi_header, op, &SG(sapi_headers) TSRMLS_CC))) {
+ (SAPI_HEADER_ADD & sapi_module.header_handler(sapi_header, op, &SG(sapi_headers)))) {
if (op == SAPI_HEADER_REPLACE) {
char *colon_offset = strchr(sapi_header->header, ':');
@@ -662,7 +665,7 @@ static void sapi_header_add_op(sapi_header_op_enum op, sapi_header_struct *sapi_
}
}
-SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
+SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg)
{
sapi_header_struct sapi_header;
char *colon_offset;
@@ -671,8 +674,8 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
int http_response_code;
if (SG(headers_sent) && !SG(request_info).no_headers) {
- const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
- int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
if (output_start_filename) {
sapi_module.sapi_error(E_WARNING, "Cannot modify header information - headers already sent by (output started at %s:%d)",
@@ -685,7 +688,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
switch (op) {
case SAPI_HEADER_SET_STATUS:
- sapi_update_response_code((int)(zend_intptr_t) arg TSRMLS_CC);
+ sapi_update_response_code((int)(zend_intptr_t) arg);
return SUCCESS;
case SAPI_HEADER_ADD:
@@ -704,7 +707,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
case SAPI_HEADER_DELETE_ALL:
if (sapi_module.header_handler) {
- sapi_module.header_handler(&sapi_header, op, &SG(sapi_headers) TSRMLS_CC);
+ sapi_module.header_handler(&sapi_header, op, &SG(sapi_headers));
}
zend_llist_clean(&SG(sapi_headers).headers);
return SUCCESS;
@@ -732,7 +735,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
if (sapi_module.header_handler) {
sapi_header.header = header_line;
sapi_header.header_len = header_line_len;
- sapi_module.header_handler(&sapi_header, op, &SG(sapi_headers) TSRMLS_CC);
+ sapi_module.header_handler(&sapi_header, op, &SG(sapi_headers));
}
sapi_remove_header(&SG(sapi_headers).headers, header_line, header_line_len);
efree(header_line);
@@ -768,7 +771,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
if (header_line_len>=5
&& !strncasecmp(header_line, "HTTP/", 5)) {
/* filter out the response code */
- sapi_update_response_code(sapi_extract_response_code(header_line) TSRMLS_CC);
+ sapi_update_response_code(sapi_extract_response_code(header_line));
/* sapi_update_response_code doesn't free the status line if the code didn't change */
if (SG(sapi_headers).http_status_line) {
efree(SG(sapi_headers).http_status_line);
@@ -795,7 +798,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
}
mimetype = estrdup(ptr);
- newlen = sapi_apply_default_charset(&mimetype, len TSRMLS_CC);
+ newlen = sapi_apply_default_charset(&mimetype, len);
if (!SG(sapi_headers).mimetype){
SG(sapi_headers).mimetype = estrdup(mimetype);
}
@@ -827,18 +830,18 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
SG(sapi_headers).http_response_code != 201) {
/* Return a Found Redirect if one is not already specified */
if (http_response_code) { /* user specified redirect code */
- sapi_update_response_code(http_response_code TSRMLS_CC);
+ sapi_update_response_code(http_response_code);
} else if (SG(request_info).proto_num > 1000 &&
SG(request_info).request_method &&
strcmp(SG(request_info).request_method, "HEAD") &&
strcmp(SG(request_info).request_method, "GET")) {
- sapi_update_response_code(303 TSRMLS_CC);
+ sapi_update_response_code(303);
} else {
- sapi_update_response_code(302 TSRMLS_CC);
+ sapi_update_response_code(302);
}
}
} else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */
- sapi_update_response_code(401 TSRMLS_CC); /* authentication-required */
+ sapi_update_response_code(401); /* authentication-required */
}
if (sapi_header.header==header_line) {
*colon_offset = ':';
@@ -846,14 +849,14 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
}
}
if (http_response_code) {
- sapi_update_response_code(http_response_code TSRMLS_CC);
+ sapi_update_response_code(http_response_code);
}
- sapi_header_add_op(op, &sapi_header TSRMLS_CC);
+ sapi_header_add_op(op, &sapi_header);
return SUCCESS;
}
-SAPI_API int sapi_send_headers(TSRMLS_D)
+SAPI_API int sapi_send_headers(void)
{
int retval;
int ret = FAILURE;
@@ -869,24 +872,24 @@ SAPI_API int sapi_send_headers(TSRMLS_D)
sapi_header_struct default_header;
uint len;
- SG(sapi_headers).mimetype = get_default_content_type(0, &len TSRMLS_CC);
+ SG(sapi_headers).mimetype = get_default_content_type(0, &len);
default_header.header_len = sizeof("Content-type: ") - 1 + len;
default_header.header = emalloc(default_header.header_len + 1);
memcpy(default_header.header, "Content-type: ", sizeof("Content-type: ") - 1);
memcpy(default_header.header + sizeof("Content-type: ") - 1, SG(sapi_headers).mimetype, len + 1);
- sapi_header_add_op(SAPI_HEADER_ADD, &default_header TSRMLS_CC);
+ sapi_header_add_op(SAPI_HEADER_ADD, &default_header);
SG(sapi_headers).send_default_content_type = 0;
}
if (Z_TYPE(SG(callback_func)) != IS_UNDEF && !SG(callback_run)) {
SG(callback_run) = 1;
- sapi_run_header_callback(TSRMLS_C);
+ sapi_run_header_callback();
}
SG(headers_sent) = 1;
if (sapi_module.send_headers) {
- retval = sapi_module.send_headers(&SG(sapi_headers) TSRMLS_CC);
+ retval = sapi_module.send_headers(&SG(sapi_headers));
} else {
retval = SAPI_HEADER_DO_SEND;
}
@@ -906,17 +909,17 @@ SAPI_API int sapi_send_headers(TSRMLS_D)
http_status_line.header = buf;
http_status_line.header_len = slprintf(buf, sizeof(buf), "HTTP/1.0 %d X", SG(sapi_headers).http_response_code);
}
- sapi_module.send_header(&http_status_line, SG(server_context) TSRMLS_CC);
+ sapi_module.send_header(&http_status_line, SG(server_context));
}
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) sapi_module.send_header, SG(server_context) TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) sapi_module.send_header, SG(server_context));
if(SG(sapi_headers).send_default_content_type) {
sapi_header_struct default_header;
- sapi_get_default_content_type_header(&default_header TSRMLS_CC);
- sapi_module.send_header(&default_header, SG(server_context) TSRMLS_CC);
+ sapi_get_default_content_type_header(&default_header);
+ sapi_module.send_header(&default_header, SG(server_context));
sapi_free_header(&default_header);
}
- sapi_module.send_header(NULL, SG(server_context) TSRMLS_CC);
+ sapi_module.send_header(NULL, SG(server_context));
ret = SUCCESS;
break;
case SAPI_HEADER_SEND_FAILED:
@@ -925,18 +928,18 @@ SAPI_API int sapi_send_headers(TSRMLS_D)
break;
}
- sapi_send_headers_free(TSRMLS_C);
+ sapi_send_headers_free();
return ret;
}
-SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC)
+SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries)
{
sapi_post_entry *p=post_entries;
while (p->content_type) {
- if (sapi_register_post_entry(p TSRMLS_CC) == FAILURE) {
+ if (sapi_register_post_entry(p) == FAILURE) {
return FAILURE;
}
p++;
@@ -945,7 +948,7 @@ SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC)
}
-SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
+SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry)
{
if (SG(sapi_started) && EG(current_execute_data)) {
return FAILURE;
@@ -955,7 +958,7 @@ SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
(void *) post_entry, sizeof(sapi_post_entry)) ? SUCCESS : FAILURE;
}
-SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
+SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry)
{
if (SG(sapi_started) && EG(current_execute_data)) {
return;
@@ -965,7 +968,7 @@ SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
}
-SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC)
+SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(void))
{
if (SG(sapi_started) && EG(current_execute_data)) {
return FAILURE;
@@ -975,7 +978,7 @@ SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRML
}
-SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC)
+SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray))
{
if (SG(sapi_started) && EG(current_execute_data)) {
return FAILURE;
@@ -984,7 +987,7 @@ SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zva
return SUCCESS;
}
-SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC)
+SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int (*input_filter_init)(void))
{
if (SG(sapi_started) && EG(current_execute_data)) {
return FAILURE;
@@ -994,20 +997,20 @@ SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, ch
return SUCCESS;
}
-SAPI_API int sapi_flush(TSRMLS_D)
+SAPI_API int sapi_flush(void)
{
if (sapi_module.flush) {
- sapi_module.flush(SG(server_context) TSRMLS_CC);
+ sapi_module.flush(SG(server_context));
return SUCCESS;
} else {
return FAILURE;
}
}
-SAPI_API zend_stat_t *sapi_get_stat(TSRMLS_D)
+SAPI_API zend_stat_t *sapi_get_stat(void)
{
if (sapi_module.get_stat) {
- return sapi_module.get_stat(TSRMLS_C);
+ return sapi_module.get_stat();
} else {
if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat)) == -1)) {
return NULL;
@@ -1016,66 +1019,66 @@ SAPI_API zend_stat_t *sapi_get_stat(TSRMLS_D)
}
}
-SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC)
+SAPI_API char *sapi_getenv(char *name, size_t name_len)
{
if (sapi_module.getenv) {
- char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC);
+ char *value, *tmp = sapi_module.getenv(name, name_len);
if (tmp) {
value = estrdup(tmp);
} else {
return NULL;
}
if (sapi_module.input_filter) {
- sapi_module.input_filter(PARSE_STRING, name, &value, strlen(value), NULL TSRMLS_CC);
+ sapi_module.input_filter(PARSE_STRING, name, &value, strlen(value), NULL);
}
return value;
}
return NULL;
}
-SAPI_API int sapi_get_fd(int *fd TSRMLS_DC)
+SAPI_API int sapi_get_fd(int *fd)
{
if (sapi_module.get_fd) {
- return sapi_module.get_fd(fd TSRMLS_CC);
+ return sapi_module.get_fd(fd);
} else {
return FAILURE;
}
}
-SAPI_API int sapi_force_http_10(TSRMLS_D)
+SAPI_API int sapi_force_http_10(void)
{
if (sapi_module.force_http_10) {
- return sapi_module.force_http_10(TSRMLS_C);
+ return sapi_module.force_http_10();
} else {
return FAILURE;
}
}
-SAPI_API int sapi_get_target_uid(uid_t *obj TSRMLS_DC)
+SAPI_API int sapi_get_target_uid(uid_t *obj)
{
if (sapi_module.get_target_uid) {
- return sapi_module.get_target_uid(obj TSRMLS_CC);
+ return sapi_module.get_target_uid(obj);
} else {
return FAILURE;
}
}
-SAPI_API int sapi_get_target_gid(gid_t *obj TSRMLS_DC)
+SAPI_API int sapi_get_target_gid(gid_t *obj)
{
if (sapi_module.get_target_gid) {
- return sapi_module.get_target_gid(obj TSRMLS_CC);
+ return sapi_module.get_target_gid(obj);
} else {
return FAILURE;
}
}
-SAPI_API double sapi_get_request_time(TSRMLS_D)
+SAPI_API double sapi_get_request_time(void)
{
if(SG(global_request_time)) return SG(global_request_time);
if (sapi_module.get_request_time && SG(server_context)) {
- SG(global_request_time) = sapi_module.get_request_time(TSRMLS_C);
+ SG(global_request_time) = sapi_module.get_request_time();
} else {
struct timeval tp = {0};
if (!gettimeofday(&tp, NULL)) {
@@ -1087,9 +1090,9 @@ SAPI_API double sapi_get_request_time(TSRMLS_D)
return SG(global_request_time);
}
-SAPI_API void sapi_terminate_process(TSRMLS_D) {
+SAPI_API void sapi_terminate_process(void) {
if (sapi_module.terminate_process) {
- sapi_module.terminate_process(TSRMLS_C);
+ sapi_module.terminate_process();
}
}
diff --git a/main/SAPI.h b/main/SAPI.h
index 79661371d9..bb523604bd 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -142,7 +142,7 @@ typedef struct _sapi_globals_struct {
BEGIN_EXTERN_C()
#ifdef ZTS
-# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
+# define SG(v) ZEND_TSRMG(sapi_globals_id, sapi_globals_struct *, v)
SAPI_API extern int sapi_globals_id;
#else
# define SG(v) (sapi_globals.v)
@@ -151,9 +151,9 @@ extern SAPI_API sapi_globals_struct sapi_globals;
SAPI_API void sapi_startup(sapi_module_struct *sf);
SAPI_API void sapi_shutdown(void);
-SAPI_API void sapi_activate(TSRMLS_D);
-SAPI_API void sapi_deactivate(TSRMLS_D);
-SAPI_API void sapi_initialize_empty_request(TSRMLS_D);
+SAPI_API void sapi_activate(void);
+SAPI_API void sapi_deactivate(void);
+SAPI_API void sapi_initialize_empty_request(void);
END_EXTERN_C()
/*
@@ -182,40 +182,40 @@ typedef enum { /* Parameter: */
} sapi_header_op_enum;
BEGIN_EXTERN_C()
-SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC);
+SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg);
/* Deprecated functions. Use sapi_header_op instead. */
-SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC);
-#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1 TSRMLS_CC)
+SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace);
+#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1)
-SAPI_API int sapi_send_headers(TSRMLS_D);
+SAPI_API int sapi_send_headers(void);
SAPI_API void sapi_free_header(sapi_header_struct *sapi_header);
-SAPI_API void sapi_handle_post(void *arg TSRMLS_DC);
-SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC);
-SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry TSRMLS_DC);
-SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
-SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
-SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC);
-SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC);
-SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
-
-SAPI_API int sapi_flush(TSRMLS_D);
-SAPI_API zend_stat_t *sapi_get_stat(TSRMLS_D);
-SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC);
-
-SAPI_API char *sapi_get_default_content_type(TSRMLS_D);
-SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC);
-SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC);
-SAPI_API void sapi_activate_headers_only(TSRMLS_D);
-
-SAPI_API int sapi_get_fd(int *fd TSRMLS_DC);
-SAPI_API int sapi_force_http_10(TSRMLS_D);
-
-SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC);
-SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC);
-SAPI_API double sapi_get_request_time(TSRMLS_D);
-SAPI_API void sapi_terminate_process(TSRMLS_D);
+SAPI_API void sapi_handle_post(void *arg);
+SAPI_API int sapi_read_post_block(char *buffer, size_t buflen);
+SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry);
+SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry);
+SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry);
+SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(void));
+SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray));
+SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int (*input_filter_init)(void));
+
+SAPI_API int sapi_flush(void);
+SAPI_API zend_stat_t *sapi_get_stat(void);
+SAPI_API char *sapi_getenv(char *name, size_t name_len);
+
+SAPI_API char *sapi_get_default_content_type(void);
+SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header);
+SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len);
+SAPI_API void sapi_activate_headers_only(void);
+
+SAPI_API int sapi_get_fd(int *fd);
+SAPI_API int sapi_force_http_10(void);
+
+SAPI_API int sapi_get_target_uid(uid_t *);
+SAPI_API int sapi_get_target_gid(gid_t *);
+SAPI_API double sapi_get_request_time(void);
+SAPI_API void sapi_terminate_process(void);
END_EXTERN_C()
struct _sapi_module_struct {
@@ -225,63 +225,63 @@ struct _sapi_module_struct {
int (*startup)(struct _sapi_module_struct *sapi_module);
int (*shutdown)(struct _sapi_module_struct *sapi_module);
- int (*activate)(TSRMLS_D);
- int (*deactivate)(TSRMLS_D);
+ int (*activate)(void);
+ int (*deactivate)(void);
- size_t (*ub_write)(const char *str, size_t str_length TSRMLS_DC);
- void (*flush)(void *server_context TSRMLS_DC);
- zend_stat_t *(*get_stat)(TSRMLS_D);
- char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
+ size_t (*ub_write)(const char *str, size_t str_length);
+ void (*flush)(void *server_context);
+ zend_stat_t *(*get_stat)(void);
+ char *(*getenv)(char *name, size_t name_len);
void (*sapi_error)(int type, const char *error_msg, ...);
- int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
- int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
- void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC);
+ int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
+ int (*send_headers)(sapi_headers_struct *sapi_headers);
+ void (*send_header)(sapi_header_struct *sapi_header, void *server_context);
- size_t (*read_post)(char *buffer, size_t count_bytes TSRMLS_DC);
- char *(*read_cookies)(TSRMLS_D);
+ size_t (*read_post)(char *buffer, size_t count_bytes);
+ char *(*read_cookies)(void);
- void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
- void (*log_message)(char *message TSRMLS_DC);
- double (*get_request_time)(TSRMLS_D);
- void (*terminate_process)(TSRMLS_D);
+ void (*register_server_variables)(zval *track_vars_array);
+ void (*log_message)(char *message);
+ double (*get_request_time)(void);
+ void (*terminate_process)(void);
char *php_ini_path_override;
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
- void (*default_post_reader)(TSRMLS_D);
- void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC);
+ void (*default_post_reader)(void);
+ void (*treat_data)(int arg, char *str, zval *destArray);
char *executable_location;
int php_ini_ignore;
int php_ini_ignore_cwd; /* don't look for php.ini in the current directory */
- int (*get_fd)(int *fd TSRMLS_DC);
+ int (*get_fd)(int *fd);
- int (*force_http_10)(TSRMLS_D);
+ int (*force_http_10)(void);
- int (*get_target_uid)(uid_t * TSRMLS_DC);
- int (*get_target_gid)(gid_t * TSRMLS_DC);
+ int (*get_target_uid)(uid_t *);
+ int (*get_target_gid)(gid_t *);
- unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC);
+ unsigned int (*input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
void (*ini_defaults)(HashTable *configuration_hash);
int phpinfo_as_text;
char *ini_entries;
const zend_function_entry *additional_functions;
- unsigned int (*input_filter_init)(TSRMLS_D);
+ unsigned int (*input_filter_init)(void);
};
struct _sapi_post_entry {
char *content_type;
uint content_type_len;
- void (*post_reader)(TSRMLS_D);
- void (*post_handler)(char *content_type_dup, void *arg TSRMLS_DC);
+ void (*post_reader)(void);
+ void (*post_handler)(char *content_type_dup, void *arg);
};
/* header_handler() constants */
@@ -296,11 +296,11 @@ struct _sapi_post_entry {
#define SAPI_DEFAULT_CHARSET PHP_DEFAULT_CHARSET
#define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION
-#define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D)
-#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg TSRMLS_DC)
+#define SAPI_POST_READER_FUNC(post_reader) void post_reader(void)
+#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg)
-#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC)
-#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC)
+#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray)
+#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len)
BEGIN_EXTERN_C()
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data);
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index b5b12eba56..9a53276be0 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -118,7 +118,7 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
*end = '\0';
end++;
}
- if (php_check_open_basedir_ex(ptr, 0 TSRMLS_CC) != 0) {
+ if (php_check_open_basedir_ex(ptr, 0) != 0) {
/* At least one portion of this open_basedir is less restrictive than the prior one, FAIL */
efree(pathbuf);
return FAILURE;
@@ -139,7 +139,7 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
open_basedir. Returns -1 if error or not in the open_basedir, else 0.
When open_basedir is NULL, always return 0.
*/
-PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC)
+PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path)
{
char resolved_name[MAXPATHLEN];
char resolved_basedir[MAXPATHLEN];
@@ -164,7 +164,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
}
/* normalize and expand path */
- if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) {
+ if (expand_filepath(path, resolved_name) == NULL) {
return -1;
}
@@ -225,7 +225,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
}
/* Resolve open_basedir to resolved_basedir */
- if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) {
+ if (expand_filepath(local_open_basedir, resolved_basedir) != NULL) {
int basedir_len = (int)strlen(basedir);
/* Handler for basedirs that end with a / */
resolved_basedir_len = (int)strlen(resolved_basedir);
@@ -284,14 +284,14 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
}
/* }}} */
-PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+PHPAPI int php_check_open_basedir(const char *path)
{
- return php_check_open_basedir_ex(path, 1 TSRMLS_CC);
+ return php_check_open_basedir_ex(path, 1);
}
/* {{{ php_check_open_basedir
*/
-PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn)
{
/* Only check when open_basedir is available */
if (PG(open_basedir) && *PG(open_basedir)) {
@@ -302,7 +302,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
/* Check if the path is too long so we can give a more useful error
* message. */
if (strlen(path) > (MAXPATHLEN - 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File name is longer than the maximum allowed path length on this platform (%d): %s", MAXPATHLEN, path);
+ php_error_docref(NULL, E_WARNING, "File name is longer than the maximum allowed path length on this platform (%d): %s", MAXPATHLEN, path);
errno = EINVAL;
return -1;
}
@@ -318,7 +318,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
end++;
}
- if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) {
+ if (php_check_specific_open_basedir(ptr, path) == 0) {
efree(pathbuf);
return 0;
}
@@ -326,7 +326,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
ptr = end;
}
if (warn) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s)", path, PG(open_basedir));
+ php_error_docref(NULL, E_WARNING, "open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s)", path, PG(open_basedir));
}
efree(pathbuf);
errno = EPERM; /* we deny permission to open it */
@@ -340,16 +340,16 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
/* {{{ php_fopen_and_set_opened_path
*/
-static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC)
+static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path)
{
FILE *fp;
- if (php_check_open_basedir((char *)path TSRMLS_CC)) {
+ if (php_check_open_basedir((char *)path)) {
return NULL;
}
fp = VCWD_FOPEN(path, mode);
if (fp && opened_path) {
- *opened_path = expand_filepath_with_mode(path, NULL, NULL, 0, CWD_EXPAND TSRMLS_CC);
+ *opened_path = expand_filepath_with_mode(path, NULL, NULL, 0, CWD_EXPAND);
}
return fp;
}
@@ -357,7 +357,7 @@ static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, c
/* {{{ php_fopen_primary_script
*/
-PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
+PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
{
char *path_info;
char *filename = NULL;
@@ -429,7 +429,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
if (filename) {
- resolved_path = zend_resolve_path(filename, (int)strlen(filename) TSRMLS_CC);
+ resolved_path = zend_resolve_path(filename, (int)strlen(filename));
}
if (!resolved_path) {
@@ -452,7 +452,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
orig_display_errors = PG(display_errors);
PG(display_errors) = 0;
- if (zend_stream_open(filename, file_handle TSRMLS_CC) == FAILURE) {
+ if (zend_stream_open(filename, file_handle) == FAILURE) {
PG(display_errors) = orig_display_errors;
if (SG(request_info).path_translated != filename) {
if (filename) {
@@ -481,7 +481,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
/* {{{ php_resolve_path
* Returns the realpath for given filename according to include path
*/
-PHPAPI char *php_resolve_path(const char *filename, int filename_length, const char *path TSRMLS_DC)
+PHPAPI char *php_resolve_path(const char *filename, int filename_length, const char *path)
{
char resolved_path[MAXPATHLEN];
char trypath[MAXPATHLEN];
@@ -496,9 +496,9 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
/* Don't resolve paths which contain protocol (except of file://) */
for (p = filename; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++);
if ((*p == ':') && (p - filename > 1) && (p[1] == '/') && (p[2] == '/')) {
- wrapper = php_stream_locate_url_wrapper(filename, &actual_path, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, &actual_path, STREAM_OPEN_FOR_INCLUDE);
if (wrapper == &php_plain_files_wrapper) {
- if (tsrm_realpath(actual_path, resolved_path TSRMLS_CC)) {
+ if (tsrm_realpath(actual_path, resolved_path)) {
return estrdup(resolved_path);
}
}
@@ -511,7 +511,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
IS_ABSOLUTE_PATH(filename, filename_length) ||
!path ||
!*path) {
- if (tsrm_realpath(filename, resolved_path TSRMLS_CC)) {
+ if (tsrm_realpath(filename, resolved_path)) {
return estrdup(resolved_path);
} else {
return NULL;
@@ -554,29 +554,29 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
}
actual_path = trypath;
if (is_stream_wrapper) {
- wrapper = php_stream_locate_url_wrapper(trypath, &actual_path, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(trypath, &actual_path, STREAM_OPEN_FOR_INCLUDE);
if (!wrapper) {
continue;
} else if (wrapper != &php_plain_files_wrapper) {
if (wrapper->wops->url_stat) {
php_stream_statbuf ssb;
- if (SUCCESS == wrapper->wops->url_stat(wrapper, trypath, 0, &ssb, NULL TSRMLS_CC)) {
+ if (SUCCESS == wrapper->wops->url_stat(wrapper, trypath, 0, &ssb, NULL)) {
return estrdup(trypath);
}
}
continue;
}
}
- if (tsrm_realpath(actual_path, resolved_path TSRMLS_CC)) {
+ if (tsrm_realpath(actual_path, resolved_path)) {
return estrdup(resolved_path);
}
} /* end provided path */
/* check in calling scripts' current working directory as a fall back case
*/
- if (zend_is_executing(TSRMLS_C)) {
- const char *exec_fname = zend_get_executed_filename(TSRMLS_C);
+ if (zend_is_executing()) {
+ const char *exec_fname = zend_get_executed_filename();
int exec_fname_length = (int)strlen(exec_fname);
while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length]));
@@ -590,14 +590,14 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
/* Check for stream wrapper */
for (p = trypath; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++);
if ((*p == ':') && (p - trypath > 1) && (p[1] == '/') && (p[2] == '/')) {
- wrapper = php_stream_locate_url_wrapper(trypath, &actual_path, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(trypath, &actual_path, STREAM_OPEN_FOR_INCLUDE);
if (!wrapper) {
return NULL;
} else if (wrapper != &php_plain_files_wrapper) {
if (wrapper->wops->url_stat) {
php_stream_statbuf ssb;
- if (SUCCESS == wrapper->wops->url_stat(wrapper, trypath, 0, &ssb, NULL TSRMLS_CC)) {
+ if (SUCCESS == wrapper->wops->url_stat(wrapper, trypath, 0, &ssb, NULL)) {
return estrdup(trypath);
}
}
@@ -605,7 +605,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
}
}
- if (tsrm_realpath(actual_path, resolved_path TSRMLS_CC)) {
+ if (tsrm_realpath(actual_path, resolved_path)) {
return estrdup(resolved_path);
}
}
@@ -619,7 +619,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
* Tries to open a file with a PATH-style list of directories.
* If the filename starts with "." or "/", the path is ignored.
*/
-PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC)
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path)
{
char *pathbuf, *ptr, *end;
const char *exec_fname;
@@ -645,15 +645,15 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
|| IS_ABSOLUTE_PATH(filename, filename_length)
|| (!path || (path && !*path))
) {
- return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
+ return php_fopen_and_set_opened_path(filename, mode, opened_path);
}
/* check in provided path */
/* append the calling scripts' current working directory
* as a fall back case
*/
- if (zend_is_executing(TSRMLS_C)) {
- exec_fname = zend_get_executed_filename(TSRMLS_C);
+ if (zend_is_executing()) {
+ exec_fname = zend_get_executed_filename();
exec_fname_length = (int)strlen(exec_fname);
path_length = (int)strlen(path);
@@ -681,9 +681,9 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
end++;
}
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
+ php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
}
- fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC);
+ fp = php_fopen_and_set_opened_path(trypath, mode, opened_path);
if (fp) {
efree(pathbuf);
return fp;
@@ -738,23 +738,23 @@ PHPAPI char *php_strip_url_passwd(char *url)
/* {{{ expand_filepath
*/
-PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
+PHPAPI char *expand_filepath(const char *filepath, char *real_path)
{
- return expand_filepath_ex(filepath, real_path, NULL, 0 TSRMLS_CC);
+ return expand_filepath_ex(filepath, real_path, NULL, 0);
}
/* }}} */
/* {{{ expand_filepath_ex
*/
-PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC)
+PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len)
{
- return expand_filepath_with_mode(filepath, real_path, relative_to, relative_to_len, CWD_FILEPATH TSRMLS_CC);
+ return expand_filepath_with_mode(filepath, real_path, relative_to, relative_to_len, CWD_FILEPATH);
}
/* }}} */
/* {{{ expand_filepath_use_realpath
*/
-PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC)
+PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode)
{
cwd_state new_state;
char cwd[MAXPATHLEN];
@@ -810,7 +810,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
new_state.cwd = estrdup(cwd);
new_state.cwd_length = (int)strlen(cwd);
- if (virtual_file_ex(&new_state, filepath, NULL, realpath_mode TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, filepath, NULL, realpath_mode)) {
efree(new_state.cwd);
return NULL;
}
diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h
index b58f54dce8..77fd69ef8c 100644
--- a/main/fopen_wrappers.h
+++ b/main/fopen_wrappers.h
@@ -25,30 +25,30 @@ BEGIN_EXTERN_C()
#include "php_globals.h"
#include "php_ini.h"
-PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC);
-PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
-PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC);
-PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int use_realpath TSRMLS_DC);
+PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle);
+PHPAPI char *expand_filepath(const char *filepath, char *real_path);
+PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len);
+PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int use_realpath);
-PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
-PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
-PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC);
+PHPAPI int php_check_open_basedir(const char *path);
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn);
+PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path);
/* {{{ OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */
#if PHP_API_VERSION < 20100412
# define OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
/* }}} */
-PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);
+PHPAPI int php_check_safe_mode_include_dir(const char *path);
-PHPAPI char *php_resolve_path(const char *filename, int filename_len, const char *path TSRMLS_DC);
+PHPAPI char *php_resolve_path(const char *filename, int filename_len, const char *path);
-PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC);
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path);
PHPAPI char *php_strip_url_passwd(char *path);
diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in
index 3f02921ddf..d04eea3103 100644
--- a/main/internal_functions.c.in
+++ b/main/internal_functions.c.in
@@ -35,9 +35,9 @@ static zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-PHPAPI int php_register_internal_extensions(TSRMLS_D)
+PHPAPI int php_register_internal_extensions(void)
{
- return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT);
}
/*
diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c
index dcb84c346c..298a9115c2 100644
--- a/main/internal_functions_nw.c
+++ b/main/internal_functions_nw.c
@@ -84,9 +84,9 @@ static zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-PHPAPI int php_register_internal_extensions(TSRMLS_D)
+PHPAPI int php_register_internal_extensions(void)
{
- return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT);
}
diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c
index b4718c379f..cb0234b4c3 100644
--- a/main/internal_functions_win32.c
+++ b/main/internal_functions_win32.c
@@ -189,9 +189,9 @@ static zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-PHPAPI int php_register_internal_extensions(TSRMLS_D)
+PHPAPI int php_register_internal_extensions(void)
{
- return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT);
}
/*
diff --git a/main/main.c b/main/main.c
index b58a643e84..276058ca3a 100644
--- a/main/main.c
+++ b/main/main.c
@@ -119,7 +119,7 @@
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
-PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions;
+PHPAPI int (*php_register_internal_extensions_func)(void) = php_register_internal_extensions;
#ifndef ZTS
php_core_globals core_globals;
@@ -130,7 +130,7 @@ PHPAPI int core_globals_id;
#ifdef PHP_WIN32
#include "win32_internal_function_disabled.h"
-static int php_win32_disable_functions(TSRMLS_D)
+static int php_win32_disable_functions(void)
{
int i;
@@ -182,14 +182,14 @@ static PHP_INI_MH(OnChangeMemoryLimit)
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
- return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
+ return zend_set_memory_limit(PG(memory_limit));
}
/* }}} */
/* {{{ php_disable_functions
*/
-static void php_disable_functions(TSRMLS_D)
+static void php_disable_functions(void)
{
char *s = NULL, *e;
@@ -207,7 +207,7 @@ static void php_disable_functions(TSRMLS_D)
case ',':
if (s) {
*e = '\0';
- zend_disable_function(s, e-s TSRMLS_CC);
+ zend_disable_function(s, e-s);
s = NULL;
}
break;
@@ -220,14 +220,14 @@ static void php_disable_functions(TSRMLS_D)
e++;
}
if (s) {
- zend_disable_function(s, e-s TSRMLS_CC);
+ zend_disable_function(s, e-s);
}
}
/* }}} */
/* {{{ php_disable_classes
*/
-static void php_disable_classes(TSRMLS_D)
+static void php_disable_classes(void)
{
char *s = NULL, *e;
@@ -243,7 +243,7 @@ static void php_disable_classes(TSRMLS_D)
case ',':
if (s) {
*e = '\0';
- zend_disable_class(s, e-s TSRMLS_CC);
+ zend_disable_class(s, e-s);
s = NULL;
}
break;
@@ -256,14 +256,14 @@ static void php_disable_classes(TSRMLS_D)
e++;
}
if (s) {
- zend_disable_class(s, e-s TSRMLS_CC);
+ zend_disable_class(s, e-s);
}
}
/* }}} */
/* {{{ php_binary_init
*/
-static void php_binary_init(TSRMLS_D)
+static void php_binary_init(void)
{
char *binary_location;
#ifdef PHP_WIN32
@@ -322,7 +322,7 @@ static PHP_INI_MH(OnUpdateTimeout)
ZEND_ATOL(EG(timeout_seconds), new_value->val);
return SUCCESS;
}
- zend_unset_timeout(TSRMLS_C);
+ zend_unset_timeout();
ZEND_ATOL(EG(timeout_seconds), new_value->val);
zend_set_timeout(EG(timeout_seconds), 0);
return SUCCESS;
@@ -376,7 +376,6 @@ static PHP_INI_DISP(display_errors_mode)
{
int mode, tmp_value_length, cgi_or_cli;
char *tmp_value;
- TSRMLS_FETCH();
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL );
@@ -423,7 +422,7 @@ static PHP_INI_DISP(display_errors_mode)
static PHP_INI_MH(OnUpdateInternalEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
PG(internal_encoding) = SG(default_charset);
}
@@ -436,7 +435,7 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
static PHP_INI_MH(OnUpdateInputEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
PG(input_encoding) = SG(default_charset);
}
@@ -449,7 +448,7 @@ static PHP_INI_MH(OnUpdateInputEncoding)
static PHP_INI_MH(OnUpdateOutputEncoding)
{
if (new_value) {
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
PG(output_encoding) = SG(default_charset);
}
@@ -463,11 +462,11 @@ static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the safemode/open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value->val, "syslog")) {
- if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) {
+ if (PG(open_basedir) && php_check_open_basedir(new_value->val)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -478,11 +477,11 @@ static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the safemode/open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) {
- if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) {
+ if (PG(open_basedir) && php_check_open_basedir(new_value->val)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -649,7 +648,7 @@ PHPAPI int php_get_module_initialized(void)
/* {{{ php_log_err
*/
-PHPAPI void php_log_err(char *log_message TSRMLS_DC)
+PHPAPI void php_log_err(char *log_message)
{
int fd = -1;
time_t error_time;
@@ -678,12 +677,12 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
time(&error_time);
#ifdef ZTS
if (!php_during_module_startup()) {
- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1);
} else {
- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0);
}
#else
- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1);
#endif
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str->val, log_message, PHP_EOL);
#ifdef PHP_WIN32
@@ -704,7 +703,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
/* Otherwise fall back to the default logging location, if we have one */
if (sapi_module.log_message) {
- sapi_module.log_message(log_message TSRMLS_CC);
+ sapi_module.log_message(log_message);
}
PG(in_error_log) = 0;
}
@@ -712,7 +711,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
/* {{{ php_write
wrapper for modules to use PHPWRITE */
-PHPAPI size_t php_write(void *buf, size_t size TSRMLS_DC)
+PHPAPI size_t php_write(void *buf, size_t size)
{
return PHPWRITE(buf, size);
}
@@ -726,7 +725,6 @@ PHPAPI size_t php_printf(const char *format, ...)
size_t ret;
char *buffer;
size_t size;
- TSRMLS_FETCH();
va_start(args, format);
size = vspprintf(&buffer, 0, format, args);
@@ -744,7 +742,7 @@ PHPAPI size_t php_printf(const char *format, ...)
* html error messages if correcponding ini setting (html_errors) is activated.
* See: CODING_STANDARDS for details.
*/
-PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC)
+PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args)
{
zend_string *replace_buffer = NULL, *replace_origin = NULL;
char *buffer = NULL, *docref_buf = NULL, *target = NULL;
@@ -763,7 +761,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
buffer_len = (int)vspprintf(&buffer, 0, format, args);
if (PG(html_errors)) {
- replace_buffer = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL TSRMLS_CC);
+ replace_buffer = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL);
efree(buffer);
buffer = replace_buffer->val;
buffer_len = (int)replace_buffer->len;
@@ -805,12 +803,12 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
function = "Unknown";
}
} else {
- function = get_active_function_name(TSRMLS_C);
+ function = get_active_function_name();
if (!function || !strlen(function)) {
function = "Unknown";
} else {
is_function = 1;
- class_name = get_active_class_name(&space TSRMLS_CC);
+ class_name = get_active_class_name(&space);
}
}
@@ -822,7 +820,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
}
if (PG(html_errors)) {
- replace_origin = php_escape_html_entities(origin, origin_len, 0, ENT_COMPAT, NULL TSRMLS_CC);
+ replace_origin = php_escape_html_entities(origin, origin_len, 0, ENT_COMPAT, NULL);
efree(origin);
origin = replace_origin->val;
}
@@ -909,7 +907,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
zval tmp;
ZVAL_STRINGL(&tmp, buffer, buffer_len);
if (EG(current_execute_data)) {
- if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0) == FAILURE) {
zval_ptr_dtor(&tmp);
}
} else {
@@ -929,38 +927,38 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
/* {{{ php_error_docref0 */
/* See: CODING_STANDARDS for details. */
-PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
+PHPAPI void php_error_docref0(const char *docref, int type, const char *format, ...)
{
va_list args;
va_start(args, format);
- php_verror(docref, "", type, format, args TSRMLS_CC);
+ php_verror(docref, "", type, format, args);
va_end(args);
}
/* }}} */
/* {{{ php_error_docref1 */
/* See: CODING_STANDARDS for details. */
-PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
+PHPAPI void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...)
{
va_list args;
va_start(args, format);
- php_verror(docref, param1, type, format, args TSRMLS_CC);
+ php_verror(docref, param1, type, format, args);
va_end(args);
}
/* }}} */
/* {{{ php_error_docref2 */
/* See: CODING_STANDARDS for details. */
-PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...)
+PHPAPI void php_error_docref2(const char *docref, const char *param1, const char *param2, int type, const char *format, ...)
{
char *params;
va_list args;
spprintf(&params, 0, "%s,%s", param1, param2);
va_start(args, format);
- php_verror(docref, params ? params : "...", type, format, args TSRMLS_CC);
+ php_verror(docref, params ? params : "...", type, format, args);
va_end(args);
if (params) {
efree(params);
@@ -970,9 +968,9 @@ PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1,
#ifdef PHP_WIN32
#define PHP_WIN32_ERROR_MSG_BUFFER_SIZE 512
-PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2 TSRMLS_DC) {
+PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2) {
if (error == 0) {
- php_error_docref2(NULL TSRMLS_CC, param1, param2, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, param1, param2, E_WARNING, "%s", strerror(errno));
} else {
char buf[PHP_WIN32_ERROR_MSG_BUFFER_SIZE + 1];
int buf_len;
@@ -983,16 +981,16 @@ PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const
buf[buf_len - 1] = '\0';
buf[buf_len - 2] = '\0';
}
- php_error_docref2(NULL TSRMLS_CC, param1, param2, E_WARNING, "%s (code: %lu)", (char *)buf, error);
+ php_error_docref2(NULL, param1, param2, E_WARNING, "%s (code: %lu)", (char *)buf, error);
}
}
#undef PHP_WIN32_ERROR_MSG_BUFFER_SIZE
#endif
/* {{{ php_html_puts */
-PHPAPI void php_html_puts(const char *str, size_t size TSRMLS_DC)
+PHPAPI void php_html_puts(const char *str, size_t size)
{
- zend_html_puts(str, size TSRMLS_CC);
+ zend_html_puts(str, size);
}
/* }}} */
@@ -1002,7 +1000,6 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
{
char *buffer;
int buffer_len, display;
- TSRMLS_FETCH();
buffer_len = (int)vspprintf(&buffer, PG(log_errors_max_len), format, args);
@@ -1071,7 +1068,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
* but DO NOT overwrite a pending exception
*/
if (EG(error_handling) == EH_THROW && !EG(exception)) {
- zend_throw_error_exception(EG(exception_class), buffer, 0, type TSRMLS_CC);
+ zend_throw_error_exception(EG(exception_class), buffer, 0, type);
}
efree(buffer);
return;
@@ -1126,7 +1123,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
}
#endif
spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
- php_log_err(log_buffer TSRMLS_CC);
+ php_log_err(log_buffer);
efree(log_buffer);
}
@@ -1139,7 +1136,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (PG(html_errors)) {
if (type == E_ERROR || type == E_PARSE) {
- zend_string *buf = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL TSRMLS_CC);
+ zend_string *buf = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL);
php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buf->val, error_filename, error_lineno, STR_PRINT(append_string));
zend_string_free(buf);
} else {
@@ -1223,16 +1220,16 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
ctr.line = "HTTP/1.0 500 Internal Server Error";
ctr.line_len = sizeof("HTTP/1.0 500 Internal Server Error") - 1;
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
/* the parser would return 1 (failure), we can bail out nicely */
if (type == E_PARSE) {
CG(parse_error) = 0;
} else {
/* restore memory limit */
- zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
+ zend_set_memory_limit(PG(memory_limit));
efree(buffer);
- zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
+ zend_objects_store_mark_destructed(&EG(objects_store));
zend_bailout();
return;
}
@@ -1252,7 +1249,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
ZVAL_STRINGL(&tmp, buffer, buffer_len);
if (EG(current_execute_data)) {
- if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_set_local_var_str("php_errormsg", sizeof("php_errormsg")-1, &tmp, 0) == FAILURE) {
zval_ptr_dtor(&tmp);
}
} else {
@@ -1266,7 +1263,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
/* {{{ php_get_current_user
*/
-PHPAPI char *php_get_current_user(TSRMLS_D)
+PHPAPI char *php_get_current_user(void)
{
zend_stat_t *pstat;
@@ -1278,7 +1275,7 @@ PHPAPI char *php_get_current_user(TSRMLS_D)
USE_SAPI is defined, because cgi will also be
interfaced in USE_SAPI */
- pstat = sapi_get_stat(TSRMLS_C);
+ pstat = sapi_get_stat();
if (!pstat) {
return "";
@@ -1336,14 +1333,14 @@ PHP_FUNCTION(set_time_limit)
int new_timeout_strlen;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &new_timeout) == FAILURE) {
return;
}
new_timeout_strlen = (int)zend_spprintf(&new_timeout_str, 0, ZEND_LONG_FMT, new_timeout);
key = zend_string_init("max_execution_time", sizeof("max_execution_time")-1, 0);
- if (zend_alter_ini_entry_chars_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
+ if (zend_alter_ini_entry_chars_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -1355,26 +1352,26 @@ PHP_FUNCTION(set_time_limit)
/* {{{ php_fopen_wrapper_for_zend
*/
-static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path TSRMLS_DC)
+static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path)
{
return php_stream_open_wrapper_as_file((char *)filename, "rb", USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path);
}
/* }}} */
-static void php_zend_stream_closer(void *handle TSRMLS_DC) /* {{{ */
+static void php_zend_stream_closer(void *handle) /* {{{ */
{
php_stream_close((php_stream*)handle);
}
/* }}} */
-static void php_zend_stream_mmap_closer(void *handle TSRMLS_DC) /* {{{ */
+static void php_zend_stream_mmap_closer(void *handle) /* {{{ */
{
php_stream_mmap_unmap((php_stream*)handle);
- php_zend_stream_closer(handle TSRMLS_CC);
+ php_zend_stream_closer(handle);
}
/* }}} */
-static size_t php_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */
+static size_t php_zend_stream_fsizer(void *handle) /* {{{ */
{
php_stream_statbuf ssb;
if (php_stream_stat((php_stream*)handle, &ssb) == 0) {
@@ -1384,13 +1381,13 @@ static size_t php_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) /* {{{ */
+static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle) /* {{{ */
{
- return php_stream_open_for_zend_ex(filename, handle, USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ return php_stream_open_for_zend_ex(filename, handle, USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE);
}
/* }}} */
-PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC) /* {{{ */
+PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode) /* {{{ */
{
char *p;
size_t len, mapped_len;
@@ -1409,7 +1406,7 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
handle->handle.stream.isatty = 0;
/* can we mmap immediately? */
memset(&handle->handle.stream.mmap, 0, sizeof(handle->handle.stream.mmap));
- len = php_zend_stream_fsizer(stream TSRMLS_CC);
+ len = php_zend_stream_fsizer(stream);
if (len != 0
#if HAVE_MMAP || defined(PHP_WIN32)
&& ((len - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD
@@ -1433,9 +1430,9 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
}
/* }}} */
-static char *php_resolve_path_for_zend(const char *filename, int filename_len TSRMLS_DC) /* {{{ */
+static char *php_resolve_path_for_zend(const char *filename, int filename_len) /* {{{ */
{
- return php_resolve_path(filename, filename_len, PG(include_path) TSRMLS_CC);
+ return php_resolve_path(filename, filename_len, PG(include_path));
}
/* }}} */
@@ -1449,17 +1446,17 @@ static zval *php_get_configuration_directive_for_zend(zend_string *name)
/* {{{ php_message_handler_for_zend
*/
-static void php_message_handler_for_zend(zend_long message, const void *data TSRMLS_DC)
+static void php_message_handler_for_zend(zend_long message, const void *data)
{
switch (message) {
case ZMSG_FAILED_INCLUDE_FOPEN:
- php_error_docref("function.include" TSRMLS_CC, E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
+ php_error_docref("function.include", E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
break;
case ZMSG_FAILED_REQUIRE_FOPEN:
- php_error_docref("function.require" TSRMLS_CC, E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
+ php_error_docref("function.require", E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
break;
case ZMSG_FAILED_HIGHLIGHT_FOPEN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data));
+ php_error_docref(NULL, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data));
break;
case ZMSG_MEMORY_LEAK_DETECTED:
case ZMSG_MEMORY_LEAK_REPEATED:
@@ -1531,11 +1528,11 @@ static void php_message_handler_for_zend(zend_long message, const void *data TSR
/* }}} */
-void php_on_timeout(int seconds TSRMLS_DC)
+void php_on_timeout(int seconds)
{
PG(connection_status) |= PHP_CONNECTION_TIMEOUT;
zend_set_timeout(EG(timeout_seconds), 1);
- if(PG(exit_on_timeout)) sapi_terminate_process(TSRMLS_C);
+ if(PG(exit_on_timeout)) sapi_terminate_process();
}
#if PHP_SIGCHILD
@@ -1555,7 +1552,7 @@ static void sigchld_handler(int apar)
/* {{{ php_start_sapi()
*/
-static int php_start_sapi(TSRMLS_D)
+static int php_start_sapi(void)
{
int retval = SUCCESS;
@@ -1568,9 +1565,9 @@ static int php_start_sapi(TSRMLS_D)
PG(header_is_being_sent) = 0;
PG(connection_status) = PHP_CONNECTION_NORMAL;
- zend_activate(TSRMLS_C);
+ zend_activate();
zend_set_timeout(EG(timeout_seconds), 1);
- zend_activate_modules(TSRMLS_C);
+ zend_activate_modules();
PG(modules_activated)=1;
} zend_catch {
retval = FAILURE;
@@ -1586,7 +1583,7 @@ static int php_start_sapi(TSRMLS_D)
/* {{{ php_request_startup
*/
#ifndef APACHE_HOOKS
-int php_request_startup(TSRMLS_D)
+int php_request_startup(void)
{
int retval = SUCCESS;
@@ -1606,7 +1603,7 @@ int php_request_startup(TSRMLS_D)
PG(in_error_log) = 0;
PG(during_request_startup) = 1;
- php_output_activate(TSRMLS_C);
+ php_output_activate();
/* initialize global variables */
PG(modules_activated) = 0;
@@ -1614,11 +1611,11 @@ int php_request_startup(TSRMLS_D)
PG(connection_status) = PHP_CONNECTION_NORMAL;
PG(in_user_include) = 0;
- zend_activate(TSRMLS_C);
- sapi_activate(TSRMLS_C);
+ zend_activate();
+ sapi_activate();
#ifdef ZEND_SIGNALS
- zend_signal_activate(TSRMLS_C);
+ zend_signal_activate();
#endif
if (PG(max_input_time) == -1) {
@@ -1640,19 +1637,19 @@ int php_request_startup(TSRMLS_D)
zval oh;
ZVAL_STRING(&oh, PG(output_handler));
- php_output_start_user(&oh, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_output_start_user(&oh, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
zval_ptr_dtor(&oh);
} else if (PG(output_buffering)) {
- php_output_start_user(NULL, PG(output_buffering) > 1 ? PG(output_buffering) : 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_output_start_user(NULL, PG(output_buffering) > 1 ? PG(output_buffering) : 0, PHP_OUTPUT_HANDLER_STDFLAGS);
} else if (PG(implicit_flush)) {
- php_output_set_implicit_flush(1 TSRMLS_CC);
+ php_output_set_implicit_flush(1);
}
/* We turn this off in php_execute_script() */
/* PG(during_request_startup) = 0; */
- php_hash_environment(TSRMLS_C);
- zend_activate_modules(TSRMLS_C);
+ php_hash_environment();
+ zend_activate_modules();
PG(modules_activated)=1;
} zend_catch {
retval = FAILURE;
@@ -1663,7 +1660,7 @@ int php_request_startup(TSRMLS_D)
return retval;
}
# else
-int php_request_startup(TSRMLS_D)
+int php_request_startup(void)
{
int retval = SUCCESS;
@@ -1675,9 +1672,9 @@ int php_request_startup(TSRMLS_D)
return FAILURE;
}
- php_output_activate(TSRMLS_C);
- sapi_activate(TSRMLS_C);
- php_hash_environment(TSRMLS_C);
+ php_output_activate();
+ sapi_activate();
+ php_hash_environment();
zend_try {
PG(during_request_startup) = 1;
@@ -1695,7 +1692,7 @@ int php_request_startup(TSRMLS_D)
/* {{{ php_request_startup_for_hook
*/
-int php_request_startup_for_hook(TSRMLS_D)
+int php_request_startup_for_hook(void)
{
int retval = SUCCESS;
@@ -1703,13 +1700,13 @@ int php_request_startup_for_hook(TSRMLS_D)
signal(SIGCHLD, sigchld_handler);
#endif
- if (php_start_sapi(TSRMLS_C) == FAILURE) {
+ if (php_start_sapi() == FAILURE) {
return FAILURE;
}
- php_output_activate(TSRMLS_C);
- sapi_activate_headers_only(TSRMLS_C);
- php_hash_environment(TSRMLS_C);
+ php_output_activate();
+ sapi_activate_headers_only();
+ php_hash_environment();
return retval;
}
@@ -1719,12 +1716,11 @@ int php_request_startup_for_hook(TSRMLS_D)
*/
void php_request_shutdown_for_exec(void *dummy)
{
- TSRMLS_FETCH();
/* used to close fd's in the 3..255 range here, but it's problematic
*/
- shutdown_memory_manager(1, 1 TSRMLS_CC);
- zend_interned_strings_restore(TSRMLS_C);
+ shutdown_memory_manager(1, 1);
+ zend_interned_strings_restore();
}
/* }}} */
@@ -1732,19 +1728,18 @@ void php_request_shutdown_for_exec(void *dummy)
*/
void php_request_shutdown_for_hook(void *dummy)
{
- TSRMLS_FETCH();
if (PG(modules_activated)) zend_try {
- php_call_shutdown_functions(TSRMLS_C);
+ php_call_shutdown_functions();
} zend_end_try();
if (PG(modules_activated)) {
- zend_deactivate_modules(TSRMLS_C);
- php_free_shutdown_functions(TSRMLS_C);
+ zend_deactivate_modules();
+ php_free_shutdown_functions();
}
zend_try {
- zend_unset_timeout(TSRMLS_C);
+ zend_unset_timeout();
} zend_end_try();
zend_try {
@@ -1755,25 +1750,25 @@ void php_request_shutdown_for_hook(void *dummy)
}
} zend_end_try();
- zend_deactivate(TSRMLS_C);
+ zend_deactivate();
zend_try {
- sapi_deactivate(TSRMLS_C);
+ sapi_deactivate();
} zend_end_try();
zend_try {
- php_shutdown_stream_hashes(TSRMLS_C);
+ php_shutdown_stream_hashes();
} zend_end_try();
zend_try {
- shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC);
+ shutdown_memory_manager(CG(unclean_shutdown), 0);
} zend_end_try();
- zend_interned_strings_restore(TSRMLS_C);
+ zend_interned_strings_restore();
#ifdef ZEND_SIGNALS
zend_try {
- zend_signal_deactivate(TSRMLS_C);
+ zend_signal_deactivate();
} zend_end_try();
#endif
}
@@ -1785,7 +1780,6 @@ void php_request_shutdown_for_hook(void *dummy)
void php_request_shutdown(void *dummy)
{
zend_bool report_memleaks;
- TSRMLS_FETCH();
report_memleaks = PG(report_memleaks);
@@ -1794,16 +1788,16 @@ void php_request_shutdown(void *dummy)
*/
EG(current_execute_data) = NULL;
- php_deactivate_ticks(TSRMLS_C);
+ php_deactivate_ticks();
/* 1. Call all possible shutdown functions registered with register_shutdown_function() */
if (PG(modules_activated)) zend_try {
- php_call_shutdown_functions(TSRMLS_C);
+ php_call_shutdown_functions();
} zend_end_try();
/* 2. Call all possible __destruct() functions */
zend_try {
- zend_call_destructors(TSRMLS_C);
+ zend_call_destructors();
} zend_end_try();
/* 3. Flush all output buffers */
@@ -1811,32 +1805,32 @@ void php_request_shutdown(void *dummy)
zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1;
if (CG(unclean_shutdown) && PG(last_error_type) == E_ERROR &&
- (size_t)PG(memory_limit) < zend_memory_usage(1 TSRMLS_CC)
+ (size_t)PG(memory_limit) < zend_memory_usage(1)
) {
send_buffer = 0;
}
if (!send_buffer) {
- php_output_discard_all(TSRMLS_C);
+ php_output_discard_all();
} else {
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
}
} zend_end_try();
/* 4. Reset max_execution_time (no longer executing php code after response sent) */
zend_try {
- zend_unset_timeout(TSRMLS_C);
+ zend_unset_timeout();
} zend_end_try();
/* 5. Call all extensions RSHUTDOWN functions */
if (PG(modules_activated)) {
- zend_deactivate_modules(TSRMLS_C);
- php_free_shutdown_functions(TSRMLS_C);
+ zend_deactivate_modules();
+ php_free_shutdown_functions();
}
/* 6. Shutdown output layer (send the set HTTP headers, cleanup output handlers, etc.) */
zend_try {
- php_output_deactivate(TSRMLS_C);
+ php_output_deactivate();
} zend_end_try();
/* 7. Destroy super-globals */
@@ -1859,35 +1853,35 @@ void php_request_shutdown(void *dummy)
}
/* 9. Shutdown scanner/executor/compiler and restore ini entries */
- zend_deactivate(TSRMLS_C);
+ zend_deactivate();
/* 10. Call all extensions post-RSHUTDOWN functions */
zend_try {
- zend_post_deactivate_modules(TSRMLS_C);
+ zend_post_deactivate_modules();
} zend_end_try();
/* 11. SAPI related shutdown (free stuff) */
zend_try {
- sapi_deactivate(TSRMLS_C);
+ sapi_deactivate();
} zend_end_try();
/* 12. free virtual CWD memory */
- virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_deactivate();
/* 13. Destroy stream hashes */
zend_try {
- php_shutdown_stream_hashes(TSRMLS_C);
+ php_shutdown_stream_hashes();
} zend_end_try();
/* 14. Free Willy (here be crashes) */
- zend_interned_strings_restore(TSRMLS_C);
+ zend_interned_strings_restore();
zend_try {
- shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC);
+ shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0);
} zend_end_try();
/* 15. Reset max_execution_time */
zend_try {
- zend_unset_timeout(TSRMLS_C);
+ zend_unset_timeout();
} zend_end_try();
#ifdef PHP_WIN32
@@ -1905,7 +1899,7 @@ void php_request_shutdown(void *dummy)
/* {{{ php_com_initialize
*/
-PHPAPI void php_com_initialize(TSRMLS_D)
+PHPAPI void php_com_initialize(void)
{
#ifdef PHP_WIN32
if (!PG(com_initialized)) {
@@ -1921,26 +1915,25 @@ PHPAPI void php_com_initialize(TSRMLS_D)
*/
static size_t php_output_wrapper(const char *str, size_t str_length)
{
- TSRMLS_FETCH();
- return php_output_write(str, str_length TSRMLS_CC);
+ return php_output_write(str, str_length);
}
/* }}} */
#ifdef ZTS
/* {{{ core_globals_ctor
*/
-static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC)
+static void core_globals_ctor(php_core_globals *core_globals)
{
memset(core_globals, 0, sizeof(*core_globals));
- php_startup_ticks(TSRMLS_C);
+ php_startup_ticks();
}
/* }}} */
#endif
/* {{{ core_globals_dtor
*/
-static void core_globals_dtor(php_core_globals *core_globals TSRMLS_DC)
+static void core_globals_dtor(php_core_globals *core_globals)
{
if (core_globals->last_error_message) {
free(core_globals->last_error_message);
@@ -1958,7 +1951,7 @@ static void core_globals_dtor(php_core_globals *core_globals TSRMLS_DC)
free(core_globals->php_binary);
}
- php_shutdown_ticks(TSRMLS_C);
+ php_shutdown_ticks();
}
/* }}} */
@@ -1972,13 +1965,13 @@ PHP_MINFO_FUNCTION(php_core) { /* {{{ */
/* {{{ php_register_extensions
*/
-int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC)
+int php_register_extensions(zend_module_entry **ptr, int count)
{
zend_module_entry **end = ptr + count;
while (ptr < end) {
if (*ptr) {
- if (zend_register_internal_module(*ptr TSRMLS_CC)==NULL) {
+ if (zend_register_internal_module(*ptr)==NULL) {
return FAILURE;
}
}
@@ -1994,10 +1987,10 @@ int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC)
*
* See algo: https://bugs.php.net/bug.php?id=63159
*/
-static int php_register_extensions_bc(zend_module_entry *ptr, int count TSRMLS_DC)
+static int php_register_extensions_bc(zend_module_entry *ptr, int count)
{
while (count--) {
- if (zend_register_internal_module(ptr++ TSRMLS_CC) == NULL) {
+ if (zend_register_internal_module(ptr++) == NULL) {
return FAILURE;
}
}
@@ -2020,8 +2013,7 @@ void dummy_invalid_parameter_handler(
int len;
if (!called) {
- TSRMLS_FETCH();
- if(PG(windows_show_crt_warning)) {
+ if(PG(windows_show_crt_warning)) {
called = 1;
if (function) {
if (file) {
@@ -2084,8 +2076,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
module_shutdown = 0;
module_startup = 1;
- sapi_initialize_empty_request(TSRMLS_C);
- sapi_activate(TSRMLS_C);
+ sapi_initialize_empty_request();
+ sapi_activate();
if (module_initialized) {
return SUCCESS;
@@ -2110,7 +2102,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
zuf.vstrpprintf_function = vstrpprintf;
zuf.getenv_function = sapi_getenv;
zuf.resolve_path_function = php_resolve_path_for_zend;
- zend_startup(&zuf, NULL TSRMLS_CC);
+ zend_startup(&zuf, NULL);
#ifdef ZTS
executor_globals = ts_resource(executor_globals_id);
@@ -2120,9 +2112,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor);
#endif
#else
- php_startup_ticks(TSRMLS_C);
+ php_startup_ticks();
#endif
- gc_globals_ctor(TSRMLS_C);
+ gc_globals_ctor();
#ifdef PHP_WIN32
{
@@ -2225,20 +2217,20 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
REGISTER_MAIN_LONG_CONSTANT("PHP_WINDOWS_NT_WORKSTATION", VER_NT_WORKSTATION, CONST_PERSISTENT | CONST_CS);
#endif
- php_binary_init(TSRMLS_C);
+ php_binary_init();
if (PG(php_binary)) {
REGISTER_MAIN_STRINGL_CONSTANT("PHP_BINARY", PG(php_binary), strlen(PG(php_binary)), CONST_PERSISTENT | CONST_CS);
} else {
REGISTER_MAIN_STRINGL_CONSTANT("PHP_BINARY", "", 0, CONST_PERSISTENT | CONST_CS);
}
- php_output_register_constants(TSRMLS_C);
- php_rfc1867_register_constants(TSRMLS_C);
+ php_output_register_constants();
+ php_rfc1867_register_constants();
/* this will read in php.ini, set up the configuration parameters,
load zend extensions and register php function extensions
to be loaded later */
- if (php_init_config(TSRMLS_C) == FAILURE) {
+ if (php_init_config() == FAILURE) {
return FAILURE;
}
@@ -2246,7 +2238,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
REGISTER_INI_ENTRIES();
/* Register Zend ini entries */
- zend_register_standard_ini_entries(TSRMLS_C);
+ zend_register_standard_ini_entries();
/* Disable realpath cache if an open_basedir is set */
if (PG(open_basedir) && *PG(open_basedir)) {
@@ -2256,25 +2248,25 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
/* initialize stream wrappers registry
* (this uses configuration parameters from php.ini)
*/
- if (php_init_stream_wrappers(module_number TSRMLS_CC) == FAILURE) {
+ if (php_init_stream_wrappers(module_number) == FAILURE) {
php_printf("PHP: Unable to initialize stream url wrappers.\n");
return FAILURE;
}
zuv.html_errors = 1;
zuv.import_use_extension = ".php";
- php_startup_auto_globals(TSRMLS_C);
+ php_startup_auto_globals();
zend_set_utility_values(&zuv);
- php_startup_sapi_content_types(TSRMLS_C);
+ php_startup_sapi_content_types();
/* startup extensions statically compiled in */
- if (php_register_internal_extensions_func(TSRMLS_C) == FAILURE) {
+ if (php_register_internal_extensions_func() == FAILURE) {
php_printf("Unable to start builtin modules\n");
return FAILURE;
}
/* start additional PHP extensions */
- php_register_extensions_bc(additional_modules, num_additional_modules TSRMLS_CC);
+ php_register_extensions_bc(additional_modules, num_additional_modules);
/* load and startup extensions compiled as shared objects (aka DLLs)
as requested by php.ini entries
@@ -2283,26 +2275,26 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
which is always an internal extension and to be initialized
ahead of all other internals
*/
- php_ini_register_extensions(TSRMLS_C);
- zend_startup_modules(TSRMLS_C);
+ php_ini_register_extensions();
+ zend_startup_modules();
/* start Zend extensions */
zend_startup_extensions();
- zend_collect_module_handlers(TSRMLS_C);
+ zend_collect_module_handlers();
/* register additional functions */
if (sapi_module.additional_functions) {
if ((module = zend_hash_str_find_ptr(&module_registry, "standard", sizeof("standard")-1)) != NULL) {
EG(current_module) = module;
- zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
+ zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT);
EG(current_module) = NULL;
}
}
/* disable certain classes and functions as requested by php.ini */
- php_disable_functions(TSRMLS_C);
- php_disable_classes(TSRMLS_C);
+ php_disable_functions();
+ php_disable_classes();
/* make core report what it should */
if ((module = zend_hash_str_find_ptr(&module_registry, "core", sizeof("core")-1)) != NULL) {
@@ -2313,13 +2305,13 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#ifdef PHP_WIN32
/* Disable incompatible functions for the running platform */
- if (php_win32_disable_functions(TSRMLS_C) == FAILURE) {
+ if (php_win32_disable_functions() == FAILURE) {
php_printf("Unable to disable unsupported functions\n");
return FAILURE;
}
#endif
- zend_post_startup(TSRMLS_C);
+ zend_post_startup();
module_initialized = 1;
@@ -2385,12 +2377,12 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
} zend_end_try();
}
- sapi_deactivate(TSRMLS_C);
+ sapi_deactivate();
module_startup = 0;
- shutdown_memory_manager(1, 0 TSRMLS_CC);
- zend_interned_strings_snapshot(TSRMLS_C);
- virtual_cwd_activate(TSRMLS_C);
+ shutdown_memory_manager(1, 0);
+ zend_interned_strings_snapshot();
+ virtual_cwd_activate();
/* we're done */
return retval;
@@ -2406,15 +2398,14 @@ void php_module_shutdown_for_exec(void)
*/
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
{
- TSRMLS_FETCH();
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return SUCCESS;
}
/* }}} */
/* {{{ php_module_shutdown
*/
-void php_module_shutdown(TSRMLS_D)
+void php_module_shutdown(void)
{
int module_number=0; /* for UNREGISTER_INI_ENTRIES() */
@@ -2437,12 +2428,12 @@ void php_module_shutdown(TSRMLS_D)
php_win32_free_rng_lock();
#endif
- sapi_flush(TSRMLS_C);
+ sapi_flush();
- zend_shutdown(TSRMLS_C);
+ zend_shutdown();
/* Destroys filter & transport registries too */
- php_shutdown_stream_wrappers(module_number TSRMLS_CC);
+ php_shutdown_stream_wrappers(module_number);
UNREGISTER_INI_ENTRIES();
@@ -2450,10 +2441,10 @@ void php_module_shutdown(TSRMLS_D)
php_shutdown_config();
#ifndef ZTS
- zend_ini_shutdown(TSRMLS_C);
- shutdown_memory_manager(CG(unclean_shutdown), 1 TSRMLS_CC);
+ zend_ini_shutdown();
+ shutdown_memory_manager(CG(unclean_shutdown), 1);
#else
- zend_ini_global_shutdown(TSRMLS_C);
+ zend_ini_global_shutdown();
#endif
php_output_shutdown();
@@ -2462,8 +2453,8 @@ void php_module_shutdown(TSRMLS_D)
module_initialized = 0;
#ifndef ZTS
- core_globals_dtor(&core_globals TSRMLS_CC);
- gc_globals_dtor(TSRMLS_C);
+ core_globals_dtor(&core_globals);
+ gc_globals_dtor();
#else
ts_free_id(core_globals_id);
#endif
@@ -2478,7 +2469,7 @@ void php_module_shutdown(TSRMLS_D)
/* {{{ php_execute_script
*/
-PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
+PHPAPI int php_execute_script(zend_file_handle *primary_file)
{
zend_file_handle *prepend_file_p, *append_file_p;
zend_file_handle prepend_file = {0}, append_file = {0};
@@ -2502,7 +2493,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
#ifdef PHP_WIN32
if(primary_file->filename) {
- UpdateIniFromRegistry((char*)primary_file->filename TSRMLS_CC);
+ UpdateIniFromRegistry((char*)primary_file->filename);
}
#endif
@@ -2528,7 +2519,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
) {
int realfile_len;
- if (expand_filepath(primary_file->filename, realfile TSRMLS_CC)) {
+ if (expand_filepath(primary_file->filename, realfile)) {
realfile_len = (int)strlen(realfile);
zend_hash_str_add_empty_element(&EG(included_files), realfile, realfile_len);
primary_file->opened_path = estrndup(realfile, realfile_len);
@@ -2556,11 +2547,11 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
}
if (PG(max_input_time) != -1) {
#ifdef PHP_WIN32
- zend_unset_timeout(TSRMLS_C);
+ zend_unset_timeout();
#endif
zend_set_timeout(INI_INT("max_execution_time"), 0);
}
- retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
+ retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
} zend_end_try();
@@ -2581,7 +2572,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
/* {{{ php_execute_simple_script
*/
-PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret TSRMLS_DC)
+PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret)
{
char *old_cwd;
ALLOCA_FLAG(use_heap)
@@ -2594,7 +2585,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret T
zend_try {
#ifdef PHP_WIN32
if(primary_file->filename) {
- UpdateIniFromRegistry((char*)primary_file->filename TSRMLS_CC);
+ UpdateIniFromRegistry((char*)primary_file->filename);
}
#endif
@@ -2604,7 +2595,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret T
php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1));
VCWD_CHDIR_FILE(primary_file->filename);
}
- zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
+ zend_execute_scripts(ZEND_REQUIRE, ret, 1, primary_file);
} zend_end_try();
if (old_cwd[0] != '\0') {
@@ -2620,10 +2611,9 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret T
*/
PHPAPI void php_handle_aborted_connection(void)
{
- TSRMLS_FETCH();
PG(connection_status) = PHP_CONNECTION_ABORTED;
- php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
+ php_output_set_status(PHP_OUTPUT_DISABLED);
if (!PG(ignore_user_abort)) {
zend_bailout();
@@ -2633,7 +2623,7 @@ PHPAPI void php_handle_aborted_connection(void)
/* {{{ php_handle_auth_data
*/
-PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC)
+PHPAPI int php_handle_auth_data(const char *auth)
{
int ret = -1;
@@ -2675,17 +2665,17 @@ PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC)
/* {{{ php_lint_script
*/
-PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC)
+PHPAPI int php_lint_script(zend_file_handle *file)
{
zend_op_array *op_array;
int retval = FAILURE;
zend_try {
- op_array = zend_compile_file(file, ZEND_INCLUDE TSRMLS_CC);
- zend_destroy_file_handle(file TSRMLS_CC);
+ op_array = zend_compile_file(file, ZEND_INCLUDE);
+ zend_destroy_file_handle(file);
if (op_array) {
- destroy_op_array(op_array TSRMLS_CC);
+ destroy_op_array(op_array);
efree(op_array);
retval = SUCCESS;
}
@@ -2698,9 +2688,9 @@ PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC)
#ifdef PHP_WIN32
/* {{{ dummy_indent
just so that this symbol gets exported... */
-PHPAPI void dummy_indent(TSRMLS_D)
+PHPAPI void dummy_indent(void)
{
- zend_indent(TSRMLS_C);
+ zend_indent();
}
/* }}} */
#endif
diff --git a/main/mergesort.c b/main/mergesort.c
index b049e683a9..a482f5b0fe 100644
--- a/main/mergesort.c
+++ b/main/mergesort.c
@@ -66,8 +66,8 @@ static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94";
#include <winsock2.h> /* Includes definition for u_char */
#endif
-static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
-static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
+static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void *));
+static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void *));
#define ISIZE sizeof(int)
#define PSIZE sizeof(u_char *)
@@ -102,7 +102,7 @@ static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const voi
/* {{{ php_mergesort
* Arguments are as for qsort.
*/
-PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC)
+PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void *))
{
register size_t i;
register int sense;
@@ -130,7 +130,7 @@ PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const
return (-1);
list1 = base;
- setup(list1, list2, nmemb, size, cmp TSRMLS_CC);
+ setup(list1, list2, nmemb, size, cmp);
last = list2 + nmemb * size;
i = big = 0;
while (*EVAL(list2) != last) {
@@ -144,7 +144,7 @@ PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const
p2 = *EVAL(p2);
l2 = list1 + (p2 - list2);
while (f1 < l1 && f2 < l2) {
- if ((*cmp)(f1, f2 TSRMLS_CC) <= 0) {
+ if ((*cmp)(f1, f2) <= 0) {
q = f2;
b = f1, t = l1;
sense = -1;
@@ -154,7 +154,7 @@ PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const
sense = 0;
}
if (!big) { /* here i = 0 */
- while ((b += size) < t && cmp(q, b TSRMLS_CC) >sense)
+ while ((b += size) < t && cmp(q, b) >sense)
if (++i == 6) {
big = 1;
goto EXPONENTIAL;
@@ -163,12 +163,12 @@ PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const
EXPONENTIAL: for (i = size; ; i <<= 1)
if ((p = (b + i)) >= t) {
if ((p = t - size) > b &&
- (*cmp)(q, p TSRMLS_CC) <= sense)
+ (*cmp)(q, p) <= sense)
t = p;
else
b = p;
break;
- } else if ((*cmp)(q, p TSRMLS_CC) <= sense) {
+ } else if ((*cmp)(q, p) <= sense) {
t = p;
if (i == size)
big = 0;
@@ -177,7 +177,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1)
b = p;
while (t > b+size) {
i = (((t - b) / size) >> 1) * size;
- if ((*cmp)(q, p = b + i TSRMLS_CC) <= sense)
+ if ((*cmp)(q, p = b + i) <= sense)
t = p;
else
b = p;
@@ -185,7 +185,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1)
goto COPY;
FASTCASE: while (i > size)
if ((*cmp)(q,
- p = b + (i >>= 1) TSRMLS_CC) <= sense)
+ p = b + (i >>= 1)) <= sense)
t = p;
else
b = p;
@@ -262,14 +262,14 @@ COPY: b = t;
* when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL
* is defined. Otherwise simple pairwise merging is used.)
*/
-static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC)
+static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void *))
{
size_t i, length, size2, sense;
u_char *f1, *f2, *s, *l2, *last, *p2, tmp;
size2 = size*2;
if (n <= 5) {
- insertionsort(list1, n, size, cmp TSRMLS_CC);
+ insertionsort(list1, n, size, cmp);
*EVAL(list2) = (u_char*) list2 + n*size;
return;
}
@@ -278,19 +278,19 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp
* for simplicity.
*/
i = 4 + (n & 1);
- insertionsort(list1 + (n - i) * size, i, size, cmp TSRMLS_CC);
+ insertionsort(list1 + (n - i) * size, i, size, cmp);
last = list1 + size * (n - i);
*EVAL(list2 + (last - list1)) = list2 + n * size;
#ifdef NATURAL
p2 = list2;
f1 = list1;
- sense = (cmp(f1, f1 + size TSRMLS_CC) > 0);
+ sense = (cmp(f1, f1 + size) > 0);
for (; f1 < last; sense = !sense) {
length = 2;
/* Find pairs with same sense. */
for (f2 = f1 + size2; f2 < last; f2 += size2) {
- if ((cmp(f2, f2+ size TSRMLS_CC) > 0) != sense)
+ if ((cmp(f2, f2+ size) > 0) != sense)
break;
length += 2;
}
@@ -303,7 +303,7 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp
} else { /* Natural merge */
l2 = f2;
for (f2 = f1 + size2; f2 < l2; f2 += size2) {
- if ((cmp(f2-size, f2 TSRMLS_CC) > 0) != sense) {
+ if ((cmp(f2-size, f2) > 0) != sense) {
p2 = *EVAL(p2) = f2 - list1 + list2;
if (sense > 0)
reverse(f1, f2-size);
@@ -313,7 +313,7 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp
if (sense > 0)
reverse (f1, f2-size);
f1 = f2;
- if (f2 < last || cmp(f2 - size, f2 TSRMLS_CC) > 0)
+ if (f2 < last || cmp(f2 - size, f2) > 0)
p2 = *EVAL(p2) = f2 - list1 + list2;
else
p2 = *EVAL(p2) = list2 + n*size;
@@ -322,7 +322,7 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp
#else /* pairwise merge only. */
for (f1 = list1, p2 = list2; f1 < last; f1 += size2) {
p2 = *EVAL(p2) = p2 + size2;
- if (cmp (f1, f1 + size TSRMLS_CC) > 0)
+ if (cmp (f1, f1 + size) > 0)
swap(f1, f1 + size);
}
#endif /* NATURAL */
@@ -333,7 +333,7 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp
* This is to avoid out-of-bounds addresses in sorting the
* last 4 elements.
*/
-static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC)
+static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void *))
{
u_char *ai, *s, *t, *u, tmp;
size_t i;
@@ -341,7 +341,7 @@ static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const voi
for (ai = a+size; --n >= 1; ai += size)
for (t = ai; t > a; t -= size) {
u = t - size;
- if (cmp(u, t TSRMLS_CC) <= 0)
+ if (cmp(u, t) <= 0)
break;
swap(u, t);
}
diff --git a/main/network.c b/main/network.c
index f44cad29a5..ac80f53f93 100644
--- a/main/network.c
+++ b/main/network.c
@@ -166,7 +166,7 @@ PHPAPI void php_network_freeaddresses(struct sockaddr **sal)
/* {{{ php_network_getaddresses
* Returns number of addresses, 0 for none/error
*/
-PHPAPI int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, zend_string **error_string TSRMLS_DC)
+PHPAPI int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, zend_string **error_string)
{
struct sockaddr **sap;
int n;
@@ -213,17 +213,17 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
if ((n = getaddrinfo(host, NULL, &hints, &res))) {
if (error_string) {
*error_string = strpprintf(0, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", (*error_string)->val);
+ php_error_docref(NULL, E_WARNING, "%s", (*error_string)->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
+ php_error_docref(NULL, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
}
return 0;
} else if (res == NULL) {
if (error_string) {
*error_string = strpprintf(0, "php_network_getaddresses: getaddrinfo failed (null result pointer) errno=%d", errno);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", (*error_string)->val);
+ php_error_docref(NULL, E_WARNING, "%s", (*error_string)->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)");
+ php_error_docref(NULL, E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)");
}
return 0;
}
@@ -250,9 +250,9 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
if (host_info == NULL) {
if (error_string) {
error_string = strpprintf(0, "php_network_getaddresses: gethostbyname failed. errno=%d", errno);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", (*error_string)->val);
+ php_error_docref(NULL, E_WARNING, "%s", (*error_string)->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: gethostbyname failed");
+ php_error_docref(NULL, E_WARNING, "php_network_getaddresses: gethostbyname failed");
}
return 0;
}
@@ -388,7 +388,7 @@ ok:
return ret;
#else
if (asynchronous) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Asynchronous connect() not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "Asynchronous connect() not supported on this platform");
}
return (connect(sockfd, addr, addrlen) == 0) ? 0 : -1;
#endif
@@ -417,7 +417,7 @@ static inline void sub_times(struct timeval a, struct timeval b, struct timeval
/* {{{ php_network_bind_socket_to_local_addr */
php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port,
int socktype, long sockopts, zend_string **error_string, int *error_code
- TSRMLS_DC)
+ )
{
int num_addrs, n, err = 0;
php_socket_t sock;
@@ -425,7 +425,7 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po
socklen_t socklen;
int sockoptval = 1;
- num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC);
+ num_addrs = php_network_getaddresses(host, socktype, &psal, error_string);
if (num_addrs == 0) {
/* could not resolve address(es) */
@@ -507,7 +507,7 @@ bound:
}
/* }}} */
-PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC)
+PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_long addrlen, struct sockaddr *sa, socklen_t *sl)
{
char *colon;
char *tmp;
@@ -558,11 +558,11 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo
}
/* looks like we'll need to resolve it */
- n = php_network_getaddresses(tmp, SOCK_DGRAM, &psal, &errstr TSRMLS_CC);
+ n = php_network_getaddresses(tmp, SOCK_DGRAM, &psal, &errstr);
if (n == 0) {
if (errstr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to resolve `%s': %s", tmp, errstr->val);
+ php_error_docref(NULL, E_WARNING, "Failed to resolve `%s': %s", tmp, errstr->val);
zend_string_release(errstr);
}
goto out;
@@ -602,7 +602,7 @@ PHPAPI void php_network_populate_name_from_sockaddr(
/* output address */
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC)
+ )
{
if (addr) {
*addr = emalloc(sl);
@@ -663,7 +663,7 @@ PHPAPI int php_network_get_peer_name(php_socket_t sock,
zend_string **textaddr,
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC)
+ )
{
php_sockaddr_storage sa;
socklen_t sl = sizeof(sa);
@@ -673,7 +673,7 @@ PHPAPI int php_network_get_peer_name(php_socket_t sock,
php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl,
textaddr,
addr, addrlen
- TSRMLS_CC);
+ );
return 0;
}
return -1;
@@ -683,7 +683,7 @@ PHPAPI int php_network_get_sock_name(php_socket_t sock,
zend_string **textaddr,
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC)
+ )
{
php_sockaddr_storage sa;
socklen_t sl = sizeof(sa);
@@ -693,7 +693,7 @@ PHPAPI int php_network_get_sock_name(php_socket_t sock,
php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl,
textaddr,
addr, addrlen
- TSRMLS_CC);
+ );
return 0;
}
return -1;
@@ -717,7 +717,7 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
struct timeval *timeout,
zend_string **error_string,
int *error_code
- TSRMLS_DC)
+ )
{
php_socket_t clisock = -1;
int error = 0, n;
@@ -739,7 +739,7 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl,
textaddr,
addr, addrlen
- TSRMLS_CC);
+ );
} else {
error = php_socket_errno();
}
@@ -768,7 +768,7 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port,
int socktype, int asynchronous, struct timeval *timeout, zend_string **error_string,
int *error_code, char *bindto, unsigned short bindport, long sockopts
- TSRMLS_DC)
+ )
{
int num_addrs, n, fatal = 0;
php_socket_t sock;
@@ -779,7 +779,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
struct timeval limit_time, time_now;
#endif
- num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC);
+ num_addrs = php_network_getaddresses(host, socktype, &psal, error_string);
if (num_addrs == 0) {
/* could not resolve address(es) */
@@ -849,7 +849,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
in4->sin_family = sa->sa_family;
in4->sin_port = htons(bindport);
if (!inet_aton(bindto, &in4->sin_addr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto);
+ php_error_docref(NULL, E_WARNING, "Invalid IP Address: %s", bindto);
goto skip_bind;
}
memset(&(in4->sin_zero), 0, sizeof(in4->sin_zero));
@@ -864,14 +864,14 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
in6->sin6_family = sa->sa_family;
in6->sin6_port = htons(bindport);
if (inet_pton(AF_INET6, bindto, &in6->sin6_addr) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto);
+ php_error_docref(NULL, E_WARNING, "Invalid IP Address: %s", bindto);
goto skip_bind;
}
}
#endif
if (!local_address || bind(sock, local_address, local_address_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno));
}
skip_bind:
if (local_address) {
@@ -1082,7 +1082,7 @@ PHPAPI zend_string *php_socket_error_str(long err)
/* }}} */
/* deprecated */
-PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC)
{
php_stream *stream;
php_netstream_data_t *sock;
@@ -1107,7 +1107,7 @@ PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const
}
PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port,
- int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC)
+ int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC)
{
char *res;
zend_long reslen;
@@ -1123,7 +1123,7 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
return stream;
}
-PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC)
+PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block)
{
int ret = SUCCESS;
@@ -1158,10 +1158,9 @@ PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC)
PHPAPI void _php_emit_fd_setsize_warning(int max_fd)
{
- TSRMLS_FETCH();
#ifdef PHP_WIN32
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"PHP needs to be recompiled with a larger value of FD_SETSIZE.\n"
"If this binary is from an official www.php.net package, file a bug report\n"
"at http://bugs.php.net, including the following information:\n"
@@ -1171,7 +1170,7 @@ PHPAPI void _php_emit_fd_setsize_warning(int max_fd)
"one time, in order to avoid seeing this error again at a later date.",
FD_SETSIZE, max_fd, (max_fd + 128) & ~127);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"You MUST recompile PHP with a larger value of FD_SETSIZE.\n"
"It is set to %d, but you have descriptors numbered at least as high as %d.\n"
" --enable-fd-setsize=%d is recommended, but you may want to set it\n"
diff --git a/main/output.c b/main/output.c
index c8b41ba1eb..c287933fb1 100644
--- a/main/output.c
+++ b/main/output.c
@@ -52,20 +52,20 @@ static HashTable php_output_handler_reverse_conflicts;
/* }}} */
/* {{{ forward declarations */
-static inline int php_output_lock_error(int op TSRMLS_DC);
-static inline void php_output_op(int op, const char *str, size_t len TSRMLS_DC);
+static inline int php_output_lock_error(int op);
+static inline void php_output_op(int op, const char *str, size_t len);
-static inline php_output_handler *php_output_handler_init(zend_string *name, size_t chunk_size, int flags TSRMLS_DC);
+static inline php_output_handler *php_output_handler_init(zend_string *name, size_t chunk_size, int flags);
static inline php_output_handler_status_t php_output_handler_op(php_output_handler *handler, php_output_context *context);
-static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf TSRMLS_DC);
+static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf);
static inline zval *php_output_handler_status(php_output_handler *handler, zval *entry);
-static inline php_output_context *php_output_context_init(php_output_context *context, int op TSRMLS_DC);
+static inline php_output_context *php_output_context_init(php_output_context *context, int op);
static inline void php_output_context_reset(php_output_context *context);
static inline void php_output_context_swap(php_output_context *context);
static inline void php_output_context_dtor(php_output_context *context);
-static inline int php_output_stack_pop(int flags TSRMLS_DC);
+static inline int php_output_stack_pop(int flags);
static int php_output_stack_apply_op(void *h, void *c);
static int php_output_stack_apply_clean(void *h, void *c);
@@ -81,6 +81,7 @@ static int php_output_handler_devnull_func(void **handler_context, php_output_co
* Initialize the module globals on MINIT */
static inline void php_output_init_globals(zend_output_globals *G)
{
+ ZEND_TSRMLS_CACHE_UPDATE;
memset(G, 0, sizeof(*G));
}
/* }}} */
@@ -103,23 +104,23 @@ static size_t php_output_stderr(const char *str, size_t str_len)
static size_t (*php_output_direct)(const char *str, size_t str_len) = php_output_stderr;
/* }}} */
-/* {{{ void php_output_header(TSRMLS_D) */
-static void php_output_header(TSRMLS_D)
+/* {{{ void php_output_header(void) */
+static void php_output_header(void)
{
if (!SG(headers_sent)) {
if (!OG(output_start_filename)) {
- if (zend_is_compiling(TSRMLS_C)) {
- OG(output_start_filename) = zend_get_compiled_filename(TSRMLS_C)->val;
- OG(output_start_lineno) = zend_get_compiled_lineno(TSRMLS_C);
- } else if (zend_is_executing(TSRMLS_C)) {
- OG(output_start_filename) = zend_get_executed_filename(TSRMLS_C);
- OG(output_start_lineno) = zend_get_executed_lineno(TSRMLS_C);
+ if (zend_is_compiling()) {
+ OG(output_start_filename) = zend_get_compiled_filename()->val;
+ OG(output_start_lineno) = zend_get_compiled_lineno();
+ } else if (zend_is_executing()) {
+ OG(output_start_filename) = zend_get_executed_filename();
+ OG(output_start_lineno) = zend_get_executed_lineno();
}
#if PHP_OUTPUT_DEBUG
fprintf(stderr, "!!! output started at: %s (%d)\n", OG(output_start_filename), OG(output_start_lineno));
#endif
}
- if (!php_header(TSRMLS_C)) {
+ if (!php_header()) {
OG(flags) |= PHP_OUTPUT_DISABLED;
}
}
@@ -155,12 +156,12 @@ PHPAPI void php_output_shutdown(void)
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_activate(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_activate(void)
* Reset output globals and setup the output handler stack */
-PHPAPI int php_output_activate(TSRMLS_D)
+PHPAPI int php_output_activate(void)
{
#ifdef ZTS
- memset((*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)], 0, sizeof(zend_output_globals));
+ memset((*((void ***) ZEND_TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)], 0, sizeof(zend_output_globals));
#else
memset(&output_globals, 0, sizeof(zend_output_globals));
#endif
@@ -172,13 +173,13 @@ PHPAPI int php_output_activate(TSRMLS_D)
}
/* }}} */
-/* {{{ void php_output_deactivate(TSRMLS_D)
+/* {{{ void php_output_deactivate(void)
* Destroy the output handler stack */
-PHPAPI void php_output_deactivate(TSRMLS_D)
+PHPAPI void php_output_deactivate(void)
{
php_output_handler **handler = NULL;
- php_output_header(TSRMLS_C);
+ php_output_header();
OG(flags) ^= PHP_OUTPUT_ACTIVATED;
OG(active) = NULL;
@@ -187,7 +188,7 @@ PHPAPI void php_output_deactivate(TSRMLS_D)
/* release all output handlers */
if (OG(handlers).elements) {
while ((handler = zend_stack_top(&OG(handlers)))) {
- php_output_handler_free(handler TSRMLS_CC);
+ php_output_handler_free(handler);
zend_stack_del_top(&OG(handlers));
}
zend_stack_destroy(&OG(handlers));
@@ -197,7 +198,7 @@ PHPAPI void php_output_deactivate(TSRMLS_D)
/* }}} */
/* {{{ void php_output_register_constants() */
-PHPAPI void php_output_register_constants(TSRMLS_D)
+PHPAPI void php_output_register_constants(void)
{
REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT);
REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_WRITE", PHP_OUTPUT_HANDLER_WRITE, CONST_CS | CONST_PERSISTENT);
@@ -216,17 +217,17 @@ PHPAPI void php_output_register_constants(TSRMLS_D)
}
/* }}} */
-/* {{{ void php_output_set_status(int status TSRMLS_DC)
+/* {{{ void php_output_set_status(int status)
* Used by SAPIs to disable output */
-PHPAPI void php_output_set_status(int status TSRMLS_DC)
+PHPAPI void php_output_set_status(int status)
{
OG(flags) = (OG(flags) & ~0xf) | (status & 0xf);
}
/* }}} */
-/* {{{ int php_output_get_status(TSRMLS_C)
+/* {{{ int php_output_get_status()
* Get output control status */
-PHPAPI int php_output_get_status(TSRMLS_D)
+PHPAPI int php_output_get_status(void)
{
return (
OG(flags)
@@ -236,47 +237,47 @@ PHPAPI int php_output_get_status(TSRMLS_D)
}
/* }}} */
-/* {{{ int php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC)
+/* {{{ int php_output_write_unbuffered(const char *str, size_t len)
* Unbuffered write */
-PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC)
+PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len)
{
if (OG(flags) & PHP_OUTPUT_DISABLED) {
return 0;
}
if (OG(flags) & PHP_OUTPUT_ACTIVATED) {
- return sapi_module.ub_write(str, len TSRMLS_CC);
+ return sapi_module.ub_write(str, len);
}
return php_output_direct(str, len);
}
/* }}} */
-/* {{{ int php_output_write(const char *str, size_t len TSRMLS_DC)
+/* {{{ int php_output_write(const char *str, size_t len)
* Buffered write */
-PHPAPI size_t php_output_write(const char *str, size_t len TSRMLS_DC)
+PHPAPI size_t php_output_write(const char *str, size_t len)
{
if (OG(flags) & PHP_OUTPUT_DISABLED) {
return 0;
}
if (OG(flags) & PHP_OUTPUT_ACTIVATED) {
- php_output_op(PHP_OUTPUT_HANDLER_WRITE, str, len TSRMLS_CC);
+ php_output_op(PHP_OUTPUT_HANDLER_WRITE, str, len);
return len;
}
return php_output_direct(str, len);
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_flush(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_flush(void)
* Flush the most recent output handlers buffer */
-PHPAPI int php_output_flush(TSRMLS_D)
+PHPAPI int php_output_flush(void)
{
php_output_context context;
if (OG(active) && (OG(active)->flags & PHP_OUTPUT_HANDLER_FLUSHABLE)) {
- php_output_context_init(&context, PHP_OUTPUT_HANDLER_FLUSH TSRMLS_CC);
+ php_output_context_init(&context, PHP_OUTPUT_HANDLER_FLUSH);
php_output_handler_op(OG(active), &context);
if (context.out.data && context.out.used) {
zend_stack_del_top(&OG(handlers));
- php_output_write(context.out.data, context.out.used TSRMLS_CC);
+ php_output_write(context.out.data, context.out.used);
zend_stack_push(&OG(handlers), &OG(active));
}
php_output_context_dtor(&context);
@@ -286,24 +287,24 @@ PHPAPI int php_output_flush(TSRMLS_D)
}
/* }}} */
-/* {{{ void php_output_flush_all(TSRMLS_C)
+/* {{{ void php_output_flush_all()
* Flush all output buffers subsequently */
-PHPAPI void php_output_flush_all(TSRMLS_D)
+PHPAPI void php_output_flush_all(void)
{
if (OG(active)) {
- php_output_op(PHP_OUTPUT_HANDLER_FLUSH, NULL, 0 TSRMLS_CC);
+ php_output_op(PHP_OUTPUT_HANDLER_FLUSH, NULL, 0);
}
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_clean(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_clean(void)
* Cleans the most recent output handlers buffer if the handler is cleanable */
-PHPAPI int php_output_clean(TSRMLS_D)
+PHPAPI int php_output_clean(void)
{
php_output_context context;
if (OG(active) && (OG(active)->flags & PHP_OUTPUT_HANDLER_CLEANABLE)) {
- php_output_context_init(&context, PHP_OUTPUT_HANDLER_CLEAN TSRMLS_CC);
+ php_output_context_init(&context, PHP_OUTPUT_HANDLER_CLEAN);
php_output_handler_op(OG(active), &context);
php_output_context_dtor(&context);
return SUCCESS;
@@ -312,69 +313,69 @@ PHPAPI int php_output_clean(TSRMLS_D)
}
/* }}} */
-/* {{{ void php_output_clean_all(TSRMLS_D)
+/* {{{ void php_output_clean_all(void)
* Cleans all output handler buffers, without regard whether the handler is cleanable */
-PHPAPI void php_output_clean_all(TSRMLS_D)
+PHPAPI void php_output_clean_all(void)
{
php_output_context context;
if (OG(active)) {
- php_output_context_init(&context, PHP_OUTPUT_HANDLER_CLEAN TSRMLS_CC);
+ php_output_context_init(&context, PHP_OUTPUT_HANDLER_CLEAN);
zend_stack_apply_with_argument(&OG(handlers), ZEND_STACK_APPLY_TOPDOWN, php_output_stack_apply_clean, &context);
}
}
-/* {{{ SUCCESS|FAILURE php_output_end(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_end(void)
* Finalizes the most recent output handler at pops it off the stack if the handler is removable */
-PHPAPI int php_output_end(TSRMLS_D)
+PHPAPI int php_output_end(void)
{
- if (php_output_stack_pop(PHP_OUTPUT_POP_TRY TSRMLS_CC)) {
+ if (php_output_stack_pop(PHP_OUTPUT_POP_TRY)) {
return SUCCESS;
}
return FAILURE;
}
/* }}} */
-/* {{{ void php_output_end_all(TSRMLS_D)
+/* {{{ void php_output_end_all(void)
* Finalizes all output handlers and ends output buffering without regard whether a handler is removable */
-PHPAPI void php_output_end_all(TSRMLS_D)
+PHPAPI void php_output_end_all(void)
{
- while (OG(active) && php_output_stack_pop(PHP_OUTPUT_POP_FORCE TSRMLS_CC));
+ while (OG(active) && php_output_stack_pop(PHP_OUTPUT_POP_FORCE));
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_discard(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_discard(void)
* Discards the most recent output handlers buffer and pops it off the stack if the handler is removable */
-PHPAPI int php_output_discard(TSRMLS_D)
+PHPAPI int php_output_discard(void)
{
- if (php_output_stack_pop(PHP_OUTPUT_POP_DISCARD|PHP_OUTPUT_POP_TRY TSRMLS_CC)) {
+ if (php_output_stack_pop(PHP_OUTPUT_POP_DISCARD|PHP_OUTPUT_POP_TRY)) {
return SUCCESS;
}
return FAILURE;
}
/* }}} */
-/* {{{ void php_output_discard_all(TSRMLS_D)
+/* {{{ void php_output_discard_all(void)
* Discard all output handlers and buffers without regard whether a handler is removable */
-PHPAPI void php_output_discard_all(TSRMLS_D)
+PHPAPI void php_output_discard_all(void)
{
while (OG(active)) {
- php_output_stack_pop(PHP_OUTPUT_POP_DISCARD|PHP_OUTPUT_POP_FORCE TSRMLS_CC);
+ php_output_stack_pop(PHP_OUTPUT_POP_DISCARD|PHP_OUTPUT_POP_FORCE);
}
}
/* }}} */
-/* {{{ int php_output_get_level(TSRMLS_D)
+/* {{{ int php_output_get_level(void)
* Get output buffering level, ie. how many output handlers the stack contains */
-PHPAPI int php_output_get_level(TSRMLS_D)
+PHPAPI int php_output_get_level(void)
{
return OG(active) ? zend_stack_count(&OG(handlers)) : 0;
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_get_contents(zval *z TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_get_contents(zval *z)
* Get the contents of the active output handlers buffer */
-PHPAPI int php_output_get_contents(zval *p TSRMLS_DC)
+PHPAPI int php_output_get_contents(zval *p)
{
if (OG(active)) {
ZVAL_STRINGL(p, OG(active)->buffer.data, OG(active)->buffer.used);
@@ -385,9 +386,9 @@ PHPAPI int php_output_get_contents(zval *p TSRMLS_DC)
}
}
-/* {{{ SUCCESS|FAILURE php_output_get_length(zval *z TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_get_length(zval *z)
* Get the length of the active output handlers buffer */
-PHPAPI int php_output_get_length(zval *p TSRMLS_DC)
+PHPAPI int php_output_get_length(zval *p)
{
if (OG(active)) {
ZVAL_LONG(p, OG(active)->buffer.used);
@@ -399,82 +400,82 @@ PHPAPI int php_output_get_length(zval *p TSRMLS_DC)
}
/* }}} */
-/* {{{ php_output_handler* php_output_get_active_handler(TSRMLS_D)
+/* {{{ php_output_handler* php_output_get_active_handler(void)
* Get active output handler */
-PHPAPI php_output_handler* php_output_get_active_handler(TSRMLS_D)
+PHPAPI php_output_handler* php_output_get_active_handler(void)
{
return OG(active);
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_start_default(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_handler_start_default(void)
* Start a "default output handler" */
-PHPAPI int php_output_start_default(TSRMLS_D)
+PHPAPI int php_output_start_default(void)
{
php_output_handler *handler;
- handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
- if (SUCCESS == php_output_handler_start(handler TSRMLS_CC)) {
+ handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
+ if (SUCCESS == php_output_handler_start(handler)) {
return SUCCESS;
}
- php_output_handler_free(&handler TSRMLS_CC);
+ php_output_handler_free(&handler);
return FAILURE;
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_start_devnull(TSRMLS_D)
+/* {{{ SUCCESS|FAILURE php_output_handler_start_devnull(void)
* Start a "null output handler" */
-PHPAPI int php_output_start_devnull(TSRMLS_D)
+PHPAPI int php_output_start_devnull(void)
{
php_output_handler *handler;
- handler = php_output_handler_create_internal(ZEND_STRL(php_output_devnull_handler_name), php_output_handler_devnull_func, PHP_OUTPUT_HANDLER_DEFAULT_SIZE, 0 TSRMLS_CC);
- if (SUCCESS == php_output_handler_start(handler TSRMLS_CC)) {
+ handler = php_output_handler_create_internal(ZEND_STRL(php_output_devnull_handler_name), php_output_handler_devnull_func, PHP_OUTPUT_HANDLER_DEFAULT_SIZE, 0);
+ if (SUCCESS == php_output_handler_start(handler)) {
return SUCCESS;
}
- php_output_handler_free(&handler TSRMLS_CC);
+ php_output_handler_free(&handler);
return FAILURE;
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_start_user(zval *handler, size_t chunk_size, int flags TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_start_user(zval *handler, size_t chunk_size, int flags)
* Start a user level output handler */
-PHPAPI int php_output_start_user(zval *output_handler, size_t chunk_size, int flags TSRMLS_DC)
+PHPAPI int php_output_start_user(zval *output_handler, size_t chunk_size, int flags)
{
php_output_handler *handler;
if (output_handler) {
- handler = php_output_handler_create_user(output_handler, chunk_size, flags TSRMLS_CC);
+ handler = php_output_handler_create_user(output_handler, chunk_size, flags);
} else {
- handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, chunk_size, flags TSRMLS_CC);
+ handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, chunk_size, flags);
}
- if (SUCCESS == php_output_handler_start(handler TSRMLS_CC)) {
+ if (SUCCESS == php_output_handler_start(handler)) {
return SUCCESS;
}
- php_output_handler_free(&handler TSRMLS_CC);
+ php_output_handler_free(&handler);
return FAILURE;
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_start_internal(zval *name, php_output_handler_func_t handler, size_t chunk_size, int flags TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_start_internal(zval *name, php_output_handler_func_t handler, size_t chunk_size, int flags)
* Start an internal output handler that does not have to maintain a non-global state */
-PHPAPI int php_output_start_internal(const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags TSRMLS_DC)
+PHPAPI int php_output_start_internal(const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags)
{
php_output_handler *handler;
- handler = php_output_handler_create_internal(name, name_len, php_output_handler_compat_func, chunk_size, flags TSRMLS_CC);
- php_output_handler_set_context(handler, output_handler, NULL TSRMLS_CC);
- if (SUCCESS == php_output_handler_start(handler TSRMLS_CC)) {
+ handler = php_output_handler_create_internal(name, name_len, php_output_handler_compat_func, chunk_size, flags);
+ php_output_handler_set_context(handler, output_handler, NULL);
+ if (SUCCESS == php_output_handler_start(handler)) {
return SUCCESS;
}
- php_output_handler_free(&handler TSRMLS_CC);
+ php_output_handler_free(&handler);
return FAILURE;
}
/* }}} */
-/* {{{ php_output_handler *php_output_handler_create_user(zval *handler, size_t chunk_size, int flags TSRMLS_DC)
+/* {{{ php_output_handler *php_output_handler_create_user(zval *handler, size_t chunk_size, int flags)
* Create a user level output handler */
-PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler, size_t chunk_size, int flags TSRMLS_DC)
+PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler, size_t chunk_size, int flags)
{
zend_string *handler_name = NULL;
char *error = NULL;
@@ -484,24 +485,24 @@ PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler,
switch (Z_TYPE_P(output_handler)) {
case IS_NULL:
- handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, chunk_size, flags TSRMLS_CC);
+ handler = php_output_handler_create_internal(ZEND_STRL(php_output_default_handler_name), php_output_handler_default_func, chunk_size, flags);
break;
case IS_STRING:
- if (Z_STRLEN_P(output_handler) && (alias = php_output_handler_alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler) TSRMLS_CC))) {
- handler = alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler), chunk_size, flags TSRMLS_CC);
+ if (Z_STRLEN_P(output_handler) && (alias = php_output_handler_alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler)))) {
+ handler = alias(Z_STRVAL_P(output_handler), Z_STRLEN_P(output_handler), chunk_size, flags);
break;
}
default:
user = ecalloc(1, sizeof(php_output_handler_user_func_t));
- if (SUCCESS == zend_fcall_info_init(output_handler, 0, &user->fci, &user->fcc, &handler_name, &error TSRMLS_CC)) {
- handler = php_output_handler_init(handler_name, chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_USER TSRMLS_CC);
+ if (SUCCESS == zend_fcall_info_init(output_handler, 0, &user->fci, &user->fcc, &handler_name, &error)) {
+ handler = php_output_handler_init(handler_name, chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_USER);
ZVAL_COPY(&user->zoh, output_handler);
handler->func.user = user;
} else {
efree(user);
}
if (error) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "%s", error);
+ php_error_docref("ref.outcontrol", E_WARNING, "%s", error);
efree(error);
}
if (handler_name) {
@@ -513,14 +514,14 @@ PHPAPI php_output_handler *php_output_handler_create_user(zval *output_handler,
}
/* }}} */
-/* {{{ php_output_handler *php_output_handler_create_internal(zval *name, php_output_handler_context_func_t handler, size_t chunk_size, int flags TSRMLS_DC)
+/* {{{ php_output_handler *php_output_handler_create_internal(zval *name, php_output_handler_context_func_t handler, size_t chunk_size, int flags)
* Create an internal output handler that can maintain a non-global state */
-PHPAPI php_output_handler *php_output_handler_create_internal(const char *name, size_t name_len, php_output_handler_context_func_t output_handler, size_t chunk_size, int flags TSRMLS_DC)
+PHPAPI php_output_handler *php_output_handler_create_internal(const char *name, size_t name_len, php_output_handler_context_func_t output_handler, size_t chunk_size, int flags)
{
php_output_handler *handler;
zend_string *str = zend_string_init(name, name_len, 1);
- handler = php_output_handler_init(str, chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_INTERNAL TSRMLS_CC);
+ handler = php_output_handler_init(str, chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_INTERNAL);
handler->func.internal = output_handler;
zend_string_release(str);
@@ -528,31 +529,31 @@ PHPAPI php_output_handler *php_output_handler_create_internal(const char *name,
}
/* }}} */
-/* {{{ void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void* TSRMLS_DC) TSRMLS_DC)
+/* {{{ void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void*))
* Set the context/state of an output handler. Calls the dtor of the previous context if there is one */
-PHPAPI void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void* TSRMLS_DC) TSRMLS_DC)
+PHPAPI void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void*))
{
if (handler->dtor && handler->opaq) {
- handler->dtor(handler->opaq TSRMLS_CC);
+ handler->dtor(handler->opaq);
}
handler->dtor = dtor;
handler->opaq = opaq;
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_start(php_output_handler *handler TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_handler_start(php_output_handler *handler)
* Starts the set up output handler and pushes it on top of the stack. Checks for any conflicts regarding the output handler to start */
-PHPAPI int php_output_handler_start(php_output_handler *handler TSRMLS_DC)
+PHPAPI int php_output_handler_start(php_output_handler *handler)
{
HashPosition pos;
HashTable *rconflicts;
php_output_handler_conflict_check_t conflict;
- if (php_output_lock_error(PHP_OUTPUT_HANDLER_START TSRMLS_CC) || !handler) {
+ if (php_output_lock_error(PHP_OUTPUT_HANDLER_START) || !handler) {
return FAILURE;
}
if (NULL != (conflict = zend_hash_find_ptr(&php_output_handler_conflicts, handler->name))) {
- if (SUCCESS != conflict(handler->name->val, handler->name->len TSRMLS_CC)) {
+ if (SUCCESS != conflict(handler->name->val, handler->name->len)) {
return FAILURE;
}
}
@@ -561,7 +562,7 @@ PHPAPI int php_output_handler_start(php_output_handler *handler TSRMLS_DC)
(conflict = zend_hash_get_current_data_ptr_ex(rconflicts, &pos)) != NULL;
zend_hash_move_forward_ex(rconflicts, &pos)
) {
- if (SUCCESS != conflict(handler->name->val, handler->name->len TSRMLS_CC)) {
+ if (SUCCESS != conflict(handler->name->val, handler->name->len)) {
return FAILURE;
}
}
@@ -573,12 +574,12 @@ PHPAPI int php_output_handler_start(php_output_handler *handler TSRMLS_DC)
}
/* }}} */
-/* {{{ int php_output_handler_started(zval *name TSRMLS_DC)
+/* {{{ int php_output_handler_started(zval *name)
* Check whether a certain output handler is in use */
-PHPAPI int php_output_handler_started(const char *name, size_t name_len TSRMLS_DC)
+PHPAPI int php_output_handler_started(const char *name, size_t name_len)
{
php_output_handler **handlers;
- int i, count = php_output_get_level(TSRMLS_C);
+ int i, count = php_output_get_level();
if (count) {
handlers = (php_output_handler **) zend_stack_base(&OG(handlers));
@@ -594,15 +595,15 @@ PHPAPI int php_output_handler_started(const char *name, size_t name_len TSRMLS_D
}
/* }}} */
-/* {{{ int php_output_handler_conflict(zval *handler_new, zval *handler_old TSRMLS_DC)
+/* {{{ int php_output_handler_conflict(zval *handler_new, zval *handler_old)
* Check whether a certain handler is in use and issue a warning that the new handler would conflict with the already used one */
-PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len TSRMLS_DC)
+PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len)
{
- if (php_output_handler_started(handler_set, handler_set_len TSRMLS_CC)) {
+ if (php_output_handler_started(handler_set, handler_set_len)) {
if (handler_new_len != handler_set_len || memcmp(handler_new, handler_set, handler_set_len)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler '%s' conflicts with '%s'", handler_new, handler_set);
+ php_error_docref("ref.outcontrol", E_WARNING, "output handler '%s' conflicts with '%s'", handler_new, handler_set);
} else {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler '%s' cannot be used twice", handler_new);
+ php_error_docref("ref.outcontrol", E_WARNING, "output handler '%s' cannot be used twice", handler_new);
}
return 1;
}
@@ -610,9 +611,9 @@ PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_n
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_conflict_register(zval *name, php_output_handler_conflict_check_t check_func TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_handler_conflict_register(zval *name, php_output_handler_conflict_check_t check_func)
* Register a conflict checking function on MINIT */
-PHPAPI int php_output_handler_conflict_register(const char *name, size_t name_len, php_output_handler_conflict_check_t check_func TSRMLS_DC)
+PHPAPI int php_output_handler_conflict_register(const char *name, size_t name_len, php_output_handler_conflict_check_t check_func)
{
if (!EG(current_module)) {
zend_error(E_ERROR, "Cannot register an output handler conflict outside of MINIT");
@@ -622,9 +623,9 @@ PHPAPI int php_output_handler_conflict_register(const char *name, size_t name_le
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_reverse_conflict_register(zval *name, php_output_handler_conflict_check_t check_func TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_handler_reverse_conflict_register(zval *name, php_output_handler_conflict_check_t check_func)
* Register a reverse conflict checking function on MINIT */
-PHPAPI int php_output_handler_reverse_conflict_register(const char *name, size_t name_len, php_output_handler_conflict_check_t check_func TSRMLS_DC)
+PHPAPI int php_output_handler_reverse_conflict_register(const char *name, size_t name_len, php_output_handler_conflict_check_t check_func)
{
HashTable rev, *rev_ptr = NULL;
@@ -650,17 +651,17 @@ PHPAPI int php_output_handler_reverse_conflict_register(const char *name, size_t
}
/* }}} */
-/* {{{ php_output_handler_alias_ctor_t php_output_handler_alias(zval *name TSRMLS_DC)
+/* {{{ php_output_handler_alias_ctor_t php_output_handler_alias(zval *name)
* Get an internal output handler for a user handler if it exists */
-PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias(const char *name, size_t name_len TSRMLS_DC)
+PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias(const char *name, size_t name_len)
{
return zend_hash_str_find_ptr(&php_output_handler_aliases, name, name_len);
}
/* }}} */
-/* {{{ SUCCESS|FAILURE php_output_handler_alias_register(zval *name, php_output_handler_alias_ctor_t func TSRMLS_DC)
+/* {{{ SUCCESS|FAILURE php_output_handler_alias_register(zval *name, php_output_handler_alias_ctor_t func)
* Registers an internal output handler as alias for a user handler */
-PHPAPI int php_output_handler_alias_register(const char *name, size_t name_len, php_output_handler_alias_ctor_t func TSRMLS_DC)
+PHPAPI int php_output_handler_alias_register(const char *name, size_t name_len, php_output_handler_alias_ctor_t func)
{
if (!EG(current_module)) {
zend_error(E_ERROR, "Cannot register an output handler alias outside of MINIT");
@@ -672,7 +673,7 @@ PHPAPI int php_output_handler_alias_register(const char *name, size_t name_len,
/* {{{ SUCCESS|FAILURE php_output_handler_hook(php_output_handler_hook_t type, void *arg TSMRLS_DC)
* Output handler hook for output handler functions to check/modify the current handlers abilities */
-PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg TSRMLS_DC)
+PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg)
{
if (OG(running)) {
switch (type) {
@@ -699,9 +700,9 @@ PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg TSR
}
/* }}} */
-/* {{{ void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC)
+/* {{{ void php_output_handler_dtor(php_output_handler *handler)
* Destroy an output handler */
-PHPAPI void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC)
+PHPAPI void php_output_handler_dtor(php_output_handler *handler)
{
if (handler->name) {
zend_string_release(handler->name);
@@ -714,7 +715,7 @@ PHPAPI void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC)
efree(handler->func.user);
}
if (handler->dtor && handler->opaq) {
- handler->dtor(handler->opaq TSRMLS_CC);
+ handler->dtor(handler->opaq);
}
memset(handler, 0, sizeof(*handler));
}
@@ -722,19 +723,19 @@ PHPAPI void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC)
/* {{{ void php_output_handler_free(php_output_handler **handler TSMRLS_DC)
* Destroy and free an output handler */
-PHPAPI void php_output_handler_free(php_output_handler **h TSRMLS_DC)
+PHPAPI void php_output_handler_free(php_output_handler **h)
{
if (*h) {
- php_output_handler_dtor(*h TSRMLS_CC);
+ php_output_handler_dtor(*h);
efree(*h);
*h = NULL;
}
}
/* }}} */
-/* void php_output_set_implicit_flush(int enabled TSRMLS_DC)
+/* void php_output_set_implicit_flush(int enabled)
* Enable or disable implicit flush */
-PHPAPI void php_output_set_implicit_flush(int flush TSRMLS_DC)
+PHPAPI void php_output_set_implicit_flush(int flush)
{
if (flush) {
OG(flags) |= PHP_OUTPUT_IMPLICITFLUSH;
@@ -744,47 +745,46 @@ PHPAPI void php_output_set_implicit_flush(int flush TSRMLS_DC)
}
/* }}} */
-/* {{{ char *php_output_get_start_filename(TSRMLS_D)
+/* {{{ char *php_output_get_start_filename(void)
* Get the file name where output has started */
-PHPAPI const char *php_output_get_start_filename(TSRMLS_D)
+PHPAPI const char *php_output_get_start_filename(void)
{
return OG(output_start_filename);
}
/* }}} */
-/* {{{ int php_output_get_start_lineno(TSRMLS_D)
+/* {{{ int php_output_get_start_lineno(void)
* Get the line number where output has started */
-PHPAPI int php_output_get_start_lineno(TSRMLS_D)
+PHPAPI int php_output_get_start_lineno(void)
{
return OG(output_start_lineno);
}
/* }}} */
-/* {{{ static int php_output_lock_error(int op TSRMLS_DC)
+/* {{{ static int php_output_lock_error(int op)
* Checks whether an unallowed operation is attempted from within the output handler and issues a fatal error */
-static inline int php_output_lock_error(int op TSRMLS_DC)
+static inline int php_output_lock_error(int op)
{
/* if there's no ob active, ob has been stopped */
if (op && OG(active) && OG(running)) {
/* fatal error */
- php_output_deactivate(TSRMLS_C);
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_ERROR, "Cannot use output buffering in output buffering display handlers");
+ php_output_deactivate();
+ php_error_docref("ref.outcontrol", E_ERROR, "Cannot use output buffering in output buffering display handlers");
return 1;
}
return 0;
}
/* }}} */
-/* {{{ static php_output_context *php_output_context_init(php_output_context *context, int op TSRMLS_DC)
+/* {{{ static php_output_context *php_output_context_init(php_output_context *context, int op)
* Initialize a new output context */
-static inline php_output_context *php_output_context_init(php_output_context *context, int op TSRMLS_DC)
+static inline php_output_context *php_output_context_init(php_output_context *context, int op)
{
if (!context) {
context = emalloc(sizeof(php_output_context));
}
memset(context, 0, sizeof(php_output_context));
- TSRMLS_SET_CTX(context->tsrm_ls);
context->op = op;
return context;
@@ -864,9 +864,9 @@ static inline void php_output_context_dtor(php_output_context *context)
}
/* }}} */
-/* {{{ static php_output_handler *php_output_handler_init(zval *name, size_t chunk_size, int flags TSRMLS_DC)
+/* {{{ static php_output_handler *php_output_handler_init(zval *name, size_t chunk_size, int flags)
* Allocates and initializes a php_output_handler structure */
-static inline php_output_handler *php_output_handler_init(zend_string *name, size_t chunk_size, int flags TSRMLS_DC)
+static inline php_output_handler *php_output_handler_init(zend_string *name, size_t chunk_size, int flags)
{
php_output_handler *handler;
@@ -881,9 +881,9 @@ static inline php_output_handler *php_output_handler_init(zend_string *name, siz
}
/* }}} */
-/* {{{ static int php_output_handler_appen(php_output_handler *handler, const php_output_buffer *buf TSRMLS_DC)
+/* {{{ static int php_output_handler_appen(php_output_handler *handler, const php_output_buffer *buf)
* Appends input to the output handlers buffer and indicates whether the buffer does not have to be processed by the output handler */
-static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf TSRMLS_DC)
+static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf)
{
if (buf->used) {
OG(flags) |= PHP_OUTPUT_WRITTEN;
@@ -939,13 +939,13 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
);
#endif
- if (php_output_lock_error(context->op TSRMLS_CC)) {
+ if (php_output_lock_error(context->op)) {
/* fatal error */
return PHP_OUTPUT_HANDLER_FAILURE;
}
/* storable? */
- if (php_output_handler_append(handler, &context->in TSRMLS_CC) && !context->op) {
+ if (php_output_handler_append(handler, &context->in) && !context->op) {
context->op = original_op;
return PHP_OUTPUT_HANDLER_NO_DATA;
} else {
@@ -960,11 +960,11 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
ZVAL_STRINGL(&ob_data, handler->buffer.data, handler->buffer.used);
ZVAL_LONG(&ob_mode, (zend_long) context->op);
- zend_fcall_info_argn(&handler->func.user->fci TSRMLS_CC, 2, &ob_data, &ob_mode);
+ zend_fcall_info_argn(&handler->func.user->fci, 2, &ob_data, &ob_mode);
zval_ptr_dtor(&ob_data);
#define PHP_OUTPUT_USER_SUCCESS(retval) ((Z_TYPE(retval) != IS_UNDEF) && !(Z_TYPE(retval) == IS_FALSE))
- if (SUCCESS == zend_fcall_info_call(&handler->func.user->fci, &handler->func.user->fcc, &retval, NULL TSRMLS_CC) && PHP_OUTPUT_USER_SUCCESS(retval)) {
+ if (SUCCESS == zend_fcall_info_call(&handler->func.user->fci, &handler->func.user->fcc, &retval, NULL) && PHP_OUTPUT_USER_SUCCESS(retval)) {
/* user handler may have returned TRUE */
status = PHP_OUTPUT_HANDLER_NO_DATA;
if (Z_TYPE(retval) != IS_FALSE && Z_TYPE(retval) != IS_TRUE) {
@@ -981,7 +981,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
status = PHP_OUTPUT_HANDLER_FAILURE;
}
- zend_fcall_info_argn(&handler->func.user->fci TSRMLS_CC, 0);
+ zend_fcall_info_argn(&handler->func.user->fci, 0);
zval_ptr_dtor(&retval);
} else {
@@ -1035,19 +1035,19 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
/* }}} */
-/* {{{ static void php_output_op(int op, const char *str, size_t len TSRMLS_DC)
+/* {{{ static void php_output_op(int op, const char *str, size_t len)
* Output op dispatcher, passes input and output handlers output through the output handler stack until it gets written to the SAPI */
-static inline void php_output_op(int op, const char *str, size_t len TSRMLS_DC)
+static inline void php_output_op(int op, const char *str, size_t len)
{
php_output_context context;
php_output_handler **active;
int obh_cnt;
- if (php_output_lock_error(op TSRMLS_CC)) {
+ if (php_output_lock_error(op)) {
return;
}
- php_output_context_init(&context, op TSRMLS_CC);
+ php_output_context_init(&context, op);
/*
* broken up for better performance:
@@ -1071,16 +1071,16 @@ static inline void php_output_op(int op, const char *str, size_t len TSRMLS_DC)
}
if (context.out.data && context.out.used) {
- php_output_header(TSRMLS_C);
+ php_output_header();
if (!(OG(flags) & PHP_OUTPUT_DISABLED)) {
#if PHP_OUTPUT_DEBUG
fprintf(stderr, "::: sapi_write('%s', %zu)\n", context.out.data, context.out.used);
#endif
- sapi_module.ub_write(context.out.data, context.out.used TSRMLS_CC);
+ sapi_module.ub_write(context.out.data, context.out.used);
if (OG(flags) & PHP_OUTPUT_IMPLICITFLUSH) {
- sapi_flush(TSRMLS_C);
+ sapi_flush();
}
OG(flags) |= PHP_OUTPUT_SENT;
@@ -1195,25 +1195,25 @@ static inline zval *php_output_handler_status(php_output_handler *handler, zval
}
/* }}} */
-/* {{{ static int php_output_stack_pop(int flags TSRMLS_DC)
+/* {{{ static int php_output_stack_pop(int flags)
* Pops an output handler off the stack */
-static inline int php_output_stack_pop(int flags TSRMLS_DC)
+static inline int php_output_stack_pop(int flags)
{
php_output_context context;
php_output_handler **current, *orphan = OG(active);
if (!orphan) {
if (!(flags & PHP_OUTPUT_POP_SILENT)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to %s buffer. No buffer to %s", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send");
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to %s buffer. No buffer to %s", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send");
}
return 0;
} else if (!(flags & PHP_OUTPUT_POP_FORCE) && !(orphan->flags & PHP_OUTPUT_HANDLER_REMOVABLE)) {
if (!(flags & PHP_OUTPUT_POP_SILENT)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to %s buffer of %s (%d)", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send", orphan->name->val, orphan->level);
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to %s buffer of %s (%d)", (flags&PHP_OUTPUT_POP_DISCARD)?"discard":"send", orphan->name->val, orphan->level);
}
return 0;
} else {
- php_output_context_init(&context, PHP_OUTPUT_HANDLER_FINAL TSRMLS_CC);
+ php_output_context_init(&context, PHP_OUTPUT_HANDLER_FINAL);
/* don't run the output handler if it's disabled */
if (!(orphan->flags & PHP_OUTPUT_HANDLER_DISABLED)) {
@@ -1238,11 +1238,11 @@ static inline int php_output_stack_pop(int flags TSRMLS_DC)
/* pass output along */
if (context.out.data && context.out.used && !(flags & PHP_OUTPUT_POP_DISCARD)) {
- php_output_write(context.out.data, context.out.used TSRMLS_CC);
+ php_output_write(context.out.data, context.out.used);
}
/* destroy the handler (after write!) */
- php_output_handler_free(&orphan TSRMLS_CC);
+ php_output_handler_free(&orphan);
php_output_context_dtor(&context);
return 1;
@@ -1261,7 +1261,7 @@ static int php_output_handler_compat_func(void **handler_context, php_output_con
char *out_str = NULL;
size_t out_len = 0;
- func(output_context->in.data, output_context->in.used, &out_str, &out_len, output_context->op TSRMLS_CC);
+ func(output_context->in.data, output_context->in.used, &out_str, &out_len, output_context->op);
if (out_str) {
output_context->out.data = out_str;
@@ -1306,7 +1306,7 @@ PHP_FUNCTION(ob_start)
zend_long chunk_size = 0;
zend_long flags = PHP_OUTPUT_HANDLER_STDFLAGS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/ll", &output_handler, &chunk_size, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z/ll", &output_handler, &chunk_size, &flags) == FAILURE) {
return;
}
@@ -1314,8 +1314,8 @@ PHP_FUNCTION(ob_start)
chunk_size = 0;
}
- if (php_output_start_user(output_handler, chunk_size, flags TSRMLS_CC) == FAILURE) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to create buffer");
+ if (php_output_start_user(output_handler, chunk_size, flags) == FAILURE) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to create buffer");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1331,12 +1331,12 @@ PHP_FUNCTION(ob_flush)
}
if (!OG(active)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer. No buffer to flush");
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to flush buffer. No buffer to flush");
RETURN_FALSE;
}
- if (SUCCESS != php_output_flush(TSRMLS_C)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
+ if (SUCCESS != php_output_flush()) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to flush buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1352,12 +1352,12 @@ PHP_FUNCTION(ob_clean)
}
if (!OG(active)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete");
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer. No buffer to delete");
RETURN_FALSE;
}
- if (SUCCESS != php_output_clean(TSRMLS_C)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
+ if (SUCCESS != php_output_clean()) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1373,11 +1373,11 @@ PHP_FUNCTION(ob_end_flush)
}
if (!OG(active)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush");
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush");
RETURN_FALSE;
}
- RETURN_BOOL(SUCCESS == php_output_end(TSRMLS_C));
+ RETURN_BOOL(SUCCESS == php_output_end());
}
/* }}} */
@@ -1390,11 +1390,11 @@ PHP_FUNCTION(ob_end_clean)
}
if (!OG(active)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete");
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer. No buffer to delete");
RETURN_FALSE;
}
- RETURN_BOOL(SUCCESS == php_output_discard(TSRMLS_C));
+ RETURN_BOOL(SUCCESS == php_output_discard());
}
/* }}} */
@@ -1406,13 +1406,13 @@ PHP_FUNCTION(ob_get_flush)
return;
}
- if (php_output_get_contents(return_value TSRMLS_CC) == FAILURE) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush");
+ if (php_output_get_contents(return_value) == FAILURE) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush");
RETURN_FALSE;
}
- if (SUCCESS != php_output_end(TSRMLS_C)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
+ if (SUCCESS != php_output_end()) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
}
}
/* }}} */
@@ -1429,13 +1429,13 @@ PHP_FUNCTION(ob_get_clean)
RETURN_FALSE;
}
- if (php_output_get_contents(return_value TSRMLS_CC) == FAILURE) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete");
+ if (php_output_get_contents(return_value) == FAILURE) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer. No buffer to delete");
RETURN_FALSE;
}
- if (SUCCESS != php_output_discard(TSRMLS_C)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
+ if (SUCCESS != php_output_discard()) {
+ php_error_docref("ref.outcontrol", E_NOTICE, "failed to delete buffer of %s (%d)", OG(active)->name->val, OG(active)->level);
}
}
/* }}} */
@@ -1448,7 +1448,7 @@ PHP_FUNCTION(ob_get_contents)
return;
}
- if (php_output_get_contents(return_value TSRMLS_CC) == FAILURE) {
+ if (php_output_get_contents(return_value) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1462,7 +1462,7 @@ PHP_FUNCTION(ob_get_level)
return;
}
- RETURN_LONG(php_output_get_level(TSRMLS_C));
+ RETURN_LONG(php_output_get_level());
}
/* }}} */
@@ -1474,7 +1474,7 @@ PHP_FUNCTION(ob_get_length)
return;
}
- if (php_output_get_length(return_value TSRMLS_CC) == FAILURE) {
+ if (php_output_get_length(return_value) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1504,7 +1504,7 @@ PHP_FUNCTION(ob_get_status)
{
zend_bool full_status = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_status) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_status) == FAILURE) {
return;
}
@@ -1528,11 +1528,11 @@ PHP_FUNCTION(ob_implicit_flush)
{
zend_long flag = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
return;
}
- php_output_set_implicit_flush(flag TSRMLS_CC);
+ php_output_set_implicit_flush(flag);
}
/* }}} */
@@ -1540,7 +1540,7 @@ PHP_FUNCTION(ob_implicit_flush)
Reset(clear) URL rewriter values */
PHP_FUNCTION(output_reset_rewrite_vars)
{
- if (php_url_scanner_reset_vars(TSRMLS_C) == SUCCESS) {
+ if (php_url_scanner_reset_vars() == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1555,11 +1555,11 @@ PHP_FUNCTION(output_add_rewrite_var)
char *name, *value;
size_t name_len, value_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
- if (php_url_scanner_add_var(name, name_len, value, value_len, 1 TSRMLS_CC) == SUCCESS) {
+ if (php_url_scanner_add_var(name, name_len, value, value_len, 1) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
diff --git a/main/php.h b/main/php.h
index 2a683e1924..515d1bb9c1 100644
--- a/main/php.h
+++ b/main/php.h
@@ -280,11 +280,11 @@ ssize_t pread(int, void *, size_t, off64_t);
BEGIN_EXTERN_C()
void phperror(char *error);
-PHPAPI size_t php_write(void *buf, size_t size TSRMLS_DC);
+PHPAPI size_t php_write(void *buf, size_t size);
PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1,
2);
PHPAPI int php_get_module_initialized(void);
-PHPAPI void php_log_err(char *log_message TSRMLS_DC);
+PHPAPI void php_log_err(char *log_message);
int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
int cfgparse(void);
END_EXTERN_C()
@@ -293,13 +293,13 @@ END_EXTERN_C()
#define error_handling_t zend_error_handling_t
BEGIN_EXTERN_C()
-static inline ZEND_ATTRIBUTE_DEPRECATED void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC)
+static inline ZEND_ATTRIBUTE_DEPRECATED void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class)
{
- zend_replace_error_handling(error_handling, exception_class, NULL TSRMLS_CC);
+ zend_replace_error_handling(error_handling, exception_class, NULL);
}
static inline ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling() {}
-PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
+PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
#ifdef ZTS
#define PHP_ATTR_FMT_OFFSET 1
@@ -308,14 +308,14 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
#endif
/* PHPAPI void php_error(int type, const char *format, ...); */
-PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
+PHPAPI void php_error_docref0(const char *docref, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4);
-PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
+PHPAPI void php_error_docref1(const char *docref, const char *param1, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5);
-PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...)
+PHPAPI void php_error_docref2(const char *docref, const char *param1, const char *param2, int type, const char *format, ...)
PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6);
#ifdef PHP_WIN32
-PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2 TSRMLS_DC);
+PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2);
#endif
END_EXTERN_C()
@@ -332,12 +332,12 @@ END_EXTERN_C()
/* functions */
BEGIN_EXTERN_C()
-PHPAPI extern int (*php_register_internal_extensions_func)(TSRMLS_D);
-PHPAPI int php_register_internal_extensions(TSRMLS_D);
-PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
+PHPAPI extern int (*php_register_internal_extensions_func)(void);
+PHPAPI int php_register_internal_extensions(void);
+PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void *));
PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata);
-PHPAPI void php_com_initialize(TSRMLS_D);
-PHPAPI char *php_get_current_user(TSRMLS_D);
+PHPAPI void php_com_initialize(void);
+PHPAPI char *php_get_current_user(void);
END_EXTERN_C()
/* PHP-named Zend macro wrappers */
diff --git a/main/php_content_types.c b/main/php_content_types.c
index 8765a507bc..9be3a0eb45 100644
--- a/main/php_content_types.c
+++ b/main/php_content_types.c
@@ -40,7 +40,7 @@ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader)
if (!strcmp(SG(request_info).request_method, "POST")) {
if (NULL == SG(request_info).post_entry) {
/* no post handler registered, so we just swallow the data */
- sapi_read_standard_form_data(TSRMLS_C);
+ sapi_read_standard_form_data();
}
}
}
@@ -48,20 +48,20 @@ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader)
/* {{{ php_startup_sapi_content_types
*/
-int php_startup_sapi_content_types(TSRMLS_D)
+int php_startup_sapi_content_types(void)
{
- sapi_register_default_post_reader(php_default_post_reader TSRMLS_CC);
- sapi_register_treat_data(php_default_treat_data TSRMLS_CC);
- sapi_register_input_filter(php_default_input_filter, NULL TSRMLS_CC);
+ sapi_register_default_post_reader(php_default_post_reader);
+ sapi_register_treat_data(php_default_treat_data);
+ sapi_register_input_filter(php_default_input_filter, NULL);
return SUCCESS;
}
/* }}} */
/* {{{ php_setup_sapi_content_types
*/
-int php_setup_sapi_content_types(TSRMLS_D)
+int php_setup_sapi_content_types(void)
{
- sapi_register_post_entries(php_post_entries TSRMLS_CC);
+ sapi_register_post_entries(php_post_entries);
return SUCCESS;
}
diff --git a/main/php_content_types.h b/main/php_content_types.h
index 0a49d1e2cd..ab364e2c17 100644
--- a/main/php_content_types.h
+++ b/main/php_content_types.h
@@ -25,7 +25,7 @@
SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader);
SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler);
-int php_startup_sapi_content_types(TSRMLS_D);
-int php_setup_sapi_content_types(TSRMLS_D);
+int php_startup_sapi_content_types(void);
+int php_setup_sapi_content_types(void);
#endif /* PHP_CONTENT_TYPES_H */
diff --git a/main/php_globals.h b/main/php_globals.h
index a60efe69de..76933d8f07 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -26,7 +26,7 @@
typedef struct _php_core_globals php_core_globals;
#ifdef ZTS
-# define PG(v) TSRMG(core_globals_id, php_core_globals *, v)
+# define PG(v) ZEND_TSRMG(core_globals_id, php_core_globals *, v)
extern PHPAPI int core_globals_id;
#else
# define PG(v) (core_globals.v)
diff --git a/main/php_ini.c b/main/php_ini.c
index 5303bf77ec..93b55ded33 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -74,7 +74,7 @@ PHPAPI char *php_ini_scanned_files=NULL;
/* {{{ php_ini_displayer_cb
*/
-static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
+static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
{
if (ini_entry->displayer) {
ini_entry->displayer(ini_entry, type);
@@ -112,7 +112,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
}
if (esc_html) {
- php_html_puts(display_string, display_string_length TSRMLS_CC);
+ php_html_puts(display_string, display_string_length);
} else {
PHPWRITE(display_string, display_string_length);
}
@@ -122,7 +122,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC)
/* {{{ php_ini_displayer
*/
-static int php_ini_displayer(zval *el, void *arg TSRMLS_DC)
+static int php_ini_displayer(zval *el, void *arg)
{
zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el);
int module_number = *(int *)arg;
@@ -135,16 +135,16 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC)
PUTS("<td class=\"e\">");
PHPWRITE(ini_entry->name->val, ini_entry->name->len);
PUTS("</td><td class=\"v\">");
- php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
+ php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE);
PUTS("</td><td class=\"v\">");
- php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
+ php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG);
PUTS("</td></tr>\n");
} else {
PHPWRITE(ini_entry->name->val, ini_entry->name->len);
PUTS(" => ");
- php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC);
+ php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE);
PUTS(" => ");
- php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC);
+ php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG);
PUTS("\n");
}
return 0;
@@ -153,7 +153,7 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC)
/* {{{ php_ini_available
*/
-static int php_ini_available(zval *el, void *arg TSRMLS_DC)
+static int php_ini_available(zval *el, void *arg)
{
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
int *module_number_available = (int *)arg;
@@ -171,7 +171,6 @@ static int php_ini_available(zval *el, void *arg TSRMLS_DC)
PHPAPI void display_ini_entries(zend_module_entry *module)
{
int module_number, module_number_available;
- TSRMLS_FETCH();
if (module) {
module_number = module->module_number;
@@ -179,11 +178,11 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
module_number = 0;
}
module_number_available = module_number;
- zend_hash_apply_with_argument(EG(ini_directives), php_ini_available, &module_number_available TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(ini_directives), php_ini_available, &module_number_available);
if (module_number_available == -1) {
php_info_print_table_start();
php_info_print_table_header(3, "Directive", "Local Value", "Master Value");
- zend_hash_apply_with_argument(EG(ini_directives), php_ini_displayer, (void *)&module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(ini_directives), php_ini_displayer, (void *)&module_number);
php_info_print_table_end();
}
}
@@ -343,23 +342,23 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
/* {{{ php_load_php_extension_cb
*/
-static void php_load_php_extension_cb(void *arg TSRMLS_DC)
+static void php_load_php_extension_cb(void *arg)
{
#ifdef HAVE_LIBDL
- php_load_extension(*((char **) arg), MODULE_PERSISTENT, 0 TSRMLS_CC);
+ php_load_extension(*((char **) arg), MODULE_PERSISTENT, 0);
#endif
}
/* }}} */
/* {{{ php_load_zend_extension_cb
*/
-static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
+static void php_load_zend_extension_cb(void *arg)
{
char *filename = *((char **) arg);
const int length = (int)strlen(filename);
if (IS_ABSOLUTE_PATH(filename, length)) {
- zend_load_extension(filename TSRMLS_CC);
+ zend_load_extension(filename);
} else {
char *libpath;
char *extension_dir = INI_STR("extension_dir");
@@ -370,7 +369,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
} else {
spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename);
}
- zend_load_extension(libpath TSRMLS_CC);
+ zend_load_extension(libpath);
efree(libpath);
}
}
@@ -378,7 +377,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
/* {{{ php_init_config
*/
-int php_init_config(TSRMLS_D)
+int php_init_config(void)
{
char *php_ini_file_name = NULL;
char *php_ini_search_path = NULL;
@@ -552,7 +551,7 @@ int php_init_config(TSRMLS_D)
if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) {
fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r");
if (fh.handle.fp) {
- fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC);
+ fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL);
}
}
}
@@ -563,7 +562,7 @@ int php_init_config(TSRMLS_D)
const char *fmt = "php-%s.ini";
char *ini_fname;
spprintf(&ini_fname, 0, fmt, sapi_module.name);
- fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
+ fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path);
efree(ini_fname);
if (fh.handle.fp) {
fh.filename = php_ini_opened_path;
@@ -572,7 +571,7 @@ int php_init_config(TSRMLS_D)
/* If still no ini file found, search for php.ini file in search path */
if (!fh.handle.fp) {
- fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
+ fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path);
if (fh.handle.fp) {
fh.filename = php_ini_opened_path;
}
@@ -589,7 +588,7 @@ int php_init_config(TSRMLS_D)
fh.type = ZEND_HANDLE_FP;
RESET_ACTIVE_INI_HASH();
- zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);
+ zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash);
{
zval tmp;
@@ -664,7 +663,7 @@ int php_init_config(TSRMLS_D)
fh2.filename = ini_file;
fh2.type = ZEND_HANDLE_FP;
- if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC) == SUCCESS) {
+ if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash) == SUCCESS) {
/* Here, add it to the list of ini files read */
l = (int)strlen(ini_file);
total_l += l + 2;
@@ -705,7 +704,7 @@ int php_init_config(TSRMLS_D)
if (sapi_module.ini_entries) {
/* Reset active ini section */
RESET_ACTIVE_INI_HASH();
- zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);
+ zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash);
}
return SUCCESS;
@@ -731,10 +730,10 @@ int php_shutdown_config(void)
/* {{{ php_ini_register_extensions
*/
-void php_ini_register_extensions(TSRMLS_D)
+void php_ini_register_extensions(void)
{
- zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC);
- zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb TSRMLS_CC);
+ zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
+ zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
zend_llist_destroy(&extension_lists.engine);
zend_llist_destroy(&extension_lists.functions);
@@ -743,7 +742,7 @@ void php_ini_register_extensions(TSRMLS_D)
/* {{{ php_parse_user_ini_file
*/
-PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash TSRMLS_DC)
+PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash)
{
zend_stat_t sb;
char ini_file[MAXPATHLEN];
@@ -761,7 +760,7 @@ PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, Hash
/* Reset active ini section */
RESET_ACTIVE_INI_HASH();
- if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash TSRMLS_CC) == SUCCESS) {
+ if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash) == SUCCESS) {
/* FIXME: Add parsed file to the list of user files read? */
return SUCCESS;
}
@@ -775,7 +774,7 @@ PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, Hash
/* {{{ php_ini_activate_config
*/
-PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage TSRMLS_DC)
+PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage)
{
zend_string *str;
zval *data;
@@ -787,7 +786,7 @@ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int
zend_hash_move_forward(source_hash)
) {
data = zend_hash_get_current_data(source_hash);
- zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0);
}
}
/* }}} */
@@ -802,7 +801,7 @@ PHPAPI int php_ini_has_per_dir_config(void)
/* {{{ php_ini_activate_per_dir_config
*/
-PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len TSRMLS_DC)
+PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
{
zval *tmp2;
char *ptr;
@@ -834,7 +833,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len TSRMLS_D
*ptr = 0;
/* Search for source array matching the path from configuration_hash */
if ((tmp2 = zend_hash_str_find(&configuration_hash, path, strlen(path))) != NULL) {
- php_ini_activate_config(Z_ARRVAL_P(tmp2), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
+ php_ini_activate_config(Z_ARRVAL_P(tmp2), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
*ptr = '/';
ptr++;
@@ -853,14 +852,14 @@ PHPAPI int php_ini_has_per_host_config(void)
/* {{{ php_ini_activate_per_host_config
*/
-PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len TSRMLS_DC)
+PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len)
{
zval *tmp;
if (has_per_host_config && host && host_len) {
/* Search for source array matching the host from configuration_hash */
if ((tmp = zend_hash_str_find(&configuration_hash, host, host_len)) != NULL) {
- php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
+ php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
}
}
diff --git a/main/php_ini.h b/main/php_ini.h
index 7022507f51..235cc68888 100644
--- a/main/php_ini.h
+++ b/main/php_ini.h
@@ -25,20 +25,20 @@
BEGIN_EXTERN_C()
PHPAPI void config_zval_dtor(zval *zvalue);
-int php_init_config(TSRMLS_D);
+int php_init_config(void);
int php_shutdown_config(void);
-void php_ini_register_extensions(TSRMLS_D);
+void php_ini_register_extensions(void);
PHPAPI zval *cfg_get_entry_ex(zend_string *name);
PHPAPI zval *cfg_get_entry(const char *name, size_t name_length);
PHPAPI int cfg_get_long(const char *varname, zend_long *result);
PHPAPI int cfg_get_double(const char *varname, double *result);
PHPAPI int cfg_get_string(const char *varname, char **result);
-PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash TSRMLS_DC);
-PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage TSRMLS_DC);
+PHPAPI int php_parse_user_ini_file(const char *dirname, char *ini_filename, HashTable *target_hash);
+PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage);
PHPAPI int php_ini_has_per_dir_config(void);
PHPAPI int php_ini_has_per_host_config(void);
-PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len TSRMLS_DC);
-PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len TSRMLS_DC);
+PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len);
+PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len);
PHPAPI HashTable* php_ini_get_configuration_hash(void);
END_EXTERN_C()
diff --git a/main/php_main.h b/main/php_main.h
index 94a6299fc3..d821710acc 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -27,28 +27,28 @@
#include "SAPI.h"
BEGIN_EXTERN_C()
-PHPAPI int php_request_startup(TSRMLS_D);
+PHPAPI int php_request_startup(void);
PHPAPI void php_request_shutdown(void *dummy);
PHPAPI void php_request_shutdown_for_exec(void *dummy);
PHPAPI int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules);
-PHPAPI void php_module_shutdown(TSRMLS_D);
+PHPAPI void php_module_shutdown(void);
PHPAPI void php_module_shutdown_for_exec(void);
PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
-PHPAPI int php_request_startup_for_hook(TSRMLS_D);
+PHPAPI int php_request_startup_for_hook(void);
PHPAPI void php_request_shutdown_for_hook(void *dummy);
-PHPAPI int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC);
+PHPAPI int php_register_extensions(zend_module_entry **ptr, int count);
-PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC);
-PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret TSRMLS_DC);
-PHPAPI int php_handle_special_queries(TSRMLS_D);
-PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC);
+PHPAPI int php_execute_script(zend_file_handle *primary_file);
+PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret);
+PHPAPI int php_handle_special_queries(void);
+PHPAPI int php_lint_script(zend_file_handle *file);
PHPAPI void php_handle_aborted_connection(void);
-PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC);
+PHPAPI int php_handle_auth_data(const char *auth);
-PHPAPI void php_html_puts(const char *str, size_t siz TSRMLS_DC);
-PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC);
+PHPAPI void php_html_puts(const char *str, size_t siz);
+PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode);
/* environment module */
extern int php_init_environ(void);
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index a7823817bc..5b9be3813e 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -29,25 +29,25 @@
#define TEMP_STREAM_READONLY 1
#define TEMP_STREAM_TAKE_BUFFER 2
-#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC TSRMLS_CC)
-#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC TSRMLS_CC)
-#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC TSRMLS_CC)
+#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC)
+#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC)
+#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC)
+#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC)
#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM)
-#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC TSRMLS_CC)
-#define php_stream_temp_create_ex(mode, max_memory_usage, tmpdir) _php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC TSRMLS_CC)
-#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC)
+#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC)
+#define php_stream_temp_create_ex(mode, max_memory_usage, tmpdir) _php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC)
+#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC)
+#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC)
BEGIN_EXTERN_C()
-PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC);
-PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC);
-PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC);
+PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC);
+PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC);
+PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC);
-PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC);
-PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC TSRMLS_DC);
-PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC);
+PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC);
+PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC);
+PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC);
END_EXTERN_C()
extern PHPAPI php_stream_ops php_stream_memory_ops;
diff --git a/main/php_network.h b/main/php_network.h
index b0b1787ea5..5a168cb0f9 100644
--- a/main/php_network.h
+++ b/main/php_network.h
@@ -230,13 +230,13 @@ typedef struct {
#endif
BEGIN_EXTERN_C()
-PHPAPI int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, zend_string **error_string TSRMLS_DC);
+PHPAPI int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, zend_string **error_string);
PHPAPI void php_network_freeaddresses(struct sockaddr **sal);
PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port,
int socktype, int asynchronous, struct timeval *timeout, zend_string **error_string,
int *error_code, char *bindto, unsigned short bindport, long sockopts
- TSRMLS_DC);
+ );
PHPAPI int php_network_connect_socket(php_socket_t sockfd,
const struct sockaddr *addr,
@@ -251,7 +251,7 @@ PHPAPI int php_network_connect_socket(php_socket_t sockfd,
PHPAPI php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port,
int socktype, long sockopts, zend_string **error_string, int *error_code
- TSRMLS_DC);
+ );
PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
zend_string **textaddr,
@@ -260,19 +260,19 @@ PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock,
struct timeval *timeout,
zend_string **error_string,
int *error_code
- TSRMLS_DC);
+ );
PHPAPI int php_network_get_sock_name(php_socket_t sock,
zend_string **textaddr,
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC);
+ );
PHPAPI int php_network_get_peer_name(php_socket_t sock,
zend_string **textaddr,
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC);
+ );
PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port);
PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr);
@@ -291,10 +291,10 @@ extern php_stream_ops php_stream_generic_socket_ops;
#define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops)
BEGIN_EXTERN_C()
-PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC );
+PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC );
/* open a connection to a host using php_hostconnect and return a stream */
PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port,
- int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC);
+ int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC);
PHPAPI void php_network_populate_name_from_sockaddr(
/* input address */
struct sockaddr *sa, socklen_t sl,
@@ -303,19 +303,19 @@ PHPAPI void php_network_populate_name_from_sockaddr(
/* output address */
struct sockaddr **addr,
socklen_t *addrlen
- TSRMLS_DC);
+ );
PHPAPI int php_network_parse_network_address_with_port(const char *addr,
- zend_long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC);
+ zend_long addrlen, struct sockaddr *sa, socklen_t *sl);
END_EXTERN_C()
-#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC TSRMLS_CC)
-#define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC TSRMLS_CC)
+#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC)
+#define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC)
/* {{{ memory debug */
-#define php_stream_sock_open_from_socket_rel(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_sock_open_host_rel(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_sock_open_unix_rel(path, pathlen, persistent, timeval) _php_stream_sock_open_unix((path), (pathlen), (persistent), (timeval) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_sock_open_from_socket_rel(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_REL_CC)
+#define php_stream_sock_open_host_rel(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_REL_CC)
+#define php_stream_sock_open_unix_rel(path, pathlen, persistent, timeval) _php_stream_sock_open_unix((path), (pathlen), (persistent), (timeval) STREAMS_REL_CC)
/* }}} */
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index 955f0d26e1..eca5da7754 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -94,7 +94,7 @@
* SUCH DAMAGE.
*/
-static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p TSRMLS_DC)
+static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p)
{
char *trailing_slash;
char *opened_path;
@@ -127,7 +127,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char **
new_state.cwd = estrdup(cwd);
new_state.cwd_length = (int)strlen(cwd);
- if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
+ if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
efree(new_state.cwd);
return -1;
}
@@ -189,7 +189,7 @@ PHPAPI void php_shutdown_temporary_directory(void)
/*
* Determine where to place temporary files.
*/
-PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
+PHPAPI const char* php_get_temporary_directory(void)
{
/* Did we determine the temporary directory already? */
if (temporary_directory) {
@@ -264,7 +264,7 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D)
* This function should do its best to return a file pointer to a newly created
* unique file, on every platform.
*/
-PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check TSRMLS_DC)
+PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check)
{
int fd;
const char *temp_dir;
@@ -278,17 +278,17 @@ PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **ope
if (!dir || *dir == '\0') {
def_tmp:
- temp_dir = php_get_temporary_directory(TSRMLS_C);
+ temp_dir = php_get_temporary_directory();
- if (temp_dir && *temp_dir != '\0' && (!open_basedir_check || !php_check_open_basedir(temp_dir TSRMLS_CC))) {
- return php_do_open_temporary_file(temp_dir, pfx, opened_path_p TSRMLS_CC);
+ if (temp_dir && *temp_dir != '\0' && (!open_basedir_check || !php_check_open_basedir(temp_dir))) {
+ return php_do_open_temporary_file(temp_dir, pfx, opened_path_p);
} else {
return -1;
}
}
/* Try the directory given as parameter. */
- fd = php_do_open_temporary_file(dir, pfx, opened_path_p TSRMLS_CC);
+ fd = php_do_open_temporary_file(dir, pfx, opened_path_p);
if (fd == -1) {
/* Use default temporary directory. */
goto def_tmp;
@@ -296,15 +296,15 @@ def_tmp:
return fd;
}
-PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC)
+PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p)
{
- return php_open_temporary_fd_ex(dir, pfx, opened_path_p, 0 TSRMLS_CC);
+ return php_open_temporary_fd_ex(dir, pfx, opened_path_p, 0);
}
-PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC)
+PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p)
{
FILE *fp;
- int fd = php_open_temporary_fd(dir, pfx, opened_path_p TSRMLS_CC);
+ int fd = php_open_temporary_fd(dir, pfx, opened_path_p);
if (fd == -1) {
return NULL;
diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h
index a11cb79014..1ed9a2bc32 100644
--- a/main/php_open_temporary_file.h
+++ b/main/php_open_temporary_file.h
@@ -22,10 +22,10 @@
#define PHP_OPEN_TEMPORARY_FILE_H
BEGIN_EXTERN_C()
-PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC);
-PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check TSRMLS_DC);
-PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC);
-PHPAPI const char *php_get_temporary_directory(TSRMLS_D);
+PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p);
+PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check);
+PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p);
+PHPAPI const char *php_get_temporary_directory(void);
PHPAPI void php_shutdown_temporary_directory(void);
END_EXTERN_C()
diff --git a/main/php_output.h b/main/php_output.h
index 535b09b46c..f2f5848280 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -102,23 +102,21 @@ typedef struct _php_output_context {
int op;
php_output_buffer in;
php_output_buffer out;
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
} php_output_context;
-#define PHP_OUTPUT_TSRMLS(ctx) TSRMLS_FETCH_FROM_CTX((ctx)->tsrm_ls)
+/* XXX remove this after TLS branch merge */
+#define PHP_OUTPUT_TSRMLS(ctx)
/* old-style, stateless callback */
-typedef void (*php_output_handler_func_t)(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC);
+typedef void (*php_output_handler_func_t)(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode);
/* new-style, opaque context callback */
typedef int (*php_output_handler_context_func_t)(void **handler_context, php_output_context *output_context);
/* output handler context dtor */
-typedef void (*php_output_handler_context_dtor_t)(void *opaq TSRMLS_DC);
+typedef void (*php_output_handler_context_dtor_t)(void *opaq);
/* conflict check callback */
-typedef int (*php_output_handler_conflict_check_t)(const char *handler_name, size_t handler_name_len TSRMLS_DC);
+typedef int (*php_output_handler_conflict_check_t)(const char *handler_name, size_t handler_name_len);
/* ctor for aliases */
-typedef struct _php_output_handler *(*php_output_handler_alias_ctor_t)(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC);
+typedef struct _php_output_handler *(*php_output_handler_alias_ctor_t)(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags);
typedef struct _php_output_handler_user_func_t {
zend_fcall_info fci;
@@ -134,7 +132,7 @@ typedef struct _php_output_handler {
php_output_buffer buffer;
void *opaq;
- void (*dtor)(void *opaq TSRMLS_DC);
+ void (*dtor)(void *opaq);
union {
php_output_handler_user_func_t *user;
@@ -155,25 +153,25 @@ PHPAPI ZEND_EXTERN_MODULE_GLOBALS(output);
/* there should not be a need to use OG() from outside of output.c */
#ifdef ZTS
-# define OG(v) TSRMG(output_globals_id, zend_output_globals *, v)
+# define OG(v) ZEND_TSRMG(output_globals_id, zend_output_globals *, v)
#else
# define OG(v) (output_globals.v)
#endif
/* convenience macros */
-#define PHPWRITE(str, str_len) php_output_write((str), (str_len) TSRMLS_CC)
-#define PHPWRITE_H(str, str_len) php_output_write_unbuffered((str), (str_len) TSRMLS_CC)
+#define PHPWRITE(str, str_len) php_output_write((str), (str_len))
+#define PHPWRITE_H(str, str_len) php_output_write_unbuffered((str), (str_len))
-#define PUTC(c) (php_output_write(&(c), 1 TSRMLS_CC), (c))
-#define PUTC_H(c) (php_output_write_unbuffered(&(c), 1 TSRMLS_CC), (c))
+#define PUTC(c) (php_output_write(&(c), 1), (c))
+#define PUTC_H(c) (php_output_write_unbuffered(&(c), 1), (c))
#define PUTS(str) do { \
const char *__str = (str); \
- php_output_write(__str, strlen(__str) TSRMLS_CC); \
+ php_output_write(__str, strlen(__str)); \
} while (0)
#define PUTS_H(str) do { \
const char *__str = (str); \
- php_output_write_unbuffered(__str, strlen(__str) TSRMLS_CC); \
+ php_output_write_unbuffered(__str, strlen(__str)); \
} while (0)
@@ -184,10 +182,10 @@ extern const char php_output_devnull_handler_name[sizeof("null output handler")]
#define php_output_tearup() \
php_output_startup(); \
- php_output_activate(TSRMLS_C)
+ php_output_activate()
#define php_output_teardown() \
- php_output_end_all(TSRMLS_C); \
- php_output_deactivate(TSRMLS_C); \
+ php_output_end_all(); \
+ php_output_deactivate(); \
php_output_shutdown()
/* MINIT */
@@ -195,58 +193,58 @@ PHPAPI void php_output_startup(void);
/* MSHUTDOWN */
PHPAPI void php_output_shutdown(void);
-PHPAPI void php_output_register_constants(TSRMLS_D);
+PHPAPI void php_output_register_constants(void);
/* RINIT */
-PHPAPI int php_output_activate(TSRMLS_D);
+PHPAPI int php_output_activate(void);
/* RSHUTDOWN */
-PHPAPI void php_output_deactivate(TSRMLS_D);
-
-PHPAPI void php_output_set_status(int status TSRMLS_DC);
-PHPAPI int php_output_get_status(TSRMLS_D);
-PHPAPI void php_output_set_implicit_flush(int flush TSRMLS_DC);
-PHPAPI const char *php_output_get_start_filename(TSRMLS_D);
-PHPAPI int php_output_get_start_lineno(TSRMLS_D);
-
-PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC);
-PHPAPI size_t php_output_write(const char *str, size_t len TSRMLS_DC);
-
-PHPAPI int php_output_flush(TSRMLS_D);
-PHPAPI void php_output_flush_all(TSRMLS_D);
-PHPAPI int php_output_clean(TSRMLS_D);
-PHPAPI void php_output_clean_all(TSRMLS_D);
-PHPAPI int php_output_end(TSRMLS_D);
-PHPAPI void php_output_end_all(TSRMLS_D);
-PHPAPI int php_output_discard(TSRMLS_D);
-PHPAPI void php_output_discard_all(TSRMLS_D);
-
-PHPAPI int php_output_get_contents(zval *p TSRMLS_DC);
-PHPAPI int php_output_get_length(zval *p TSRMLS_DC);
-PHPAPI int php_output_get_level(TSRMLS_D);
-PHPAPI php_output_handler* php_output_get_active_handler(TSRMLS_D);
-
-PHPAPI int php_output_start_default(TSRMLS_D);
-PHPAPI int php_output_start_devnull(TSRMLS_D);
-
-PHPAPI int php_output_start_user(zval *output_handler, size_t chunk_size, int flags TSRMLS_DC);
-PHPAPI int php_output_start_internal(const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags TSRMLS_DC);
-
-PHPAPI php_output_handler *php_output_handler_create_user(zval *handler, size_t chunk_size, int flags TSRMLS_DC);
-PHPAPI php_output_handler *php_output_handler_create_internal(const char *name, size_t name_len, php_output_handler_context_func_t handler, size_t chunk_size, int flags TSRMLS_DC);
-
-PHPAPI void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void* TSRMLS_DC) TSRMLS_DC);
-PHPAPI int php_output_handler_start(php_output_handler *handler TSRMLS_DC);
-PHPAPI int php_output_handler_started(const char *name, size_t name_len TSRMLS_DC);
-PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg TSRMLS_DC);
-PHPAPI void php_output_handler_dtor(php_output_handler *handler TSRMLS_DC);
-PHPAPI void php_output_handler_free(php_output_handler **handler TSRMLS_DC);
-
-PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len TSRMLS_DC);
-PHPAPI int php_output_handler_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func TSRMLS_DC);
-PHPAPI int php_output_handler_reverse_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func TSRMLS_DC);
-
-PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias(const char *handler_name, size_t handler_name_len TSRMLS_DC);
-PHPAPI int php_output_handler_alias_register(const char *handler_name, size_t handler_name_len, php_output_handler_alias_ctor_t func TSRMLS_DC);
+PHPAPI void php_output_deactivate(void);
+
+PHPAPI void php_output_set_status(int status);
+PHPAPI int php_output_get_status(void);
+PHPAPI void php_output_set_implicit_flush(int flush);
+PHPAPI const char *php_output_get_start_filename(void);
+PHPAPI int php_output_get_start_lineno(void);
+
+PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len);
+PHPAPI size_t php_output_write(const char *str, size_t len);
+
+PHPAPI int php_output_flush(void);
+PHPAPI void php_output_flush_all(void);
+PHPAPI int php_output_clean(void);
+PHPAPI void php_output_clean_all(void);
+PHPAPI int php_output_end(void);
+PHPAPI void php_output_end_all(void);
+PHPAPI int php_output_discard(void);
+PHPAPI void php_output_discard_all(void);
+
+PHPAPI int php_output_get_contents(zval *p);
+PHPAPI int php_output_get_length(zval *p);
+PHPAPI int php_output_get_level(void);
+PHPAPI php_output_handler* php_output_get_active_handler(void);
+
+PHPAPI int php_output_start_default(void);
+PHPAPI int php_output_start_devnull(void);
+
+PHPAPI int php_output_start_user(zval *output_handler, size_t chunk_size, int flags);
+PHPAPI int php_output_start_internal(const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags);
+
+PHPAPI php_output_handler *php_output_handler_create_user(zval *handler, size_t chunk_size, int flags);
+PHPAPI php_output_handler *php_output_handler_create_internal(const char *name, size_t name_len, php_output_handler_context_func_t handler, size_t chunk_size, int flags);
+
+PHPAPI void php_output_handler_set_context(php_output_handler *handler, void *opaq, void (*dtor)(void*));
+PHPAPI int php_output_handler_start(php_output_handler *handler);
+PHPAPI int php_output_handler_started(const char *name, size_t name_len);
+PHPAPI int php_output_handler_hook(php_output_handler_hook_t type, void *arg);
+PHPAPI void php_output_handler_dtor(php_output_handler *handler);
+PHPAPI void php_output_handler_free(php_output_handler **handler);
+
+PHPAPI int php_output_handler_conflict(const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len);
+PHPAPI int php_output_handler_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func);
+PHPAPI int php_output_handler_reverse_conflict_register(const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func);
+
+PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias(const char *handler_name, size_t handler_name_len);
+PHPAPI int php_output_handler_alias_register(const char *handler_name, size_t handler_name_len, php_output_handler_alias_ctor_t func);
END_EXTERN_C()
diff --git a/main/php_streams.h b/main/php_streams.h
index 79ceaf2761..29abb3ebd5 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -61,27 +61,27 @@ END_EXTERN_C()
/* these functions relay the file/line number information. They are depth aware, so they will pass
* the ultimate ancestor, which is useful, because there can be several layers of calls */
-#define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC)
-#define php_stream_copy_to_mem_rel(src, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_copy_to_mem_rel(src, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC)
-#define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC)
-#define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC)
-#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_REL_CC)
+#define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC)
-#define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC)
-#define php_stream_fopen_tmpfile_rel() _php_stream_fopen_tmpfile(0 STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_tmpfile_rel() _php_stream_fopen_tmpfile(0 STREAMS_REL_CC)
-#define php_stream_fopen_temporary_file_rel(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_temporary_file_rel(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_REL_CC)
-#define php_stream_open_wrapper_rel(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_open_wrapper_ex_rel(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_open_wrapper_rel(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_REL_CC)
+#define php_stream_open_wrapper_ex_rel(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_REL_CC)
-#define php_stream_make_seekable_rel(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_make_seekable_rel(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_REL_CC)
/* }}} */
@@ -117,47 +117,47 @@ typedef struct _php_stream_dirent {
/* operations on streams that are file-handles */
typedef struct _php_stream_ops {
/* stdio like functions - these are mandatory! */
- size_t (*write)(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
- size_t (*read)(php_stream *stream, char *buf, size_t count TSRMLS_DC);
- int (*close)(php_stream *stream, int close_handle TSRMLS_DC);
- int (*flush)(php_stream *stream TSRMLS_DC);
+ size_t (*write)(php_stream *stream, const char *buf, size_t count);
+ size_t (*read)(php_stream *stream, char *buf, size_t count);
+ int (*close)(php_stream *stream, int close_handle);
+ int (*flush)(php_stream *stream);
const char *label; /* label for this ops structure */
/* these are optional */
- int (*seek)(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
- int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC);
- int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
- int (*set_option)(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
+ int (*seek)(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset);
+ int (*cast)(php_stream *stream, int castas, void **ret);
+ int (*stat)(php_stream *stream, php_stream_statbuf *ssb);
+ int (*set_option)(php_stream *stream, int option, int value, void *ptrparam);
} php_stream_ops;
typedef struct _php_stream_wrapper_ops {
/* open/create a wrapped stream */
php_stream *(*stream_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+ int options, char **opened_path, php_stream_context *context STREAMS_DC);
/* close/destroy a wrapped stream */
- int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC);
+ int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream);
/* stat a wrapped stream */
- int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
+ int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb);
/* stat a URL */
- int (*url_stat)(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
+ int (*url_stat)(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context);
/* open a "directory" stream */
php_stream *(*dir_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+ int options, char **opened_path, php_stream_context *context STREAMS_DC);
const char *label;
/* delete a file */
- int (*unlink)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
+ int (*unlink)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
/* rename a file */
- int (*rename)(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC);
+ int (*rename)(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context);
/* Create/Remove directory */
- int (*stream_mkdir)(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC);
- int (*stream_rmdir)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
+ int (*stream_mkdir)(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context);
+ int (*stream_rmdir)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
/* Metadata handling */
- int (*stream_metadata)(php_stream_wrapper *wrapper, const char *url, int options, void *value, php_stream_context *context TSRMLS_DC);
+ int (*stream_metadata)(php_stream_wrapper *wrapper, const char *url, int options, void *value, php_stream_context *context);
} php_stream_wrapper_ops;
struct _php_stream_wrapper {
@@ -241,9 +241,9 @@ struct _php_stream {
/* allocate a new stream for a particular ops */
BEGIN_EXTERN_C()
PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract,
- const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC);
+ const char *persistent_id, const char *mode STREAMS_DC);
END_EXTERN_C()
-#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC)
+#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC)
#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->res->handle
/* use this to tell the stream that it is OK if we don't explicitly close it */
@@ -254,14 +254,14 @@ END_EXTERN_C()
#define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; }
#define php_stream_from_zval(xstr, pzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (pzval), -1, "stream", php_file_le_stream(), php_file_le_pstream())
-#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((pzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((pzval), -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream())
BEGIN_EXTERN_C()
PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);
-#define php_stream_free_enclosed(stream_enclosed, close_options) _php_stream_free_enclosed((stream_enclosed), (close_options) TSRMLS_CC)
-PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC);
+#define php_stream_free_enclosed(stream_enclosed, close_options) _php_stream_free_enclosed((stream_enclosed), (close_options))
+PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options);
-PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC);
+PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream);
#define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */
#define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */
#define PHP_STREAM_PERSISTENT_NOT_EXIST 2 /* id does not exist */
@@ -276,73 +276,73 @@ PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream *
#define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE)
#define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT)
-PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC);
-#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options) TSRMLS_CC)
-#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC)
-#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT TSRMLS_CC)
+PHPAPI int _php_stream_free(php_stream *stream, int close_options);
+#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options))
+#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE)
+#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT)
-PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TSRMLS_DC);
-#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET TSRMLS_CC)
-#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence) TSRMLS_CC)
+PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
+#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET)
+#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence))
-PHPAPI zend_off_t _php_stream_tell(php_stream *stream TSRMLS_DC);
-#define php_stream_tell(stream) _php_stream_tell((stream) TSRMLS_CC)
+PHPAPI zend_off_t _php_stream_tell(php_stream *stream);
+#define php_stream_tell(stream) _php_stream_tell((stream))
-PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC);
-#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count) TSRMLS_CC)
+PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count);
+#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count))
-PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC)
-#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC)
+PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
+#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str))
+#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count))
#ifdef ZTS
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
+PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
#endif
-/* php_stream_printf macro & function require TSRMLS_CC */
+/* php_stream_printf macro & function require */
#define php_stream_printf _php_stream_printf
-PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC);
-#define php_stream_eof(stream) _php_stream_eof((stream) TSRMLS_CC)
+PHPAPI int _php_stream_eof(php_stream *stream);
+#define php_stream_eof(stream) _php_stream_eof((stream))
-PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC);
-#define php_stream_getc(stream) _php_stream_getc((stream) TSRMLS_CC)
+PHPAPI int _php_stream_getc(php_stream *stream);
+#define php_stream_getc(stream) _php_stream_getc((stream))
-PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC);
-#define php_stream_putc(stream, c) _php_stream_putc((stream), (c) TSRMLS_CC)
+PHPAPI int _php_stream_putc(php_stream *stream, int c);
+#define php_stream_putc(stream, c) _php_stream_putc((stream), (c))
-PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC);
-#define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC)
+PHPAPI int _php_stream_flush(php_stream *stream, int closing);
+#define php_stream_flush(stream) _php_stream_flush((stream), 0)
-PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len TSRMLS_DC);
-#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC)
+PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
+#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL)
-#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC)
-PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len TSRMLS_DC);
+#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen))
+PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
/* CAREFUL! this is equivalent to puts NOT fputs! */
-PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC);
-#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf) TSRMLS_CC)
+PHPAPI int _php_stream_puts(php_stream *stream, const char *buf);
+#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf))
-PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
-#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb) TSRMLS_CC)
+PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
+#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb))
-PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
-#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL TSRMLS_CC)
-#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC)
+PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
+#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL)
+#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context))
-PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC);
-#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context TSRMLS_CC)
+PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
+#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context)
-PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC);
-#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context TSRMLS_CC)
+PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
+#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context)
-PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC);
-#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC)
-PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC);
-#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent) TSRMLS_CC)
+PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC);
+#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC)
+PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
+#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent))
#define php_stream_closedir(dirstream) php_stream_close((dirstream))
#define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream))
@@ -350,13 +350,13 @@ PHPAPI int php_stream_dirent_alphasort(const zend_string **a, const zend_string
PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string **b);
PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context,
- int (*compare) (const zend_string **a, const zend_string **b) TSRMLS_DC);
-#define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare) TSRMLS_CC)
+ int (*compare) (const zend_string **a, const zend_string **b));
+#define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare))
-PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
-#define php_stream_set_option(stream, option, value, ptrvalue) _php_stream_set_option((stream), (option), (value), (ptrvalue) TSRMLS_CC)
+PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam);
+#define php_stream_set_option(stream, option, value, ptrvalue) _php_stream_set_option((stream), (option), (value), (ptrvalue))
-#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC)
+#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL)
END_EXTERN_C()
@@ -395,8 +395,8 @@ END_EXTERN_C()
/* whether or not locking is supported */
#define PHP_STREAM_LOCK_SUPPORTED 1
-#define php_stream_supports_lock(stream) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, 0, (void *) PHP_STREAM_LOCK_SUPPORTED TSRMLS_CC) == 0 ? 1 : 0
-#define php_stream_lock(stream, mode) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, (mode), (void *) NULL TSRMLS_CC)
+#define php_stream_supports_lock(stream) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, 0, (void *) PHP_STREAM_LOCK_SUPPORTED) == 0 ? 1 : 0
+#define php_stream_lock(stream, mode) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, (mode), (void *) NULL)
/* option code used by the php_stream_xport_XXX api */
#define PHP_STREAM_OPTION_XPORT_API 7 /* see php_stream_transport.h */
@@ -407,15 +407,15 @@ END_EXTERN_C()
#define PHP_STREAM_TRUNCATE_SUPPORTED 0
#define PHP_STREAM_TRUNCATE_SET_SIZE 1 /* ptrparam is a pointer to a size_t */
-#define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0)
+#define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0)
BEGIN_EXTERN_C()
-PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC);
-#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size) TSRMLS_CC)
+PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize);
+#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size))
END_EXTERN_C()
#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add meta data information */
-#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0)
+#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0)
/* Check if the stream is still "live"; for sockets/pipes this means the socket
* is still connected; for files, this does not really have meaning */
@@ -431,20 +431,20 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_ATTRIBUTE_DEPRECATED
-PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC);
-#define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC TSRMLS_CC)
-PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC TSRMLS_DC);
-#define php_stream_copy_to_stream_ex(src, dest, maxlen, len) _php_stream_copy_to_stream_ex((src), (dest), (maxlen), (len) STREAMS_CC TSRMLS_CC)
+PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC);
+#define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC)
+PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC);
+#define php_stream_copy_to_stream_ex(src, dest, maxlen, len) _php_stream_copy_to_stream_ex((src), (dest), (maxlen), (len) STREAMS_CC)
/* read all data from stream and put into a buffer. Caller must free buffer
* when done. */
-PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC);
-#define php_stream_copy_to_mem(src, maxlen, persistent) _php_stream_copy_to_mem((src), (maxlen), (persistent) STREAMS_CC TSRMLS_CC)
+PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC);
+#define php_stream_copy_to_mem(src, maxlen, persistent) _php_stream_copy_to_mem((src), (maxlen), (persistent) STREAMS_CC)
/* output all data from a stream */
-PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC TSRMLS_DC);
-#define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC TSRMLS_CC)
+PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC);
+#define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC)
END_EXTERN_C()
#include "streams/php_stream_transport.h"
@@ -469,11 +469,11 @@ END_EXTERN_C()
#define PHP_STREAM_CAST_INTERNAL 0x20000000 /* stream cast for internal use */
#define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL)
BEGIN_EXTERN_C()
-PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC);
+PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err);
END_EXTERN_C()
/* use this to check if a stream can be cast into another form */
-#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0 TSRMLS_CC)
-#define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err) TSRMLS_CC)
+#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0)
+#define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err))
/* use this to check if a stream is of a particular type:
* PHPAPI int php_stream_is(php_stream *stream, php_stream_ops *ops); */
@@ -532,22 +532,22 @@ END_EXTERN_C()
/* Antique - no longer has meaning */
#define IGNORE_URL_WIN 0
-int php_init_stream_wrappers(int module_number TSRMLS_DC);
-int php_shutdown_stream_wrappers(int module_number TSRMLS_DC);
-void php_shutdown_stream_hashes(TSRMLS_D);
+int php_init_stream_wrappers(int module_number);
+int php_shutdown_stream_wrappers(int module_number);
+void php_shutdown_stream_hashes(void);
PHP_RSHUTDOWN_FUNCTION(streams);
BEGIN_EXTERN_C()
-PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC);
-PHPAPI int php_unregister_url_stream_wrapper(const char *protocol TSRMLS_DC);
-PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC);
-PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC);
-PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC);
-PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TSRMLS_DC);
+PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper);
+PHPAPI int php_unregister_url_stream_wrapper(const char *protocol);
+PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper);
+PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol);
+PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options);
+PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf);
-#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC)
-#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC TSRMLS_CC)
+#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
+#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC)
#define php_stream_get_from_zval(stream, zstream, mode, options, opened, context) \
if (Z_TYPE_PP((zstream)) == IS_RESOURCE) { \
@@ -557,9 +557,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS
/* pushes an error message onto the stack for a wrapper instance */
#ifdef ZTS
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5);
#else
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#endif
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
@@ -570,15 +570,15 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option
#define PHP_STREAM_PREFER_STDIO 1
#define PHP_STREAM_FORCE_CONVERSION 2
/* DO NOT call this on streams that are referenced by resources! */
-PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC);
-#define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC TSRMLS_CC)
+PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC);
+#define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC)
/* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */
-PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D);
-#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash(TSRMLS_C)
+PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(void);
+#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash()
PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void);
-PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D);
-#define php_get_stream_filters_hash() _php_get_stream_filters_hash(TSRMLS_C)
+PHPAPI HashTable *_php_get_stream_filters_hash(void);
+#define php_get_stream_filters_hash() _php_get_stream_filters_hash()
PHPAPI HashTable *php_get_stream_filters_hash_global(void);
extern php_stream_wrapper_ops *php_stream_user_wrapper_ops;
END_EXTERN_C()
diff --git a/main/php_ticks.c b/main/php_ticks.c
index daa6cde6ff..0c7c0d2f1f 100644
--- a/main/php_ticks.c
+++ b/main/php_ticks.c
@@ -21,18 +21,18 @@
#include "php.h"
#include "php_ticks.h"
-int php_startup_ticks(TSRMLS_D)
+int php_startup_ticks(void)
{
zend_llist_init(&PG(tick_functions), sizeof(void(*)(int)), NULL, 1);
return SUCCESS;
}
-void php_deactivate_ticks(TSRMLS_D)
+void php_deactivate_ticks(void)
{
zend_llist_clean(&PG(tick_functions));
}
-void php_shutdown_ticks(TSRMLS_D)
+void php_shutdown_ticks(void)
{
zend_llist_destroy(&PG(tick_functions));
}
@@ -46,18 +46,18 @@ static int php_compare_tick_functions(void *elem1, void *elem2)
return (func1 == func2);
}
-PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC)
+PHPAPI void php_add_tick_function(void (*func)(int))
{
zend_llist_add_element(&PG(tick_functions), (void *)&func);
}
-PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC)
+PHPAPI void php_remove_tick_function(void (*func)(int))
{
zend_llist_del_element(&PG(tick_functions), (void *)func,
(int(*)(void*, void*))php_compare_tick_functions);
}
-static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
+static void php_tick_iterator(void *data, void *arg)
{
void (*func)(int);
@@ -65,9 +65,9 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
func(*((int *)arg));
}
-void php_run_ticks(int count TSRMLS_DC)
+void php_run_ticks(int count)
{
- zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC);
+ zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count);
}
/*
diff --git a/main/php_ticks.h b/main/php_ticks.h
index 0f8277cc7f..d2a873ee18 100644
--- a/main/php_ticks.h
+++ b/main/php_ticks.h
@@ -21,14 +21,14 @@
#ifndef PHP_TICKS_H
#define PHP_TICKS_H
-int php_startup_ticks(TSRMLS_D);
-void php_deactivate_ticks(TSRMLS_D);
-void php_shutdown_ticks(TSRMLS_D);
-void php_run_ticks(int count TSRMLS_DC);
+int php_startup_ticks(void);
+void php_deactivate_ticks(void);
+void php_shutdown_ticks(void);
+void php_run_ticks(int count);
BEGIN_EXTERN_C()
-PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC);
-PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC);
+PHPAPI void php_add_tick_function(void (*func)(int));
+PHPAPI void php_remove_tick_function(void (*func)(int));
END_EXTERN_C()
#endif
diff --git a/main/php_variables.c b/main/php_variables.c
index 4f911c2e65..38df80d097 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -34,26 +34,26 @@
#endif
/* for systems that need to override reading of environment variables */
-void _php_import_environment_variables(zval *array_ptr TSRMLS_DC);
-PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC) = _php_import_environment_variables;
+void _php_import_environment_variables(zval *array_ptr);
+PHPAPI void (*php_import_environment_variables)(zval *array_ptr) = _php_import_environment_variables;
-PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array TSRMLS_DC)
+PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array)
{
- php_register_variable_safe(var, strval, strlen(strval), track_vars_array TSRMLS_CC);
+ php_register_variable_safe(var, strval, strlen(strval), track_vars_array);
}
/* binary-safe version */
-PHPAPI void php_register_variable_safe(char *var, char *strval, size_t str_len, zval *track_vars_array TSRMLS_DC)
+PHPAPI void php_register_variable_safe(char *var, char *strval, size_t str_len, zval *track_vars_array)
{
zval new_entry;
assert(strval != NULL);
/* Prepare value */
ZVAL_NEW_STR(&new_entry, zend_string_init(strval, str_len, 0));
- php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC);
+ php_register_variable_ex(var, &new_entry, track_vars_array);
}
-PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC)
+PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array)
{
char *p = NULL;
char *ip = NULL; /* index pointer */
@@ -141,7 +141,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
/* do not output the error message to the screen,
this helps us to to avoid "information disclosure" */
if (!PG(display_errors)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variable nesting level exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_nesting_level in php.ini.", PG(max_input_nesting_level));
+ php_error_docref(NULL, E_WARNING, "Input variable nesting level exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_nesting_level in php.ini.", PG(max_input_nesting_level));
}
free_alloca(var_orig, use_heap);
return;
@@ -241,7 +241,7 @@ typedef struct post_var_data {
uint64_t cnt;
} post_var_data_t;
-static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC)
+static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
{
char *ksep, *vsep, *val;
size_t klen, vlen;
@@ -281,8 +281,8 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
vlen = php_url_decode(val, vlen);
}
- if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) {
- php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen)) {
+ php_register_variable_safe(var->ptr, val, new_vlen, arr);
}
efree(val);
@@ -290,15 +290,15 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
return 1;
}
-static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof TSRMLS_DC)
+static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof)
{
uint64_t max_vars = PG(max_input_vars);
vars->ptr = vars->str.s->val;
vars->end = vars->str.s->val + vars->str.s->len;
- while (add_post_var(arr, vars, eof TSRMLS_CC)) {
+ while (add_post_var(arr, vars, eof)) {
if (++vars->cnt > max_vars) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Input variables exceeded %" PRIu64 ". "
"To increase the limit change max_input_vars in php.ini.",
max_vars);
@@ -328,7 +328,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
if (len && len != (size_t) -1) {
smart_str_appendl(&post_data.str, buf, len);
- if (SUCCESS != add_post_vars(arr, &post_data, 0 TSRMLS_CC)) {
+ if (SUCCESS != add_post_vars(arr, &post_data, 0)) {
smart_str_free(&post_data.str);
return;
}
@@ -340,7 +340,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
}
if (post_data.str.s) {
- add_post_vars(arr, &post_data, 1 TSRMLS_CC);
+ add_post_vars(arr, &post_data, 1);
smart_str_free(&post_data.str);
}
}
@@ -389,7 +389,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
}
if (arg == PARSE_POST) {
- sapi_handle_post(&array TSRMLS_CC);
+ sapi_handle_post(&array);
return;
}
@@ -444,7 +444,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
}
if (++count > PG(max_input_vars)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ php_error_docref(NULL, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
break;
}
@@ -456,8 +456,8 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
php_url_decode(var, strlen(var));
val_len = php_url_decode(val, strlen(val));
val = estrndup(val, val_len);
- if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, &array TSRMLS_CC);
+ if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len)) {
+ php_register_variable_safe(var, val, new_val_len, &array);
}
efree(val);
} else {
@@ -467,8 +467,8 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
php_url_decode(var, strlen(var));
val_len = 0;
val = estrndup("", val_len);
- if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, &array TSRMLS_CC);
+ if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len)) {
+ php_register_variable_safe(var, val, new_val_len, &array);
}
efree(val);
}
@@ -485,7 +485,7 @@ next_cookie:
}
}
-void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
+void _php_import_environment_variables(zval *array_ptr)
{
char buf[128];
char **env, *p, *t = buf;
@@ -504,14 +504,14 @@ void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
}
memcpy(t, *env, nlen);
t[nlen] = '\0';
- php_register_variable(t, p + 1, array_ptr TSRMLS_CC);
+ php_register_variable(t, p + 1, array_ptr);
}
if (t != buf && t != NULL) {
efree(t);
}
}
-zend_bool php_std_auto_global_callback(char *name, uint name_len TSRMLS_DC)
+zend_bool php_std_auto_global_callback(char *name, uint name_len)
{
zend_printf("%s\n", name);
return 0; /* don't rearm */
@@ -519,7 +519,7 @@ zend_bool php_std_auto_global_callback(char *name, uint name_len TSRMLS_DC)
/* {{{ php_build_argv
*/
-static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
+static void php_build_argv(char *s, zval *track_vars_array)
{
zval arr, argc, tmp;
int count = 0;
@@ -585,33 +585,33 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
/* {{{ php_register_server_variables
*/
-static inline void php_register_server_variables(TSRMLS_D)
+static inline void php_register_server_variables(void)
{
zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]);
array_init(&PG(http_globals)[TRACK_VARS_SERVER]);
/* Server variables */
if (sapi_module.register_server_variables) {
- sapi_module.register_server_variables(&PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ sapi_module.register_server_variables(&PG(http_globals)[TRACK_VARS_SERVER]);
}
/* PHP Authentication support */
if (SG(request_info).auth_user) {
- php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, &PG(http_globals)[TRACK_VARS_SERVER]);
}
if (SG(request_info).auth_password) {
- php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, &PG(http_globals)[TRACK_VARS_SERVER]);
}
if (SG(request_info).auth_digest) {
- php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, &PG(http_globals)[TRACK_VARS_SERVER]);
}
/* store request init time */
{
zval request_time_float, request_time_long;
- ZVAL_DOUBLE(&request_time_float, sapi_get_request_time(TSRMLS_C));
- php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ ZVAL_DOUBLE(&request_time_float, sapi_get_request_time());
+ php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER]);
ZVAL_LONG(&request_time_long, zend_dval_to_lval(Z_DVAL(request_time_float)));
- php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER]);
}
}
@@ -619,7 +619,7 @@ static inline void php_register_server_variables(TSRMLS_D)
/* {{{ php_autoglobal_merge
*/
-static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
+static void php_autoglobal_merge(HashTable *dest, HashTable *src)
{
zval *src_entry, *dest_entry;
zend_string *string_key;
@@ -646,7 +646,7 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
}
} else {
SEPARATE_ZVAL(dest_entry);
- php_autoglobal_merge(Z_ARRVAL_P(dest_entry), Z_ARRVAL_P(src_entry) TSRMLS_CC);
+ php_autoglobal_merge(Z_ARRVAL_P(dest_entry), Z_ARRVAL_P(src_entry));
}
} ZEND_HASH_FOREACH_END();
}
@@ -654,21 +654,21 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
/* {{{ php_hash_environment
*/
-PHPAPI int php_hash_environment(TSRMLS_D)
+PHPAPI int php_hash_environment(void)
{
memset(PG(http_globals), 0, sizeof(PG(http_globals)));
- zend_activate_auto_globals(TSRMLS_C);
+ zend_activate_auto_globals();
if (PG(register_argc_argv)) {
- php_build_argv(SG(request_info).query_string, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_build_argv(SG(request_info).query_string, &PG(http_globals)[TRACK_VARS_SERVER]);
}
return SUCCESS;
}
/* }}} */
-static zend_bool php_auto_globals_create_get(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_get(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'G') || strchr(PG(variables_order),'g'))) {
- sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);
+ sapi_module.treat_data(PARSE_GET, NULL, NULL);
} else {
zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]);
array_init(&PG(http_globals)[TRACK_VARS_GET]);
@@ -680,14 +680,14 @@ static zend_bool php_auto_globals_create_get(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_post(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_post(zend_string *name)
{
if (PG(variables_order) &&
(strchr(PG(variables_order),'P') || strchr(PG(variables_order),'p')) &&
!SG(headers_sent) &&
SG(request_info).request_method &&
!strcasecmp(SG(request_info).request_method, "POST")) {
- sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC);
+ sapi_module.treat_data(PARSE_POST, NULL, NULL);
} else {
zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]);
array_init(&PG(http_globals)[TRACK_VARS_POST]);
@@ -699,10 +699,10 @@ static zend_bool php_auto_globals_create_post(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_cookie(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_cookie(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'C') || strchr(PG(variables_order),'c'))) {
- sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);
+ sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
} else {
zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]);
array_init(&PG(http_globals)[TRACK_VARS_COOKIE]);
@@ -714,7 +714,7 @@ static zend_bool php_auto_globals_create_cookie(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_files(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_files(zend_string *name)
{
if (Z_TYPE(PG(http_globals)[TRACK_VARS_FILES]) == IS_UNDEF) {
array_init(&PG(http_globals)[TRACK_VARS_FILES]);
@@ -726,10 +726,10 @@ static zend_bool php_auto_globals_create_files(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_server(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_server(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
- php_register_server_variables(TSRMLS_C);
+ php_register_server_variables();
if (PG(register_argc_argv)) {
if (SG(request_info).argc) {
@@ -742,7 +742,7 @@ static zend_bool php_auto_globals_create_server(zend_string *name TSRMLS_DC)
zend_hash_str_update(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "argc", sizeof("argc")-1, argc);
}
} else {
- php_build_argv(SG(request_info).query_string, &PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_build_argv(SG(request_info).query_string, &PG(http_globals)[TRACK_VARS_SERVER]);
}
}
@@ -757,13 +757,13 @@ static zend_bool php_auto_globals_create_server(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_env(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_env(zend_string *name)
{
zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]);
array_init(&PG(http_globals)[TRACK_VARS_ENV]);
if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) {
- php_import_environment_variables(&PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
+ php_import_environment_variables(&PG(http_globals)[TRACK_VARS_ENV]);
}
zend_hash_update(&EG(symbol_table).ht, name, &PG(http_globals)[TRACK_VARS_ENV]);
@@ -772,7 +772,7 @@ static zend_bool php_auto_globals_create_env(zend_string *name TSRMLS_DC)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_request(zend_string *name TSRMLS_DC)
+static zend_bool php_auto_globals_create_request(zend_string *name)
{
zval form_variables;
unsigned char _gpc_flags[3] = {0, 0, 0};
@@ -791,21 +791,21 @@ static zend_bool php_auto_globals_create_request(zend_string *name TSRMLS_DC)
case 'g':
case 'G':
if (!_gpc_flags[0]) {
- php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
+ php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_GET]));
_gpc_flags[0] = 1;
}
break;
case 'p':
case 'P':
if (!_gpc_flags[1]) {
- php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
+ php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_POST]));
_gpc_flags[1] = 1;
}
break;
case 'c':
case 'C':
if (!_gpc_flags[2]) {
- php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
+ php_autoglobal_merge(Z_ARRVAL(form_variables), Z_ARRVAL(PG(http_globals)[TRACK_VARS_COOKIE]));
_gpc_flags[2] = 1;
}
break;
@@ -816,15 +816,15 @@ static zend_bool php_auto_globals_create_request(zend_string *name TSRMLS_DC)
return 0;
}
-void php_startup_auto_globals(TSRMLS_D)
+void php_startup_auto_globals(void)
{
- zend_register_auto_global(zend_string_init("_GET", sizeof("_GET")-1, 1), 0, php_auto_globals_create_get TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_POST", sizeof("_POST")-1, 1), 0, php_auto_globals_create_post TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_COOKIE", sizeof("_COOKIE")-1, 1), 0, php_auto_globals_create_cookie TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_SERVER", sizeof("_SERVER")-1, 1), PG(auto_globals_jit), php_auto_globals_create_server TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_ENV", sizeof("_ENV")-1, 1), PG(auto_globals_jit), php_auto_globals_create_env TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_REQUEST", sizeof("_REQUEST")-1, 1), PG(auto_globals_jit), php_auto_globals_create_request TSRMLS_CC);
- zend_register_auto_global(zend_string_init("_FILES", sizeof("_FILES")-1, 1), 0, php_auto_globals_create_files TSRMLS_CC);
+ zend_register_auto_global(zend_string_init("_GET", sizeof("_GET")-1, 1), 0, php_auto_globals_create_get);
+ zend_register_auto_global(zend_string_init("_POST", sizeof("_POST")-1, 1), 0, php_auto_globals_create_post);
+ zend_register_auto_global(zend_string_init("_COOKIE", sizeof("_COOKIE")-1, 1), 0, php_auto_globals_create_cookie);
+ zend_register_auto_global(zend_string_init("_SERVER", sizeof("_SERVER")-1, 1), PG(auto_globals_jit), php_auto_globals_create_server);
+ zend_register_auto_global(zend_string_init("_ENV", sizeof("_ENV")-1, 1), PG(auto_globals_jit), php_auto_globals_create_env);
+ zend_register_auto_global(zend_string_init("_REQUEST", sizeof("_REQUEST")-1, 1), PG(auto_globals_jit), php_auto_globals_create_request);
+ zend_register_auto_global(zend_string_init("_FILES", sizeof("_FILES")-1, 1), 0, php_auto_globals_create_files);
}
/*
diff --git a/main/php_variables.h b/main/php_variables.h
index 08abeb5267..6c9ceaa277 100644
--- a/main/php_variables.h
+++ b/main/php_variables.h
@@ -34,14 +34,14 @@
#define PARSE_SESSION 6
BEGIN_EXTERN_C()
-void php_startup_auto_globals(TSRMLS_D);
-extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC);
-PHPAPI void php_register_variable(char *var, char *val, zval *track_vars_array TSRMLS_DC);
+void php_startup_auto_globals(void);
+extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr);
+PHPAPI void php_register_variable(char *var, char *val, zval *track_vars_array);
/* binary-safe version */
-PHPAPI void php_register_variable_safe(char *var, char *val, size_t val_len, zval *track_vars_array TSRMLS_DC);
-PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_array TSRMLS_DC);
+PHPAPI void php_register_variable_safe(char *var, char *val, size_t val_len, zval *track_vars_array);
+PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_array);
-PHPAPI int php_hash_environment(TSRMLS_D);
+PHPAPI int php_hash_environment(void);
END_EXTERN_C()
#define NUM_TRACK_VARS 6
diff --git a/main/rfc1867.c b/main/rfc1867.c
index e8b15f8494..4ff6507465 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -41,13 +41,13 @@
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
-static int dummy_encoding_translation(TSRMLS_D)
+static int dummy_encoding_translation(void)
{
return 0;
}
-static char *php_ap_getword(const zend_encoding *encoding, char **line, char stop TSRMLS_DC);
-static char *php_ap_getword_conf(const zend_encoding *encoding, char *str TSRMLS_DC);
+static char *php_ap_getword(const zend_encoding *encoding, char **line, char stop);
+static char *php_ap_getword_conf(const zend_encoding *encoding, char *str);
static php_rfc1867_encoding_translation_t php_rfc1867_encoding_translation = dummy_encoding_translation;
static php_rfc1867_get_detect_order_t php_rfc1867_get_detect_order = NULL;
@@ -56,9 +56,9 @@ static php_rfc1867_getword_t php_rfc1867_getword = php_ap_getword;
static php_rfc1867_getword_conf_t php_rfc1867_getword_conf = php_ap_getword_conf;
static php_rfc1867_basename_t php_rfc1867_basename = NULL;
-PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL;
+PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra) = NULL;
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection TSRMLS_DC);
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection);
/* The longest property name we use in an uploaded file array */
#define MAX_SIZE_OF_INDEX sizeof("[tmp_name]")
@@ -76,7 +76,7 @@ static void safe_php_register_variable(char *var, char *strval, size_t val_len,
#define UPLOAD_ERROR_F 7 /* Failed to write file to disk */
#define UPLOAD_ERROR_X 8 /* File upload stopped by extension */
-void php_rfc1867_register_constants(TSRMLS_D) /* {{{ */
+void php_rfc1867_register_constants(void) /* {{{ */
{
REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_OK", UPLOAD_ERROR_OK, CONST_CS | CONST_PERSISTENT);
REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_INI_SIZE", UPLOAD_ERROR_A, CONST_CS | CONST_PERSISTENT);
@@ -89,7 +89,7 @@ void php_rfc1867_register_constants(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void normalize_protected_variable(char *varname TSRMLS_DC) /* {{{ */
+static void normalize_protected_variable(char *varname) /* {{{ */
{
char *s = varname, *index = NULL, *indexend = NULL, *p;
@@ -147,49 +147,49 @@ static void normalize_protected_variable(char *varname TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void add_protected_variable(char *varname TSRMLS_DC) /* {{{ */
+static void add_protected_variable(char *varname) /* {{{ */
{
- normalize_protected_variable(varname TSRMLS_CC);
+ normalize_protected_variable(varname);
zend_hash_str_add_empty_element(&PG(rfc1867_protected_variables), varname, strlen(varname));
}
/* }}} */
-static zend_bool is_protected_variable(char *varname TSRMLS_DC) /* {{{ */
+static zend_bool is_protected_variable(char *varname) /* {{{ */
{
- normalize_protected_variable(varname TSRMLS_CC);
+ normalize_protected_variable(varname);
return zend_hash_str_exists(&PG(rfc1867_protected_variables), varname, strlen(varname));
}
/* }}} */
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) /* {{{ */
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection) /* {{{ */
{
- if (override_protection || !is_protected_variable(var TSRMLS_CC)) {
- php_register_variable_safe(var, strval, val_len, track_vars_array TSRMLS_CC);
+ if (override_protection || !is_protected_variable(var)) {
+ php_register_variable_safe(var, strval, val_len, track_vars_array);
}
}
/* }}} */
-static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) /* {{{ */
+static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection) /* {{{ */
{
- if (override_protection || !is_protected_variable(var TSRMLS_CC)) {
- php_register_variable_ex(var, val, track_vars_array TSRMLS_CC);
+ if (override_protection || !is_protected_variable(var)) {
+ php_register_variable_ex(var, val, track_vars_array);
}
}
/* }}} */
-static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) /* {{{ */
+static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
{
- safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection TSRMLS_CC);
+ safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection);
}
/* }}} */
-static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) /* {{{ */
+static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
{
- safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC);
+ safe_php_register_variable_ex(var, val, http_post_files, override_protection);
}
/* }}} */
-static int unlink_filename(zval *el TSRMLS_DC) /* {{{ */
+static int unlink_filename(zval *el) /* {{{ */
{
char *filename = (char*)Z_PTR_P(el);
VCWD_UNLINK(filename);
@@ -203,9 +203,9 @@ static void free_filename(zval *el) {
efree(filename);
}
-void destroy_uploaded_files_hash(TSRMLS_D) /* {{{ */
+void destroy_uploaded_files_hash(void) /* {{{ */
{
- zend_hash_apply(SG(rfc1867_uploaded_files), unlink_filename TSRMLS_CC);
+ zend_hash_apply(SG(rfc1867_uploaded_files), unlink_filename);
zend_hash_destroy(SG(rfc1867_uploaded_files));
FREE_HASHTABLE(SG(rfc1867_uploaded_files));
}
@@ -242,7 +242,7 @@ typedef struct {
* Fill up the buffer with client data.
* Returns number of bytes added to buffer.
*/
-static int fill_buffer(multipart_buffer *self TSRMLS_DC)
+static int fill_buffer(multipart_buffer *self)
{
int bytes_to_read, total_read = 0, actual_read = 0;
@@ -261,7 +261,7 @@ static int fill_buffer(multipart_buffer *self TSRMLS_DC)
char *buf = self->buffer + self->bytes_in_buffer;
- actual_read = (int)sapi_module.read_post(buf, bytes_to_read TSRMLS_CC);
+ actual_read = (int)sapi_module.read_post(buf, bytes_to_read);
/* update the buffer length */
if (actual_read > 0) {
@@ -278,9 +278,9 @@ static int fill_buffer(multipart_buffer *self TSRMLS_DC)
}
/* eof if we are out of bytes, or if we hit the final boundary */
-static int multipart_buffer_eof(multipart_buffer *self TSRMLS_DC)
+static int multipart_buffer_eof(multipart_buffer *self)
{
- if ( (self->bytes_in_buffer == 0 && fill_buffer(self TSRMLS_CC) < 1) ) {
+ if ( (self->bytes_in_buffer == 0 && fill_buffer(self) < 1) ) {
return 1;
} else {
return 0;
@@ -288,7 +288,7 @@ static int multipart_buffer_eof(multipart_buffer *self TSRMLS_DC)
}
/* create new multipart_buffer structure */
-static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len TSRMLS_DC)
+static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len)
{
multipart_buffer *self = (multipart_buffer *) ecalloc(1, sizeof(multipart_buffer));
@@ -305,8 +305,8 @@ static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len T
self->buf_begin = self->buffer;
self->bytes_in_buffer = 0;
- if (php_rfc1867_encoding_translation(TSRMLS_C)) {
- php_rfc1867_get_detect_order(&self->detect_order, &self->detect_order_size TSRMLS_CC);
+ if (php_rfc1867_encoding_translation()) {
+ php_rfc1867_get_detect_order(&self->detect_order, &self->detect_order_size);
} else {
self->detect_order = NULL;
self->detect_order_size = 0;
@@ -363,12 +363,12 @@ static char *next_line(multipart_buffer *self)
}
/* Returns the next CRLF terminated line from the client */
-static char *get_line(multipart_buffer *self TSRMLS_DC)
+static char *get_line(multipart_buffer *self)
{
char* ptr = next_line(self);
if (!ptr) {
- fill_buffer(self TSRMLS_CC);
+ fill_buffer(self);
ptr = next_line(self);
}
@@ -387,12 +387,12 @@ static void php_free_hdr_entry(mime_header_entry *h)
}
/* finds a boundary */
-static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC)
+static int find_boundary(multipart_buffer *self, char *boundary)
{
char *line;
/* loop thru lines */
- while( (line = get_line(self TSRMLS_CC)) )
+ while( (line = get_line(self)) )
{
/* finished if we found the boundary */
if (!strcmp(line, boundary)) {
@@ -405,27 +405,27 @@ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC)
}
/* parse headers */
-static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC)
+static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header)
{
char *line;
mime_header_entry prev_entry = {0}, entry;
int prev_len, cur_len;
/* didn't find boundary, abort */
- if (!find_boundary(self, self->boundary TSRMLS_CC)) {
+ if (!find_boundary(self, self->boundary)) {
return 0;
}
/* get lines of text, or CRLF_CRLF */
- while( (line = get_line(self TSRMLS_CC)) && line[0] != '\0' )
+ while( (line = get_line(self)) && line[0] != '\0' )
{
/* add header to table */
char *key = line;
char *value = NULL;
- if (php_rfc1867_encoding_translation(TSRMLS_C)) {
- self->input_encoding = zend_multibyte_encoding_detector(line, strlen(line), self->detect_order, self->detect_order_size TSRMLS_CC);
+ if (php_rfc1867_encoding_translation()) {
+ self->input_encoding = zend_multibyte_encoding_detector(line, strlen(line), self->detect_order, self->detect_order_size);
}
/* space in the beginning means same header */
@@ -483,7 +483,7 @@ static char *php_mime_get_hdr_value(zend_llist header, char *key)
return NULL;
}
-static char *php_ap_getword(const zend_encoding *encoding, char **line, char stop TSRMLS_DC)
+static char *php_ap_getword(const zend_encoding *encoding, char **line, char stop)
{
char *pos = *line, quote;
char *res;
@@ -537,7 +537,7 @@ static char *substring_conf(char *start, int len, char quote)
return result;
}
-static char *php_ap_getword_conf(const zend_encoding *encoding, char *str TSRMLS_DC)
+static char *php_ap_getword_conf(const zend_encoding *encoding, char *str)
{
while (*str && isspace(*str)) {
++str;
@@ -562,7 +562,7 @@ static char *php_ap_getword_conf(const zend_encoding *encoding, char *str TSRMLS
}
}
-static char *php_ap_basename(const zend_encoding *encoding, char *path TSRMLS_DC)
+static char *php_ap_basename(const zend_encoding *encoding, char *path)
{
char *s = strrchr(path, '\\');
char *s2 = strrchr(path, '/');
@@ -611,14 +611,14 @@ static void *php_ap_memstr(char *haystack, int haystacklen, char *needle, int ne
}
/* read until a boundary condition */
-static int multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes, int *end TSRMLS_DC)
+static int multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes, int *end)
{
size_t len, max;
char *bound;
/* fill buffer if needed */
if (bytes > self->bytes_in_buffer) {
- fill_buffer(self TSRMLS_CC);
+ fill_buffer(self);
}
/* look for a potential boundary match, only read data up to that point */
@@ -657,12 +657,12 @@ static int multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes
XXX: this is horrible memory-usage-wise, but we only expect
to do this on small pieces of form data.
*/
-static char *multipart_buffer_read_body(multipart_buffer *self, size_t *len TSRMLS_DC)
+static char *multipart_buffer_read_body(multipart_buffer *self, size_t *len)
{
char buf[FILLUNIT], *out=NULL;
int total_bytes=0, read_bytes=0;
- while((read_bytes = multipart_buffer_read(self, buf, sizeof(buf), NULL TSRMLS_CC))) {
+ while((read_bytes = multipart_buffer_read(self, buf, sizeof(buf), NULL))) {
out = erealloc(out, total_bytes + read_bytes + 1);
memcpy(out + total_bytes, buf, read_bytes);
total_bytes += read_bytes;
@@ -697,13 +697,13 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
void *event_extra_data = NULL;
unsigned int llen = 0;
int upload_cnt = INI_INT("max_file_uploads");
- const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding();
php_rfc1867_getword_t getword;
php_rfc1867_getword_conf_t getword_conf;
php_rfc1867_basename_t _basename;
zend_long count = 0;
- if (php_rfc1867_encoding_translation(TSRMLS_C) && internal_encoding) {
+ if (php_rfc1867_encoding_translation() && internal_encoding) {
getword = php_rfc1867_getword;
getword_conf = php_rfc1867_getword_conf;
_basename = php_rfc1867_basename;
@@ -757,7 +757,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
/* Initialize the buffer */
- if (!(mbuff = multipart_buffer_new(boundary, boundary_len TSRMLS_CC))) {
+ if (!(mbuff = multipart_buffer_new(boundary, boundary_len))) {
sapi_module.sapi_error(E_WARNING, "Unable to initialize the input buffer");
return;
}
@@ -777,12 +777,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
multipart_event_start event_start;
event_start.content_length = SG(request_info).content_length;
- if (php_rfc1867_callback(MULTIPART_EVENT_START, &event_start, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (php_rfc1867_callback(MULTIPART_EVENT_START, &event_start, &event_extra_data) == FAILURE) {
goto fileupload_done;
}
}
- while (!multipart_buffer_eof(mbuff TSRMLS_CC))
+ while (!multipart_buffer_eof(mbuff))
{
char buff[FILLUNIT];
char *cd = NULL, *param = NULL, *filename = NULL, *tmp = NULL;
@@ -791,7 +791,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
zend_llist_clean(&header);
- if (!multipart_buffer_headers(mbuff, &header TSRMLS_CC)) {
+ if (!multipart_buffer_headers(mbuff, &header)) {
goto fileupload_done;
}
@@ -803,7 +803,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
++cd;
}
- while (*cd && (pair = getword(mbuff->input_encoding, &cd, ';' TSRMLS_CC)))
+ while (*cd && (pair = getword(mbuff->input_encoding, &cd, ';')))
{
char *key = NULL, *word = pair;
@@ -812,17 +812,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
if (strchr(pair, '=')) {
- key = getword(mbuff->input_encoding, &pair, '=' TSRMLS_CC);
+ key = getword(mbuff->input_encoding, &pair, '=');
if (!strcasecmp(key, "name")) {
if (param) {
efree(param);
}
- param = getword_conf(mbuff->input_encoding, pair TSRMLS_CC);
+ param = getword_conf(mbuff->input_encoding, pair);
if (mbuff->input_encoding && internal_encoding) {
unsigned char *new_param;
size_t new_param_len;
- if ((size_t)-1 != zend_multibyte_encoding_converter(&new_param, &new_param_len, (unsigned char *)param, strlen(param), internal_encoding, mbuff->input_encoding TSRMLS_CC)) {
+ if ((size_t)-1 != zend_multibyte_encoding_converter(&new_param, &new_param_len, (unsigned char *)param, strlen(param), internal_encoding, mbuff->input_encoding)) {
efree(param);
param = (char *)new_param;
}
@@ -831,11 +831,11 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
if (filename) {
efree(filename);
}
- filename = getword_conf(mbuff->input_encoding, pair TSRMLS_CC);
+ filename = getword_conf(mbuff->input_encoding, pair);
if (mbuff->input_encoding && internal_encoding) {
unsigned char *new_filename;
size_t new_filename_len;
- if ((size_t)-1 != zend_multibyte_encoding_converter(&new_filename, &new_filename_len, (unsigned char *)filename, strlen(filename), internal_encoding, mbuff->input_encoding TSRMLS_CC)) {
+ if ((size_t)-1 != zend_multibyte_encoding_converter(&new_filename, &new_filename_len, (unsigned char *)filename, strlen(filename), internal_encoding, mbuff->input_encoding)) {
efree(filename);
filename = (char *)new_filename;
}
@@ -851,7 +851,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
/* Normal form variable, safe to read all data into memory */
if (!filename && param) {
size_t value_len;
- char *value = multipart_buffer_read_body(mbuff, &value_len TSRMLS_CC);
+ char *value = multipart_buffer_read_body(mbuff, &value_len);
size_t new_val_len; /* Dummy variable */
if (!value) {
@@ -862,14 +862,14 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
if (mbuff->input_encoding && internal_encoding) {
unsigned char *new_value;
size_t new_value_len;
- if ((size_t)-1 != zend_multibyte_encoding_converter(&new_value, &new_value_len, (unsigned char *)value, value_len, internal_encoding, mbuff->input_encoding TSRMLS_CC)) {
+ if ((size_t)-1 != zend_multibyte_encoding_converter(&new_value, &new_value_len, (unsigned char *)value, value_len, internal_encoding, mbuff->input_encoding)) {
efree(value);
value = (char *)new_value;
value_len = new_value_len;
}
}
- if (++count <= PG(max_input_vars) && sapi_module.input_filter(PARSE_POST, param, &value, value_len, &new_val_len TSRMLS_CC)) {
+ if (++count <= PG(max_input_vars) && sapi_module.input_filter(PARSE_POST, param, &value, value_len, &new_val_len)) {
if (php_rfc1867_callback != NULL) {
multipart_event_formdata event_formdata;
size_t newlength = new_val_len;
@@ -879,17 +879,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
event_formdata.value = &value;
event_formdata.length = new_val_len;
event_formdata.newlength = &newlength;
- if (php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data) == FAILURE) {
efree(param);
efree(value);
continue;
}
new_val_len = newlength;
}
- safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC);
+ safe_php_register_variable(param, value, new_val_len, array_ptr, 0);
} else {
if (count == PG(max_input_vars) + 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ php_error_docref(NULL, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
}
if (php_rfc1867_callback != NULL) {
@@ -900,7 +900,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
event_formdata.value = &value;
event_formdata.length = value_len;
event_formdata.newlength = NULL;
- php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC);
+ php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data);
}
}
@@ -976,7 +976,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
event_file_start.post_bytes_processed = SG(read_post_bytes);
event_file_start.name = param;
event_file_start.filename = &filename;
- if (php_rfc1867_callback(MULTIPART_EVENT_FILE_START, &event_file_start, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_START, &event_file_start, &event_extra_data) == FAILURE) {
temp_filename = "";
efree(param);
efree(filename);
@@ -1002,14 +1002,14 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
if (!cancel_upload) {
/* only bother to open temp file if we have data */
- blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC);
+ blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end);
#if DEBUG_FILE_UPLOAD
if (blen > 0) {
#else
/* in non-debug mode we have no problem with 0-length files */
{
#endif
- fd = php_open_temporary_fd_ex(PG(upload_tmp_dir), "php", &temp_filename, 1 TSRMLS_CC);
+ fd = php_open_temporary_fd_ex(PG(upload_tmp_dir), "php", &temp_filename, 1);
upload_cnt--;
if (fd == -1) {
sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file");
@@ -1028,7 +1028,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
event_file_data.data = buff;
event_file_data.length = blen;
event_file_data.newlength = &blen;
- if (php_rfc1867_callback(MULTIPART_EVENT_FILE_DATA, &event_file_data, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_DATA, &event_file_data, &event_extra_data) == FAILURE) {
cancel_upload = UPLOAD_ERROR_X;
continue;
}
@@ -1069,7 +1069,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
/* read data for next iteration */
- blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC);
+ blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end);
}
if (fd != -1) { /* may not be initialized if file could not be created */
@@ -1094,7 +1094,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
event_file_end.post_bytes_processed = SG(read_post_bytes);
event_file_end.temp_filename = temp_filename;
event_file_end.cancel_upload = cancel_upload;
- if (php_rfc1867_callback(MULTIPART_EVENT_FILE_END, &event_file_end, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_END, &event_file_end, &event_extra_data) == FAILURE) {
cancel_upload = UPLOAD_ERROR_X;
}
}
@@ -1144,13 +1144,13 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
* the full path of the file on the user's filesystem, which means that unless
* the user does basename() they get a bogus file name. Until IE's user base drops
* to nill or problem is fixed this code must remain enabled for all systems. */
- s = _basename(internal_encoding, filename TSRMLS_CC);
+ s = _basename(internal_encoding, filename);
if (!s) {
s = filename;
}
if (!is_anonymous) {
- safe_php_register_variable(lbuf, s, strlen(s), NULL, 0 TSRMLS_CC);
+ safe_php_register_variable(lbuf, s, strlen(s), NULL, 0);
}
/* Add $foo[name] */
@@ -1159,7 +1159,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
} else {
snprintf(lbuf, llen, "%s[name]", param);
}
- register_http_post_files_variable(lbuf, s, &PG(http_globals)[TRACK_VARS_FILES], 0 TSRMLS_CC);
+ register_http_post_files_variable(lbuf, s, &PG(http_globals)[TRACK_VARS_FILES], 0);
efree(filename);
s = NULL;
@@ -1181,7 +1181,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
snprintf(lbuf, llen, "%s_type", param);
}
if (!is_anonymous) {
- safe_php_register_variable(lbuf, cd, strlen(cd), NULL, 0 TSRMLS_CC);
+ safe_php_register_variable(lbuf, cd, strlen(cd), NULL, 0);
}
/* Add $foo[type] */
@@ -1190,7 +1190,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
} else {
snprintf(lbuf, llen, "%s[type]", param);
}
- register_http_post_files_variable(lbuf, cd, &PG(http_globals)[TRACK_VARS_FILES], 0 TSRMLS_CC);
+ register_http_post_files_variable(lbuf, cd, &PG(http_globals)[TRACK_VARS_FILES], 0);
/* Restore Content-Type Header */
if (s != NULL) {
@@ -1204,12 +1204,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
zval zfilename;
/* Initialize variables */
- add_protected_variable(param TSRMLS_CC);
+ add_protected_variable(param);
/* if param is of form xxx[.*] this will cut it to xxx */
if (!is_anonymous) {
ZVAL_STRING(&zfilename, temp_filename);
- safe_php_register_variable_ex(param, &zfilename, NULL, 1 TSRMLS_CC);
+ safe_php_register_variable_ex(param, &zfilename, NULL, 1);
}
/* Add $foo[tmp_name] */
@@ -1218,9 +1218,9 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
} else {
snprintf(lbuf, llen, "%s[tmp_name]", param);
}
- add_protected_variable(lbuf TSRMLS_CC);
+ add_protected_variable(lbuf);
ZVAL_STRING(&zfilename, temp_filename);
- register_http_post_files_variable_ex(lbuf, &zfilename, &PG(http_globals)[TRACK_VARS_FILES], 1 TSRMLS_CC);
+ register_http_post_files_variable_ex(lbuf, &zfilename, &PG(http_globals)[TRACK_VARS_FILES], 1);
}
{
@@ -1258,7 +1258,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
} else {
snprintf(lbuf, llen, "%s[error]", param);
}
- register_http_post_files_variable_ex(lbuf, &error_type, &PG(http_globals)[TRACK_VARS_FILES], 0 TSRMLS_CC);
+ register_http_post_files_variable_ex(lbuf, &error_type, &PG(http_globals)[TRACK_VARS_FILES], 0);
/* Add $foo_size */
if (is_arr_upload) {
@@ -1270,7 +1270,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
if (size_overflow) {
ZVAL_STRING(&file_size, file_size_buf);
}
- safe_php_register_variable_ex(lbuf, &file_size, NULL, size_overflow TSRMLS_CC);
+ safe_php_register_variable_ex(lbuf, &file_size, NULL, size_overflow);
}
/* Add $foo[size] */
@@ -1282,7 +1282,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
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 TSRMLS_CC);
+ register_http_post_files_variable_ex(lbuf, &file_size, &PG(http_globals)[TRACK_VARS_FILES], size_overflow);
}
efree(param);
}
@@ -1293,7 +1293,7 @@ fileupload_done:
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 TSRMLS_CC);
+ php_rfc1867_callback(MULTIPART_EVENT_END, &event_end, &event_extra_data);
}
if (lbuf) efree(lbuf);
diff --git a/main/rfc1867.h b/main/rfc1867.h
index ab5f50f8d6..8df4fa8b52 100644
--- a/main/rfc1867.h
+++ b/main/rfc1867.h
@@ -67,18 +67,18 @@ typedef struct _multipart_event_end {
size_t post_bytes_processed;
} multipart_event_end;
-typedef int (*php_rfc1867_encoding_translation_t)(TSRMLS_D);
-typedef void (*php_rfc1867_get_detect_order_t)(const zend_encoding ***list, size_t *list_size TSRMLS_DC);
-typedef void (*php_rfc1867_set_input_encoding_t)(const zend_encoding *encoding TSRMLS_DC);
-typedef char* (*php_rfc1867_getword_t)(const zend_encoding *encoding, char **line, char stop TSRMLS_DC);
-typedef char* (*php_rfc1867_getword_conf_t)(const zend_encoding *encoding, char *str TSRMLS_DC);
-typedef char* (*php_rfc1867_basename_t)(const zend_encoding *encoding, char *str TSRMLS_DC);
+typedef int (*php_rfc1867_encoding_translation_t)(void);
+typedef void (*php_rfc1867_get_detect_order_t)(const zend_encoding ***list, size_t *list_size);
+typedef void (*php_rfc1867_set_input_encoding_t)(const zend_encoding *encoding);
+typedef char* (*php_rfc1867_getword_t)(const zend_encoding *encoding, char **line, char stop);
+typedef char* (*php_rfc1867_getword_conf_t)(const zend_encoding *encoding, char *str);
+typedef char* (*php_rfc1867_basename_t)(const zend_encoding *encoding, char *str);
SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler);
-void destroy_uploaded_files_hash(TSRMLS_D);
-void php_rfc1867_register_constants(TSRMLS_D);
-extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
+void destroy_uploaded_files_hash(void);
+void php_rfc1867_register_constants(void);
+extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra);
SAPI_API void php_rfc1867_set_multibyte_callbacks(
php_rfc1867_encoding_translation_t encoding_translation,
diff --git a/main/snprintf.c b/main/snprintf.c
index 7e4d8a11ab..b9867ebcee 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -796,9 +796,8 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
*/
switch (*fmt) {
case 'Z': {
- TSRMLS_FETCH();
- zvp = (zval*) va_arg(ap, zval*);
- free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC);
+ zvp = (zval*) va_arg(ap, zval*);
+ free_zcopy = zend_make_printable_zval(zvp, &zcopy);
if (free_zcopy) {
zvp = &zcopy;
}
diff --git a/main/spprintf.c b/main/spprintf.c
index ee73d4f4e5..f860ee3dff 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -410,9 +410,8 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
*/
switch (*fmt) {
case 'Z': {
- TSRMLS_FETCH();
- zvp = (zval*) va_arg(ap, zval*);
- free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC);
+ zvp = (zval*) va_arg(ap, zval*);
+ free_zcopy = zend_make_printable_zval(zvp, &zcopy);
if (free_zcopy) {
zvp = &zcopy;
}
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 3291a9ca8f..83236fa47f 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -63,7 +63,6 @@ FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs)
static int stream_cookie_reader(void *cookie, char *buffer, int size)
{
int ret;
- TSRMLS_FETCH();
ret = php_stream_read((php_stream*)cookie, buffer, size);
return ret;
@@ -71,14 +70,12 @@ static int stream_cookie_reader(void *cookie, char *buffer, int size)
static int stream_cookie_writer(void *cookie, const char *buffer, int size)
{
- TSRMLS_FETCH();
return php_stream_write((php_stream *)cookie, (char *)buffer, size);
}
static PHP_FPOS_T stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
{
- TSRMLS_FETCH();
return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence);
}
@@ -86,7 +83,6 @@ static PHP_FPOS_T stream_cookie_seeker(void *cookie, zend_off_t position, int wh
static int stream_cookie_closer(void *cookie)
{
php_stream *stream = (php_stream*)cookie;
- TSRMLS_FETCH();
/* prevent recursion */
stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
@@ -96,7 +92,6 @@ static int stream_cookie_closer(void *cookie)
static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
{
ssize_t ret;
- TSRMLS_FETCH();
ret = php_stream_read(((php_stream *)cookie), buffer, size);
return ret;
@@ -104,7 +99,6 @@ static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t size)
{
- TSRMLS_FETCH();
return php_stream_write(((php_stream *)cookie), (char *)buffer, size);
}
@@ -112,7 +106,6 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz
# ifdef COOKIE_SEEKER_USES_OFF64_T
static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence)
{
- TSRMLS_FETCH();
*position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence);
@@ -124,7 +117,6 @@ static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence)
# else
static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
{
- TSRMLS_FETCH();
return php_stream_seek((php_stream *)cookie, position, whence);
}
@@ -133,7 +125,6 @@ static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
static int stream_cookie_closer(void *cookie)
{
php_stream *stream = (php_stream*)cookie;
- TSRMLS_FETCH();
/* prevent recursion */
stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
@@ -197,7 +188,7 @@ void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *resul
/* }}} */
/* {{{ php_stream_cast */
-PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC)
+PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err)
{
int flags = castas & PHP_STREAM_CAST_MASK;
castas &= ~PHP_STREAM_CAST_MASK;
@@ -208,7 +199,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) {
zend_off_t dummy;
- stream->ops->seek(stream, stream->position, SEEK_SET, &dummy TSRMLS_CC);
+ stream->ops->seek(stream, stream->position, SEEK_SET, &dummy);
stream->readpos = stream->writepos = 0;
}
}
@@ -228,7 +219,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
if (php_stream_is(stream, PHP_STREAM_IS_STDIO) &&
stream->ops->cast &&
!php_stream_is_filtered(stream) &&
- stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS
+ stream->ops->cast(stream, castas, ret) == SUCCESS
) {
goto exit_success;
}
@@ -265,12 +256,12 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
b) no memory
-> lets bail
*/
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "fopencookie failed");
+ php_error_docref(NULL, E_ERROR, "fopencookie failed");
return FAILURE;
#endif
- if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL TSRMLS_CC) == SUCCESS) {
- if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) {
+ if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL) == SUCCESS) {
+ if (FAILURE == stream->ops->cast(stream, castas, ret)) {
return FAILURE;
}
goto exit_success;
@@ -304,9 +295,9 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
}
if (php_stream_is_filtered(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot cast a filtered stream on this system");
+ php_error_docref(NULL, E_WARNING, "cannot cast a filtered stream on this system");
return FAILURE;
- } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) {
+ } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) {
goto exit_success;
}
@@ -319,7 +310,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
"select()able descriptor"
};
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->label, cast_names[castas]);
+ php_error_docref(NULL, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->label, cast_names[castas]);
}
return FAILURE;
@@ -334,7 +325,7 @@ exit_success:
* will be accessing the stream. Emit a warning so that the end-user will
* know that they should try something else */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, ZEND_LONG_FMT " bytes of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos));
+ php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " bytes of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos));
}
if (castas == PHP_STREAM_AS_STDIO && ret) {
@@ -351,7 +342,7 @@ exit_success:
/* }}} */
/* {{{ php_stream_open_wrapper_as_file */
-PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC)
+PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC)
{
FILE *fp = NULL;
php_stream *stream = NULL;
@@ -374,7 +365,7 @@ PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int optio
/* }}} */
/* {{{ php_stream_make_seekable */
-PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC)
+PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC)
{
if (newstream == NULL) {
return PHP_STREAM_FAILED;
diff --git a/main/streams/filter.c b/main/streams/filter.c
index 56e388403d..62d27e5ee7 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -38,24 +38,24 @@ PHPAPI HashTable *php_get_stream_filters_hash_global(void)
}
/* Normal hash selection/retrieval call */
-PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D)
+PHPAPI HashTable *_php_get_stream_filters_hash(void)
{
return (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash);
}
/* API for registering GLOBAL filters */
-PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC)
+PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory)
{
return zend_hash_str_add_ptr(&stream_filters_hash, filterpattern, strlen(filterpattern), factory) ? SUCCESS : FAILURE;
}
-PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC)
+PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern)
{
return zend_hash_str_del(&stream_filters_hash, filterpattern, strlen(filterpattern));
}
/* API for registering VOLATILE wrappers */
-PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC)
+PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory)
{
if (!FG(stream_filters)) {
ALLOC_HASHTABLE(FG(stream_filters));
@@ -68,7 +68,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern
/* Buckets */
-PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC)
+PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent)
{
int is_persistent = php_stream_is_persistent(stream);
php_stream_bucket *bucket;
@@ -112,11 +112,11 @@ PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, s
* In both cases, the original bucket is unlinked from its brigade.
* If a copy is made, the original bucket is delref'd.
* */
-PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC)
+PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket)
{
php_stream_bucket *retval;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (bucket->refcount == 1 && bucket->own_buf) {
return bucket;
@@ -131,12 +131,12 @@ PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bu
retval->refcount = 1;
retval->own_buf = 1;
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return retval;
}
-PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC)
+PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length)
{
*left = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent);
*right = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent);
@@ -177,7 +177,7 @@ exit_fail:
return FAILURE;
}
-PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC)
+PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket)
{
if (--bucket->refcount == 0) {
if (bucket->own_buf) {
@@ -187,7 +187,7 @@ PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC)
}
}
-PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC)
+PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket)
{
bucket->next = brigade->head;
bucket->prev = NULL;
@@ -201,7 +201,7 @@ PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_st
bucket->brigade = brigade;
}
-PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC)
+PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket)
{
if (brigade->tail == bucket) {
return;
@@ -219,7 +219,7 @@ PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_str
bucket->brigade = brigade;
}
-PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC)
+PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket)
{
if (bucket->prev) {
bucket->prev->next = bucket->next;
@@ -247,7 +247,7 @@ PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC)
* match. If that fails, we try "convert.charset.*", then "convert.*"
* This means that we don't need to clog up the hashtable with a zillion
* charsets (for example) but still be able to provide them all as filters */
-PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent)
{
HashTable *filter_hash = (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash);
php_stream_filter_factory *factory = NULL;
@@ -258,7 +258,7 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval
n = (int)strlen(filtername);
if (NULL != (factory = zend_hash_str_find_ptr(filter_hash, filtername, n))) {
- filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC);
+ filter = factory->create_filter(filtername, filterparams, persistent);
} else if ((period = strrchr(filtername, '.'))) {
/* try a wildcard */
char *wildname;
@@ -270,7 +270,7 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval
*period = '\0';
strncat(wildname, ".*", 2);
if (NULL != (factory = zend_hash_str_find_ptr(filter_hash, wildname, strlen(wildname)))) {
- filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC);
+ filter = factory->create_filter(filtername, filterparams, persistent);
}
*period = '\0';
@@ -282,15 +282,15 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval
if (filter == NULL) {
/* TODO: these need correct docrefs */
if (factory == NULL)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to locate filter \"%s\"", filtername);
+ php_error_docref(NULL, E_WARNING, "unable to locate filter \"%s\"", filtername);
else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create or locate filter \"%s\"", filtername);
+ php_error_docref(NULL, E_WARNING, "unable to create or locate filter \"%s\"", filtername);
}
return filter;
}
-PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC)
{
php_stream_filter *filter;
@@ -304,14 +304,14 @@ PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops,
return filter;
}
-PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC)
+PHPAPI void php_stream_filter_free(php_stream_filter *filter)
{
if (filter->fops->dtor)
- filter->fops->dtor(filter TSRMLS_CC);
+ filter->fops->dtor(filter);
pefree(filter, filter->is_persistent);
}
-PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC)
+PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter)
{
filter->next = chain->head;
filter->prev = NULL;
@@ -327,12 +327,12 @@ PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stre
return SUCCESS;
}
-PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC)
+PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter)
{
- php_stream_filter_prepend_ex(chain, filter TSRMLS_CC);
+ php_stream_filter_prepend_ex(chain, filter);
}
-PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC)
+PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter)
{
php_stream *stream = chain->stream;
@@ -354,9 +354,9 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
php_stream_bucket *bucket;
size_t consumed = 0;
- bucket = php_stream_bucket_new(stream, (char*) stream->readbuf + stream->readpos, stream->writepos - stream->readpos, 0, 0 TSRMLS_CC);
- php_stream_bucket_append(brig_inp, bucket TSRMLS_CC);
- status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, (char*) stream->readbuf + stream->readpos, stream->writepos - stream->readpos, 0, 0);
+ php_stream_bucket_append(brig_inp, bucket);
+ status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL);
if (stream->readpos + consumed > (uint)stream->writepos) {
/* No behaving filter should cause this. */
@@ -367,15 +367,15 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
case PSFS_ERR_FATAL:
while (brig_in.head) {
bucket = brig_in.head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
while (brig_out.head) {
bucket = brig_out.head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter failed to process pre-buffered data");
+ php_error_docref(NULL, E_WARNING, "Filter failed to process pre-buffered data");
return FAILURE;
case PSFS_FEED_ME:
/* We don't actually need data yet,
@@ -403,8 +403,8 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen);
stream->writepos += bucket->buflen;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
break;
}
@@ -413,9 +413,9 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
return SUCCESS;
}
-PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC)
+PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter)
{
- if (php_stream_filter_append_ex(chain, filter TSRMLS_CC) != SUCCESS) {
+ if (php_stream_filter_append_ex(chain, filter) != SUCCESS) {
if (chain->head == filter) {
chain->head = NULL;
chain->tail = NULL;
@@ -426,7 +426,7 @@ PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream
}
}
-PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC)
+PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish)
{
php_stream_bucket_brigade brig_a = { NULL, NULL }, brig_b = { NULL, NULL }, *inp = &brig_a, *outp = &brig_b, *brig_temp;
php_stream_bucket *bucket;
@@ -447,7 +447,7 @@ PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS
for(current = filter; current; current = current->next) {
php_stream_filter_status_t status;
- status = filter->fops->filter(stream, filter, inp, outp, NULL, flags TSRMLS_CC);
+ status = filter->fops->filter(stream, filter, inp, outp, NULL, flags);
if (status == PSFS_FEED_ME) {
/* We've flushed the data far enough */
return SUCCESS;
@@ -493,22 +493,22 @@ PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS
while ((bucket = inp->head)) {
memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen);
stream->writepos += bucket->buflen;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
} else if (chain == &(stream->writefilters)) {
/* Send flushed data to the stream */
while ((bucket = inp->head)) {
- stream->ops->write(stream, bucket->buf, bucket->buflen TSRMLS_CC);
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ stream->ops->write(stream, bucket->buf, bucket->buflen);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
}
return SUCCESS;
}
-PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC)
+PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor)
{
if (filter->prev) {
filter->prev->next = filter->next;
@@ -526,7 +526,7 @@ PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, in
}
if (call_dtor) {
- php_stream_filter_free(filter TSRMLS_CC);
+ php_stream_filter_free(filter);
return NULL;
}
return filter;
diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c
index e62fbfb662..7822265ea3 100644
--- a/main/streams/glob_wrapper.c
+++ b/main/streams/glob_wrapper.c
@@ -47,7 +47,7 @@ typedef struct {
size_t pattern_len;
} glob_s_t;
-PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC) /* {{{ */
+PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
@@ -69,7 +69,7 @@ PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *ple
}
/* }}} */
-PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC) /* {{{ */
+PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
@@ -91,7 +91,7 @@ PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *
}
/* }}} */
-PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC) /* {{{ */
+PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
@@ -109,7 +109,7 @@ PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC
}
/* }}} */
-static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char **p_file TSRMLS_DC) /* {{{ */
+static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char **p_file) /* {{{ */
{
const char *pos, *gpath = path;
@@ -137,7 +137,7 @@ static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int ge
}
/* }}} */
-static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
php_stream_dirent *ent = (php_stream_dirent*)buf;
@@ -146,7 +146,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T
/* avoid problems if someone mis-uses the stream */
if (count == sizeof(php_stream_dirent) && pglob) {
if (pglob->index < (size_t)pglob->glob.gl_pathc) {
- php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path TSRMLS_CC);
+ php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path);
PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path));
return sizeof(php_stream_dirent);
}
@@ -161,7 +161,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T
}
/* }}} */
-static int php_glob_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_glob_stream_close(php_stream *stream, int close_handle) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
@@ -180,7 +180,7 @@ static int php_glob_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
}
/* {{{ */
-static int php_glob_stream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) /* {{{ */
+static int php_glob_stream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs) /* {{{ */
{
glob_s_t *pglob = (glob_s_t *)stream->abstract;
@@ -207,13 +207,13 @@ php_stream_ops php_glob_stream_ops = {
/* {{{ php_glob_stream_opener */
static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
glob_s_t *pglob;
int ret;
const char *tmp, *pos;
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) {
return NULL;
}
@@ -252,9 +252,9 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha
pglob->flags |= GLOB_APPEND;
if (pglob->glob.gl_pathc) {
- php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[0], 1, &tmp TSRMLS_CC);
+ php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[0], 1, &tmp);
} else {
- php_glob_stream_path_split(pglob, path, 1, &tmp TSRMLS_CC);
+ php_glob_stream_path_split(pglob, path, 1, &tmp);
}
return php_stream_alloc(&php_glob_stream_ops, pglob, 0, mode);
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 28274d7fcd..b2dca2115c 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -46,7 +46,7 @@ typedef struct {
/* {{{ */
-static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
@@ -82,7 +82,7 @@ static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_
/* {{{ */
-static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
@@ -107,7 +107,7 @@ static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count
/* {{{ */
-static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_stream_memory_close(php_stream *stream, int close_handle)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
@@ -122,7 +122,7 @@ static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_D
/* {{{ */
-static int php_stream_memory_flush(php_stream *stream TSRMLS_DC)
+static int php_stream_memory_flush(php_stream *stream)
{
/* nothing to do here */
return 0;
@@ -131,7 +131,7 @@ static int php_stream_memory_flush(php_stream *stream TSRMLS_DC)
/* {{{ */
-static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
@@ -195,13 +195,13 @@ static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whe
/* }}} */
/* {{{ */
-static int php_stream_memory_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_stream_memory_cast(php_stream *stream, int castas, void **ret)
{
return FAILURE;
}
/* }}} */
-static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
time_t timestamp = 0;
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
@@ -244,7 +244,7 @@ static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TS
}
/* }}} */
-static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */
+static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
size_t newsize;
@@ -290,7 +290,7 @@ PHPAPI php_stream_ops php_stream_memory_ops = {
/* {{{ */
-PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC)
{
php_stream_memory_data *self;
php_stream *stream;
@@ -310,7 +310,7 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC)
/* {{{ */
-PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC)
{
php_stream *stream;
php_stream_memory_data *ms;
@@ -335,7 +335,7 @@ PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length ST
/* {{{ */
-PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC)
+PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
@@ -361,7 +361,7 @@ typedef struct {
/* {{{ */
-static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
@@ -387,7 +387,7 @@ static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t
/* {{{ */
-static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
size_t got;
@@ -408,7 +408,7 @@ static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count T
/* {{{ */
-static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_stream_temp_close(php_stream *stream, int close_handle)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
int ret;
@@ -435,7 +435,7 @@ static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC)
/* {{{ */
-static int php_stream_temp_flush(php_stream *stream TSRMLS_DC)
+static int php_stream_temp_flush(php_stream *stream)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
@@ -446,7 +446,7 @@ static int php_stream_temp_flush(php_stream *stream TSRMLS_DC)
/* {{{ */
-static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
int ret;
@@ -466,7 +466,7 @@ static int php_stream_temp_seek(php_stream *stream, zend_off_t offset, int whenc
/* }}} */
/* {{{ */
-static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_stream_temp_cast(php_stream *stream, int castas, void **ret)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
php_stream *file;
@@ -512,7 +512,7 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRML
}
/* }}} */
-static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
@@ -523,7 +523,7 @@ static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRM
}
/* }}} */
-static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */
+static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
@@ -555,7 +555,7 @@ PHPAPI php_stream_ops php_stream_temp_ops = {
/* }}} */
/* {{{ _php_stream_temp_create_ex */
-PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC)
{
php_stream_temp_data *self;
php_stream *stream;
@@ -577,14 +577,14 @@ PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage,
/* }}} */
/* {{{ _php_stream_temp_create */
-PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC)
{
return php_stream_temp_create_ex(mode, max_memory_usage, NULL);
}
/* }}} */
/* {{{ _php_stream_temp_open */
-PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC)
{
php_stream *stream;
php_stream_temp_data *ts;
@@ -593,8 +593,8 @@ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char
if ((stream = php_stream_temp_create_rel(mode, max_memory_usage)) != NULL) {
if (length) {
assert(buf != NULL);
- php_stream_temp_write(stream, buf, length TSRMLS_CC);
- php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
+ php_stream_temp_write(stream, buf, length);
+ php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs);
}
ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
@@ -616,7 +616,7 @@ PHPAPI php_stream_ops php_stream_rfc2397_ops = {
static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, const char *path,
const char *mode, int options, char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+ php_stream_context *context STREAMS_DC) /* {{{ */
{
php_stream *stream;
php_stream_temp_data *ts;
@@ -641,7 +641,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
}
if ((comma = memchr(path, ',', dlen)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: no comma in URL");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: no comma in URL");
return NULL;
}
@@ -653,7 +653,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
sep = memchr(path, '/', mlen);
if (!semi && !sep) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal media type");
return NULL;
}
@@ -668,7 +668,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
path += plen;
} else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */
zval_ptr_dtor(&meta);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal media type");
return NULL;
}
/* get parameters and potentially ';base64' */
@@ -681,7 +681,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
if (mlen != sizeof("base64")-1 || memcmp(path, "base64", sizeof("base64")-1)) {
/* must be error since parameters are only allowed after mediatype and we have no '=' sign */
zval_ptr_dtor(&meta);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal parameter");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal parameter");
return NULL;
}
base64 = 1;
@@ -701,7 +701,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
}
if (mlen) {
zval_ptr_dtor(&meta);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal URL");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: illegal URL");
return NULL;
}
} else {
@@ -717,7 +717,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
base64_comma = php_base64_decode((const unsigned char *)comma, dlen);
if (!base64_comma) {
zval_ptr_dtor(&meta);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: unable to decode");
+ php_stream_wrapper_log_error(wrapper, options, "rfc2397: unable to decode");
return NULL;
}
comma = base64_comma->val;
@@ -730,8 +730,8 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
/* store data */
- php_stream_temp_write(stream, comma, ilen TSRMLS_CC);
- php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
+ php_stream_temp_write(stream, comma, ilen);
+ php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs);
/* set special stream stuff (enforce exact mode) */
vlen = strlen(mode);
if (vlen >= sizeof(stream->mode)) {
diff --git a/main/streams/mmap.c b/main/streams/mmap.c
index 8746959bbe..3eee859c13 100644
--- a/main/streams/mmap.c
+++ b/main/streams/mmap.c
@@ -22,7 +22,7 @@
#include "php.h"
#include "php_streams_int.h"
-PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC)
+PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len)
{
php_stream_mmap_range range;
@@ -46,12 +46,12 @@ PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t le
return NULL;
}
-PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC)
+PHPAPI int _php_stream_mmap_unmap(php_stream *stream)
{
return php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_UNMAP, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0;
}
-PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden TSRMLS_DC)
+PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden)
{
int ret = 1;
diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h
index ac90a0ba3c..836cd9cadb 100644
--- a/main/streams/php_stream_context.h
+++ b/main/streams/php_stream_context.h
@@ -25,7 +25,7 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
int notifycode, int severity,
char *xmsg, int xcode,
size_t bytes_sofar, size_t bytes_max,
- void * ptr TSRMLS_DC);
+ void * ptr);
#define PHP_STREAM_NOTIFIER_PROGRESS 1
@@ -33,10 +33,10 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
If no context was passed, use the default context
The default context has not yet been created, do it now. */
#define php_stream_context_from_zval(zcontext, nocontext) ( \
- (zcontext) ? zend_fetch_resource(zcontext TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \
+ (zcontext) ? zend_fetch_resource(zcontext, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \
(nocontext) ? NULL : \
FG(default_context) ? FG(default_context) : \
- (FG(default_context) = php_stream_context_alloc(TSRMLS_C)) )
+ (FG(default_context) = php_stream_context_alloc()) )
#define php_stream_context_to_zval(context, zval) { ZVAL_RES(zval, (context)->res); GC_REFCOUNT((context)->res)++; }
@@ -58,7 +58,7 @@ struct _php_stream_context {
BEGIN_EXTERN_C()
PHPAPI void php_stream_context_free(php_stream_context *context);
-PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D);
+PHPAPI php_stream_context *php_stream_context_alloc(void);
PHPAPI zval *php_stream_context_get_option(php_stream_context *context,
const char *wrappername, const char *optionname);
PHPAPI int php_stream_context_set_option(php_stream_context *context,
@@ -86,17 +86,17 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity,
- char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC);
-PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC);
+ char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr);
+PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context);
END_EXTERN_C()
#define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \
php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \
- (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while (0)
+ (xmsg), (xcode), 0, 0, NULL); } } while (0)
#define php_stream_notify_progress(context, bsofar, bmax) do { if ((context) && (context)->notifier) { \
php_stream_notification_notify((context), PHP_STREAM_NOTIFY_PROGRESS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \
- NULL, 0, (bsofar), (bmax), NULL TSRMLS_CC); } } while(0)
+ NULL, 0, (bsofar), (bmax), NULL); } } while(0)
#define php_stream_notify_progress_init(context, sofar, bmax) do { if ((context) && (context)->notifier) { \
(context)->notifier->progress = (sofar); \
@@ -111,11 +111,11 @@ END_EXTERN_C()
#define php_stream_notify_file_size(context, file_size, xmsg, xcode) do { if ((context) && (context)->notifier) { \
php_stream_notification_notify((context), PHP_STREAM_NOTIFY_FILE_SIZE_IS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \
- (xmsg), (xcode), 0, (file_size), NULL TSRMLS_CC); } } while(0)
+ (xmsg), (xcode), 0, (file_size), NULL); } } while(0)
#define php_stream_notify_error(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) {\
php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \
- (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while(0)
+ (xmsg), (xcode), 0, 0, NULL); } } while(0)
/*
diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h
index dfa4ae2937..7c9248ecc1 100644
--- a/main/streams/php_stream_filter_api.h
+++ b/main/streams/php_stream_filter_api.h
@@ -67,14 +67,14 @@ typedef enum {
/* Buckets API. */
BEGIN_EXTERN_C()
-PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC);
-PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC);
-PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC);
+PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent);
+PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length);
+PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket);
#define php_stream_bucket_addref(bucket) (bucket)->refcount++
-PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC);
-PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC);
-PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC);
-PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC);
+PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket);
+PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket);
+PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket);
+PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket);
END_EXTERN_C()
#define PSFS_FLAG_NORMAL 0 /* regular read/write */
@@ -90,9 +90,9 @@ typedef struct _php_stream_filter_ops {
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
int flags
- TSRMLS_DC);
+ );
- void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC);
+ void (*dtor)(php_stream_filter *thisfilter);
const char *label;
@@ -124,32 +124,32 @@ struct _php_stream_filter {
/* stack filter onto a stream */
BEGIN_EXTERN_C()
-PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC);
-PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC);
-PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC);
-PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC);
-PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC);
-PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC);
-PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC);
-PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC);
+PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter);
+PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter);
+PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter);
+PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter);
+PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish);
+PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor);
+PHPAPI void php_stream_filter_free(php_stream_filter *filter);
+PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC);
END_EXTERN_C()
-#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC TSRMLS_CC)
-#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter) TSRMLS_CC)
-#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter) TSRMLS_CC)
-#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish) TSRMLS_CC)
+#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC)
+#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC)
+#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter))
+#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter))
+#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish))
#define php_stream_is_filtered(stream) ((stream)->readfilters.head || (stream)->writefilters.head)
typedef struct _php_stream_filter_factory {
- php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent TSRMLS_DC);
+ php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent);
} php_stream_filter_factory;
BEGIN_EXTERN_C()
-PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC);
-PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC);
-PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC);
-PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC);
+PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory);
+PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern);
+PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory);
+PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent);
END_EXTERN_C()
/*
diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h
index 69b67d4c85..be93651fd1 100644
--- a/main/streams/php_stream_glob_wrapper.h
+++ b/main/streams/php_stream_glob_wrapper.h
@@ -23,14 +23,14 @@ PHPAPI extern php_stream_ops php_glob_stream_ops;
BEGIN_EXTERN_C()
-PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC);
-#define php_glob_stream_get_path(stream, copy, plen) _php_glob_stream_get_path((stream), (copy), (plen) STREAMS_CC TSRMLS_CC)
+PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, size_t *plen STREAMS_DC);
+#define php_glob_stream_get_path(stream, copy, plen) _php_glob_stream_get_path((stream), (copy), (plen) STREAMS_CC)
-PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC TSRMLS_DC);
-#define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC TSRMLS_CC)
+PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, size_t *plen STREAMS_DC);
+#define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC)
-PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC);
-#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC TSRMLS_CC)
+PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC);
+#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC)
END_EXTERN_C()
diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h
index a25c4ac6b9..e58b703095 100644
--- a/main/streams/php_stream_mmap.h
+++ b/main/streams/php_stream_mmap.h
@@ -60,22 +60,22 @@ typedef struct {
#define PHP_STREAM_MMAP_ALL 0
-#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL TSRMLS_CC) == 0 ? 1 : 0)
+#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL) == 0 ? 1 : 0)
/* Returns 1 if the stream in its current state can be memory mapped,
* 0 otherwise */
#define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream)))
BEGIN_EXTERN_C()
-PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC);
-#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len) TSRMLS_CC)
+PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len);
+#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len))
/* un-maps the last mapped range */
-PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC);
-#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream) TSRMLS_CC)
+PHPAPI int _php_stream_mmap_unmap(php_stream *stream);
+#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream))
-PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden TSRMLS_DC);
-#define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden) TSRMLS_CC)
+PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden);
+#define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden))
END_EXTERN_C()
/*
diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h
index 7d5278c620..d2bf50d189 100644
--- a/main/streams/php_stream_plain_wrapper.h
+++ b/main/streams/php_stream_plain_wrapper.h
@@ -27,32 +27,32 @@ PHPAPI extern php_stream_wrapper php_plain_files_wrapper;
BEGIN_EXTERN_C()
/* like fopen, but returns a stream */
-PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC);
+#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC);
+#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC);
+#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC);
+#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC);
+#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC);
+#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC)
-PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC);
-#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC)
+PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC);
+#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC)
/* This is a utility API for extensions that are opening a stream, converting it
* to a FILE* and then closing it again. Be warned that fileno() on the result
* will most likely fail on systems with fopencookie. */
-PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC TSRMLS_DC);
-#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC)
+PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC);
+#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC)
END_EXTERN_C()
diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h
index 2d076064cf..7f587282f0 100644
--- a/main/streams/php_stream_transport.h
+++ b/main/streams/php_stream_transport.h
@@ -30,12 +30,12 @@ typedef php_stream *(php_stream_transport_factory_func)(const char *proto, size_
const char *resourcename, size_t resourcenamelen,
const char *persistent_id, int options, int flags,
struct timeval *timeout,
- php_stream_context *context STREAMS_DC TSRMLS_DC);
+ php_stream_context *context STREAMS_DC);
typedef php_stream_transport_factory_func *php_stream_transport_factory;
BEGIN_EXTERN_C()
-PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC);
-PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC);
+PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory);
+PHPAPI int php_stream_xport_unregister(const char *protocol);
#define STREAM_XPORT_CLIENT 0
#define STREAM_XPORT_SERVER 1
@@ -52,16 +52,16 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
php_stream_context *context,
zend_string **error_string,
int *error_code
- STREAMS_DC TSRMLS_DC);
+ STREAMS_DC);
#define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode) \
- _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC TSRMLS_CC)
+ _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC)
/* Bind the stream to a local address */
PHPAPI int php_stream_xport_bind(php_stream *stream,
const char *name, size_t namelen,
zend_string **error_text
- TSRMLS_DC);
+ );
/* Connect to a remote address */
PHPAPI int php_stream_xport_connect(php_stream *stream,
@@ -70,13 +70,13 @@ PHPAPI int php_stream_xport_connect(php_stream *stream,
struct timeval *timeout,
zend_string **error_text,
int *error_code
- TSRMLS_DC);
+ );
/* Prepare to listen */
PHPAPI int php_stream_xport_listen(php_stream *stream,
int backlog,
zend_string **error_text
- TSRMLS_DC);
+ );
/* Get the next client and their address as a string, or the underlying address
* structure. You must efree either of these if you request them */
@@ -85,13 +85,13 @@ PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client,
void **addr, socklen_t *addrlen,
struct timeval *timeout,
zend_string **error_text
- TSRMLS_DC);
+ );
/* Get the name of either the socket or it's peer */
PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer,
zend_string **textaddr,
void **addr, socklen_t *addrlen
- TSRMLS_DC);
+ );
enum php_stream_xport_send_recv_flags {
STREAM_OOB = 1,
@@ -102,12 +102,12 @@ enum php_stream_xport_send_recv_flags {
* peeking, optionally retrieving OOB data */
PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen,
int flags, void **addr, socklen_t *addrlen,
- zend_string **textaddr TSRMLS_DC);
+ zend_string **textaddr);
/* Similar to send() system call; send data to the stream, optionally
* sending it as OOB data */
PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen,
- int flags, void *addr, socklen_t addrlen TSRMLS_DC);
+ int flags, void *addr, socklen_t addrlen);
typedef enum {
STREAM_SHUT_RD,
@@ -117,7 +117,7 @@ typedef enum {
/* Similar to shutdown() system call; shut down part of a full-duplex
* connection */
-PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC);
+PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how);
END_EXTERN_C()
@@ -186,8 +186,8 @@ typedef enum {
/* These functions provide crypto support on the underlying transport */
BEGIN_EXTERN_C()
-PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC);
-PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC);
+PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream);
+PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate);
END_EXTERN_C()
typedef struct _php_stream_xport_crypto_param {
diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h
index d8799fcefb..ac0163ddb4 100644
--- a/main/streams/php_streams_int.h
+++ b/main/streams/php_streams_int.h
@@ -66,6 +66,6 @@
* ones. result should be a char[5]. */
void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result);
-void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC);
-void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC);
+void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper);
+void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption);
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 8fad2aa4f1..acb34b8968 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -44,14 +44,14 @@
# include "win32/time.h"
#endif
-#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC)
-#define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC)
-#define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC TSRMLS_CC)
-#define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC TSRMLS_CC)
+#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC)
+#define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC)
+#define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC)
+#define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC)
#if !defined(WINDOWS) && !defined(NETWARE)
-extern int php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC);
-extern int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC);
+extern int php_get_uid_by_name(const char *name, uid_t *uid);
+extern int php_get_gid_by_name(const char *name, gid_t *gid);
#endif
#if defined(PHP_WIN32)
@@ -158,7 +158,7 @@ static int do_fstat(php_stdio_stream_data *d, int force)
return 0;
}
-static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC)
+static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const char *persistent_id STREAMS_DC)
{
php_stdio_stream_data *self;
@@ -174,7 +174,7 @@ static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const
return php_stream_alloc_rel(&php_stream_stdio_ops, self, persistent_id, mode);
}
-static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode STREAMS_DC TSRMLS_DC)
+static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode STREAMS_DC)
{
php_stdio_stream_data *self;
@@ -190,12 +190,12 @@ static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode
return php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode);
}
-PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path_ptr STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path_ptr STREAMS_DC)
{
char *opened_path = NULL;
int fd;
- fd = php_open_temporary_fd(dir, pfx, &opened_path TSRMLS_CC);
+ fd = php_open_temporary_fd(dir, pfx, &opened_path);
if (fd != -1) {
php_stream *stream;
@@ -216,19 +216,19 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char
}
close(fd);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream");
+ php_error_docref(NULL, E_WARNING, "unable to allocate stream");
return NULL;
}
return NULL;
}
-PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC)
{
return php_stream_fopen_temporary_file(NULL, "php", NULL);
}
-PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC)
{
php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id);
@@ -267,7 +267,7 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha
return stream;
}
-PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC)
{
php_stream *stream = php_stream_fopen_from_file_int_rel(file, mode);
@@ -299,7 +299,7 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE
return stream;
}
-PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC)
{
php_stdio_stream_data *self;
php_stream *stream;
@@ -318,7 +318,7 @@ PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STRE
return stream;
}
-static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count)
{
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
@@ -345,7 +345,7 @@ static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count
}
}
-static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count)
{
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
size_t ret;
@@ -406,7 +406,7 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
return ret;
}
-static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_stdiop_close(php_stream *stream, int close_handle)
{
int ret;
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
@@ -467,7 +467,7 @@ static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC)
return ret;
}
-static int php_stdiop_flush(php_stream *stream TSRMLS_DC)
+static int php_stdiop_flush(php_stream *stream)
{
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
@@ -484,7 +484,7 @@ static int php_stdiop_flush(php_stream *stream TSRMLS_DC)
return 0;
}
-static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC)
+static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset)
{
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
int ret;
@@ -492,7 +492,7 @@ static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, ze
assert(data != NULL);
if (data->is_pipe) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot seek on a pipe");
+ php_error_docref(NULL, E_WARNING, "cannot seek on a pipe");
return -1;
}
@@ -513,7 +513,7 @@ static int php_stdiop_seek(php_stream *stream, zend_off_t offset, int whence, ze
}
}
-static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_stdiop_cast(php_stream *stream, int castas, void **ret)
{
php_socket_t fd;
php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract;
@@ -571,7 +571,7 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
}
}
-static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb)
{
int ret;
php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract;
@@ -583,7 +583,7 @@ static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC
return ret;
}
-static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract;
size_t size;
@@ -846,7 +846,7 @@ PHPAPI php_stream_ops php_stream_stdio_ops = {
/* }}} */
/* {{{ plain files opendir/readdir implementation */
-static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count)
{
DIR *dir = (DIR*)stream->abstract;
/* avoid libc5 readdir problems */
@@ -865,12 +865,12 @@ static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size
return 0;
}
-static int php_plain_files_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_plain_files_dirstream_close(php_stream *stream, int close_handle)
{
return closedir((DIR *)stream->abstract);
}
-static int php_plain_files_dirstream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_plain_files_dirstream_rewind(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
rewinddir((DIR *)stream->abstract);
return 0;
@@ -887,18 +887,18 @@ static php_stream_ops php_plain_files_dirstream_ops = {
};
static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const char *path, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
DIR *dir = NULL;
php_stream *stream = NULL;
#ifdef HAVE_GLOB
if (options & STREAM_USE_GLOB_DIR_OPEN) {
- return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC TSRMLS_CC);
+ return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC);
}
#endif
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) {
return NULL;
}
@@ -906,7 +906,7 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const
#ifdef PHP_WIN32
if (!dir) {
- php_win32_docref2_from_error(GetLastError(), path, path TSRMLS_CC);
+ php_win32_docref2_from_error(GetLastError(), path, path);
}
if (dir && dir->finished) {
@@ -925,7 +925,7 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const
/* }}} */
/* {{{ php_stream_fopen */
-PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC)
{
char *realpath = NULL;
int open_flags;
@@ -936,7 +936,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha
if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "`%s' is not a valid mode for fopen", mode);
+ php_error_docref(NULL, E_WARNING, "`%s' is not a valid mode for fopen", mode);
}
return NULL;
}
@@ -944,14 +944,14 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha
if (options & STREAM_ASSUME_REALPATH) {
realpath = estrdup(filename);
} else {
- if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) {
+ if ((realpath = expand_filepath(filename, NULL)) == NULL) {
return NULL;
}
}
if (persistent) {
spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath);
- switch (php_stream_from_persistent_id(persistent_id, &ret TSRMLS_CC)) {
+ switch (php_stream_from_persistent_id(persistent_id, &ret)) {
case PHP_STREAM_PERSISTENT_SUCCESS:
if (opened_path) {
*opened_path = realpath;
@@ -1025,22 +1025,22 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha
static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) {
return NULL;
}
return php_stream_fopen_rel(path, mode, opened_path, options);
}
-static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context)
{
if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) {
url += sizeof("file://") - 1;
}
- if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1)) {
return -1;
}
@@ -1060,7 +1060,7 @@ static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *u
return VCWD_STAT(url, &ssb->sb);
}
-static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
int ret;
@@ -1068,25 +1068,25 @@ static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url,
url += sizeof("file://") - 1;
}
- if (php_check_open_basedir(url TSRMLS_CC)) {
+ if (php_check_open_basedir(url)) {
return 0;
}
ret = VCWD_UNLINK(url);
if (ret == -1) {
if (options & REPORT_ERRORS) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno));
+ php_error_docref1(NULL, url, E_WARNING, "%s", strerror(errno));
}
return 0;
}
/* Clear stat cache (and realpath cache) */
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
return 1;
}
-static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context)
{
int ret;
@@ -1096,11 +1096,11 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
- php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
+ php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
return 0;
}
if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) {
- php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
+ php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
return 0;
}
#endif
@@ -1113,7 +1113,7 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
url_to += sizeof("file://") - 1;
}
- if (php_check_open_basedir(url_from TSRMLS_CC) || php_check_open_basedir(url_to TSRMLS_CC)) {
+ if (php_check_open_basedir(url_from) || php_check_open_basedir(url_to)) {
return 0;
}
@@ -1124,25 +1124,25 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
# ifdef EXDEV
if (errno == EXDEV) {
zend_stat_t sb;
- if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) {
+ if (php_copy_file(url_from, url_to) == SUCCESS) {
if (VCWD_STAT(url_from, &sb) == 0) {
# if !defined(TSRM_WIN32) && !defined(NETWARE)
if (VCWD_CHMOD(url_to, sb.st_mode)) {
if (errno == EPERM) {
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
VCWD_UNLINK(url_from);
return 1;
}
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
}
if (VCWD_CHOWN(url_to, sb.st_uid, sb.st_gid)) {
if (errno == EPERM) {
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
VCWD_UNLINK(url_from);
return 1;
}
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
}
# endif
@@ -1150,27 +1150,27 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
return 1;
}
}
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
return 0;
}
# endif
#endif
#ifdef PHP_WIN32
- php_win32_docref2_from_error(GetLastError(), url_from, url_to TSRMLS_CC);
+ php_win32_docref2_from_error(GetLastError(), url_from, url_to);
#else
- php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno));
#endif
return 0;
}
/* Clear stat cache (and realpath cache) */
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
return 1;
}
-static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, int mode, int options, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, int mode, int options, php_stream_context *context)
{
int ret, recursive = options & PHP_STREAM_MKDIR_RECURSIVE;
char *p;
@@ -1180,7 +1180,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
}
if (!recursive) {
- ret = php_mkdir(dir, mode TSRMLS_CC);
+ ret = php_mkdir(dir, mode);
} else {
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
char *e;
@@ -1189,8 +1189,8 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
int offset = 0;
char buf[MAXPATHLEN];
- if (!expand_filepath_with_mode(dir, buf, NULL, 0, CWD_EXPAND TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
+ if (!expand_filepath_with_mode(dir, buf, NULL, 0, CWD_EXPAND )) {
+ php_error_docref(NULL, E_WARNING, "Invalid path");
return 0;
}
@@ -1227,8 +1227,8 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
}
if (p == buf) {
- ret = php_mkdir(dir, mode TSRMLS_CC);
- } else if (!(ret = php_mkdir(buf, mode TSRMLS_CC))) {
+ ret = php_mkdir(dir, mode);
+ } else if (!(ret = php_mkdir(buf, mode))) {
if (!p) {
p = buf;
}
@@ -1239,7 +1239,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
if ((*(p+1) != '\0') &&
(ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
break;
}
@@ -1256,35 +1256,35 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
}
}
-static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) {
url += sizeof("file://") - 1;
}
- if (php_check_open_basedir(url TSRMLS_CC)) {
+ if (php_check_open_basedir(url)) {
return 0;
}
#if PHP_WIN32
if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(ENOENT));
+ php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
}
#endif
if (VCWD_RMDIR(url) < 0) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno));
+ php_error_docref1(NULL, url, E_WARNING, "%s", strerror(errno));
return 0;
}
/* Clear stat cache (and realpath cache) */
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
return 1;
}
-static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC)
+static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context)
{
struct utimbuf *newtime;
#if !defined(WINDOWS) && !defined(NETWARE)
@@ -1299,7 +1299,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
#if PHP_WIN32
if (!php_win32_check_trailing_space(url, url_len)) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(ENOENT));
+ php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
}
#endif
@@ -1308,7 +1308,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
url += sizeof("file://") - 1;
}
- if (php_check_open_basedir(url TSRMLS_CC)) {
+ if (php_check_open_basedir(url)) {
return 0;
}
@@ -1318,7 +1318,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
if (VCWD_ACCESS(url, F_OK) != 0) {
FILE *file = VCWD_FOPEN(url, "w");
if (file == NULL) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to create file %s because %s", url, strerror(errno));
+ php_error_docref1(NULL, url, E_WARNING, "Unable to create file %s because %s", url, strerror(errno));
return 0;
}
fclose(file);
@@ -1330,8 +1330,8 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
case PHP_STREAM_META_OWNER_NAME:
case PHP_STREAM_META_OWNER:
if(option == PHP_STREAM_META_OWNER_NAME) {
- if(php_get_uid_by_name((char *)value, &uid TSRMLS_CC) != SUCCESS) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to find uid for %s", (char *)value);
+ if(php_get_uid_by_name((char *)value, &uid) != SUCCESS) {
+ php_error_docref1(NULL, url, E_WARNING, "Unable to find uid for %s", (char *)value);
return 0;
}
} else {
@@ -1342,8 +1342,8 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
case PHP_STREAM_META_GROUP:
case PHP_STREAM_META_GROUP_NAME:
if(option == PHP_STREAM_META_OWNER_NAME) {
- if(php_get_gid_by_name((char *)value, &gid TSRMLS_CC) != SUCCESS) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unable to find gid for %s", (char *)value);
+ if(php_get_gid_by_name((char *)value, &gid) != SUCCESS) {
+ php_error_docref1(NULL, url, E_WARNING, "Unable to find gid for %s", (char *)value);
return 0;
}
} else {
@@ -1357,14 +1357,14 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
ret = VCWD_CHMOD(url, mode);
break;
default:
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Unknown option %d for stream_metadata", option);
+ php_error_docref1(NULL, url, E_WARNING, "Unknown option %d for stream_metadata", option);
return 0;
}
if (ret == -1) {
- php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "Operation failed: %s", strerror(errno));
+ php_error_docref1(NULL, url, E_WARNING, "Operation failed: %s", strerror(errno));
return 0;
}
- php_clear_stat_cache(0, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(0, NULL, 0);
return 1;
}
@@ -1390,7 +1390,7 @@ PHPAPI php_stream_wrapper php_plain_files_wrapper = {
};
/* {{{ php_stream_fopen_with_path */
-PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC)
+PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC)
{
/* code ripped off from fopen_wrappers.c */
char *pathbuf, *end;
@@ -1424,7 +1424,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char
}
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename)) {
return NULL;
}
@@ -1436,7 +1436,7 @@ not_relative_path:
/* Absolute path open */
if (IS_ABSOLUTE_PATH(filename, filename_length)) {
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename)) {
return NULL;
}
@@ -1447,17 +1447,17 @@ not_relative_path:
if (IS_SLASH(filename[0])) {
size_t cwd_len;
char *cwd;
- cwd = virtual_getcwd_ex(&cwd_len TSRMLS_CC);
+ cwd = virtual_getcwd_ex(&cwd_len);
/* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */
*(cwd+3) = '\0';
if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
+ php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
}
efree(cwd);
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath)) {
return NULL;
}
@@ -1473,8 +1473,8 @@ not_relative_path:
/* append the calling scripts' current working directory
* as a fall back case
*/
- if (zend_is_executing(TSRMLS_C)) {
- exec_fname = zend_get_executed_filename(TSRMLS_C);
+ if (zend_is_executing()) {
+ exec_fname = zend_get_executed_filename();
exec_fname_length = (int)strlen(exec_fname);
path_length = (int)strlen(path);
@@ -1506,10 +1506,10 @@ not_relative_path:
goto stream_skip;
}
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
+ php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
}
- if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) {
+ if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0)) {
goto stream_skip;
}
diff --git a/main/streams/streams.c b/main/streams/streams.c
index c6420dc0d0..fab5d42eb3 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -55,7 +55,7 @@ PHPAPI int php_file_le_stream_filter(void)
return le_stream_filter;
}
-PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D)
+PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(void)
{
return (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash);
}
@@ -65,7 +65,7 @@ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void)
return &url_stream_wrappers_hash;
}
-static int _php_stream_release_context(zval *zv, void *pContext TSRMLS_DC)
+static int _php_stream_release_context(zval *zv, void *pContext)
{
zend_resource *le = Z_RES_P(zv);
if (le->ptr == pContext) {
@@ -74,7 +74,7 @@ static int _php_stream_release_context(zval *zv, void *pContext TSRMLS_DC)
return 0;
}
-static int forget_persistent_resource_id_numbers(zval *el TSRMLS_DC)
+static int forget_persistent_resource_id_numbers(zval *el)
{
php_stream *stream;
zend_resource *rsrc = Z_RES_P(el);
@@ -94,7 +94,7 @@ fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream);
if (PHP_STREAM_CONTEXT(stream)) {
zend_hash_apply_with_argument(&EG(regular_list),
_php_stream_release_context,
- PHP_STREAM_CONTEXT(stream) TSRMLS_CC);
+ PHP_STREAM_CONTEXT(stream));
stream->ctx = NULL;
}
@@ -103,7 +103,7 @@ fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream);
PHP_RSHUTDOWN_FUNCTION(streams)
{
- zend_hash_apply(&EG(persistent_list), forget_persistent_resource_id_numbers TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), forget_persistent_resource_id_numbers);
return SUCCESS;
}
@@ -116,7 +116,7 @@ PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclos
return orig;
}
-PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC)
+PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream)
{
zend_resource *le;
@@ -155,7 +155,7 @@ PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream *
/* }}} */
-static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper TSRMLS_DC)
+static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper)
{
if (!FG(wrapper_errors)) {
return NULL;
@@ -165,14 +165,14 @@ static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper TSRML
}
/* {{{ wrapper error reporting */
-void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC)
+void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption)
{
char *tmp = estrdup(path);
char *msg;
int free_msg = 0;
if (wrapper) {
- zend_llist *err_list = php_get_wrapper_errors_list(wrapper TSRMLS_CC);
+ zend_llist *err_list = php_get_wrapper_errors_list(wrapper);
if (err_list) {
size_t l = 0;
int brlen;
@@ -222,14 +222,14 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
}
php_strip_url_passwd(tmp);
- php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg);
+ php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg);
efree(tmp);
if (free_msg) {
efree(msg);
}
}
-void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC)
+void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper)
{
if (wrapper && FG(wrapper_errors)) {
zend_hash_str_del(FG(wrapper_errors), (const char*)&wrapper, sizeof(wrapper));
@@ -247,7 +247,7 @@ static void wrapper_list_dtor(zval *item) {
efree(list);
}
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...)
+PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...)
{
va_list args;
char *buffer = NULL;
@@ -257,7 +257,7 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option
va_end(args);
if (options & REPORT_ERRORS || wrapper == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buffer);
+ php_error_docref(NULL, E_WARNING, "%s", buffer);
efree(buffer);
} else {
zend_llist *list = NULL;
@@ -284,7 +284,7 @@ PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int option
/* }}} */
/* allocate a new stream for a particular ops */
-PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC) /* {{{ */
+PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC) /* {{{ */
{
php_stream *ret;
@@ -341,10 +341,10 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste
}
/* }}} */
-PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC) /* {{{ */
+PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options) /* {{{ */
{
return _php_stream_free(stream_enclosed,
- close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING TSRMLS_CC);
+ close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING);
}
/* }}} */
@@ -369,14 +369,14 @@ static const char *_php_stream_pretty_free_options(int close_options, char *out)
}
#endif
-static int _php_stream_free_persistent(zval *zv, void *pStream TSRMLS_DC)
+static int _php_stream_free_persistent(zval *zv, void *pStream)
{
zend_resource *le = Z_RES_P(zv);
return le->ptr == pStream;
}
-PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */
+PHPAPI int _php_stream_free(php_stream *stream, int close_options) /* {{{ */
{
int ret = 1;
int preserve_handle = close_options & PHP_STREAM_FREE_PRESERVE_HANDLE ? 1 : 0;
@@ -426,7 +426,7 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /*
* enclosing stream can free this stream. We remove rsrc_dtor because
* we want the enclosing stream to be deleted from the resource list */
return _php_stream_free(enclosing_stream,
- (close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR TSRMLS_CC);
+ (close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR);
}
/* if we are releasing the stream only (and preserving the underlying handle),
@@ -454,7 +454,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
#endif
/* make sure everything is saved */
- _php_stream_flush(stream, 1 TSRMLS_CC);
+ _php_stream_flush(stream, 1);
/* If not called from the resource dtor, remove the stream from the resource list. */
if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && stream->res) {
@@ -485,7 +485,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
return fclose(stream->stdiocast);
}
- ret = stream->ops->close(stream, preserve_handle ? 0 : 1 TSRMLS_CC);
+ ret = stream->ops->close(stream, preserve_handle ? 0 : 1);
stream->abstract = NULL;
/* tidy up any FILE* that might have been fdopened */
@@ -498,14 +498,14 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
if (close_options & PHP_STREAM_FREE_RELEASE_STREAM) {
while (stream->readfilters.head) {
- php_stream_filter_remove(stream->readfilters.head, 1 TSRMLS_CC);
+ php_stream_filter_remove(stream->readfilters.head, 1);
}
while (stream->writefilters.head) {
- php_stream_filter_remove(stream->writefilters.head, 1 TSRMLS_CC);
+ php_stream_filter_remove(stream->writefilters.head, 1);
}
if (stream->wrapper && stream->wrapper->wops && stream->wrapper->wops->stream_closer) {
- stream->wrapper->wops->stream_closer(stream->wrapper, stream TSRMLS_CC);
+ stream->wrapper->wops->stream_closer(stream->wrapper, stream);
stream->wrapper = NULL;
}
@@ -521,7 +521,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) {
/* we don't work with *stream but need its value for comparison */
- zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream);
}
#if ZEND_DEBUG
if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting) & E_WARNING)) {
@@ -572,7 +572,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
/* {{{ generic stream operations */
-static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC)
+static void php_stream_fill_read_buffer(php_stream *stream, size_t size)
{
/* allocate/fill the buffer */
@@ -597,12 +597,12 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D
php_stream_filter *filter;
/* read a chunk into a bucket */
- justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC);
+ justread = stream->ops->read(stream, chunk_buf, stream->chunk_size);
if (justread && justread != (size_t)-1) {
- bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0);
/* after this call, bucket is owned by the brigade */
- php_stream_bucket_append(brig_inp, bucket TSRMLS_CC);
+ php_stream_bucket_append(brig_inp, bucket);
flags = PSFS_FLAG_NORMAL;
} else {
@@ -611,7 +611,7 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D
/* wind the handle... */
for (filter = stream->readfilters.head; filter; filter = filter->next) {
- status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags TSRMLS_CC);
+ status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags);
if (status != PSFS_PASS_ON) {
break;
@@ -643,8 +643,8 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D
memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen);
stream->writepos += bucket->buflen;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
break;
@@ -695,7 +695,7 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D
justread = stream->ops->read(stream, (char*)stream->readbuf + stream->writepos,
stream->readbuflen - stream->writepos
- TSRMLS_CC);
+ );
if (justread != (size_t)-1) {
stream->writepos += justread;
@@ -704,7 +704,7 @@ static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_D
}
}
-PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC)
+PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size)
{
size_t toread = 0, didread = 0;
@@ -734,13 +734,13 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS
}
if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) {
- toread = stream->ops->read(stream, buf, size TSRMLS_CC);
+ toread = stream->ops->read(stream, buf, size);
if (toread == (size_t) -1) {
/* e.g. underlying read(2) returned -1 */
break;
}
} else {
- php_stream_fill_read_buffer(stream, size TSRMLS_CC);
+ php_stream_fill_read_buffer(stream, size);
toread = stream->writepos - stream->readpos;
if (toread > size) {
@@ -774,7 +774,7 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS
return didread;
}
-PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC)
+PHPAPI int _php_stream_eof(php_stream *stream)
{
/* if there is data in the buffer, it's not EOF */
if (stream->writepos - stream->readpos > 0) {
@@ -791,7 +791,7 @@ PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC)
return stream->eof;
}
-PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC)
+PHPAPI int _php_stream_putc(php_stream *stream, int c)
{
unsigned char buf = c;
@@ -801,7 +801,7 @@ PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC)
return EOF;
}
-PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC)
+PHPAPI int _php_stream_getc(php_stream *stream)
{
char buf;
@@ -811,7 +811,7 @@ PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC)
return EOF;
}
-PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC)
+PHPAPI int _php_stream_puts(php_stream *stream, const char *buf)
{
size_t len;
char newline[2] = "\n"; /* is this OK for Win? */
@@ -823,13 +823,13 @@ PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC)
return 0;
}
-PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb)
{
memset(ssb, 0, sizeof(*ssb));
/* if the stream was wrapped, allow the wrapper to stat it */
if (stream->wrapper && stream->wrapper->wops->stream_stat != NULL) {
- return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb TSRMLS_CC);
+ return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb);
}
/* if the stream doesn't directly support stat-ing, return with failure.
@@ -840,10 +840,10 @@ PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
return -1;
}
- return (stream->ops->stat)(stream, ssb TSRMLS_CC);
+ return (stream->ops->stat)(stream, ssb);
}
-PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TSRMLS_DC)
+PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf)
{
size_t avail;
const char *cr, *lf, *eol = NULL;
@@ -886,7 +886,7 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS
* appropriate length to hold the line, regardless of the line length, memory
* permitting */
PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen,
- size_t *returned_len TSRMLS_DC)
+ size_t *returned_len)
{
size_t avail = 0;
size_t current_buf_size = 0;
@@ -923,7 +923,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen,
int done = 0;
readptr = (char*)stream->readbuf + stream->readpos;
- eol = php_stream_locate_eol(stream, NULL TSRMLS_CC);
+ eol = php_stream_locate_eol(stream, NULL);
if (eol) {
cpysz = eol - readptr + 1;
@@ -976,7 +976,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen,
}
}
- php_stream_fill_read_buffer(stream, toread TSRMLS_CC);
+ php_stream_fill_read_buffer(stream, toread);
if (stream->writepos - stream->readpos == 0) {
break;
@@ -1006,7 +1006,7 @@ static const char *_php_stream_search_delim(php_stream *stream,
size_t maxlen,
size_t skiplen,
const char *delim, /* non-empty! */
- size_t delim_len TSRMLS_DC)
+ size_t delim_len)
{
size_t seek_len;
@@ -1026,7 +1026,7 @@ static const char *_php_stream_search_delim(php_stream *stream,
}
}
-PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len TSRMLS_DC)
+PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len)
{
zend_string *ret_buf; /* returned buffer */
const char *found_delim = NULL;
@@ -1040,7 +1040,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
if (has_delim) {
found_delim = _php_stream_search_delim(
- stream, maxlen, 0, delim, delim_len TSRMLS_CC);
+ stream, maxlen, 0, delim, delim_len);
}
buffered_len = STREAM_BUFFERED_AMOUNT(stream);
@@ -1051,7 +1051,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
to_read_now = MIN(maxlen - buffered_len, stream->chunk_size);
- php_stream_fill_read_buffer(stream, buffered_len + to_read_now TSRMLS_CC);
+ php_stream_fill_read_buffer(stream, buffered_len + to_read_now);
just_read = STREAM_BUFFERED_AMOUNT(stream) - buffered_len;
@@ -1073,7 +1073,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
buffered_len >= (delim_len - 1)
? buffered_len - (delim_len - 1)
: 0,
- delim, delim_len TSRMLS_CC);
+ delim, delim_len);
if (found_delim) {
break;
}
@@ -1115,7 +1115,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
}
/* Writes a buffer directly to a stream, using multiple of the chunk size */
-static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count)
{
size_t didwrite = 0, towrite, justwrote;
@@ -1125,7 +1125,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size
if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stream->writepos) {
stream->readpos = stream->writepos = 0;
- stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC);
+ stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position);
}
@@ -1134,7 +1134,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size
if (towrite > stream->chunk_size)
towrite = stream->chunk_size;
- justwrote = stream->ops->write(stream, buf, towrite TSRMLS_CC);
+ justwrote = stream->ops->write(stream, buf, towrite);
/* convert justwrote to an integer, since normally it is unsigned */
if ((int)justwrote > 0) {
@@ -1160,7 +1160,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size
* This may trigger a real write to the stream.
* Returns the number of bytes consumed from buf by the first filter in the chain.
* */
-static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags TSRMLS_DC)
+static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags)
{
size_t consumed = 0;
php_stream_bucket *bucket;
@@ -1170,15 +1170,15 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si
php_stream_filter *filter;
if (buf) {
- bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0 TSRMLS_CC);
- php_stream_bucket_append(&brig_in, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0);
+ php_stream_bucket_append(&brig_in, bucket);
}
for (filter = stream->writefilters.head; filter; filter = filter->next) {
/* for our return value, we are interested in the number of bytes consumed from
* the first filter in the chain */
status = filter->fops->filter(stream, filter, brig_inp, brig_outp,
- filter == stream->writefilters.head ? &consumed : NULL, flags TSRMLS_CC);
+ filter == stream->writefilters.head ? &consumed : NULL, flags);
if (status != PSFS_PASS_ON) {
break;
@@ -1198,14 +1198,14 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si
* underlying stream */
while (brig_inp->head) {
bucket = brig_inp->head;
- _php_stream_write_buffer(stream, bucket->buf, bucket->buflen TSRMLS_CC);
+ _php_stream_write_buffer(stream, bucket->buf, bucket->buflen);
/* Potential error situation - eg: no space on device. Perhaps we should keep this brigade
* hanging around and try to write it later.
* At the moment, we just drop it on the floor
* */
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
break;
case PSFS_FEED_ME:
@@ -1221,35 +1221,35 @@ static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, si
return consumed;
}
-PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC)
+PHPAPI int _php_stream_flush(php_stream *stream, int closing)
{
int ret = 0;
if (stream->writefilters.head) {
- _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC TSRMLS_CC);
+ _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC );
}
if (stream->ops->flush) {
- ret = stream->ops->flush(stream TSRMLS_CC);
+ ret = stream->ops->flush(stream);
}
return ret;
}
-PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count)
{
if (buf == NULL || count == 0 || stream->ops->write == NULL) {
return 0;
}
if (stream->writefilters.head) {
- return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL TSRMLS_CC);
+ return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL);
} else {
- return _php_stream_write_buffer(stream, buf, count TSRMLS_CC);
+ return _php_stream_write_buffer(stream, buf, count);
}
}
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...)
+PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...)
{
size_t count;
char *buf;
@@ -1269,12 +1269,12 @@ PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt,
return count;
}
-PHPAPI zend_off_t _php_stream_tell(php_stream *stream TSRMLS_DC)
+PHPAPI zend_off_t _php_stream_tell(php_stream *stream)
{
return stream->position;
}
-PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TSRMLS_DC)
+PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence)
{
if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) {
/* flush to commit data written to the fopencookie FILE* */
@@ -1309,7 +1309,7 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS
int ret;
if (stream->writefilters.head) {
- _php_stream_flush(stream, 0 TSRMLS_CC);
+ _php_stream_flush(stream, 0);
}
switch(whence) {
@@ -1318,7 +1318,7 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS
whence = SEEK_SET;
break;
}
- ret = stream->ops->seek(stream, offset, whence, &stream->position TSRMLS_CC);
+ ret = stream->ops->seek(stream, offset, whence, &stream->position);
if (((stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) || ret == 0) {
if (ret == 0) {
@@ -1348,17 +1348,17 @@ PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence TS
return 0;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream does not support seeking");
+ php_error_docref(NULL, E_WARNING, "stream does not support seeking");
return -1;
}
-PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
int ret = PHP_STREAM_OPTION_RETURN_NOTIMPL;
if (stream->ops->set_option) {
- ret = stream->ops->set_option(stream, option, value, ptrparam TSRMLS_CC);
+ ret = stream->ops->set_option(stream, option, value, ptrparam);
}
if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) {
@@ -1387,12 +1387,12 @@ PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, voi
return ret;
}
-PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC)
+PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize)
{
return php_stream_set_option(stream, PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SET_SIZE, &newsize);
}
-PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC)
+PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC)
{
size_t bcount = 0;
char buf[8192];
@@ -1427,7 +1427,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC)
}
-PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC)
+PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int persistent STREAMS_DC)
{
size_t ret = 0;
char *ptr;
@@ -1503,7 +1503,7 @@ PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, int
}
/* Returns SUCCESS/FAILURE and sets *len to the number of bytes moved */
-PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC TSRMLS_DC)
+PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC)
{
char buf[CHUNK_SIZE];
size_t readchunk;
@@ -1610,10 +1610,10 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size
* Returns 1 when source len is 0.
* Deprecated in favor of php_stream_copy_to_stream_ex() */
ZEND_ATTRIBUTE_DEPRECATED
-PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC)
+PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC)
{
size_t len;
- int ret = _php_stream_copy_to_stream_ex(src, dest, maxlen, &len STREAMS_REL_CC TSRMLS_CC);
+ int ret = _php_stream_copy_to_stream_ex(src, dest, maxlen, &len STREAMS_REL_CC);
if (ret == SUCCESS && len == 0 && maxlen != 0) {
return 1;
}
@@ -1623,20 +1623,20 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size
/* {{{ wrapper init and registration */
-static void stream_resource_regular_dtor(zend_resource *rsrc TSRMLS_DC)
+static void stream_resource_regular_dtor(zend_resource *rsrc)
{
php_stream *stream = (php_stream*)rsrc->ptr;
/* set the return value for pclose */
FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR);
}
-static void stream_resource_persistent_dtor(zend_resource *rsrc TSRMLS_DC)
+static void stream_resource_persistent_dtor(zend_resource *rsrc)
{
php_stream *stream = (php_stream*)rsrc->ptr;
FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR);
}
-void php_shutdown_stream_hashes(TSRMLS_D)
+void php_shutdown_stream_hashes(void)
{
if (FG(stream_wrappers)) {
zend_hash_destroy(FG(stream_wrappers));
@@ -1657,7 +1657,7 @@ void php_shutdown_stream_hashes(TSRMLS_D)
}
}
-int php_init_stream_wrappers(int module_number TSRMLS_DC)
+int php_init_stream_wrappers(int module_number)
{
le_stream = zend_register_list_destructors_ex(stream_resource_regular_dtor, NULL, "stream", module_number);
le_pstream = zend_register_list_destructors_ex(NULL, stream_resource_persistent_dtor, "persistent stream", module_number);
@@ -1669,19 +1669,19 @@ int php_init_stream_wrappers(int module_number TSRMLS_DC)
zend_hash_init(php_get_stream_filters_hash_global(), 8, NULL, NULL, 1);
zend_hash_init(php_stream_xport_get_hash(), 8, NULL, NULL, 1);
- return (php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
+ return (php_stream_xport_register("tcp", php_stream_generic_socket_factory) == SUCCESS
&&
- php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
+ php_stream_xport_register("udp", php_stream_generic_socket_factory) == SUCCESS
#if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE))
&&
- php_stream_xport_register("unix", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
+ php_stream_xport_register("unix", php_stream_generic_socket_factory) == SUCCESS
&&
- php_stream_xport_register("udg", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
+ php_stream_xport_register("udg", php_stream_generic_socket_factory) == SUCCESS
#endif
) ? SUCCESS : FAILURE;
}
-int php_shutdown_stream_wrappers(int module_number TSRMLS_DC)
+int php_shutdown_stream_wrappers(int module_number)
{
zend_hash_destroy(&url_stream_wrappers_hash);
zend_hash_destroy(php_get_stream_filters_hash_global());
@@ -1709,7 +1709,7 @@ static inline int php_stream_wrapper_scheme_validate(const char *protocol, unsig
}
/* API for registering GLOBAL wrappers */
-PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC)
+PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper)
{
unsigned int protocol_len = (unsigned int)strlen(protocol);
@@ -1720,12 +1720,12 @@ PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrap
return zend_hash_str_add_ptr(&url_stream_wrappers_hash, protocol, protocol_len, wrapper) ? SUCCESS : FAILURE;
}
-PHPAPI int php_unregister_url_stream_wrapper(const char *protocol TSRMLS_DC)
+PHPAPI int php_unregister_url_stream_wrapper(const char *protocol)
{
return zend_hash_str_del(&url_stream_wrappers_hash, protocol, strlen(protocol));
}
-static void clone_wrapper_hash(TSRMLS_D)
+static void clone_wrapper_hash(void)
{
ALLOC_HASHTABLE(FG(stream_wrappers));
zend_hash_init(FG(stream_wrappers), zend_hash_num_elements(&url_stream_wrappers_hash), NULL, NULL, 1);
@@ -1733,7 +1733,7 @@ static void clone_wrapper_hash(TSRMLS_D)
}
/* API for registering VOLATILE wrappers */
-PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC)
+PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper)
{
unsigned int protocol_len = (unsigned int)strlen(protocol);
@@ -1742,16 +1742,16 @@ PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_st
}
if (!FG(stream_wrappers)) {
- clone_wrapper_hash(TSRMLS_C);
+ clone_wrapper_hash();
}
return zend_hash_str_add_ptr(FG(stream_wrappers), protocol, protocol_len, wrapper) ? SUCCESS : FAILURE;
}
-PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC)
+PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol)
{
if (!FG(stream_wrappers)) {
- clone_wrapper_hash(TSRMLS_C);
+ clone_wrapper_hash();
}
return zend_hash_str_del(FG(stream_wrappers), protocol, strlen(protocol));
@@ -1759,7 +1759,7 @@ PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRML
/* }}} */
/* {{{ php_stream_locate_url_wrapper */
-PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC)
+PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options)
{
HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash);
php_stream_wrapper *wrapper = NULL;
@@ -1784,7 +1784,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
/* BC with older php scripts and zlib wrapper */
protocol = "compress.zlib";
n = 13;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead");
+ php_error_docref(NULL, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead");
}
if (protocol) {
@@ -1799,7 +1799,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
}
PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name);
+ php_error_docref(NULL, E_WARNING, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name);
wrapper = NULL;
protocol = NULL;
@@ -1825,7 +1825,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
if (localhost == 0 && path[n+3] != '\0' && path[n+3] != '/') {
#endif
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path);
+ php_error_docref(NULL, E_WARNING, "remote host file access not supported, %s", path);
}
return NULL;
}
@@ -1862,7 +1862,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
}
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "file:// wrapper is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "file:// wrapper is disabled in the server configuration");
}
return NULL;
}
@@ -1879,9 +1879,9 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
/* protocol[n] probably isn't '\0' */
char *protocol_dup = estrndup(protocol, n);
if (!PG(allow_url_fopen)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", protocol_dup);
+ php_error_docref(NULL, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", protocol_dup);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_include=0", protocol_dup);
+ php_error_docref(NULL, E_WARNING, "%s:// wrapper is disabled in the server configuration by allow_url_include=0", protocol_dup);
}
efree(protocol_dup);
}
@@ -1894,36 +1894,36 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
/* {{{ _php_stream_mkdir
*/
-PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC)
+PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context)
{
php_stream_wrapper *wrapper = NULL;
- wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(path, NULL, 0);
if (!wrapper || !wrapper->wops || !wrapper->wops->stream_mkdir) {
return 0;
}
- return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context TSRMLS_CC);
+ return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context);
}
/* }}} */
/* {{{ _php_stream_rmdir
*/
-PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC)
+PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context)
{
php_stream_wrapper *wrapper = NULL;
- wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(path, NULL, 0);
if (!wrapper || !wrapper->wops || !wrapper->wops->stream_rmdir) {
return 0;
}
- return wrapper->wops->stream_rmdir(wrapper, path, options, context TSRMLS_CC);
+ return wrapper->wops->stream_rmdir(wrapper, path, options, context);
}
/* }}} */
/* {{{ _php_stream_stat_path */
-PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context)
{
php_stream_wrapper *wrapper = NULL;
const char *path_to_open = path;
@@ -1944,9 +1944,9 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf
}
}
- wrapper = php_stream_locate_url_wrapper(path, &path_to_open, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(path, &path_to_open, 0);
if (wrapper && wrapper->wops->url_stat) {
- ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC);
+ ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context);
if (ret == 0) {
if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) {
/* Drop into cache */
@@ -1973,7 +1973,7 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf
/* {{{ php_stream_opendir */
PHPAPI php_stream *_php_stream_opendir(const char *path, int options,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_stream_wrapper *wrapper = NULL;
@@ -1985,31 +1985,31 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options,
path_to_open = path;
- wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options);
if (wrapper && wrapper->wops->dir_opener) {
stream = wrapper->wops->dir_opener(wrapper,
path_to_open, "r", options ^ REPORT_ERRORS, NULL,
- context STREAMS_REL_CC TSRMLS_CC);
+ context STREAMS_REL_CC);
if (stream) {
stream->wrapper = wrapper;
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR;
}
} else if (wrapper) {
- php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, "not implemented");
+ php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "not implemented");
}
if (stream == NULL && (options & REPORT_ERRORS)) {
- php_stream_display_wrapper_errors(wrapper, path, "failed to open dir" TSRMLS_CC);
+ php_stream_display_wrapper_errors(wrapper, path, "failed to open dir");
}
- php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC);
+ php_stream_tidy_wrapper_error_log(wrapper);
return stream;
}
/* }}} */
/* {{{ _php_stream_readdir */
-PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC)
+PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent)
{
if (sizeof(php_stream_dirent) == php_stream_read(dirstream, (char*)ent, sizeof(php_stream_dirent))) {
@@ -2022,7 +2022,7 @@ PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_
/* {{{ php_stream_open_wrapper_ex */
PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ char **opened_path, php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_stream_wrapper *wrapper = NULL;
@@ -2036,12 +2036,12 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
}
if (!path || !*path) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Filename cannot be empty");
return NULL;
}
if (options & USE_PATH) {
- resolved_path = zend_resolve_path(path, (int)strlen(path) TSRMLS_CC);
+ resolved_path = zend_resolve_path(path, (int)strlen(path));
if (resolved_path) {
path = resolved_path;
/* we've found this file, don't re-check include_path or run realpath */
@@ -2052,9 +2052,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
path_to_open = path;
- wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options);
if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function may only be used against URLs");
+ php_error_docref(NULL, E_WARNING, "This function may only be used against URLs");
if (resolved_path) {
efree(resolved_path);
}
@@ -2063,18 +2063,18 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
if (wrapper) {
if (!wrapper->wops->stream_opener) {
- php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS,
"wrapper does not support stream open");
} else {
stream = wrapper->wops->stream_opener(wrapper,
path_to_open, mode, options ^ REPORT_ERRORS,
- opened_path, context STREAMS_REL_CC TSRMLS_CC);
+ opened_path, context STREAMS_REL_CC);
}
/* if the caller asked for a persistent stream but the wrapper did not
* return one, force an error here */
if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) {
- php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS,
"wrapper does not support persistent streams");
php_stream_close(stream);
stream = NULL;
@@ -2127,7 +2127,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
if (options & REPORT_ERRORS) {
char *tmp = estrdup(path);
php_strip_url_passwd(tmp);
- php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "could not make seekable - %s",
+ php_error_docref1(NULL, tmp, E_WARNING, "could not make seekable - %s",
tmp);
efree(tmp);
@@ -2140,19 +2140,19 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
zend_off_t newpos = 0;
/* if opened for append, we need to revise our idea of the initial file position */
- if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos TSRMLS_CC)) {
+ if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos)) {
stream->position = newpos;
}
}
if (stream == NULL && (options & REPORT_ERRORS)) {
- php_stream_display_wrapper_errors(wrapper, path, "failed to open stream" TSRMLS_CC);
+ php_stream_display_wrapper_errors(wrapper, path, "failed to open stream");
if (opened_path && *opened_path) {
efree(*opened_path);
*opened_path = NULL;
}
}
- php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC);
+ php_stream_tidy_wrapper_error_log(wrapper);
#if ZEND_DEBUG
if (stream == NULL && copy_of_path != NULL) {
pefree(copy_of_path, persistent);
@@ -2166,7 +2166,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
/* }}} */
/* {{{ context API */
-PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC)
+PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context)
{
php_stream_context *oldcontext = PHP_STREAM_CONTEXT(stream);
@@ -2184,10 +2184,10 @@ PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream
}
PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity,
- char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC)
+ char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr)
{
if (context && context->notifier)
- context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr TSRMLS_CC);
+ context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr);
}
PHPAPI void php_stream_context_free(php_stream_context *context)
@@ -2203,7 +2203,7 @@ PHPAPI void php_stream_context_free(php_stream_context *context)
efree(context);
}
-PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
+PHPAPI php_stream_context *php_stream_context_alloc(void)
{
php_stream_context *context;
@@ -2211,7 +2211,7 @@ PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
context->notifier = NULL;
array_init(&context->options);
- context->res = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context(TSRMLS_C));
+ context->res = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context());
return context;
}
@@ -2278,7 +2278,7 @@ PHPAPI int php_stream_dirent_alphasortr(const zend_string **a, const zend_string
/* {{{ php_stream_scandir
*/
PHPAPI int _php_stream_scandir(const char *dirname, zend_string **namelist[], int flags, php_stream_context *context,
- int (*compare) (const zend_string **a, const zend_string **b) TSRMLS_DC)
+ int (*compare) (const zend_string **a, const zend_string **b))
{
php_stream *stream;
php_stream_dirent sdp;
diff --git a/main/streams/transports.c b/main/streams/transports.c
index 8fd0b91d35..6c68f839be 100644
--- a/main/streams/transports.c
+++ b/main/streams/transports.c
@@ -29,23 +29,23 @@ PHPAPI HashTable *php_stream_xport_get_hash(void)
return &xport_hash;
}
-PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC)
+PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory)
{
return zend_hash_str_update_ptr(&xport_hash, protocol, strlen(protocol), factory) ? SUCCESS : FAILURE;
}
-PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC)
+PHPAPI int php_stream_xport_unregister(const char *protocol)
{
return zend_hash_str_del(&xport_hash, protocol, strlen(protocol));
}
#define ERR_REPORT(out_err, fmt, arg) \
if (out_err) { *out_err = strpprintf(0, fmt, arg); } \
- else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, arg); }
+ else { php_error_docref(NULL, E_WARNING, fmt, arg); }
#define ERR_RETURN(out_err, local_err, fmt) \
if (out_err) { *out_err = local_err; } \
- else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, local_err ? local_err->val : "Unspecified error"); \
+ else { php_error_docref(NULL, E_WARNING, fmt, local_err ? local_err->val : "Unspecified error"); \
if (local_err) { zend_string_release(local_err); local_err = NULL; } \
}
@@ -55,7 +55,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
php_stream_context *context,
zend_string **error_string,
int *error_code
- STREAMS_DC TSRMLS_DC)
+ STREAMS_DC)
{
php_stream *stream = NULL;
php_stream_transport_factory factory = NULL;
@@ -72,7 +72,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
/* check for a cached persistent socket */
if (persistent_id) {
- switch(php_stream_from_persistent_id(persistent_id, &stream TSRMLS_CC)) {
+ switch(php_stream_from_persistent_id(persistent_id, &stream)) {
case PHP_STREAM_PERSISTENT_SUCCESS:
/* use a 0 second timeout when checking if the socket
* has already died */
@@ -125,16 +125,16 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
if (factory == NULL) {
/* should never happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find a factory !?");
+ php_error_docref(NULL, E_WARNING, "Could not find a factory !?");
return NULL;
}
stream = (factory)(protocol, n,
(char*)name, namelen, persistent_id, options, flags, timeout,
- context STREAMS_REL_CC TSRMLS_CC);
+ context STREAMS_REL_CC);
if (stream) {
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
if ((flags & STREAM_XPORT_SERVER) == 0) {
/* client */
@@ -142,7 +142,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
if (flags & (STREAM_XPORT_CONNECT|STREAM_XPORT_CONNECT_ASYNC)) {
if (-1 == php_stream_xport_connect(stream, name, namelen,
flags & STREAM_XPORT_CONNECT_ASYNC ? 1 : 0,
- timeout, &error_text, error_code TSRMLS_CC)) {
+ timeout, &error_text, error_code)) {
ERR_RETURN(error_string, error_text, "connect() failed: %s");
@@ -153,7 +153,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
} else {
/* server */
if (flags & STREAM_XPORT_BIND) {
- if (0 != php_stream_xport_bind(stream, name, namelen, &error_text TSRMLS_CC)) {
+ if (0 != php_stream_xport_bind(stream, name, namelen, &error_text)) {
ERR_RETURN(error_string, error_text, "bind() failed: %s");
failed = 1;
} else if (flags & STREAM_XPORT_LISTEN) {
@@ -170,7 +170,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
}
}
- if (0 != php_stream_xport_listen(stream, backlog, &error_text TSRMLS_CC)) {
+ if (0 != php_stream_xport_listen(stream, backlog, &error_text)) {
ERR_RETURN(error_string, error_text, "listen() failed: %s");
failed = 1;
}
@@ -196,7 +196,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
PHPAPI int php_stream_xport_bind(php_stream *stream,
const char *name, size_t namelen,
zend_string **error_text
- TSRMLS_DC)
+ )
{
php_stream_xport_param param;
int ret;
@@ -227,7 +227,7 @@ PHPAPI int php_stream_xport_connect(php_stream *stream,
struct timeval *timeout,
zend_string **error_text,
int *error_code
- TSRMLS_DC)
+ )
{
php_stream_xport_param param;
int ret;
@@ -257,7 +257,7 @@ PHPAPI int php_stream_xport_connect(php_stream *stream,
}
/* Prepare to listen */
-PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, zend_string **error_text TSRMLS_DC)
+PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, zend_string **error_text)
{
php_stream_xport_param param;
int ret;
@@ -286,7 +286,7 @@ PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client,
void **addr, socklen_t *addrlen,
struct timeval *timeout,
zend_string **error_text
- TSRMLS_DC)
+ )
{
php_stream_xport_param param;
int ret;
@@ -322,7 +322,7 @@ PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client,
PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer,
zend_string **textaddr,
void **addr, socklen_t *addrlen
- TSRMLS_DC)
+ )
{
php_stream_xport_param param;
int ret;
@@ -349,7 +349,7 @@ PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer,
return ret;
}
-PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC)
+PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream)
{
php_stream_xport_crypto_param param;
int ret;
@@ -365,12 +365,12 @@ PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_cr
return param.outputs.returncode;
}
- php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto");
+ php_error_docref("streams.crypto", E_WARNING, "this stream does not support SSL/crypto");
return ret;
}
-PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC)
+PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate)
{
php_stream_xport_crypto_param param;
int ret;
@@ -385,7 +385,7 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML
return param.outputs.returncode;
}
- php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto");
+ php_error_docref("streams.crypto", E_WARNING, "this stream does not support SSL/crypto");
return ret;
}
@@ -394,7 +394,7 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML
* peeking, optionally retrieving OOB data */
PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen,
int flags, void **addr, socklen_t *addrlen, zend_string **textaddr
- TSRMLS_DC)
+ )
{
php_stream_xport_param param;
int ret = 0;
@@ -407,7 +407,7 @@ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t bufle
}
if (stream->readfilters.head) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot peek or fetch OOB data from a filtered stream");
+ php_error_docref(NULL, E_WARNING, "cannot peek or fetch OOB data from a filtered stream");
return -1;
}
@@ -462,7 +462,7 @@ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t bufle
/* Similar to send() system call; send data to the stream, optionally
* sending it as OOB data */
PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen,
- int flags, void *addr, socklen_t addrlen TSRMLS_DC)
+ int flags, void *addr, socklen_t addrlen)
{
php_stream_xport_param param;
int ret = 0;
@@ -477,7 +477,7 @@ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t b
oob = (flags & STREAM_OOB) == STREAM_OOB;
if ((oob || addr) && stream->writefilters.head) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream");
+ php_error_docref(NULL, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream");
return -1;
}
@@ -501,7 +501,7 @@ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t b
/* Similar to shutdown() system call; shut down part of a full-duplex
* connection */
-PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC)
+PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how)
{
php_stream_xport_param param;
int ret = 0;
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index 1ff80cdfa6..c3f167636e 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -45,15 +45,15 @@ struct php_user_stream_wrapper {
php_stream_wrapper wrapper;
};
-static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
-static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
-static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC);
-static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC);
-static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
-static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC);
+static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context);
+static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
+static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context);
+static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context);
+static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
+static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context);
static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+ int options, char **opened_path, php_stream_context *context STREAMS_DC);
static php_stream_wrapper_ops user_stream_wops = {
user_wrapper_opener,
@@ -70,7 +70,7 @@ static php_stream_wrapper_ops user_stream_wops = {
};
-static void stream_wrapper_dtor(zend_resource *rsrc TSRMLS_DC)
+static void stream_wrapper_dtor(zend_resource *rsrc)
{
struct php_user_stream_wrapper * uwrap = (struct php_user_stream_wrapper*)rsrc->ptr;
@@ -281,7 +281,7 @@ typedef struct _php_userstream_data php_userstream_data_t;
}}} **/
-static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context, zval *object TSRMLS_DC)
+static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context, zval *object)
{
/* create an instance of our class */
object_init_ex(object, uwrap->ce);
@@ -314,8 +314,8 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php
fcc.called_scope = Z_OBJCE_P(object);
fcc.object = Z_OBJ_P(object);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name->val, uwrap->ce->constructor->common.function_name->val);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name->val, uwrap->ce->constructor->common.function_name->val);
zval_dtor(object);
ZVAL_UNDEF(object);
} else {
@@ -325,7 +325,7 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php
}
static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
php_userstream_data_t *us;
@@ -337,7 +337,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
/* Try to catch bad usage without preventing flexibility */
if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented");
+ php_stream_wrapper_log_error(wrapper, options, "infinite recursion prevented");
return NULL;
}
FG(user_stream_current_filename) = filename;
@@ -356,7 +356,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
us = emalloc(sizeof(*us));
us->wrapper = uwrap;
- user_stream_create_object(uwrap, context, &us->object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &us->object);
if (Z_TYPE(us->object) == IS_UNDEF) {
FG(user_stream_current_filename) = NULL;
PG(in_user_include) = old_in_user_include;
@@ -377,7 +377,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
&zfuncname,
&zretval,
4, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && Z_TYPE(zretval) != IS_UNDEF && zval_is_true(&zretval)) {
/* the stream is now open! */
@@ -391,7 +391,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
/* set wrapper data to be a reference to our object */
ZVAL_COPY(&stream->wrapperdata, &us->object);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_OPEN "\" call failed",
+ php_stream_wrapper_log_error(wrapper, options, "\"%s::" USERSTREAM_OPEN "\" call failed",
us->wrapper->classname);
}
@@ -415,7 +415,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
}
static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
php_userstream_data_t *us;
@@ -426,7 +426,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
/* Try to catch bad usage without preventing flexibility */
if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented");
+ php_stream_wrapper_log_error(wrapper, options, "infinite recursion prevented");
return NULL;
}
FG(user_stream_current_filename) = filename;
@@ -434,7 +434,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
us = emalloc(sizeof(*us));
us->wrapper = uwrap;
- user_stream_create_object(uwrap, context, &us->object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &us->object);
if (Z_TYPE(us->object) == IS_UNDEF) {
FG(user_stream_current_filename) = NULL;
efree(us);
@@ -452,7 +452,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
&zfuncname,
&zretval,
2, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && Z_TYPE(zretval) != IS_UNDEF && zval_is_true(&zretval)) {
/* the stream is now open! */
@@ -461,7 +461,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char
/* set wrapper data to be a reference to our object */
ZVAL_COPY(&stream->wrapperdata, &us->object);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed",
+ php_stream_wrapper_log_error(wrapper, options, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed",
us->wrapper->classname);
}
@@ -492,7 +492,7 @@ PHP_FUNCTION(stream_wrapper_register)
zend_resource *rsrc;
zend_long flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &protocol, &classname, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &protocol, &classname, &flags) == FAILURE) {
RETURN_FALSE;
}
@@ -505,20 +505,20 @@ PHP_FUNCTION(stream_wrapper_register)
rsrc = ZEND_REGISTER_RESOURCE(NULL, uwrap, le_protocols);
- if ((uwrap->ce = zend_lookup_class(classname TSRMLS_CC)) != NULL) {
- if (php_register_url_stream_wrapper_volatile(protocol->val, &uwrap->wrapper TSRMLS_CC) == SUCCESS) {
+ if ((uwrap->ce = zend_lookup_class(classname)) != NULL) {
+ if (php_register_url_stream_wrapper_volatile(protocol->val, &uwrap->wrapper) == SUCCESS) {
RETURN_TRUE;
} else {
/* We failed. But why? */
if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol %s:// is already defined.", protocol->val);
+ php_error_docref(NULL, E_WARNING, "Protocol %s:// is already defined.", protocol->val);
} else {
/* Hash doesn't exist so it must have been an invalid protocol scheme */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid protocol scheme specified. Unable to register wrapper class %s to %s://", classname->val, protocol->val);
+ php_error_docref(NULL, E_WARNING, "Invalid protocol scheme specified. Unable to register wrapper class %s to %s://", classname->val, protocol->val);
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "class '%s' is undefined", classname->val);
+ php_error_docref(NULL, E_WARNING, "class '%s' is undefined", classname->val);
}
zend_list_delete(rsrc);
@@ -533,13 +533,13 @@ PHP_FUNCTION(stream_wrapper_unregister)
char *protocol;
size_t protocol_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &protocol, &protocol_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC) == FAILURE) {
+ if (php_unregister_url_stream_wrapper_volatile(protocol) == FAILURE) {
/* We failed */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to unregister protocol %s://", protocol);
+ php_error_docref(NULL, E_WARNING, "Unable to unregister protocol %s://", protocol);
RETURN_FALSE;
}
@@ -555,26 +555,26 @@ PHP_FUNCTION(stream_wrapper_restore)
php_stream_wrapper *wrapper;
HashTable *global_wrapper_hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &protocol) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &protocol) == FAILURE) {
RETURN_FALSE;
}
global_wrapper_hash = php_stream_get_url_stream_wrappers_hash_global();
if (php_stream_get_url_stream_wrappers_hash() == global_wrapper_hash) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s:// was never changed, nothing to restore", protocol->val);
+ php_error_docref(NULL, E_NOTICE, "%s:// was never changed, nothing to restore", protocol->val);
RETURN_TRUE;
}
if ((wrapper = zend_hash_find_ptr(global_wrapper_hash, protocol)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// never existed, nothing to restore", protocol->val);
+ php_error_docref(NULL, E_WARNING, "%s:// never existed, nothing to restore", protocol->val);
RETURN_FALSE;
}
/* A failure here could be okay given that the protocol might have been merely unregistered */
- php_unregister_url_stream_wrapper_volatile(protocol->val TSRMLS_CC);
+ php_unregister_url_stream_wrapper_volatile(protocol->val);
- if (php_register_url_stream_wrapper_volatile(protocol->val, wrapper TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to restore original %s:// wrapper", protocol->val);
+ if (php_register_url_stream_wrapper_volatile(protocol->val, wrapper) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Unable to restore original %s:// wrapper", protocol->val);
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(stream_wrapper_restore)
}
/* }}} */
-static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count)
{
zval func_name;
zval retval;
@@ -602,7 +602,7 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t
&func_name,
&retval,
1, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&func_name);
@@ -611,13 +611,13 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t
convert_to_long(&retval);
didwrite = Z_LVAL(retval);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!",
us->wrapper->classname);
}
/* don't allow strange buffer overruns due to bogus return */
if (didwrite > count) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " written, " ZEND_LONG_FMT " max)",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_WRITE " wrote " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " written, " ZEND_LONG_FMT " max)",
us->wrapper->classname,
(zend_long)(didwrite - count), (zend_long)didwrite, (zend_long)count);
didwrite = count;
@@ -628,7 +628,7 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t
return didwrite;
}
-static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count)
{
zval func_name;
zval retval;
@@ -648,20 +648,20 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
&func_name,
&retval,
1, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
convert_to_string(&retval);
didread = Z_STRLEN(retval);
if (didread > count) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " read, " ZEND_LONG_FMT " max) - excess data will be lost",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_READ " - read " ZEND_LONG_FMT " bytes more data than requested (" ZEND_LONG_FMT " read, " ZEND_LONG_FMT " max) - excess data will be lost",
us->wrapper->classname, (zend_long)(didread - count), (zend_long)didread, (zend_long)count);
didread = count;
}
if (didread > 0)
memcpy(buf, Z_STRVAL(retval), didread);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!",
us->wrapper->classname);
}
zval_ptr_dtor(&args[0]);
@@ -678,12 +678,12 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval)) {
stream->eof = 1;
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s::" USERSTREAM_EOF " is not implemented! Assuming EOF",
us->wrapper->classname);
@@ -696,7 +696,7 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
return didread;
}
-static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_userstreamop_close(php_stream *stream, int close_handle)
{
zval func_name;
zval retval;
@@ -710,7 +710,7 @@ static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&func_name);
@@ -723,7 +723,7 @@ static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC
return 0;
}
-static int php_userstreamop_flush(php_stream *stream TSRMLS_DC)
+static int php_userstreamop_flush(php_stream *stream)
{
zval func_name;
zval retval;
@@ -738,7 +738,7 @@ static int php_userstreamop_flush(php_stream *stream TSRMLS_DC)
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval))
call_result = 0;
@@ -751,7 +751,7 @@ static int php_userstreamop_flush(php_stream *stream TSRMLS_DC)
return call_result;
}
-static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
zval func_name;
zval retval;
@@ -771,7 +771,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
&func_name,
&retval,
2, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&args[1]);
@@ -805,13 +805,13 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) == IS_LONG) {
*newoffs = Z_LVAL(retval);
ret = 0;
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname);
ret = -1;
} else {
ret = -1;
@@ -824,7 +824,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when
/* parse the return value from one of the stat functions and store the
* relevant fields into the statbuf provided */
-static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC)
+static int statbuf_from_array(zval *array, php_stream_statbuf *ssb)
{
zval *elem;
@@ -869,7 +869,7 @@ static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC)
return SUCCESS;
}
-static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb)
{
zval func_name;
zval retval;
@@ -883,14 +883,14 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) == IS_ARRAY) {
- if (SUCCESS == statbuf_from_array(&retval, ssb TSRMLS_CC))
+ if (SUCCESS == statbuf_from_array(&retval, ssb))
ret = 0;
} else {
if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!",
us->wrapper->classname);
}
}
@@ -902,7 +902,7 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR
}
-static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) {
+static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam) {
zval func_name;
zval retval;
int call_result;
@@ -913,12 +913,12 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
switch (option) {
case PHP_STREAM_OPTION_CHECK_LIVENESS:
ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1);
- call_result = call_user_function_ex(NULL, Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC);
+ call_result = call_user_function_ex(NULL, Z_ISUNDEF(us->object)? NULL : &us->object, &func_name, &retval, 0, NULL, 0, NULL);
if (call_result == SUCCESS && (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE)) {
ret = zval_is_true(&retval) ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
} else {
ret = PHP_STREAM_OPTION_RETURN_ERR;
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s::" USERSTREAM_EOF " is not implemented! Assuming EOF",
us->wrapper->classname);
}
@@ -951,7 +951,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 1, args, 0, NULL TSRMLS_CC);
+ 1, args, 0, NULL);
if (call_result == SUCCESS && (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE)) {
ret = (Z_TYPE(retval) == IS_FALSE);
@@ -960,7 +960,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
/* lock support test (TODO: more check) */
ret = PHP_STREAM_OPTION_RETURN_OK;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!",
us->wrapper->classname);
ret = PHP_STREAM_OPTION_RETURN_ERR;
}
@@ -978,7 +978,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
case PHP_STREAM_TRUNCATE_SUPPORTED:
if (zend_is_callable_ex(&func_name,
Z_ISUNDEF(us->object)? NULL : Z_OBJ(us->object),
- IS_CALLABLE_CHECK_SILENT, NULL, NULL, NULL TSRMLS_CC))
+ IS_CALLABLE_CHECK_SILENT, NULL, NULL, NULL))
ret = PHP_STREAM_OPTION_RETURN_OK;
else
ret = PHP_STREAM_OPTION_RETURN_ERR;
@@ -992,18 +992,18 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 1, args, 0, NULL TSRMLS_CC);
+ 1, args, 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE) {
ret = (Z_TYPE(retval) == IS_TRUE) ? PHP_STREAM_OPTION_RETURN_OK :
PHP_STREAM_OPTION_RETURN_ERR;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s::" USERSTREAM_TRUNCATE " did not return a boolean!",
us->wrapper->classname);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s::" USERSTREAM_TRUNCATE " is not implemented!",
us->wrapper->classname);
}
@@ -1056,13 +1056,13 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 3, args, 0, NULL TSRMLS_CC);
+ 3, args, 0, NULL);
if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!",
us->wrapper->classname);
ret = PHP_STREAM_OPTION_RETURN_ERR;
- } else if (Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval TSRMLS_CC)) {
+ } else if (Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval)) {
ret = PHP_STREAM_OPTION_RETURN_OK;
} else {
ret = PHP_STREAM_OPTION_RETURN_ERR;
@@ -1082,7 +1082,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
}
-static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1092,7 +1092,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
int ret = 0;
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
return ret;
}
@@ -1107,12 +1107,12 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
&zfuncname,
&zretval,
1, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) {
ret = (Z_TYPE(zretval) == IS_TRUE);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname);
}
/* clean up */
@@ -1126,7 +1126,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
}
static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to,
- int options, php_stream_context *context TSRMLS_DC)
+ int options, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1136,7 +1136,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
int ret = 0;
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
return ret;
}
@@ -1152,12 +1152,12 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
&zfuncname,
&zretval,
2, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) {
ret = (Z_TYPE(zretval) == IS_TRUE);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname);
}
/* clean up */
@@ -1172,7 +1172,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode,
- int options, php_stream_context *context TSRMLS_DC)
+ int options, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1182,7 +1182,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int
int ret = 0;
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
return ret;
}
@@ -1199,12 +1199,12 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int
&zfuncname,
&zretval,
3, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) {
ret = (Z_TYPE(zretval) == IS_TRUE);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname);
}
/* clean up */
@@ -1220,7 +1220,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int
}
static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url,
- int options, php_stream_context *context TSRMLS_DC)
+ int options, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1230,7 +1230,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url,
int ret = 0;
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
return ret;
}
@@ -1246,12 +1246,12 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url,
&zfuncname,
&zretval,
2, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) {
ret = (Z_TYPE(zretval) == IS_TRUE);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname);
}
/* clean up */
@@ -1266,7 +1266,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url,
}
static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option,
- void *value, php_stream_context *context TSRMLS_DC)
+ void *value, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1294,13 +1294,13 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i
ZVAL_STRING(&args[2], value);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option %d for " USERSTREAM_METADATA, option);
+ php_error_docref(NULL, E_WARNING, "Unknown option %d for " USERSTREAM_METADATA, option);
zval_ptr_dtor(&args[2]);
return ret;
}
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
zval_ptr_dtor(&args[2]);
return ret;
@@ -1317,12 +1317,12 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i
&zfuncname,
&zretval,
3, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE)) {
ret = Z_TYPE(zretval) == IS_TRUE;
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_METADATA " is not implemented!", uwrap->classname);
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_METADATA " is not implemented!", uwrap->classname);
}
/* clean up */
@@ -1339,7 +1339,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i
static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags,
- php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+ php_stream_statbuf *ssb, php_stream_context *context)
{
struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract;
zval zfuncname, zretval;
@@ -1349,7 +1349,7 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i
int ret = -1;
/* create an instance of our class */
- user_stream_create_object(uwrap, context, &object TSRMLS_CC);
+ user_stream_create_object(uwrap, context, &object);
if (Z_TYPE(object) == IS_UNDEF) {
return ret;
}
@@ -1365,15 +1365,15 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i
&zfuncname,
&zretval,
2, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL );
if (call_result == SUCCESS && Z_TYPE(zretval) == IS_ARRAY) {
/* We got the info we needed */
- if (SUCCESS == statbuf_from_array(&zretval, ssb TSRMLS_CC))
+ if (SUCCESS == statbuf_from_array(&zretval, ssb))
ret = 0;
} else {
if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!",
uwrap->classname);
}
}
@@ -1390,7 +1390,7 @@ static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, i
}
-static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count)
{
zval func_name;
zval retval;
@@ -1410,7 +1410,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou
&func_name,
&retval,
0, NULL,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_FALSE && Z_TYPE(retval) != IS_TRUE) {
convert_to_string(&retval);
@@ -1418,7 +1418,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou
didread = sizeof(php_stream_dirent);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!",
us->wrapper->classname);
}
@@ -1428,7 +1428,7 @@ static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t cou
return didread;
}
-static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_userstreamop_closedir(php_stream *stream, int close_handle)
{
zval func_name;
zval retval;
@@ -1442,7 +1442,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&func_name);
@@ -1454,7 +1454,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS
return 0;
}
-static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
zval func_name;
zval retval;
@@ -1466,7 +1466,7 @@ static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 0, NULL, 0, NULL TSRMLS_CC);
+ 0, NULL, 0, NULL);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&func_name);
@@ -1475,7 +1475,7 @@ static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int
}
-static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr TSRMLS_DC)
+static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr)
{
php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract;
zval func_name;
@@ -1500,25 +1500,25 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr T
Z_ISUNDEF(us->object)? NULL : &us->object,
&func_name,
&retval,
- 1, args, 0, NULL TSRMLS_CC);
+ 1, args, 0, NULL);
do {
if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " is not implemented!",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " is not implemented!",
us->wrapper->classname);
break;
}
- if (Z_ISUNDEF(retval) || !zend_is_true(&retval TSRMLS_CC)) {
+ if (Z_ISUNDEF(retval) || !zend_is_true(&retval)) {
break;
}
php_stream_from_zval_no_verify(intstream, &retval);
if (!intstream) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " must return a stream resource",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " must return a stream resource",
us->wrapper->classname);
break;
}
if (intstream == stream) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_CAST " must not return itself",
+ php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_CAST " must not return itself",
us->wrapper->classname);
intstream = NULL;
break;
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 7427a794b4..9fa2ae367e 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -55,10 +55,10 @@ php_stream_ops php_stream_unixdg_socket_ops;
#endif
-static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
+static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam);
/* {{{ Generic socket stream operations */
-static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
int didwrite;
@@ -102,7 +102,7 @@ retry:
} while (err == EINTR);
}
estr = php_socket_strerror(err, NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s",
+ php_error_docref(NULL, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s",
(zend_long)count, err, estr);
efree(estr);
}
@@ -118,7 +118,7 @@ retry:
return didwrite;
}
-static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC)
+static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock)
{
int retval;
struct timeval *ptimeout;
@@ -148,7 +148,7 @@ static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data
}
}
-static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_sockop_read(php_stream *stream, char *buf, size_t count)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
ssize_t nr_bytes = 0;
@@ -158,7 +158,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
}
if (sock->is_blocked) {
- php_sock_stream_wait_for_data(stream, sock TSRMLS_CC);
+ php_sock_stream_wait_for_data(stream, sock);
if (sock->timeout_event)
return 0;
}
@@ -179,7 +179,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
}
-static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_sockop_close(php_stream *stream, int close_handle)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
#ifdef PHP_WIN32
@@ -222,7 +222,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
return 0;
}
-static int php_sockop_flush(php_stream *stream TSRMLS_DC)
+static int php_sockop_flush(php_stream *stream)
{
#if 0
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -231,7 +231,7 @@ static int php_sockop_flush(php_stream *stream TSRMLS_DC)
return 0;
}
-static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb)
{
#if ZEND_WIN32
return 0;
@@ -244,7 +244,7 @@ static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC
static inline int sock_sendto(php_netstream_data_t *sock, const char *buf, size_t buflen, int flags,
struct sockaddr *addr, socklen_t addrlen
- TSRMLS_DC)
+ )
{
int ret;
if (addr) {
@@ -262,7 +262,7 @@ static inline int sock_sendto(php_netstream_data_t *sock, const char *buf, size_
static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t buflen, int flags,
zend_string **textaddr,
struct sockaddr **addr, socklen_t *addrlen
- TSRMLS_DC)
+ )
{
php_sockaddr_storage sa;
socklen_t sl = sizeof(sa);
@@ -273,7 +273,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu
ret = recvfrom(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags, (struct sockaddr*)&sa, &sl);
ret = (ret == SOCK_CONN_ERR) ? -1 : ret;
php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl,
- textaddr, addr, addrlen TSRMLS_CC);
+ textaddr, addr, addrlen);
} else {
ret = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags);
ret = (ret == SOCK_CONN_ERR) ? -1 : ret;
@@ -282,7 +282,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu
return ret;
}
-static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
int oldmode, flags;
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -323,7 +323,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
case PHP_STREAM_OPTION_BLOCKING:
oldmode = sock->is_blocked;
- if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) {
+ if (SUCCESS == php_set_sock_blocking(sock->socket, value)) {
sock->is_blocked = value;
return oldmode;
}
@@ -353,7 +353,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
xparam->want_textaddr ? &xparam->outputs.textaddr : NULL,
xparam->want_addr ? &xparam->outputs.addr : NULL,
xparam->want_addr ? &xparam->outputs.addrlen : NULL
- TSRMLS_CC);
+ );
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_GET_PEER_NAME:
@@ -361,7 +361,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
xparam->want_textaddr ? &xparam->outputs.textaddr : NULL,
xparam->want_addr ? &xparam->outputs.addr : NULL,
xparam->want_addr ? &xparam->outputs.addrlen : NULL
- TSRMLS_CC);
+ );
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_SEND:
@@ -373,10 +373,10 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
xparam->inputs.buf, xparam->inputs.buflen,
flags,
xparam->inputs.addr,
- xparam->inputs.addrlen TSRMLS_CC);
+ xparam->inputs.addrlen);
if (xparam->outputs.returncode == -1) {
char *err = php_socket_strerror(php_socket_errno(), NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s\n", err);
efree(err);
}
@@ -396,7 +396,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
xparam->want_textaddr ? &xparam->outputs.textaddr : NULL,
xparam->want_addr ? &xparam->outputs.addr : NULL,
xparam->want_addr ? &xparam->outputs.addrlen : NULL
- TSRMLS_CC);
+ );
return PHP_STREAM_OPTION_RETURN_OK;
@@ -427,7 +427,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
}
}
-static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_sockop_cast(php_stream *stream, int castas, void **ret)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -518,7 +518,7 @@ php_stream_ops php_stream_unixdg_socket_ops = {
/* network socket operations */
#ifdef AF_UNIX
-static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr TSRMLS_DC)
+static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr)
{
memset(unix_addr, 0, sizeof(*unix_addr));
unix_addr->sun_family = AF_UNIX;
@@ -532,7 +532,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
* BUT, to get into this branch of code, the name is too long,
* so we don't care. */
xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"socket path exceeded the maximum allowed length of %lu bytes "
"and was truncated", (unsigned long)sizeof(unix_addr->sun_path));
}
@@ -543,7 +543,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
}
#endif
-static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err TSRMLS_DC)
+static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err)
{
char *colon;
char *host = NULL;
@@ -582,13 +582,13 @@ static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *po
return host;
}
-static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC)
+static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno)
{
- return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC);
+ return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text);
}
static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam TSRMLS_DC)
+ php_stream_xport_param *xparam)
{
char *host = NULL;
int portno, err;
@@ -610,14 +610,14 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
return -1;
}
- parse_unix_address(xparam, &unix_addr TSRMLS_CC);
+ parse_unix_address(xparam, &unix_addr);
return bind(sock->socket, (const struct sockaddr *)&unix_addr,
(socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen);
}
#endif
- host = parse_ip_address(xparam, &portno TSRMLS_CC);
+ host = parse_ip_address(xparam, &portno);
if (host == NULL) {
return -1;
@@ -626,7 +626,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
#ifdef SO_REUSEPORT
if (PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_reuseport")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_REUSEPORT;
}
@@ -636,7 +636,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */
&& PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_BROADCAST;
}
@@ -647,7 +647,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
sockopts,
xparam->want_errortext ? &xparam->outputs.error_text : NULL,
&err
- TSRMLS_CC);
+ );
if (host) {
efree(host);
@@ -657,7 +657,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
}
static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam TSRMLS_DC)
+ php_stream_xport_param *xparam)
{
char *host = NULL, *bindto = NULL;
int portno, bindport = 0;
@@ -679,7 +679,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
return -1;
}
- parse_unix_address(xparam, &unix_addr TSRMLS_CC);
+ parse_unix_address(xparam, &unix_addr);
ret = php_network_connect_socket(sock->socket,
(const struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen,
@@ -693,7 +693,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
}
#endif
- host = parse_ip_address(xparam, &portno TSRMLS_CC);
+ host = parse_ip_address(xparam, &portno);
if (host == NULL) {
return -1;
@@ -707,14 +707,14 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
efree(host);
return -1;
}
- bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC);
+ bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text);
}
#ifdef SO_BROADCAST
if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */
&& PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_BROADCAST;
}
@@ -733,7 +733,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
bindto,
bindport,
sockopts
- TSRMLS_CC);
+ );
ret = sock->socket == -1 ? -1 : 0;
xparam->outputs.error_code = err;
@@ -758,7 +758,7 @@ out:
}
static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC)
+ php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
@@ -771,7 +771,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
xparam->inputs.timeout,
xparam->want_errortext ? &xparam->outputs.error_text : NULL,
&xparam->outputs.error_code
- TSRMLS_CC);
+ );
if (clisock >= 0) {
php_netstream_data_t *clisockdata;
@@ -798,7 +798,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
return xparam->outputs.client == NULL ? -1 : 0;
}
-static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
php_stream_xport_param *xparam;
@@ -810,23 +810,23 @@ static int php_tcp_sockop_set_option(php_stream *stream, int option, int value,
switch(xparam->op) {
case STREAM_XPORT_OP_CONNECT:
case STREAM_XPORT_OP_CONNECT_ASYNC:
- xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam);
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_BIND:
- xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam);
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_ACCEPT:
- xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC);
return PHP_STREAM_OPTION_RETURN_OK;
default:
/* fall through */
;
}
}
- return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC);
+ return php_sockop_set_option(stream, option, value, ptrparam);
}
@@ -834,7 +834,7 @@ PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t p
const char *resourcename, size_t resourcenamelen,
const char *persistent_id, int options, int flags,
struct timeval *timeout,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_netstream_data_t *sock;
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 2796dd23a5..9df215ecd6 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -86,7 +86,7 @@ static void php_ns_config(php_ns_context *ctx, char global);
*/
static int
-php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+php_ns_sapi_ub_write(const char *str, uint str_length)
{
int n;
uint sent = 0;
@@ -111,7 +111,7 @@ php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
*/
static int
-php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content;
char *p;
@@ -145,7 +145,7 @@ php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct
*/
static int
-php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
if(SG(sapi_headers).send_default_content_type) {
Ns_ConnSetRequiredHeaders(NSG(conn), "text/html", 0);
@@ -162,7 +162,7 @@ php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
*/
static int
-php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
+php_ns_sapi_read_post(char *buf, uint count_bytes)
{
uint max_read;
uint total_read = 0;
@@ -185,7 +185,7 @@ php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
* the HTTP request header
*/
-static char *php_ns_sapi_read_cookies(TSRMLS_D)
+static char *php_ns_sapi_read_cookies(void)
{
int i;
char *http_cookie = NULL;
@@ -295,13 +295,13 @@ php_ns_startup(sapi_module_struct *sapi_module)
*/
#define ADD_STRINGX(name, buf) \
- php_register_variable(name, buf, track_vars_array TSRMLS_CC)
+ php_register_variable(name, buf, track_vars_array)
#define ADD_STRING(name) \
ADD_STRINGX(name, buf)
static void
-php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
+php_ns_sapi_register_variables(zval *track_vars_array)
{
int i;
char buf[NS_BUF_SIZE + 1];
@@ -402,7 +402,7 @@ static sapi_module_struct aolserver_sapi_module = {
*/
static int
-php_ns_module_main(TSRMLS_D)
+php_ns_module_main(void)
{
zend_file_handle file_handle;
@@ -412,11 +412,11 @@ php_ns_module_main(TSRMLS_D)
file_handle.opened_path = NULL;
php_ns_config(global_context, 0);
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return NS_ERROR;
}
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
return NS_OK;
@@ -428,7 +428,7 @@ php_ns_module_main(TSRMLS_D)
*/
static void
-php_ns_request_ctor(TSRMLS_D)
+php_ns_request_ctor(void)
{
char *server;
Ns_DString ds;
@@ -477,7 +477,7 @@ php_ns_request_ctor(TSRMLS_D)
*/
static void
-php_ns_request_dtor(TSRMLS_D)
+php_ns_request_dtor(void)
{
free(SG(request_info).path_translated);
if (SG(request_info).query_string)
@@ -494,17 +494,16 @@ static int
php_ns_request_handler(void *context, Ns_Conn *conn)
{
int status = NS_OK;
- TSRMLS_FETCH();
NSG(conn) = conn;
SG(server_context) = global_context;
- php_ns_request_ctor(TSRMLS_C);
+ php_ns_request_ctor();
- status = php_ns_module_main(TSRMLS_C);
+ status = php_ns_module_main();
- php_ns_request_dtor(TSRMLS_C);
+ php_ns_request_dtor();
return status;
}
diff --git a/sapi/apache/mod_php7.c b/sapi/apache/mod_php7.c
index 687586952f..afd1d18472 100644
--- a/sapi/apache/mod_php7.c
+++ b/sapi/apache/mod_php7.c
@@ -30,13 +30,13 @@
/* {{{ Prototypes
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
+int apache_php_module_main(request_rec *r, int display_source_mode);
static void php_save_umask(void);
static void php_restore_umask(void);
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC);
-static char *sapi_apache_read_cookies(TSRMLS_D);
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC);
+static int sapi_apache_read_post(char *buffer, uint count_bytes);
+static char *sapi_apache_read_cookies(void);
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers);
static int send_php(request_rec *r, int display_source_mode, char *filename);
static int send_parsed_php(request_rec * r);
static int send_parsed_php_source(request_rec * r);
@@ -92,7 +92,7 @@ static void php_save_umask(void)
/* {{{ sapi_apache_ub_write
*/
-static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_apache_ub_write(const char *str, uint str_length)
{
int ret=0;
@@ -108,7 +108,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context TSRMLS_DC)
+static void sapi_apache_flush(void *server_context)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
@@ -122,7 +122,7 @@ static void sapi_apache_flush(void *server_context TSRMLS_DC)
/* {{{ sapi_apache_read_post
*/
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_apache_read_post(char *buffer, uint count_bytes)
{
int total_read_bytes=0, read_bytes;
request_rec *r = (request_rec *) SG(server_context);
@@ -155,7 +155,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/* {{{ sapi_apache_read_cookies
*/
-static char *sapi_apache_read_cookies(TSRMLS_D)
+static char *sapi_apache_read_cookies(void)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE");
}
@@ -163,7 +163,7 @@ static char *sapi_apache_read_cookies(TSRMLS_D)
/* {{{ sapi_apache_header_handler
*/
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
@@ -218,7 +218,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
/* {{{ sapi_apache_send_headers
*/
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers)
{
request_rec *r = SG(server_context);
const char *sline = SG(sapi_headers).http_status_line;
@@ -251,7 +251,7 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* {{{ sapi_apache_register_server_variables
*/
-static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_apache_register_server_variables(zval *track_vars_array)
{
register int i;
array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
@@ -270,8 +270,8 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
val = "";
}
val_len = strlen(val);
- if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len)) {
+ php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array);
}
}
@@ -284,11 +284,11 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
if (symbol_table
&& !zend_hash_str_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")-1)
&& (path_translated = zend_hash_str_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1)) != NULL) {
- php_register_variable("PATH_TRANSLATED", Z_STRVAL_P(path_translated), track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_TRANSLATED", Z_STRVAL_P(path_translated), track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len TSRMLS_CC)) {
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len)) {
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array);
}
}
/* }}} */
@@ -307,7 +307,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module)
/* {{{ php_apache_log_message
*/
-static void php_apache_log_message(char *message TSRMLS_DC)
+static void php_apache_log_message(char *message)
{
if (SG(server_context)) {
#if MODULE_MAGIC_NUMBER >= 19970831
@@ -325,9 +325,8 @@ static void php_apache_log_message(char *message TSRMLS_DC)
*/
static void php_apache_request_shutdown(void *dummy)
{
- TSRMLS_FETCH();
- php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
+ php_output_set_status(PHP_OUTPUT_DISABLED);
if (AP(in_request)) {
AP(in_request) = 0;
php_request_shutdown(dummy);
@@ -342,7 +341,7 @@ static void php_apache_request_shutdown(void *dummy)
/* {{{ php_apache_sapi_activate
*/
-static int php_apache_sapi_activate(TSRMLS_D)
+static int php_apache_sapi_activate(void)
{
request_rec *r = (request_rec *) SG(server_context);
@@ -369,7 +368,7 @@ static int php_apache_sapi_activate(TSRMLS_D)
/* {{{ php_apache_get_stat
*/
-static struct stat *php_apache_get_stat(TSRMLS_D)
+static struct stat *php_apache_get_stat(void)
{
return &((request_rec *) SG(server_context))->finfo;
}
@@ -377,7 +376,7 @@ static struct stat *php_apache_get_stat(TSRMLS_D)
/* {{{ php_apache_getenv
*/
-static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *php_apache_getenv(char *name, size_t name_len)
{
if (SG(server_context) == NULL) {
return NULL;
@@ -389,7 +388,7 @@ static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
/* {{{ sapi_apache_get_fd
*/
-static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
+static int sapi_apache_get_fd(int *nfd)
{
#if PHP_APACHE_HAVE_CLIENT_FD
request_rec *r = SG(server_context);
@@ -408,7 +407,7 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
/* {{{ sapi_apache_force_http_10
*/
-static int sapi_apache_force_http_10(TSRMLS_D)
+static int sapi_apache_force_http_10(void)
{
request_rec *r = SG(server_context);
@@ -420,7 +419,7 @@ static int sapi_apache_force_http_10(TSRMLS_D)
/* {{{ sapi_apache_get_target_uid
*/
-static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC)
+static int sapi_apache_get_target_uid(uid_t *obj)
{
*obj = ap_user_id;
return SUCCESS;
@@ -429,7 +428,7 @@ static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC)
/* {{{ sapi_apache_get_target_gid
*/
-static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC)
+static int sapi_apache_get_target_gid(gid_t *obj)
{
*obj = ap_group_id;
return SUCCESS;
@@ -438,7 +437,7 @@ static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC)
/* {{{ php_apache_get_request_time
*/
-static double php_apache_get_request_time(TSRMLS_D)
+static double php_apache_get_request_time(void)
{
return (double) ((request_rec *)SG(server_context))->request_time;
}
@@ -446,7 +445,7 @@ static double php_apache_get_request_time(TSRMLS_D)
/* {{{ sapi_apache_child_terminate
*/
-static void sapi_apache_child_terminate(TSRMLS_D)
+static void sapi_apache_child_terminate(void)
{
#ifndef MULTITHREAD
ap_child_terminate((request_rec *)SG(server_context));
@@ -517,7 +516,7 @@ static void php_restore_umask(void)
/* {{{ init_request_info
*/
-static void init_request_info(TSRMLS_D)
+static void init_request_info(void)
{
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
@@ -564,7 +563,7 @@ static void init_request_info(TSRMLS_D)
/* {{{ php_apache_alter_ini_entries
*/
-static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
+static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
{
zend_string *key = STR_INIT(per_dir_entry->key, per_dir_entry->key_length, 0);
zend_alter_ini_entry_chars(key, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, per_dir_entry->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE);
@@ -575,7 +574,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_
/* {{{ php_apache_get_default_mimetype
*/
-static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
+static char *php_apache_get_default_mimetype(request_rec *r)
{
char *mimetype;
@@ -583,7 +582,7 @@ static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
/* Assume output will be of the default MIME type. Individual
scripts may change this later. */
char *tmpmimetype;
- tmpmimetype = sapi_get_default_content_type(TSRMLS_C);
+ tmpmimetype = sapi_get_default_content_type();
mimetype = pstrdup(r->pool, tmpmimetype);
efree(tmpmimetype);
} else {
@@ -599,7 +598,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
{
int retval;
HashTable *per_dir_conf;
- TSRMLS_FETCH();
if (AP(in_request)) {
zend_file_handle fh;
@@ -609,7 +607,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
- zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
+ zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &fh);
return OK;
}
@@ -624,16 +622,16 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module);
if (per_dir_conf) {
- zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries);
}
/* If PHP parser engine has been turned off with an "engine off"
* directive, then decline to handle this request
*/
if (!AP(engine)) {
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -645,7 +643,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER > 19961007
if ((retval = setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -655,7 +653,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER < 19970912
if ((retval = set_last_modified(r, r->finfo.st_mtime))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -667,7 +665,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
}
/* Assume output will be of the default MIME type. Individual
scripts may change this later in the request. */
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
/* Init timeout */
hard_timeout("send", r);
@@ -676,8 +674,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
add_common_vars(r);
add_cgi_vars(r);
- init_request_info(TSRMLS_C);
- apache_php_module_main(r, display_source_mode TSRMLS_CC);
+ init_request_info();
+ apache_php_module_main(r, display_source_mode);
/* Done, restore umask, turn off timeout, close file and return */
php_restore_umask();
@@ -693,10 +691,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
static int send_parsed_php(request_rec * r)
{
int result = send_php(r, 0, NULL);
- TSRMLS_FETCH();
ap_table_setn(r->notes, "mod_php_memory_usage",
- ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC)));
+ ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1)));
return result;
}
@@ -904,18 +901,17 @@ static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf,
static int php_xbithack_handler(request_rec * r)
{
HashTable *per_dir_conf;
- TSRMLS_FETCH();
if (!(r->finfo.st_mode & S_IXUSR)) {
return DECLINED;
}
per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module);
if (per_dir_conf) {
- zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries);
}
if(!AP(xbithack)) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -973,8 +969,7 @@ static void php_init_handler(server_rec *s, pool *p)
}
#if MODULE_MAGIC_NUMBER >= 19980527
{
- TSRMLS_FETCH();
- if (PG(expose_php)) {
+ if (PG(expose_php)) {
ap_add_version_component("PHP/" PHP_VERSION);
}
}
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index f6e9e61203..b151495b66 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -120,7 +120,7 @@ PHP_INI_END()
-static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC)
+static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
{
apache_globals->in_request = 0;
}
@@ -131,7 +131,7 @@ static PHP_MINIT_FUNCTION(apache)
#ifdef ZTS
ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
#else
- php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
+ php_apache_globals_ctor(&php_apache_info);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
@@ -298,11 +298,11 @@ PHP_FUNCTION(apache_child_terminate)
ap_child_terminate( ((request_rec *)SG(server_context)) );
RETURN_TRUE;
} else { /* tell them to get lost! */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled");
+ php_error_docref(NULL, E_WARNING, "This function is disabled");
RETURN_FALSE;
}
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build");
+ php_error_docref(NULL, E_WARNING, "This function is not supported in this build");
RETURN_FALSE;
#endif
}
@@ -316,7 +316,7 @@ PHP_FUNCTION(apache_note)
int note_name_len, note_val_len;
char *old_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
return;
}
@@ -350,29 +350,29 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
if (!(rr = sub_req_lookup_uri (filename, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
if (rr)
destroy_sub_req (rr);
RETURN_FALSE;
}
if (rr->status != 200) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename);
if (rr)
destroy_sub_req (rr);
RETURN_FALSE;
}
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
if (run_sub_req(rr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename);
if (rr)
destroy_sub_req (rr);
RETURN_FALSE;
@@ -440,7 +440,7 @@ PHP_FUNCTION(apache_setenv)
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
return;
}
@@ -462,12 +462,12 @@ PHP_FUNCTION(apache_lookup_uri)
int filename_len;
request_rec *rr=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
if (!(rr = sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", filename);
+ php_error_docref(NULL, E_WARNING, "URI lookup failed '%s'", filename);
RETURN_FALSE;
}
@@ -540,12 +540,12 @@ PHP_FUNCTION(apache_exec_uri)
int filename_len;
request_rec *rr=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
if(!(rr = ap_sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", filename);
+ php_error_docref(NULL, E_WARNING, "URI lookup failed", filename);
RETURN_FALSE;
}
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index 466cf6b8ff..f0c54c59ad 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -25,12 +25,12 @@
/* {{{ apache_php_module_main
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
+int apache_php_module_main(request_rec *r, int display_source_mode)
{
int retval = OK;
zend_file_handle file_handle;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return FAILURE;
}
/* sending a file handle to another dll is not working
@@ -40,7 +40,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC) != SUCCESS) {
+ if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini) != SUCCESS) {
retval = NOT_FOUND;
}
} else {
@@ -50,7 +50,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
- (void) php_execute_script(&file_handle TSRMLS_CC);
+ (void) php_execute_script(&file_handle);
}
AP(in_request) = 0;
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index 7918cf6de8..5d9e795667 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -54,8 +54,8 @@ char *get_php_config(void *conf, char *name, size_t name_len);
void apply_config(void *);
extern const command_rec php_dir_cmds[];
-static size_t php_apache_read_stream(void *, char *, size_t TSRMLS_DC);
-static size_t php_apache_fsizer_stream(void * TSRMLS_DC);
+static size_t php_apache_read_stream(void *, char *, size_t);
+static size_t php_apache_fsizer_stream(void *);
#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \
{ \
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c
index ea137384f2..ad0f229003 100644
--- a/sapi/apache2filter/php_functions.c
+++ b/sapi/apache2filter/php_functions.c
@@ -43,7 +43,7 @@
#include "php_apache.h"
-static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC)
+static request_rec *php_apache_lookup_uri(char *filename)
{
php_struct *ctx;
@@ -63,18 +63,18 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
- if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ if (!(rr = php_apache_lookup_uri(filename))) {
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
RETURN_FALSE;
}
if (rr->status == HTTP_OK) {
if (ap_run_sub_req(rr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
@@ -82,7 +82,7 @@ PHP_FUNCTION(virtual)
RETURN_TRUE;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
@@ -101,12 +101,12 @@ PHP_FUNCTION(apache_lookup_uri)
char *filename;
int filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
- if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ if (!(rr = php_apache_lookup_uri(filename))) {
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
RETURN_FALSE;
}
@@ -143,7 +143,7 @@ PHP_FUNCTION(apache_lookup_uri)
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
@@ -197,7 +197,7 @@ PHP_FUNCTION(apache_note)
int note_name_len, note_val_len;
char *old_note_val=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
return;
}
@@ -228,7 +228,7 @@ PHP_FUNCTION(apache_setenv)
zend_bool walk_to_top = 0;
int arg_count = ZEND_NUM_ARGS();
- if (zend_parse_parameters(arg_count TSRMLS_CC, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) {
+ if (zend_parse_parameters(arg_count, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) {
return;
}
@@ -257,7 +257,7 @@ PHP_FUNCTION(apache_getenv)
int arg_count = ZEND_NUM_ARGS();
char *env_val=NULL;
- if (zend_parse_parameters(arg_count TSRMLS_CC, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) {
+ if (zend_parse_parameters(arg_count, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) {
return;
}
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 389686124d..315fafd550 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -64,7 +64,7 @@
char *apache2_php_ini_path_override = NULL;
static int
-php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+php_apache_sapi_ub_write(const char *str, uint str_length)
{
apr_bucket *b;
apr_bucket_brigade *bb;
@@ -91,7 +91,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
}
static int
-php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
php_struct *ctx;
char *val, *ptr;
@@ -141,7 +141,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
}
static int
-php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
php_struct *ctx = SG(server_context);
@@ -151,7 +151,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
static int
-php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
+php_apache_sapi_read_post(char *buf, uint count_bytes)
{
apr_size_t len;
php_struct *ctx = SG(server_context);
@@ -177,7 +177,7 @@ php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
return len;
}
static struct stat*
-php_apache_sapi_get_stat(TSRMLS_D)
+php_apache_sapi_get_stat(void)
{
php_struct *ctx = SG(server_context);
@@ -202,7 +202,7 @@ php_apache_sapi_get_stat(TSRMLS_D)
}
static char *
-php_apache_sapi_read_cookies(TSRMLS_D)
+php_apache_sapi_read_cookies(void)
{
php_struct *ctx = SG(server_context);
const char *http_cookie;
@@ -214,7 +214,7 @@ php_apache_sapi_read_cookies(TSRMLS_D)
}
static char *
-php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
+php_apache_sapi_getenv(char *name, size_t name_len)
{
php_struct *ctx = SG(server_context);
const char *env_var;
@@ -225,7 +225,7 @@ php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
}
static void
-php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
+php_apache_sapi_register_variables(zval *track_vars_array)
{
php_struct *ctx = SG(server_context);
const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env);
@@ -236,19 +236,19 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
if (!val) {
val = "";
}
- if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len)) {
+ php_register_variable_safe(key, val, new_val_len, track_vars_array);
}
APR_ARRAY_FOREACH_CLOSE()
- php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len)) {
+ php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array);
}
}
static void
-php_apache_sapi_flush(void *server_context TSRMLS_DC)
+php_apache_sapi_flush(void *server_context)
{
php_struct *ctx;
apr_bucket_brigade *bb;
@@ -263,7 +263,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC)
if (!server_context)
return;
- sapi_send_headers(TSRMLS_C);
+ sapi_send_headers();
ctx->r->status = SG(sapi_headers).http_response_code;
SG(headers_sent) = 1;
@@ -284,7 +284,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC)
}
}
-static void php_apache_sapi_log_message(char *msg TSRMLS_DC)
+static void php_apache_sapi_log_message(char *msg)
{
php_struct *ctx;
@@ -310,7 +310,7 @@ php_apache_disable_caching(ap_filter_t *f)
return OK;
}
-static double php_apache_sapi_get_request_time(TSRMLS_D)
+static double php_apache_sapi_get_request_time(void)
{
php_struct *ctx = SG(server_context);
return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0;
@@ -363,7 +363,6 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
{
php_struct *ctx;
apr_status_t rv;
- TSRMLS_FETCH();
if (f->r->proxyreq) {
return ap_get_brigade(f->next, bb, mode, block, readbytes);
@@ -392,7 +391,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
return APR_SUCCESS;
}
-static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
+static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx)
{
char *content_type;
char *content_length;
@@ -409,7 +408,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
SG(request_info).request_uri = safe_strdup(f->r->uri);
SG(request_info).path_translated = safe_strdup(f->r->filename);
f->r->no_local_copy = 1;
- content_type = sapi_get_default_content_type(TSRMLS_C);
+ content_type = sapi_get_default_content_type();
f->r->content_type = apr_pstrdup(f->r->pool, content_type);
efree(content_type);
@@ -423,7 +422,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
apr_table_unset(f->r->headers_out, "ETag");
auth = apr_table_get(f->r->headers_in, "Authorization");
- php_handle_auth_data(auth TSRMLS_CC);
+ php_handle_auth_data(auth);
if (SG(request_info).auth_user == NULL && f->r->user) {
SG(request_info).auth_user = estrdup(f->r->user);
@@ -431,10 +430,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
- php_request_startup(TSRMLS_C);
+ php_request_startup();
}
-static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC)
+static void php_apache_request_dtor(ap_filter_t *f)
{
php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)f->ctx;
@@ -461,11 +460,10 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
zend_file_handle zfd;
php_apr_bucket_brigade *pbb;
apr_bucket *b;
- TSRMLS_FETCH();
if (f->r->proxyreq) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return ap_pass_brigade(f->next, bb);
}
@@ -473,7 +471,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
/* handle situations where user turns the engine off */
if (*p == '0') {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return ap_pass_brigade(f->next, bb);
}
@@ -512,7 +510,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
"php failed to get server context");
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return HTTP_INTERNAL_SERVER_ERROR;
}
@@ -521,13 +519,13 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
if (ctx->request_processed) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return ap_pass_brigade(f->next, bb);
}
apply_config(conf);
- php_apache_request_ctor(f, ctx TSRMLS_CC);
+ php_apache_request_ctor(f, ctx);
/* It'd be nice if we could highlight based of a zend_file_handle here....
* ...but we can't. */
@@ -544,12 +542,12 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
zfd.opened_path = NULL;
zfd.free_filename = 0;
- php_execute_script(&zfd TSRMLS_CC);
+ php_execute_script(&zfd);
apr_table_set(ctx->r->notes, "mod_php_memory_usage",
- apr_psprintf(ctx->r->pool, "%lu", (unsigned long) zend_memory_peak_usage(1 TSRMLS_CC)));
+ apr_psprintf(ctx->r->pool, "%lu", (unsigned long) zend_memory_peak_usage(1)));
- php_apache_request_dtor(f TSRMLS_CC);
+ php_apache_request_dtor(f);
if (!f->r->main) {
ctx->request_processed = 1;
@@ -575,7 +573,6 @@ php_apache_server_shutdown(void *tmp)
static void php_apache_add_version(apr_pool_t *p)
{
- TSRMLS_FETCH();
if (PG(expose_php)) {
ap_add_version_component(p, "PHP/" PHP_VERSION);
}
@@ -679,7 +676,6 @@ static apr_status_t php_server_context_cleanup(void *data_)
static int php_post_read_request(request_rec *r)
{
php_struct *ctx;
- TSRMLS_FETCH();
/* Initialize filter context */
SG(server_context) = ctx = apr_pcalloc(r->pool, sizeof(*ctx));
@@ -708,7 +704,7 @@ static void php_register_hook(apr_pool_t *p)
ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE);
}
-static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSRMLS_DC)
+static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen)
{
php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle;
apr_bucket_brigade *rbb;
@@ -728,7 +724,7 @@ static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSR
return readlen;
}
-static size_t php_apache_fsizer_stream(void *handle TSRMLS_DC)
+static size_t php_apache_fsizer_stream(void *handle)
{
php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle;
apr_off_t actual = 0;
diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
index 59e17393dd..2e64b215e5 100644
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -56,7 +56,7 @@ if test "$PHP_APXS2" != "no"; then
esac
done
- APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"
+ APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
# Test that we're trying to configure with apache 2.x
PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32
index d15dcfaf03..8ea1305d4f 100644
--- a/sapi/apache2handler/config.w32
+++ b/sapi/apache2handler/config.w32
@@ -13,7 +13,7 @@ if (PHP_APACHE2HANDLER != "no") {
) {
SAPI('apache2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c',
'php' + PHP_VERSION + 'apache2.dll',
- '/D PHP_APACHE2_EXPORTS /I win32');
+ '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
} else {
WARNING("Could not find apache2 libraries/headers");
}
@@ -31,7 +31,7 @@ if (PHP_APACHE2_2HANDLER != "no") {
) {
SAPI('apache2_2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c',
'php' + PHP_VERSION + 'apache2_2.dll',
- '/D PHP_APACHE2_EXPORTS /I win32',
+ '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1',
'sapi\\apache2_2handler');
} else {
WARNING("Could not find apache2.2 libraries/headers");
@@ -49,7 +49,7 @@ if (PHP_APACHE2_4HANDLER != "no") {
) {
SAPI('apache2_4handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c',
'php' + PHP_VERSION + 'apache2_4.dll',
- '/D PHP_APACHE2_EXPORTS /I win32',
+ '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1',
'sapi\\apache2handler');
} else {
WARNING("Could not find apache 2.4 libraries/headers");
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index 22eabaafd4..8712b2b958 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -79,7 +79,8 @@ extern zend_module_entry apache2_module_entry;
#ifdef ZTS
extern int php_apache2_info_id;
-#define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v)
+#define AP2(v) ZEND_TSRMG(php_apache2_info_id, php_apache2_info_struct *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
extern php_apache2_info_struct php_apache2_info;
#define AP2(v) (php_apache2_info.v)
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 76bbad6194..2eb6a64c00 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -56,7 +56,7 @@ php_apache2_info_struct php_apache2_info;
#define SECTION(name) PUTS("<h2>" name "</h2>\n")
-static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC)
+static request_rec *php_apache_lookup_uri(char *filename)
{
php_struct *ctx = SG(server_context);
@@ -75,31 +75,31 @@ PHP_FUNCTION(virtual)
size_t filename_len;
request_rec *rr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
- if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ if (!(rr = php_apache_lookup_uri(filename))) {
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
RETURN_FALSE;
}
if (rr->status != HTTP_OK) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
/* Flush everything. */
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
/* Ensure that the ap_r* layer for the main request is flushed, to
* work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */
ap_rflush(rr->main);
if (ap_run_sub_req(rr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
@@ -121,12 +121,12 @@ PHP_FUNCTION(apache_lookup_uri)
char *filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
- if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ if (!(rr = php_apache_lookup_uri(filename))) {
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
RETURN_FALSE;
}
@@ -163,7 +163,7 @@ PHP_FUNCTION(apache_lookup_uri)
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename);
ap_destroy_sub_req(rr);
RETURN_FALSE;
}
@@ -225,7 +225,7 @@ PHP_FUNCTION(apache_note)
size_t note_name_len, note_val_len;
char *old_note_val=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
return;
}
@@ -259,7 +259,7 @@ PHP_FUNCTION(apache_setenv)
int arg_count = ZEND_NUM_ARGS();
request_rec *r;
- if (zend_parse_parameters(arg_count TSRMLS_CC, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) {
+ if (zend_parse_parameters(arg_count, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) {
return;
}
@@ -295,7 +295,7 @@ PHP_FUNCTION(apache_getenv)
char *env_val=NULL;
request_rec *r;
- if (zend_parse_parameters(arg_count TSRMLS_CC, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) {
+ if (zend_parse_parameters(arg_count, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) {
return;
}
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 3b7eaf2283..5336b115c0 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -71,9 +71,12 @@
/* A way to specify the location of the php.ini dir in an apache directive */
char *apache2_php_ini_path_override = NULL;
+#if defined(PHP_WIN32) && defined(ZTS)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
static size_t
-php_apache_sapi_ub_write(const char *str, size_t str_length TSRMLS_DC)
+php_apache_sapi_ub_write(const char *str, size_t str_length)
{
request_rec *r;
php_struct *ctx;
@@ -89,7 +92,7 @@ php_apache_sapi_ub_write(const char *str, size_t str_length TSRMLS_DC)
}
static int
-php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
php_struct *ctx;
char *val, *ptr;
@@ -151,7 +154,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
}
static int
-php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
php_struct *ctx = SG(server_context);
const char *sline = SG(sapi_headers).http_status_line;
@@ -171,7 +174,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* call ap_set_content_type only once, else each time we call it,
configured output filters for that content type will be added */
if (!ctx->content_type) {
- ctx->content_type = sapi_get_default_content_type(TSRMLS_C);
+ ctx->content_type = sapi_get_default_content_type();
}
ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type));
efree(ctx->content_type);
@@ -181,7 +184,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
static apr_size_t
-php_apache_sapi_read_post(char *buf, size_t count_bytes TSRMLS_DC)
+php_apache_sapi_read_post(char *buf, size_t count_bytes)
{
apr_size_t len, tlen=0;
php_struct *ctx = SG(server_context);
@@ -213,7 +216,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes TSRMLS_DC)
}
static zend_stat_t*
-php_apache_sapi_get_stat(TSRMLS_D)
+php_apache_sapi_get_stat(void)
{
php_struct *ctx = SG(server_context);
@@ -238,7 +241,7 @@ php_apache_sapi_get_stat(TSRMLS_D)
}
static char *
-php_apache_sapi_read_cookies(TSRMLS_D)
+php_apache_sapi_read_cookies(void)
{
php_struct *ctx = SG(server_context);
const char *http_cookie;
@@ -250,7 +253,7 @@ php_apache_sapi_read_cookies(TSRMLS_D)
}
static char *
-php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
+php_apache_sapi_getenv(char *name, size_t name_len)
{
php_struct *ctx = SG(server_context);
const char *env_var;
@@ -265,7 +268,7 @@ php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC)
}
static void
-php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
+php_apache_sapi_register_variables(zval *track_vars_array)
{
php_struct *ctx = SG(server_context);
const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env);
@@ -276,18 +279,18 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
if (!val) {
val = "";
}
- if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len)) {
+ php_register_variable_safe(key, val, new_val_len, track_vars_array);
}
APR_ARRAY_FOREACH_CLOSE()
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len)) {
+ php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array);
}
}
static void
-php_apache_sapi_flush(void *server_context TSRMLS_DC)
+php_apache_sapi_flush(void *server_context)
{
php_struct *ctx;
request_rec *r;
@@ -302,7 +305,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC)
r = ctx->r;
- sapi_send_headers(TSRMLS_C);
+ sapi_send_headers();
r->status = SG(sapi_headers).http_response_code;
SG(headers_sent) = 1;
@@ -312,7 +315,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC)
}
}
-static void php_apache_sapi_log_message(char *msg TSRMLS_DC)
+static void php_apache_sapi_log_message(char *msg)
{
php_struct *ctx;
@@ -325,16 +328,16 @@ static void php_apache_sapi_log_message(char *msg TSRMLS_DC)
}
}
-static void php_apache_sapi_log_message_ex(char *msg, request_rec *r TSRMLS_DC)
+static void php_apache_sapi_log_message_ex(char *msg, request_rec *r)
{
if (r) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename);
} else {
- php_apache_sapi_log_message(msg TSRMLS_CC);
+ php_apache_sapi_log_message(msg);
}
}
-static double php_apache_sapi_get_request_time(TSRMLS_D)
+static double php_apache_sapi_get_request_time(void)
{
php_struct *ctx = SG(server_context);
return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0;
@@ -403,7 +406,6 @@ static apr_status_t php_apache_child_shutdown(void *tmp)
static void php_apache_add_version(apr_pool_t *p)
{
- TSRMLS_FETCH();
if (PG(expose_php)) {
ap_add_version_component(p, "PHP/" PHP_VERSION);
}
@@ -451,6 +453,8 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
}
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
+ (void)ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
#endif
sapi_startup(&apache2_sapi_module);
apache2_sapi_module.startup(&apache2_sapi_module);
@@ -467,7 +471,7 @@ static apr_status_t php_server_context_cleanup(void *data_)
return APR_SUCCESS;
}
-static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
+static int php_apache_request_ctor(request_rec *r, php_struct *ctx)
{
char *content_length;
const char *auth;
@@ -494,7 +498,7 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
apr_table_unset(r->headers_out, "ETag");
auth = apr_table_get(r->headers_in, "Authorization");
- php_handle_auth_data(auth TSRMLS_CC);
+ php_handle_auth_data(auth);
if (SG(request_info).auth_user == NULL && r->user) {
SG(request_info).auth_user = estrdup(r->user);
@@ -502,18 +506,18 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
- return php_request_startup(TSRMLS_C);
+ return php_request_startup();
}
-static void php_apache_request_dtor(request_rec *r TSRMLS_DC)
+static void php_apache_request_dtor(request_rec *r)
{
php_request_shutdown(NULL);
}
-static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC)
+static void php_apache_ini_dtor(request_rec *r, request_rec *p)
{
if (strcmp(r->protocol, "INCLUDED")) {
- zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try();
+ zend_try { zend_ini_deactivate(); } zend_end_try();
} else {
typedef struct {
HashTable config;
@@ -540,9 +544,13 @@ static int php_handler(request_rec *r)
apr_bucket *bucket;
apr_status_t rv;
request_rec * volatile parent_req = NULL;
- TSRMLS_FETCH();
+#ifdef ZTS
+ /* initial resource fetch */
+ void ***tsrm_ls = ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
-#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
+#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req);
conf = ap_get_module_config(r->per_dir_config, &php7_module);
@@ -587,12 +595,12 @@ normal:
}
if (r->finfo.filetype == 0) {
- php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r TSRMLS_CC);
+ php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r);
PHPAP_INI_OFF;
return HTTP_NOT_FOUND;
}
if (r->finfo.filetype == APR_DIR) {
- php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r TSRMLS_CC);
+ php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r);
PHPAP_INI_OFF;
return HTTP_FORBIDDEN;
}
@@ -614,7 +622,7 @@ zend_first_try {
ctx = SG(server_context);
ctx->brigade = brigade;
- if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+ if (php_apache_request_ctor(r, ctx)!=SUCCESS) {
zend_bailout();
}
} else {
@@ -625,7 +633,7 @@ zend_first_try {
strcmp(parent_req->handler, PHP_MAGIC_TYPE) &&
strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) &&
strcmp(parent_req->handler, PHP_SCRIPT)) {
- if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+ if (php_apache_request_ctor(r, ctx)!=SUCCESS) {
zend_bailout();
}
}
@@ -653,7 +661,7 @@ zend_first_try {
if (strncmp(r->handler, PHP_SOURCE_MAGIC_TYPE, sizeof(PHP_SOURCE_MAGIC_TYPE) - 1) == 0) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file((char *)r->filename, &syntax_highlighter_ini);
} else {
zend_file_handle zfd;
@@ -663,19 +671,19 @@ zend_first_try {
zfd.opened_path = NULL;
if (!parent_req) {
- php_execute_script(&zfd TSRMLS_CC);
+ php_execute_script(&zfd);
} else {
- zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd);
+ zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &zfd);
}
apr_table_set(r->notes, "mod_php_memory_usage",
- apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1 TSRMLS_CC)));
+ apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1)));
}
} zend_end_try();
if (!parent_req) {
- php_apache_request_dtor(r TSRMLS_CC);
+ php_apache_request_dtor(r);
ctx->request_processed = 1;
bucket = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(brigade, bucket);
diff --git a/sapi/apache_hooks/mod_php7.c b/sapi/apache_hooks/mod_php7.c
index 33e0931fb6..cd1e733f32 100644
--- a/sapi/apache_hooks/mod_php7.c
+++ b/sapi/apache_hooks/mod_php7.c
@@ -29,13 +29,13 @@
/* {{{ Prototypes
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
+int apache_php_module_main(request_rec *r, int display_source_mode);
static void php_save_umask(void);
static void php_restore_umask(void);
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC);
-static char *sapi_apache_read_cookies(TSRMLS_D);
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC);
+static int sapi_apache_read_post(char *buffer, uint count_bytes);
+static char *sapi_apache_read_cookies(void);
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers);
static int send_php(request_rec *r, int display_source_mode, char *filename);
static int send_parsed_php(request_rec * r);
static int send_parsed_php_source(request_rec * r);
@@ -237,7 +237,7 @@ static void php_save_umask(void)
/* {{{ sapi_apache_ub_write
*/
-static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_apache_ub_write(const char *str, uint str_length)
{
int ret=0;
@@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context TSRMLS_DC)
+static void sapi_apache_flush(void *server_context)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
@@ -267,7 +267,7 @@ static void sapi_apache_flush(void *server_context TSRMLS_DC)
/* {{{ sapi_apache_read_post
*/
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_apache_read_post(char *buffer, uint count_bytes)
{
uint total_read_bytes=0, read_bytes;
request_rec *r = (request_rec *) SG(server_context);
@@ -300,7 +300,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/* {{{ sapi_apache_read_cookies
*/
-static char *sapi_apache_read_cookies(TSRMLS_D)
+static char *sapi_apache_read_cookies(void)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE");
}
@@ -308,7 +308,7 @@ static char *sapi_apache_read_cookies(TSRMLS_D)
/* {{{ sapi_apache_header_handler
*/
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
@@ -361,7 +361,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
/* {{{ sapi_apache_send_headers
*/
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers)
{
if(SG(server_context) == NULL) { /* server_context is not here anymore */
return SAPI_HEADER_SEND_FAILED;
@@ -381,7 +381,7 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* {{{ sapi_apache_register_server_variables
*/
-static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_apache_register_server_variables(zval *track_vars_array)
{
register int i;
array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
@@ -397,7 +397,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
} else {
val = "";
}
- php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
+ php_register_variable(elts[i].key, val, track_vars_array );
}
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
@@ -409,10 +409,10 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
if (symbol_table
&& !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"))
&& zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) {
- php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array);
}
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array);
}
/* }}} */
@@ -430,7 +430,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module)
/* {{{ php_apache_log_message
*/
-static void php_apache_log_message(char *message TSRMLS_DC)
+static void php_apache_log_message(char *message)
{
if (SG(server_context)) {
#if MODULE_MAGIC_NUMBER >= 19970831
@@ -449,9 +449,8 @@ static void php_apache_log_message(char *message TSRMLS_DC)
*/
static void php_apache_request_shutdown(void *dummy)
{
- TSRMLS_FETCH();
AP(current_hook) = AP_CLEANUP;
- php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
+ php_output_set_status(PHP_OUTPUT_DISABLED);
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
if(SG(sapi_started)) {
php_request_shutdown(dummy);
@@ -468,7 +467,7 @@ static void php_apache_request_shutdown(void *dummy)
/* {{{ php_apache_sapi_activate
*/
-static int php_apache_sapi_activate(TSRMLS_D)
+static int php_apache_sapi_activate(void)
{
request_rec *r = (request_rec *) SG(server_context);
@@ -495,7 +494,7 @@ static int php_apache_sapi_activate(TSRMLS_D)
/* {{{ php_apache_get_stat
*/
-static struct stat *php_apache_get_stat(TSRMLS_D)
+static struct stat *php_apache_get_stat(void)
{
return &((request_rec *) SG(server_context))->finfo;
}
@@ -503,7 +502,7 @@ static struct stat *php_apache_get_stat(TSRMLS_D)
/* {{{ php_apache_getenv
*/
-static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *php_apache_getenv(char *name, size_t name_len)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
@@ -569,7 +568,7 @@ static void php_restore_umask(void)
/* {{{ init_request_info
*/
-static void init_request_info(TSRMLS_D)
+static void init_request_info(void)
{
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
@@ -614,7 +613,7 @@ static void init_request_info(TSRMLS_D)
/* {{{ php_apache_alter_ini_entries
*/
-static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
+static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
{
zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE);
return 0;
@@ -623,7 +622,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_
/* {{{ php_apache_get_default_mimetype
*/
-static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
+static char *php_apache_get_default_mimetype(request_rec *r)
{
char *mimetype;
@@ -631,7 +630,7 @@ static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
/* Assume output will be of the default MIME type. Individual
scripts may change this later. */
char *tmpmimetype;
- tmpmimetype = sapi_get_default_content_type(TSRMLS_C);
+ tmpmimetype = sapi_get_default_content_type();
mimetype = pstrdup(r->pool, tmpmimetype);
efree(tmpmimetype);
} else {
@@ -647,7 +646,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
{
int retval;
php_per_dir_config *per_dir_conf;
- TSRMLS_FETCH();
if (AP(in_request)) {
zend_file_handle fh;
@@ -656,7 +654,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
- zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
+ zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &fh);
return OK;
}
@@ -669,17 +667,17 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (per_dir_conf) {
- zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
}
/* If PHP parser engine has been turned off with an "engine off"
* directive, then decline to handle this request
*/
if (!AP(engine)) {
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
r->allowed |= (1 << METHODS) - 1;
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -691,7 +689,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER > 19961007
if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -701,7 +699,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER < 19970912
if ((retval = set_last_modified(r, r->finfo.st_mtime))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -713,7 +711,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
}
/* Assume output will be of the default MIME type. Individual
scripts may change this later in the request. */
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
/* Init timeout */
hard_timeout("send", r);
@@ -726,8 +724,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
add_common_vars(r);
add_cgi_vars(r);
}
- init_request_info(TSRMLS_C);
- apache_php_module_main(r, display_source_mode TSRMLS_CC);
+ init_request_info();
+ apache_php_module_main(r, display_source_mode);
/* Done, restore umask, turn off timeout, close file and return */
php_restore_umask();
@@ -743,10 +741,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
static int send_parsed_php(request_rec * r)
{
int result = send_php(r, 0, NULL);
- TSRMLS_FETCH();
ap_table_setn(r->notes, "mod_php_memory_usage",
- ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC)));
+ ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1)));
return result;
}
@@ -1178,7 +1175,6 @@ static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf,
static int php_xbithack_handler(request_rec * r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
if (!(r->finfo.st_mode & S_IXUSR)) {
r->allowed |= (1 << METHODS) - 1;
@@ -1186,12 +1182,12 @@ static int php_xbithack_handler(request_rec * r)
}
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (conf) {
- zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
}
if(!AP(xbithack)) {
r->allowed |= (1 << METHODS) - 1;
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -1249,8 +1245,7 @@ static void php_init_handler(server_rec *s, pool *p)
}
#if MODULE_MAGIC_NUMBER >= 19980527
{
- TSRMLS_FETCH();
- if (PG(expose_php)) {
+ if (PG(expose_php)) {
ap_add_version_component("PHP/" PHP_VERSION);
}
}
@@ -1263,12 +1258,11 @@ static int php_run_hook(php_handler *handler, request_rec *r)
zval *ret = NULL;
php_per_dir_config *conf;
- TSRMLS_FETCH();
if(!AP(apache_config_loaded)) {
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (conf)
- zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
AP(apache_config_loaded) = 1;
}
if (!handler->name) {
@@ -1281,8 +1275,8 @@ static int php_run_hook(php_handler *handler, request_rec *r)
add_cgi_vars(r);
}
SG(server_context) = r;
- init_request_info(TSRMLS_C);
- apache_php_module_hook(r, handler, &ret TSRMLS_CC);
+ init_request_info();
+ apache_php_module_hook(r, handler, &ret);
php_restore_umask();
kill_timeout(r);
if (ret) {
@@ -1296,7 +1290,6 @@ static int php_run_hook(php_handler *handler, request_rec *r)
static int php_uri_translation(request_rec *r)
{
php_per_server_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_URI_TRANS;
conf = (php_per_server_config *) get_module_config(r->server->module_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers,
@@ -1307,7 +1300,6 @@ static int php_uri_translation(request_rec *r)
static int php_header_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_HEADER_PARSE;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers,
@@ -1318,7 +1310,6 @@ static int php_header_hook(request_rec *r)
static int php_auth_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_AUTHENTICATION;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers,
@@ -1330,7 +1321,6 @@ static int php_access_hook(request_rec *r)
{
php_per_dir_config *conf;
int status = DECLINED;
- TSRMLS_FETCH();
AP(current_hook) = AP_ACCESS_CONTROL;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers,
@@ -1343,7 +1333,6 @@ static int php_access_hook(request_rec *r)
static int php_type_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_TYPE_CHECKING;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers,
@@ -1355,7 +1344,6 @@ static int php_type_hook(request_rec *r)
static int php_fixup_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_FIXUP;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers,
@@ -1367,7 +1355,6 @@ static int php_fixup_hook(request_rec *r)
static int php_logger_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_LOGGING;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers,
@@ -1380,7 +1367,6 @@ static int php_post_read_hook(request_rec *r)
{
php_per_dir_config *conf;
php_per_server_config *svr;
- TSRMLS_FETCH();
AP(current_hook) = AP_POST_READ;
svr = get_module_config(r->server->module_config, &php7_module);
if(ap_is_initial_req(r)) {
@@ -1395,7 +1381,6 @@ static int php_post_read_hook(request_rec *r)
static int php_response_handler(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_RESPONSE;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r);
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index e5bd3f5d61..57b4505f10 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -105,7 +105,7 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC)
+static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
{
apache_globals->in_request = 0;
}
@@ -113,20 +113,20 @@ static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRML
#define APREQ_GET_THIS(ZVAL) if (NULL == (ZVAL = getThis())) { \
php_error(E_WARNING, "%s(): underlying ApacheRequest object missing", \
- get_active_function_name(TSRMLS_C)); \
+ get_active_function_name()); \
RETURN_FALSE; \
}
#define APREQ_GET_REQUEST(ZVAL, R) APREQ_GET_THIS(ZVAL); \
- R = get_apache_request(ZVAL TSRMLS_CC)
+ R = get_apache_request(ZVAL)
-static void php_apache_request_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_apache_request_free(zend_rsrc_list_entry *rsrc)
{
zval *z = (zval *)rsrc->ptr;
/* fprintf(stderr, "%s() %p\n", __FUNCTION__, z); */
zval_ptr_dtor(&z);
}
-static request_rec *get_apache_request(zval *z TSRMLS_DC)
+static request_rec *get_apache_request(zval *z)
{
request_rec *r;
zval **addr;
@@ -137,28 +137,28 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC)
}
if (Z_TYPE_P(z) != IS_OBJECT) {
- php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name());
return NULL;
}
if (zend_hash_index_find(Z_OBJPROP_P(z), 0, (void **)&addr) == FAILURE) {
- php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name());
return NULL;
}
r = (request_rec *)Z_LVAL_PP(addr);
if (!r) {
- php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name());
return NULL;
}
return r;
}
-/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC)
+/* {{{ php_apache_request_new(request_rec *r)
* create a new zval-instance for ApacheRequest that wraps request_rec
*/
-zval *php_apache_request_new(request_rec *r TSRMLS_DC)
+zval *php_apache_request_new(request_rec *r)
{
zval *req;
zval *addr;
@@ -210,7 +210,7 @@ static void apache_request_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS)
int new_value_len;
char **target;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &new_value, &new_value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &new_value, &new_value_len) == FAILURE) {
return;
}
@@ -260,7 +260,7 @@ static void apache_request_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS)
long old_value, new_value;
long *target;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &new_value) == FAILURE) {
return;
}
@@ -504,7 +504,7 @@ PHP_FUNCTION(apache_request_content_length)
long zlen;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &zlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &zlen) == FAILURE) {
return;
}
@@ -584,7 +584,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
zend_bool replace = 0;
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zb", &first, &second, &replace) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|zb", &first, &second, &replace) == FAILURE) {
RETURN_FALSE;
}
@@ -614,7 +614,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
break;
case HASH_KEY_IS_LONG:
default:
- php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name());
break;
}
@@ -715,7 +715,7 @@ PHP_FUNCTION(apache_request_remote_host)
request_rec *r;
char *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &type) == FAILURE) {
return;
}
@@ -743,7 +743,7 @@ PHP_FUNCTION(apache_request_update_mtime)
request_rec *r;
long mtime = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mtime) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mtime) == FAILURE) {
return;
}
@@ -931,7 +931,7 @@ PHP_FUNCTION(apache_request_basic_auth_pw)
const char *pw;
long status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zpw) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zpw) == FAILURE) {
return;
}
@@ -963,7 +963,7 @@ PHP_FUNCTION(apache_request_send_http_header)
char *type = NULL;
int typelen;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() , "|s", &type, &typelen) == FAILURE) {
return;
}
@@ -1034,7 +1034,7 @@ PHP_FUNCTION(apache_request_send_error_response)
request_rec *r;
long rec = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &rec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &rec) == FAILURE) {
return;
}
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(apache_request_set_content_length)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
@@ -1092,7 +1092,7 @@ PHP_FUNCTION(apache_request_rputs)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buffer, &buffer_len) == FAILURE) {
return;
}
@@ -1136,7 +1136,7 @@ PHP_FUNCTION(apache_request_log_error)
long facility = APLOG_ERR;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) {
return;
}
@@ -1158,7 +1158,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
int file_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
@@ -1168,7 +1168,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
int file_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
@@ -1194,7 +1194,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1209,7 +1209,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
int file_len, method_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &method, &method_len, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &method, &method_len, &file, &file_len) == FAILURE) {
return;
}
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1255,7 +1255,7 @@ PHP_FUNCTION(apache_request_internal_redirect)
int new_uri_len;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_uri, &new_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &new_uri, &new_uri_len) == FAILURE) {
return;
}
@@ -1271,7 +1271,7 @@ PHP_FUNCTION(apache_request_send_header_field)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) {
return;
}
@@ -1394,14 +1394,14 @@ static PHP_MINIT_FUNCTION(apache)
#ifdef ZTS
ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
#else
- php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
+ php_apache_globals_ctor(&php_apache_info);
#endif
REGISTER_INI_ENTRIES();
le_apachereq = zend_register_list_destructors_ex(php_apache_request_free, NULL, "ApacheRequest", module_number);
INIT_OVERLOADED_CLASS_ENTRY(ce, "ApacheRequest", php_apache_request_class_functions, NULL, NULL, NULL);
- apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL);
REGISTER_LONG_CONSTANT("OK", OK, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DECLINED", DECLINED, CONST_CS | CONST_PERSISTENT);
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(apache_note)
int arg_name_len, arg_val_len;
char *note_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) {
return;
}
@@ -1714,7 +1714,7 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
@@ -1732,8 +1732,8 @@ PHP_FUNCTION(virtual)
RETURN_FALSE;
}
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
if (run_sub_req(rr)) {
php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename);
@@ -1811,7 +1811,7 @@ PHP_FUNCTION(apache_setenv)
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
RETURN_FALSE;
}
@@ -1835,7 +1835,7 @@ PHP_FUNCTION(apache_lookup_uri)
int filename_len;
request_rec *rr=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h
index e6610741c7..f79bd91c50 100644
--- a/sapi/apache_hooks/php_apache_http.h
+++ b/sapi/apache_hooks/php_apache_http.h
@@ -41,4 +41,4 @@
zval *php_apache_request_new(request_rec *r);
-int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC);
+int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret);
diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c
index daaad4e39d..78e7c8cbd3 100644
--- a/sapi/apache_hooks/sapi_apache.c
+++ b/sapi/apache_hooks/sapi_apache.c
@@ -25,11 +25,11 @@
/* {{{ apache_php_module_main
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
+int apache_php_module_main(request_rec *r, int display_source_mode)
{
zend_file_handle file_handle;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return FAILURE;
}
/* sending a file handle to another dll is not working
@@ -39,7 +39,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){
+ if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini)){
return OK;
} else {
return NOT_FOUND;
@@ -50,7 +50,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
file_handle.filename = SG(request_info).path_translated;
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
- (void) php_execute_script(&file_handle TSRMLS_CC);
+ (void) php_execute_script(&file_handle);
}
AP(in_request) = 0;
@@ -60,7 +60,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
/* {{{ apache_php_module_hook
*/
-int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC)
+int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret)
{
zend_file_handle file_handle;
zval *req;
@@ -70,24 +70,24 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM
signal(SIGCHLD, sigchld_handler);
#endif
if(AP(current_hook) == AP_RESPONSE) {
- if (php_request_startup_for_hook(TSRMLS_C) == FAILURE)
+ if (php_request_startup_for_hook() == FAILURE)
return FAILURE;
}
else {
- if (php_request_startup_for_hook(TSRMLS_C) == FAILURE)
+ if (php_request_startup_for_hook() == FAILURE)
return FAILURE;
}
req = php_apache_request_new(r);
- php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER]);
switch(handler->type) {
case AP_HANDLER_TYPE_FILE:
- php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER]);
memset(&file_handle, 0, sizeof(file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = handler->name;
- (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC);
+ (void) php_execute_simple_script(&file_handle, ret);
break;
case AP_HANDLER_TYPE_METHOD:
if( (tmp = strstr(handler->name, "::")) != NULL && *(tmp+2) != '\0' ) {
@@ -99,7 +99,7 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM
ALLOC_ZVAL(method);
ZVAL_STRING(method, tmp +2, 1);
*tmp = ':';
- call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL TSRMLS_CC);
+ call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL);
zval_dtor(class);
zval_dtor(method);
}
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index b1ffddb460..850e761955 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -103,7 +103,7 @@ typedef struct
void pike_module_init(void);
void pike_module_exit(void);
-static void free_struct(TSRMLS_D);
+static void free_struct(void);
void f_php_caudium_request_handler(INT32 args);
/* Defines to get to the data supplied when the script is started. */
@@ -209,7 +209,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
*/
INLINE static int
-php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
+php_caudium_low_ub_write(const char *str, uint str_length) {
int sent_bytes = 0;
struct pike_string *to_write = NULL;
GET_THIS();
@@ -239,7 +239,7 @@ php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
*/
static int
-php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+php_caudium_sapi_ub_write(const char *str, uint str_length)
{
GET_THIS();
int sent_bytes = 0, fd = MY_FD;
@@ -269,7 +269,7 @@ php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
}
THIS->written += sent_bytes;
} else {
- THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC),
+ THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length),
"write");
}
return sent_bytes;
@@ -335,7 +335,7 @@ php_caudium_set_header(char *header_name, char *value, char *p)
*/
static int
php_caudium_sapi_header_handler(sapi_header_struct *sapi_header,
- sapi_headers_struct *sapi_headers TSRMLS_DC)
+ sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
header_name = sapi_header->header;
@@ -357,7 +357,7 @@ php_caudium_sapi_header_handler(sapi_header_struct *sapi_header,
*/
INLINE static int
-php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_caudium_low_send_headers(sapi_headers_struct *sapi_headers)
{
struct pike_string *ind;
struct svalue *s_headermap;
@@ -383,10 +383,10 @@ php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
static int
-php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
int res = 0;
- THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers TSRMLS_CC), "send headers");
+ THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers), "send headers");
return res;
}
@@ -395,7 +395,7 @@ php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
+INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes)
{
uint total_read = 0;
GET_THIS();
@@ -419,10 +419,10 @@ INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_D
}
static int
-php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
+php_caudium_sapi_read_post(char *buf, uint count_bytes)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
+ THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post");
return total_read;
}
@@ -432,7 +432,7 @@ php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
*/
static char *
-php_caudium_sapi_read_cookies(TSRMLS_D)
+php_caudium_sapi_read_cookies(void)
{
char *cookies;
cookies = lookup_string_header("HTTP_COOKIE", NULL);
@@ -477,7 +477,7 @@ static zend_module_entry php_caudium_module = {
};
-INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC)
+INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array)
{
int i;
struct keypair *k;
@@ -487,16 +487,16 @@ INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TS
struct svalue *val;
GET_THIS();
php_register_variable("PHP_SELF", SG(request_info).request_uri,
- track_vars_array TSRMLS_CC);
+ track_vars_array);
php_register_variable("GATEWAY_INTERFACE", "CGI/1.1",
- track_vars_array TSRMLS_CC);
+ track_vars_array);
php_register_variable("REQUEST_METHOD",
(char *) SG(request_info).request_method,
- track_vars_array TSRMLS_CC);
+ track_vars_array);
php_register_variable("REQUEST_URI", SG(request_info).request_uri,
- track_vars_array TSRMLS_CC);
+ track_vars_array);
php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated,
- track_vars_array TSRMLS_CC);
+ track_vars_array);
sind = make_shared_string("env");
headers = low_mapping_string_lookup(REQUEST_DATA, sind);
@@ -508,15 +508,15 @@ INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TS
if(ind && ind->type == PIKE_T_STRING &&
val && val->type == PIKE_T_STRING) {
php_register_variable(ind->u.string->str, val->u.string->str,
- track_vars_array TSRMLS_CC );
+ track_vars_array );
}
}
}
}
-static void sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_caudium_register_variables(zval *track_vars_array)
{
- THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array TSRMLS_CC), "register_variables");
+ THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array), "register_variables");
}
@@ -568,8 +568,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
struct thread_state *state;
extern struct program *thread_id_prog;
#endif
- TSRMLS_FETCH();
- GET_THIS();
+ GET_THIS();
THIS->filename = ureq->filename;
THIS->done_cb = ureq->done_cb;
THIS->my_fd_obj = ureq->my_fd_obj;
@@ -626,7 +625,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
}
/* Let PHP7 handle the deconding of the AUTH */
- php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), TSRMLS_C);
+ php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), );
/* Swap out this thread and release the interpreter lock to allow
* Pike threads to run. We wait since the above would otherwise require
* a lot of unlock/lock.
@@ -644,22 +643,22 @@ static void php_caudium_module_main(php_caudium_request *ureq)
file_handle.free_filename = 0;
THIS->written = 0;
- res = php_request_startup(TSRMLS_C);
+ res = php_request_startup();
if(res == FAILURE) {
THREAD_SAFE_RUN({
apply_svalue(&THIS->done_cb, 0);
pop_stack();
- free_struct(TSRMLS_C);
+ free_struct();
}, "Negative run response");
} else {
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
THREAD_SAFE_RUN({
push_int(THIS->written);
apply_svalue(&THIS->done_cb, 1);
pop_stack();
- free_struct(TSRMLS_C);
+ free_struct();
}, "positive run response");
}
@@ -737,7 +736,7 @@ void f_php_caudium_request_handler(INT32 args)
pop_n_elems(args);
}
-static void free_struct(TSRMLS_D)
+static void free_struct(void)
{
GET_THIS();
if(THIS->request_data) free_mapping(THIS->request_data);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 1bef17c257..283090d977 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -97,7 +97,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS;
struct sigaction act, old_term, old_quit, old_int;
#endif
-static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC);
+static void (*php_php_import_environment_variables)(zval *array_ptr);
#ifndef PHP_WIN32
/* these globals used for forking children on unix systems */
@@ -198,7 +198,10 @@ static void user_config_cache_entry_dtor(zval *el)
#ifdef ZTS
static int php_cgi_globals_id;
-#define CGIG(v) TSRMG(php_cgi_globals_id, php_cgi_globals_struct *, v)
+#define CGIG(v) ZEND_TSRMG(php_cgi_globals_id, php_cgi_globals_struct *, v)
+#if defined(PHP_WIN32)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
#else
static php_cgi_globals_struct php_cgi_globals;
#define CGIG(v) (php_cgi_globals.v)
@@ -217,14 +220,14 @@ static php_cgi_globals_struct php_cgi_globals;
#define TRANSLATE_SLASHES(path)
#endif
-static int print_module_info(zval *element TSRMLS_DC)
+static int print_module_info(zval *element)
{
zend_module_entry *module = Z_PTR_P(element);
php_printf("%s\n", module->name);
return ZEND_HASH_APPLY_KEEP;
}
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
+static int module_name_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -233,37 +236,37 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
((zend_module_entry *)Z_PTR(s->val))->name);
}
-static void print_modules(TSRMLS_D)
+static void print_modules(void)
{
HashTable sorted_registry;
zend_hash_init(&sorted_registry, 64, NULL, NULL, 1);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
- zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
- zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC);
+ zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0);
+ zend_hash_apply(&sorted_registry, print_module_info);
zend_hash_destroy(&sorted_registry);
}
-static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC)
+static int print_extension_info(zend_extension *ext, void *arg)
{
php_printf("%s\n", ext->name);
return 0;
}
-static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC)
+static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s)
{
return strcmp( ((zend_extension *)(*f)->data)->name,
((zend_extension *)(*s)->data)->name);
}
-static void print_extensions(TSRMLS_D)
+static void print_extensions(void)
{
zend_llist sorted_exts;
zend_llist_copy(&sorted_exts, &zend_extensions);
sorted_exts.dtor = NULL;
- zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC);
- zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC);
+ zend_llist_sort(&sorted_exts, extension_name_cmp);
+ zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL);
zend_llist_destroy(&sorted_exts);
}
@@ -271,7 +274,7 @@ static void print_extensions(TSRMLS_D)
#define STDOUT_FILENO 1
#endif
-static inline size_t sapi_cgi_single_write(const char *str, size_t str_length TSRMLS_DC)
+static inline size_t sapi_cgi_single_write(const char *str, size_t str_length)
{
#ifdef PHP_WRITE_STDOUT
int ret;
@@ -287,14 +290,14 @@ static inline size_t sapi_cgi_single_write(const char *str, size_t str_length TS
#endif
}
-static size_t sapi_cgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
+static size_t sapi_cgi_ub_write(const char *str, size_t str_length)
{
const char *ptr = str;
size_t remaining = str_length;
size_t ret;
while (remaining > 0) {
- ret = sapi_cgi_single_write(ptr, remaining TSRMLS_CC);
+ ret = sapi_cgi_single_write(ptr, remaining);
if (!ret) {
php_handle_aborted_connection();
return str_length - remaining;
@@ -306,7 +309,7 @@ static size_t sapi_cgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
return str_length;
}
-static size_t sapi_fcgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
+static size_t sapi_fcgi_ub_write(const char *str, size_t str_length)
{
const char *ptr = str;
size_t remaining = str_length;
@@ -327,14 +330,14 @@ static size_t sapi_fcgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
return str_length;
}
-static void sapi_cgi_flush(void *server_context TSRMLS_DC)
+static void sapi_cgi_flush(void *server_context)
{
if (fflush(stdout) == EOF) {
php_handle_aborted_connection();
}
}
-static void sapi_fcgi_flush(void *server_context TSRMLS_DC)
+static void sapi_fcgi_flush(void *server_context)
{
fcgi_request *request = (fcgi_request*) server_context;
@@ -400,7 +403,7 @@ static const http_error http_error_codes[] = {
{0, NULL}
};
-static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers)
{
char buf[SAPI_CGI_MAX_HEADER_LENGTH];
sapi_header_struct *h;
@@ -506,7 +509,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
# define STDIN_FILENO 0
#endif
-static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
+static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes)
{
size_t read_bytes = 0;
int tmp_read_bytes;
@@ -534,7 +537,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
return read_bytes;
}
-static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
+static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes)
{
size_t read_bytes = 0;
int tmp_read_bytes;
@@ -557,12 +560,12 @@ static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
return read_bytes;
}
-static char *sapi_cgi_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *sapi_cgi_getenv(char *name, size_t name_len)
{
return getenv(name);
}
-static char *sapi_fcgi_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *sapi_fcgi_getenv(char *name, size_t name_len)
{
/* when php is started by mod_fastcgi, no regular environment
* is provided to PHP. It is always sent to PHP at the start
@@ -622,30 +625,30 @@ static char *_sapi_cgi_putenv(char *name, size_t name_len, char *value)
return getenv(name);
}
-static char *sapi_cgi_read_cookies(TSRMLS_D)
+static char *sapi_cgi_read_cookies(void)
{
return getenv("HTTP_COOKIE");
}
-static char *sapi_fcgi_read_cookies(TSRMLS_D)
+static char *sapi_fcgi_read_cookies(void)
{
fcgi_request *request = (fcgi_request*) SG(server_context);
return FCGI_GETENV(request, "HTTP_COOKIE");
}
-static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC)
+static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg)
{
zval *array_ptr = (zval*)arg;
int filter_arg = (Z_ARR_P(array_ptr) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV]))?PARSE_ENV:PARSE_SERVER;
size_t new_val_len;
- if (sapi_module.input_filter(filter_arg, var, &val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
+ if (sapi_module.input_filter(filter_arg, var, &val, strlen(val), &new_val_len)) {
+ php_register_variable_safe(var, val, new_val_len, array_ptr);
}
}
-static void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
+static void cgi_php_import_environment_variables(zval *array_ptr)
{
if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) &&
@@ -664,15 +667,15 @@ static void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
}
/* call php's original import as a catch-all */
- php_php_import_environment_variables(array_ptr TSRMLS_CC);
+ php_php_import_environment_variables(array_ptr);
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);
- fcgi_loadenv(request, cgi_php_load_env_var, array_ptr TSRMLS_CC);
+ fcgi_loadenv(request, cgi_php_load_env_var, array_ptr);
}
}
-static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_cgi_register_variables(zval *track_vars_array)
{
size_t php_self_len;
char *php_self;
@@ -680,7 +683,7 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
/* In CGI mode, we consider the environment to be a part of the server
* variables
*/
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
if (CGIG(fix_pathinfo)) {
char *script_name = SG(request_info).request_uri;
@@ -723,8 +726,8 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
}
/* Build the special-case PHP_SELF variable for the CGI version */
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) {
+ php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array);
}
if (free_php_self) {
free_alloca(php_self, use_heap);
@@ -732,13 +735,13 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
} else {
php_self = SG(request_info).request_uri ? SG(request_info).request_uri : "";
php_self_len = strlen(php_self);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) {
+ php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array);
}
}
}
-static void sapi_cgi_log_message(char *message TSRMLS_DC)
+static void sapi_cgi_log_message(char *message)
{
if (fcgi_is_fastcgi() && CGIG(fcgi_logging)) {
fcgi_request *request;
@@ -763,11 +766,11 @@ static void sapi_cgi_log_message(char *message TSRMLS_DC)
/* {{{ php_cgi_ini_activate_user_config
*/
-static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const char *doc_root, size_t doc_root_len, int start TSRMLS_DC)
+static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const char *doc_root, size_t doc_root_len, int start)
{
char *ptr;
user_config_cache_entry *new_entry, *entry;
- time_t request_time = (time_t)sapi_get_request_time(TSRMLS_C);
+ time_t request_time = (time_t)sapi_get_request_time();
/* Find cached config entry: If not found, create one */
if ((entry = zend_hash_str_find_ptr(&CGIG(user_config_cache), path, path_len)) == NULL) {
@@ -789,7 +792,7 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const
zend_hash_clean(entry->user_config);
if (!IS_ABSOLUTE_PATH(path, path_len)) {
- real_path = tsrm_realpath(path, NULL TSRMLS_CC);
+ real_path = tsrm_realpath(path, NULL);
if (real_path == NULL) {
return;
}
@@ -820,12 +823,12 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const
ptr = s2 + start; /* start is the point where doc_root ends! */
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
*ptr = 0;
- php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
+ php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
*ptr = '/';
ptr++;
}
} else {
- php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
+ php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
}
if (real_path) {
@@ -835,11 +838,11 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const
}
/* Activate ini entries with values from the user config hash */
- php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS TSRMLS_CC);
+ php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS);
}
/* }}} */
-static int sapi_cgi_activate(TSRMLS_D)
+static int sapi_cgi_activate(void)
{
char *path, *doc_root, *server_name;
size_t path_len, doc_root_len, server_name_len;
@@ -863,7 +866,7 @@ static int sapi_cgi_activate(TSRMLS_D)
server_name_len = strlen(server_name);
server_name = estrndup(server_name, server_name_len);
zend_str_tolower(server_name, server_name_len);
- php_ini_activate_per_host_config(server_name, server_name_len TSRMLS_CC);
+ php_ini_activate_per_host_config(server_name, server_name_len);
efree(server_name);
}
}
@@ -887,7 +890,7 @@ static int sapi_cgi_activate(TSRMLS_D)
path[path_len] = 0;
/* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */
- php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */
+ php_ini_activate_per_dir_config(path, path_len); /* Note: for global settings sake we check from root to path */
/* Load and activate user ini files in path starting from DOCUMENT_ROOT */
if (PG(user_ini_filename) && *PG(user_ini_filename)) {
@@ -909,7 +912,7 @@ static int sapi_cgi_activate(TSRMLS_D)
doc_root = estrndup(doc_root, doc_root_len);
zend_str_tolower(doc_root, doc_root_len);
#endif
- php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, (doc_root_len > 0 && (doc_root_len - 1)) TSRMLS_CC);
+ php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, (doc_root_len > 0 && (doc_root_len - 1)));
#ifdef PHP_WIN32
efree(doc_root);
@@ -923,7 +926,7 @@ static int sapi_cgi_activate(TSRMLS_D)
return SUCCESS;
}
-static int sapi_cgi_deactivate(TSRMLS_D)
+static int sapi_cgi_deactivate(void)
{
/* flush only when SAPI was started. The reasons are:
1. SAPI Deactivate is called from two places: module init and request shutdown
@@ -939,7 +942,7 @@ static int sapi_cgi_deactivate(TSRMLS_D)
php_handle_aborted_connection();
}
} else {
- sapi_cgi_flush(SG(server_context) TSRMLS_CC);
+ sapi_cgi_flush(SG(server_context));
}
}
return SUCCESS;
@@ -1146,7 +1149,7 @@ static int is_valid_path(const char *path)
Comments in the code below refer to using the above URL in a request
*/
-static void init_request_info(fcgi_request *request TSRMLS_DC)
+static void init_request_info(fcgi_request *request)
{
char *env_script_filename = CGI_GETENV("SCRIPT_FILENAME");
char *env_path_translated = CGI_GETENV("PATH_TRANSLATED");
@@ -1246,7 +1249,7 @@ static void init_request_info(fcgi_request *request TSRMLS_DC)
#ifdef PHP_WIN32
script_path_translated[script_path_translated_len-1] == '\\' ||
#endif
- (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)
+ (real_path = tsrm_realpath(script_path_translated, NULL)) == NULL)
) {
char *pt = estrndup(script_path_translated, script_path_translated_len);
size_t len = script_path_translated_len;
@@ -1436,7 +1439,7 @@ static void init_request_info(fcgi_request *request TSRMLS_DC)
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
auth = CGI_GETENV("HTTP_AUTHORIZATION");
- php_handle_auth_data(auth TSRMLS_CC);
+ php_handle_auth_data(auth);
}
}
/* }}} */
@@ -1480,8 +1483,11 @@ PHP_INI_END()
/* {{{ php_cgi_globals_ctor
*/
-static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC)
+static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals)
{
+#ifdef ZTS
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
php_cgi_globals->rfc2616_headers = 0;
php_cgi_globals->nph = 0;
php_cgi_globals->check_shebang_line = 1;
@@ -1504,7 +1510,7 @@ static PHP_MINIT_FUNCTION(cgi)
#ifdef ZTS
ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
#else
- php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC);
+ php_cgi_globals_ctor(&php_cgi_globals);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
@@ -1541,7 +1547,7 @@ PHP_FUNCTION(apache_child_terminate) /* {{{ */
}
/* }}} */
-static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC) /* {{{ */
+static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg) /* {{{ */
{
zval *return_value = (zval*)arg;
char *str = NULL;
@@ -1598,7 +1604,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);
- fcgi_loadenv(request, add_request_header, return_value TSRMLS_CC);
+ fcgi_loadenv(request, add_request_header, return_value);
} else {
char buf[128];
char **env, *p, *q, *var, *val, *t = buf;
@@ -1672,7 +1678,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
}
/* }}} */
-static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */
+static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{{ */
{
char *s, *p;
size_t len = 0;
@@ -1712,7 +1718,7 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */
RETURN_FALSE;
}
array_init(return_value);
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value);
}
/* }}} */
@@ -1809,6 +1815,7 @@ int main(int argc, char *argv[])
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
tsrm_ls = ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
#endif
sapi_startup(&cgi_sapi_module);
@@ -2138,7 +2145,7 @@ consult the installation file that came with this distribution, or visit \n\
no_headers = 1;
SG(headers_sent) = 1;
php_cgi_usage(argv[0]);
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
exit_status = 0;
goto out;
}
@@ -2157,7 +2164,7 @@ consult the installation file that came with this distribution, or visit \n\
#endif
while (!fastcgi || fcgi_accept_request(request) >= 0) {
SG(server_context) = fastcgi ? (void *) request : (void *) 1;
- init_request_info(request TSRMLS_CC);
+ init_request_info(request);
if (!cgi && !fastcgi) {
while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
@@ -2187,16 +2194,16 @@ consult the installation file that came with this distribution, or visit \n\
if (script_file) {
efree(script_file);
}
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FAILURE;
}
if (no_headers) {
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
}
- php_print_info(0xFFFFFFFF TSRMLS_CC);
+ php_print_info(0xFFFFFFFF);
php_request_shutdown((void *) 0);
fcgi_shutdown();
exit_status = 0;
@@ -2213,11 +2220,11 @@ consult the installation file that came with this distribution, or visit \n\
}
SG(headers_sent) = 1;
php_printf("[PHP Modules]\n");
- print_modules(TSRMLS_C);
+ print_modules();
php_printf("\n[Zend Modules]\n");
- print_extensions(TSRMLS_C);
+ print_extensions();
php_printf("\n");
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
fcgi_shutdown();
exit_status = 0;
goto out;
@@ -2237,9 +2244,9 @@ consult the installation file that came with this distribution, or visit \n\
efree(script_file);
}
no_headers = 1;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FAILURE;
}
if (no_headers) {
@@ -2261,7 +2268,7 @@ consult the installation file that came with this distribution, or visit \n\
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg TSRMLS_CC);
+ zend_load_extension(php_optarg);
break;
default:
@@ -2346,12 +2353,12 @@ consult the installation file that came with this distribution, or visit \n\
/* request startup only after we've done all we can to
* get path_translated */
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
if (fastcgi) {
fcgi_finish_request(request, 1);
}
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FAILURE;
}
if (no_headers) {
@@ -2365,7 +2372,7 @@ consult the installation file that came with this distribution, or visit \n\
2. we are running as cgi or fastcgi
*/
if (cgi || fastcgi || SG(request_info).path_translated) {
- if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) {
+ if (php_fopen_primary_script(&file_handle) == FAILURE) {
zend_try {
if (errno == EACCES) {
SG(sapi_headers).http_response_code = 403;
@@ -2392,7 +2399,7 @@ consult the installation file that came with this distribution, or visit \n\
php_request_shutdown((void *) 0);
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
sapi_shutdown();
#ifdef ZTS
tsrm_shutdown();
@@ -2475,11 +2482,11 @@ consult the installation file that came with this distribution, or visit \n\
switch (behavior) {
case PHP_MODE_STANDARD:
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
break;
case PHP_MODE_LINT:
PG(during_request_startup) = 0;
- exit_status = php_lint_script(&file_handle TSRMLS_CC);
+ exit_status = php_lint_script(&file_handle);
if (exit_status == SUCCESS) {
zend_printf("No syntax errors detected in %s\n", file_handle.filename);
} else {
@@ -2487,9 +2494,9 @@ consult the installation file that came with this distribution, or visit \n\
}
break;
case PHP_MODE_STRIP:
- if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) {
- zend_strip(TSRMLS_C);
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ if (open_file_for_scanning(&file_handle) == SUCCESS) {
+ zend_strip();
+ zend_file_handle_dtor(&file_handle);
php_output_teardown();
}
return SUCCESS;
@@ -2498,13 +2505,13 @@ consult the installation file that came with this distribution, or visit \n\
{
zend_syntax_highlighter_ini syntax_highlighter_ini;
- if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) {
+ if (open_file_for_scanning(&file_handle) == SUCCESS) {
php_get_highlight_struct(&syntax_highlighter_ini);
- zend_highlight(&syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(&syntax_highlighter_ini);
if (fastcgi) {
goto fastcgi_request_done;
}
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
php_output_teardown();
}
return SUCCESS;
@@ -2513,9 +2520,9 @@ consult the installation file that came with this distribution, or visit \n\
#if 0
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
- open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent(TSRMLS_C);
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ open_file_for_scanning(&file_handle);
+ zend_indent();
+ zend_file_handle_dtor(&file_handle);
php_output_teardown();
return SUCCESS;
break;
@@ -2620,7 +2627,7 @@ parent_out:
#endif
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
sapi_shutdown();
#ifdef ZTS
diff --git a/sapi/cgi/config.w32 b/sapi/cgi/config.w32
index 55a2fba48f..daf4f05687 100644
--- a/sapi/cgi/config.w32
+++ b/sapi/cgi/config.w32
@@ -5,6 +5,6 @@ ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes');
if (PHP_CGI == "yes") {
ADD_FLAG("LDFLAGS_CGI", "/stack:67108864");
- SAPI('cgi', 'cgi_main.c fastcgi.c', 'php-cgi.exe');
+ SAPI('cgi', 'cgi_main.c fastcgi.c', 'php-cgi.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib');
}
diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4
index 49e61c83c3..a005f8e0ad 100644
--- a/sapi/cgi/config9.m4
+++ b/sapi/cgi/config9.m4
@@ -50,7 +50,7 @@ if test "$PHP_CGI" != "no"; then
esac
dnl Select SAPI
- PHP_SELECT_SAPI(cgi, program, cgi_main.c fastcgi.c,, '$(SAPI_CGI_PATH)')
+ PHP_SELECT_SAPI(cgi, program, cgi_main.c fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, '$(SAPI_CGI_PATH)')
case $host_alias in
*aix*)
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 7925f87562..1f5ee50d03 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -323,13 +323,13 @@ static char *fcgi_hash_get(fcgi_hash *h, unsigned int hash_value, char *var, uns
return NULL;
}
-static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg TSRMLS_DC)
+static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg)
{
fcgi_hash_bucket *p = h->list;
while (p) {
if (EXPECTED(p->val != NULL)) {
- func(p->var, p->var_len, p->val, p->val_len, arg TSRMLS_CC);
+ func(p->var, p->var_len, p->val, p->val_len, arg);
}
p = p->list_next;
}
@@ -1496,9 +1496,9 @@ char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int
}
}
-void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array TSRMLS_DC)
+void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array)
{
- fcgi_hash_apply(&req->env, func, array TSRMLS_CC);
+ fcgi_hash_apply(&req->env, func, array);
}
#ifdef _WIN32
diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h
index 4a30a207b1..5c43d336cc 100644
--- a/sapi/cgi/fastcgi.h
+++ b/sapi/cgi/fastcgi.h
@@ -108,7 +108,7 @@ typedef struct _fcgi_end_request_rec {
/* FastCGI client API */
-typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC);
+typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg);
typedef struct _fcgi_request fcgi_request;
@@ -127,7 +127,7 @@ char* fcgi_getenv(fcgi_request *req, const char* var, int var_len);
char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val);
char* fcgi_quick_getenv(fcgi_request *req, const char* var, int var_len, unsigned int hash_value);
char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int hash_value, char* val);
-void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array TSRMLS_DC);
+void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array);
int fcgi_read(fcgi_request *req, char *str, int len);
diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h
index e49a203821..30dc4fdfa0 100644
--- a/sapi/cli/cli.h
+++ b/sapi/cli/cli.h
@@ -30,12 +30,12 @@
#endif
-extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRMLS_DC);
+extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length);
typedef struct {
- size_t (*cli_shell_write)(const char *str, size_t str_length TSRMLS_DC);
- size_t (*cli_shell_ub_write)(const char *str, size_t str_length TSRMLS_DC);
- int (*cli_shell_run)(TSRMLS_D);
+ size_t (*cli_shell_write)(const char *str, size_t str_length);
+ size_t (*cli_shell_ub_write)(const char *str, size_t str_length);
+ int (*cli_shell_run)(void);
} cli_shell_callbacks_t;
extern PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks();
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4
index 090574a007..c5819cd8b4 100644
--- a/sapi/cli/config.m4
+++ b/sapi/cli/config.m4
@@ -31,7 +31,7 @@ if test "$PHP_CLI" != "no"; then
SAPI_CLI_PATH=sapi/cli/php
dnl Select SAPI
- PHP_SELECT_SAPI(cli, program, php_cli.c php_http_parser.c php_cli_server.c ps_title.c php_cli_process_title.c,, '$(SAPI_CLI_PATH)')
+ PHP_SELECT_SAPI(cli, program, php_cli.c php_http_parser.c php_cli_server.c ps_title.c php_cli_process_title.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, '$(SAPI_CLI_PATH)')
case $host_alias in
*aix*)
diff --git a/sapi/cli/config.w32 b/sapi/cli/config.w32
index 438c9e6d62..664394c8a6 100644
--- a/sapi/cli/config.w32
+++ b/sapi/cli/config.w32
@@ -6,7 +6,7 @@ ARG_ENABLE('crt-debug', 'Enable CRT memory dumps for debugging sent to STDERR',
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c php_cli_process_title.c ps_title.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c php_cli_process_title.c ps_title.c', 'php.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_FLAG("LIBS_CLI", "ws2_32.lib");
if (PHP_CRT_DEBUG == "yes") {
ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP");
@@ -15,7 +15,7 @@ if (PHP_CLI == "yes") {
}
if (PHP_CLI_WIN32 == "yes") {
- SAPI('cli_win32', 'cli_win32.c php_cli_process_title.c ps_title.c', 'php-win.exe');
+ SAPI('cli_win32', 'cli_win32.c php_cli_process_title.c ps_title.c', 'php-win.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_FLAG("LDFLAGS_CLI_WIN32", "/stack:67108864");
}
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index ef45ef6ef9..fb6a898430 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -99,6 +99,10 @@ PHPAPI extern char *php_ini_opened_path;
PHPAPI extern char *php_ini_scanned_path;
PHPAPI extern char *php_ini_scanned_files;
+#if defined(PHP_WIN32) && defined(ZTS)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -173,7 +177,7 @@ const opt_struct OPTIONS[] = {
{'-', 0, NULL} /* end of args */
};
-static int print_module_info(zval *element TSRMLS_DC) /* {{{ */
+static int print_module_info(zval *element) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(element);
php_printf("%s\n", module->name);
@@ -181,7 +185,7 @@ static int print_module_info(zval *element TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int module_name_cmp(const void *a, const void *b) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -191,40 +195,40 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void print_modules(TSRMLS_D) /* {{{ */
+static void print_modules(void) /* {{{ */
{
HashTable sorted_registry;
zend_hash_init(&sorted_registry, 50, NULL, NULL, 0);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
- zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
- zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC);
+ zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0);
+ zend_hash_apply(&sorted_registry, print_module_info);
zend_hash_destroy(&sorted_registry);
}
/* }}} */
-static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */
+static int print_extension_info(zend_extension *ext, void *arg) /* {{{ */
{
php_printf("%s\n", ext->name);
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) /* {{{ */
+static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s) /* {{{ */
{
return strcmp(((zend_extension *)(*f)->data)->name,
((zend_extension *)(*s)->data)->name);
}
/* }}} */
-static void print_extensions(TSRMLS_D) /* {{{ */
+static void print_extensions(void) /* {{{ */
{
zend_llist sorted_exts;
zend_llist_copy(&sorted_exts, &zend_extensions);
sorted_exts.dtor = NULL;
- zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC);
- zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC);
+ zend_llist_sort(&sorted_exts, extension_name_cmp);
+ zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info);
zend_llist_destroy(&sorted_exts);
}
/* }}} */
@@ -233,7 +237,7 @@ static void print_extensions(TSRMLS_D) /* {{{ */
#define STDOUT_FILENO 1
#endif
-static inline int sapi_cli_select(int fd TSRMLS_DC)
+static inline int sapi_cli_select(int fd)
{
fd_set wfd, dfd;
struct timeval tv;
@@ -252,7 +256,7 @@ static inline int sapi_cli_select(int fd TSRMLS_DC)
return ret != -1;
}
-PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length) /* {{{ */
{
#ifdef PHP_WRITE_STDOUT
zend_long ret;
@@ -262,7 +266,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM
if (cli_shell_callbacks.cli_shell_write) {
size_t shell_wrote;
- shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC);
+ shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length);
if (shell_wrote > -1) {
return shell_wrote;
}
@@ -271,7 +275,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM
#ifdef PHP_WRITE_STDOUT
do {
ret = write(STDOUT_FILENO, str, str_length);
- } while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO TSRMLS_CC));
+ } while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO));
if (ret <= 0) {
return 0;
@@ -285,7 +289,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM
}
/* }}} */
-static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */
{
const char *ptr = str;
size_t remaining = str_length;
@@ -297,7 +301,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /*
if (cli_shell_callbacks.cli_shell_ub_write) {
size_t ub_wrote;
- ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC);
+ ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length);
if (ub_wrote > -1) {
return ub_wrote;
}
@@ -305,7 +309,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /*
while (remaining > 0)
{
- ret = sapi_cli_single_write(ptr, remaining TSRMLS_CC);
+ ret = sapi_cli_single_write(ptr, remaining);
if (!ret) {
#ifndef PHP_CLI_WIN32_NO_CONSOLE
php_handle_aborted_connection();
@@ -320,7 +324,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /*
}
/* }}} */
-static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */
+static void sapi_cli_flush(void *server_context) /* {{{ */
{
/* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams
* are/could be closed before fflush() is called.
@@ -336,7 +340,7 @@ static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */
static char *php_self = "";
static char *script_filename = "";
-static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */
+static void sapi_cli_register_variables(zval *track_vars_array) /* {{{ */
{
size_t len;
char *docroot = "";
@@ -344,39 +348,39 @@ static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{
/* In CGI mode, we consider the environment to be a part of the server
* variables
*/
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
/* Build the special-case PHP_SELF variable for the CLI version */
len = strlen(php_self);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, len, &len TSRMLS_CC)) {
- php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, len, &len)) {
+ php_register_variable("PHP_SELF", php_self, track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &php_self, len, &len TSRMLS_CC)) {
- php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &php_self, len, &len)) {
+ php_register_variable("SCRIPT_NAME", php_self, track_vars_array);
}
/* filenames are empty for stdin */
len = strlen(script_filename);
- if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &script_filename, len, &len TSRMLS_CC)) {
- php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &script_filename, len, &len)) {
+ php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &script_filename, len, &len TSRMLS_CC)) {
- php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &script_filename, len, &len)) {
+ php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array);
}
/* just make it available */
len = 0U;
- if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) {
- php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) {
+ php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array);
}
}
/* }}} */
-static void sapi_cli_log_message(char *message TSRMLS_DC) /* {{{ */
+static void sapi_cli_log_message(char *message) /* {{{ */
{
fprintf(stderr, "%s\n", message);
}
/* }}} */
-static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */
+static int sapi_cli_deactivate(void) /* {{{ */
{
fflush(stdout);
if(SG(request_info).argv0) {
@@ -387,19 +391,19 @@ static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */
}
/* }}} */
-static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */
+static char* sapi_cli_read_cookies(void) /* {{{ */
{
return NULL;
}
/* }}} */
-static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */
+static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s) /* {{{ */
{
return 0;
}
/* }}} */
-static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */
+static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */
{
/* We do nothing here, this function is needed to prevent that the fallback
* header handling is called. */
@@ -407,7 +411,7 @@ static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /*
}
/* }}} */
-static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */
+static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context) /* {{{ */
{
}
/* }}} */
@@ -549,7 +553,7 @@ static void php_cli_usage(char *argv0)
static php_stream *s_in_process = NULL;
-static void cli_register_file_handles(TSRMLS_D) /* {{{ */
+static void cli_register_file_handles(void) /* {{{ */
{
zval zin, zout, zerr;
php_stream *s_in, *s_out, *s_err;
@@ -583,19 +587,19 @@ static void cli_register_file_handles(TSRMLS_D) /* {{{ */
ic.flags = CONST_CS;
ic.name = zend_string_init("STDIN", sizeof("STDIN")-1, 1);
ic.module_number = 0;
- zend_register_constant(&ic TSRMLS_CC);
+ zend_register_constant(&ic);
ZVAL_COPY_VALUE(&oc.value, &zout);
oc.flags = CONST_CS;
oc.name = zend_string_init("STDOUT", sizeof("STDOUT")-1, 1);
oc.module_number = 0;
- zend_register_constant(&oc TSRMLS_CC);
+ zend_register_constant(&oc);
ZVAL_COPY_VALUE(&ec.value, &zerr);
ec.flags = CONST_CS;
ec.name = zend_string_init("STDERR", sizeof("STDERR")-1, 1);
ec.module_number = 0;
- zend_register_constant(&ec TSRMLS_CC);
+ zend_register_constant(&ec);
}
/* }}} */
@@ -603,7 +607,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st
/* {{{ cli_seek_file_begin
*/
-static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC)
+static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno)
{
int c;
@@ -640,7 +644,7 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
}
/* }}} */
-static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
+static int do_cli(int argc, char **argv) /* {{{ */
{
int c;
zend_file_handle file_handle;
@@ -667,12 +671,12 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
switch (c) {
case 'i': /* php info & quit */
- if (php_request_startup(TSRMLS_C)==FAILURE) {
+ if (php_request_startup()==FAILURE) {
goto err;
}
request_started = 1;
- php_print_info(0xFFFFFFFF TSRMLS_CC);
- php_output_end_all(TSRMLS_C);
+ php_print_info(0xFFFFFFFF);
+ php_output_end_all();
exit_status = (c == '?' && argc > 1 && !strchr(argv[1], c));
goto out;
@@ -690,20 +694,20 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
#endif
get_zend_version()
);
- sapi_deactivate(TSRMLS_C);
+ sapi_deactivate();
goto out;
case 'm': /* list compiled in modules */
- if (php_request_startup(TSRMLS_C)==FAILURE) {
+ if (php_request_startup()==FAILURE) {
goto err;
}
request_started = 1;
php_printf("[PHP Modules]\n");
- print_modules(TSRMLS_C);
+ print_modules();
php_printf("\n[Zend Modules]\n");
- print_extensions(TSRMLS_C);
+ print_extensions();
php_printf("\n");
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
exit_status=0;
goto out;
@@ -854,7 +858,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg TSRMLS_CC);
+ zend_load_extension(php_optarg);
break;
case 'H':
hide_argv = 1;
@@ -913,7 +917,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
php_optind++;
}
if (script_file) {
- if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
+ if (cli_seek_file_begin(&file_handle, script_file, &lineno) != SUCCESS) {
goto err;
} else {
char real_path[MAXPATHLEN];
@@ -944,7 +948,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
argv[php_optind-1] = (char*)file_handle.filename;
SG(request_info).argv=argv+php_optind-1;
- if (php_request_startup(TSRMLS_C)==FAILURE) {
+ if (php_request_startup()==FAILURE) {
*arg_excp = arg_free;
fclose(file_handle.handle.fp);
PUTS("Could not startup.\n");
@@ -962,25 +966,25 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
}
key = zend_string_init("_SERVER", sizeof("_SERVER")-1, 0);
- zend_is_auto_global(key TSRMLS_CC);
+ zend_is_auto_global(key);
zend_string_release(key);
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
if (strcmp(file_handle.filename, "-")) {
- cli_register_file_handles(TSRMLS_C);
+ cli_register_file_handles();
}
if (interactive && cli_shell_callbacks.cli_shell_run) {
- exit_status = cli_shell_callbacks.cli_shell_run(TSRMLS_C);
+ exit_status = cli_shell_callbacks.cli_shell_run();
} else {
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
exit_status = EG(exit_status);
}
break;
case PHP_MODE_LINT:
- exit_status = php_lint_script(&file_handle TSRMLS_CC);
+ exit_status = php_lint_script(&file_handle);
if (exit_status==SUCCESS) {
zend_printf("No syntax errors detected in %s\n", file_handle.filename);
} else {
@@ -988,8 +992,8 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
}
break;
case PHP_MODE_STRIP:
- if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) {
- zend_strip(TSRMLS_C);
+ if (open_file_for_scanning(&file_handle)==SUCCESS) {
+ zend_strip();
}
goto out;
break;
@@ -997,9 +1001,9 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
{
zend_syntax_highlighter_ini syntax_highlighter_ini;
- if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) {
+ if (open_file_for_scanning(&file_handle)==SUCCESS) {
php_get_highlight_struct(&syntax_highlighter_ini);
- zend_highlight(&syntax_highlighter_ini TSRMLS_CC);
+ zend_highlight(&syntax_highlighter_ini);
}
goto out;
}
@@ -1007,15 +1011,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
#if 0
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
- open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent(TSRMLS_C);
- zend_file_handle_dtor(file_handle.handle TSRMLS_CC);
+ open_file_for_scanning(&file_handle);
+ zend_indent();
+ zend_file_handle_dtor(file_handle.handle);
goto out;
break;
#endif
case PHP_MODE_CLI_DIRECT:
- cli_register_file_handles(TSRMLS_C);
- if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) {
+ cli_register_file_handles();
+ if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1) == FAILURE) {
exit_status=254;
}
break;
@@ -1026,9 +1030,9 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
size_t len, index = 0;
zval argn, argi;
- cli_register_file_handles(TSRMLS_C);
+ cli_register_file_handles();
- if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) {
+ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1) == FAILURE) {
exit_status=254;
}
ZVAL_LONG(&argi, index);
@@ -1042,23 +1046,23 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
zend_hash_str_update(&EG(symbol_table).ht, "argn", sizeof("argn")-1, &argn);
Z_LVAL(argi) = ++index;
if (exec_run) {
- if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) {
+ if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1) == FAILURE) {
exit_status=254;
}
} else {
if (script_file) {
- if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
+ if (cli_seek_file_begin(&file_handle, script_file, &lineno) != SUCCESS) {
exit_status = 1;
} else {
CG(start_lineno) = lineno;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
exit_status = EG(exit_status);
}
}
}
efree(input);
}
- if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) {
+ if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1) == FAILURE) {
exit_status=254;
}
@@ -1106,7 +1110,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
zval tmp, *msg;
ZVAL_OBJ(&tmp, EG(exception));
- msg = zend_read_property(zend_exception_get_default(TSRMLS_C), &tmp, "message", sizeof("message")-1, 0 TSRMLS_CC);
+ msg = zend_read_property(zend_exception_get_default(), &tmp, "message", sizeof("message")-1, 0);
zend_printf("Exception: %s\n", Z_STRVAL_P(msg));
zval_ptr_dtor(&tmp);
EG(exception) = NULL;
@@ -1132,7 +1136,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
exit_status = 1;
}
} else {
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
efree(lcname);
@@ -1162,8 +1166,8 @@ out:
}
return exit_status;
err:
- sapi_deactivate(TSRMLS_C);
- zend_ini_deactivate(TSRMLS_C);
+ sapi_deactivate();
+ zend_ini_deactivate();
exit_status = 1;
goto out;
}
@@ -1236,6 +1240,7 @@ int main(int argc, char *argv[])
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
tsrm_ls = ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
#endif
#ifdef PHP_WIN32
@@ -1353,10 +1358,10 @@ exit_loop:
#ifndef PHP_CLI_WIN32_NO_CONSOLE
if (sapi_module == &cli_sapi_module) {
#endif
- exit_status = do_cli(argc, argv TSRMLS_CC);
+ exit_status = do_cli(argc, argv);
#ifndef PHP_CLI_WIN32_NO_CONSOLE
} else {
- exit_status = do_cli_server(argc, argv TSRMLS_CC);
+ exit_status = do_cli_server(argc, argv);
}
#endif
} zend_end_try();
@@ -1368,7 +1373,7 @@ out:
free(ini_entries);
}
if (module_started) {
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
}
if (sapi_started) {
sapi_shutdown();
diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c
index 28fbdfb518..0725e292de 100644
--- a/sapi/cli/php_cli_process_title.c
+++ b/sapi/cli/php_cli_process_title.c
@@ -34,7 +34,7 @@ PHP_FUNCTION(cli_set_process_title)
size_t title_len;
int rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &title, &title_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &title, &title_len) == FAILURE) {
return;
}
@@ -43,7 +43,7 @@ PHP_FUNCTION(cli_set_process_title)
RETURN_TRUE;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_set_process_title had an error: %s", ps_title_errno(rc));
+ php_error_docref(NULL, E_WARNING, "cli_set_process_title had an error: %s", ps_title_errno(rc));
RETURN_FALSE;
}
/* }}} */
@@ -62,7 +62,7 @@ PHP_FUNCTION(cli_get_process_title)
rc = get_ps_title(&length, &title);
if (rc != PS_TITLE_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc));
+ php_error_docref(NULL, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc));
RETURN_NULL();
}
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index a0a9052f8a..da690577d1 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -266,8 +266,8 @@ static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED;
static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len);
static php_cli_server_chunk *php_cli_server_chunk_heap_new_self_contained(size_t len);
static void php_cli_server_buffer_append(php_cli_server_buffer *buffer, php_cli_server_chunk *chunk);
-static void php_cli_server_logf(const char *format TSRMLS_DC, ...);
-static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC);
+static void php_cli_server_logf(const char *format, ...);
+static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message);
ZEND_DECLARE_MODULE_GLOBALS(cli_server);
@@ -435,7 +435,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
}
/* }}} */
-static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */
+static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{{ */
{
char *s, *p;
ptrdiff_t len;
@@ -473,14 +473,14 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */
RETURN_FALSE;
}
array_init(return_value);
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value);
}
/* }}} */
/* {{{ cli_server module
*/
-static void cli_server_init_globals(zend_cli_server_globals *cg TSRMLS_DC)
+static void cli_server_init_globals(zend_cli_server_globals *cg)
{
cg->color = 0;
}
@@ -541,7 +541,7 @@ static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */
return SUCCESS;
} /* }}} */
-static size_t sapi_cli_server_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t sapi_cli_server_ub_write(const char *str, size_t str_length) /* {{{ */
{
php_cli_server_client *client = SG(server_context);
if (!client) {
@@ -550,7 +550,7 @@ static size_t sapi_cli_server_ub_write(const char *str, size_t str_length TSRMLS
return php_cli_server_client_send_through(client, str, str_length);
} /* }}} */
-static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */
+static void sapi_cli_server_flush(void *server_context) /* {{{ */
{
php_cli_server_client *client = server_context;
@@ -564,17 +564,17 @@ static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */
}
if (!SG(headers_sent)) {
- sapi_send_headers(TSRMLS_C);
+ sapi_send_headers();
SG(headers_sent) = 1;
}
} /* }}} */
-static int sapi_cli_server_discard_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */{
+static int sapi_cli_server_discard_headers(sapi_headers_struct *sapi_headers) /* {{{ */{
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
/* }}} */
-static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */
+static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */
{
php_cli_server_client *client = SG(server_context);
smart_str buffer = { 0 };
@@ -611,7 +611,7 @@ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS
}
/* }}} */
-static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */
+static char *sapi_cli_server_read_cookies(void) /* {{{ */
{
php_cli_server_client *client = SG(server_context);
char *val;
@@ -621,7 +621,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */
return val;
} /* }}} */
-static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes TSRMLS_DC) /* {{{ */
+static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes) /* {{{ */
{
php_cli_server_client *client = SG(server_context);
if (client->request.content) {
@@ -634,16 +634,16 @@ static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes TSRMLS_DC)
return 0;
} /* }}} */
-static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val TSRMLS_DC) /* {{{ */
+static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val) /* {{{ */
{
char *new_val = (char *)val;
size_t new_val_len;
- if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len)) {
+ php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array);
}
} /* }}} */
-static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ {
+static int sapi_cli_server_register_entry_cb(char **entry, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ {
zval *track_vars_array = va_arg(args, zval *);
if (hash_key->key) {
char *real_key, *key;
@@ -657,7 +657,7 @@ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_arg
}
}
spprintf(&real_key, 0, "%s_%s", "HTTP", key);
- sapi_cli_server_register_variable(track_vars_array, real_key, *entry TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, real_key, *entry);
efree(key);
efree(real_key);
}
@@ -666,10 +666,10 @@ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_arg
}
/* }}} */
-static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */
+static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */
{
php_cli_server_client *client = SG(server_context);
- sapi_cli_server_register_variable(track_vars_array, "DOCUMENT_ROOT", client->server->document_root TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "DOCUMENT_ROOT", client->server->document_root);
{
char *tmp;
if ((tmp = strrchr(client->addr_str, ':'))) {
@@ -678,61 +678,61 @@ static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC)
port[7] = '\0';
strncpy(addr, client->addr_str, tmp - client->addr_str);
addr[tmp - client->addr_str] = '\0';
- sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", addr TSRMLS_CC);
- sapi_cli_server_register_variable(track_vars_array, "REMOTE_PORT", port TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", addr);
+ sapi_cli_server_register_variable(track_vars_array, "REMOTE_PORT", port);
} else {
- sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str);
}
}
{
char *tmp;
spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION);
- sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp);
efree(tmp);
}
{
char *tmp;
spprintf(&tmp, 0, "HTTP/%d.%d", client->request.protocol_version / 100, client->request.protocol_version % 100);
- sapi_cli_server_register_variable(track_vars_array, "SERVER_PROTOCOL", tmp TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SERVER_PROTOCOL", tmp);
efree(tmp);
}
- sapi_cli_server_register_variable(track_vars_array, "SERVER_NAME", client->server->host TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SERVER_NAME", client->server->host);
{
char *tmp;
spprintf(&tmp, 0, "%i", client->server->port);
- sapi_cli_server_register_variable(track_vars_array, "SERVER_PORT", tmp TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SERVER_PORT", tmp);
efree(tmp);
}
- sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri TSRMLS_CC);
- sapi_cli_server_register_variable(track_vars_array, "REQUEST_METHOD", SG(request_info).request_method TSRMLS_CC);
- sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri);
+ sapi_cli_server_register_variable(track_vars_array, "REQUEST_METHOD", SG(request_info).request_method);
+ sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath);
if (SG(request_info).path_translated) {
- sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated);
} else if (client->server->router) {
char *temp;
spprintf(&temp, 0, "%s/%s", client->server->document_root, client->server->router);
- sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp);
efree(temp);
}
if (client->request.path_info) {
- sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info);
}
if (client->request.path_info_len) {
char *tmp;
spprintf(&tmp, 0, "%s%s", client->request.vpath, client->request.path_info);
- sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", tmp TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", tmp);
efree(tmp);
} else {
- sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath);
}
if (client->request.query_string) {
- sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string TSRMLS_CC);
+ sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string);
}
- zend_hash_apply_with_arguments(&client->request.headers TSRMLS_CC, (apply_func_args_t)sapi_cli_server_register_entry_cb, 1, track_vars_array);
+ zend_hash_apply_with_arguments(&client->request.headers, (apply_func_args_t)sapi_cli_server_register_entry_cb, 1, track_vars_array);
} /* }}} */
-static void sapi_cli_server_log_message(char *msg TSRMLS_DC) /* {{{ */
+static void sapi_cli_server_log_message(char *msg) /* {{{ */
{
char buf[52];
@@ -1087,7 +1087,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
return 0;
} /* }}} */
-static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read TSRMLS_DC) /* {{{ */
+static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */
{
#ifdef PHP_WIN32
int _nbytes_read;
@@ -1103,7 +1103,7 @@ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sen
#endif
if (_nbytes_read < 0) {
char *errstr = get_last_error();
- php_cli_server_logf("%s" TSRMLS_CC, errstr);
+ php_cli_server_logf("%s", errstr);
pefree(errstr, 1);
php_cli_server_chunk_dtor(chunk);
pefree(chunk, 1);
@@ -1125,7 +1125,7 @@ static int php_cli_is_output_tty() /* {{{ */
} /* }}} */
#endif
-static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC) /* {{{ */
+static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message) /* {{{ */
{
int color = 0, effective_status = status;
char *basic_buf, *message_buf = "", *error_buf = "";
@@ -1191,9 +1191,9 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu
}
if (color) {
- php_cli_server_logf("\x1b[3%dm%s%s%s\x1b[0m" TSRMLS_CC, color, basic_buf, message_buf, error_buf);
+ php_cli_server_logf("\x1b[3%dm%s%s%s\x1b[0m", color, basic_buf, message_buf, error_buf);
} else {
- php_cli_server_logf("%s%s%s" TSRMLS_CC, basic_buf, message_buf, error_buf);
+ php_cli_server_logf("%s%s%s", basic_buf, message_buf, error_buf);
}
efree(basic_buf);
@@ -1205,15 +1205,12 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu
}
} /* }}} */
-static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */
+static void php_cli_server_logf(const char *format, ...) /* {{{ */
{
char *buf = NULL;
va_list ap;
-#ifdef ZTS
- va_start(ap, tsrm_ls);
-#else
+
va_start(ap, format);
-#endif
vspprintf(&buf, 0, format, ap);
va_end(ap);
@@ -1222,19 +1219,19 @@ static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */
}
if (sapi_module.log_message) {
- sapi_module.log_message(buf TSRMLS_CC);
+ sapi_module.log_message(buf);
}
efree(buf);
} /* }}} */
-static php_socket_t php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, zend_string **errstr TSRMLS_DC) /* {{{ */
+static php_socket_t php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, zend_string **errstr) /* {{{ */
{
php_socket_t retval = SOCK_ERR;
int err = 0;
struct sockaddr *sa = NULL, **p, **sal;
- int num_addrs = php_network_getaddresses(host, socktype, &sal, errstr TSRMLS_CC);
+ int num_addrs = php_network_getaddresses(host, socktype, &sal, errstr);
if (num_addrs == 0) {
return -1;
}
@@ -1352,6 +1349,9 @@ out:
static int php_cli_server_request_ctor(php_cli_server_request *req) /* {{{ */
{
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
req->protocol_version = 0;
req->request_uri = NULL;
req->request_uri_len = 0;
@@ -1699,7 +1699,7 @@ static int php_cli_server_client_read_request_on_message_complete(php_http_parse
return 0;
}
-static int php_cli_server_client_read_request(php_cli_server_client *client, char **errstr TSRMLS_DC)
+static int php_cli_server_client_read_request(php_cli_server_client *client, char **errstr)
{
char buf[16384];
static const php_http_parser_settings settings = {
@@ -1816,7 +1816,7 @@ static void destroy_request_info(sapi_request_info *request_info) /* {{{ */
{
} /* }}} */
-static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, php_socket_t client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */
+static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, php_socket_t client_sock, struct sockaddr *addr, socklen_t addr_len) /* {{{ */
{
client->server = server;
client->sock = client_sock;
@@ -1825,7 +1825,7 @@ static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_ser
{
zend_string *addr_str = 0;
- php_network_populate_name_from_sockaddr(addr, addr_len, &addr_str, NULL, 0 TSRMLS_CC);
+ php_network_populate_name_from_sockaddr(addr, addr_len, &addr_str, NULL, 0);
client->addr_str = pestrndup(addr_str->val, addr_str->len, 1);
client->addr_str_len = addr_str->len;
zend_string_release(addr_str);
@@ -1858,15 +1858,15 @@ static void php_cli_server_client_dtor(php_cli_server_client *client) /* {{{ */
}
} /* }}} */
-static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
#ifdef DEBUG
- php_cli_server_logf("%s Closing" TSRMLS_CC, client->addr_str);
+ php_cli_server_logf("%s Closing", client->addr_str);
#endif
zend_hash_index_del(&server->clients, client->sock);
} /* }}} */
-static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server_client *client, int status TSRMLS_DC) /* {{{ */
+static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server_client *client, int status) /* {{{ */
{
zend_string *escaped_request_uri = NULL;
const char *status_string = get_status_string(status);
@@ -1877,7 +1877,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
php_cli_server_content_sender_ctor(&client->content_sender);
client->content_sender_initialized = 1;
- escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, 0, ENT_QUOTES, NULL, 0 TSRMLS_CC);
+ escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, 0, ENT_QUOTES, NULL, 0);
{
static const char prologue_template[] = "<!doctype html><html><head><title>%d %s</title>";
@@ -1945,7 +1945,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
php_cli_server_buffer_prepend(&client->content_sender.buffer, chunk);
}
- php_cli_server_log_response(client, status, errstr ? errstr : "?" TSRMLS_CC);
+ php_cli_server_log_response(client, status, errstr ? errstr : "?");
php_cli_server_poller_add(&server->poller, POLLOUT, client->sock);
if (errstr) {
pefree(errstr, 1);
@@ -1961,11 +1961,11 @@ fail:
return FAILURE;
} /* }}} */
-static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
if (strlen(client->request.path_translated) != client->request.path_translated_len) {
/* can't handle paths that contain nul bytes */
- return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC);
+ return php_cli_server_send_error_page(server, client, 400);
}
{
zend_file_handle zfd;
@@ -1975,27 +1975,27 @@ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server
zfd.free_filename = 0;
zfd.opened_path = NULL;
zend_try {
- php_execute_script(&zfd TSRMLS_CC);
+ php_execute_script(&zfd);
} zend_end_try();
}
- php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL TSRMLS_CC);
+ php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL);
return SUCCESS;
} /* }}} */
-static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
int fd;
int status = 200;
if (client->request.path_translated && strlen(client->request.path_translated) != client->request.path_translated_len) {
/* can't handle paths that contain nul bytes */
- return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC);
+ return php_cli_server_send_error_page(server, client, 400);
}
fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1;
if (fd < 0) {
- return php_cli_server_send_error_page(server, client, 404 TSRMLS_CC);
+ return php_cli_server_send_error_page(server, client, 404);
}
php_cli_server_content_sender_ctor(&client->content_sender);
@@ -2013,7 +2013,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
append_http_status_line(&buffer, client->request.protocol_version, status, 1);
if (!buffer.s) {
/* out of memory */
- php_cli_server_log_response(client, 500, NULL TSRMLS_CC);
+ php_cli_server_log_response(client, 500, NULL);
return FAILURE;
}
append_essential_headers(&buffer, client, 1);
@@ -2030,25 +2030,25 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len);
if (!chunk) {
smart_str_free(&buffer);
- php_cli_server_log_response(client, 500, NULL TSRMLS_CC);
+ php_cli_server_log_response(client, 500, NULL);
return FAILURE;
}
php_cli_server_buffer_append(&client->content_sender.buffer, chunk);
}
- php_cli_server_log_response(client, 200, NULL TSRMLS_CC);
+ php_cli_server_log_response(client, 200, NULL);
php_cli_server_poller_add(&server->poller, POLLOUT, client->sock);
return SUCCESS;
}
/* }}} */
-static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */
+static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client) { /* {{{ */
char *auth;
php_cli_server_client_populate_request_info(client, &SG(request_info));
if (NULL != (auth = zend_hash_str_find_ptr(&client->request.headers, "authorization", sizeof("authorization")-1))) {
- php_handle_auth_data(auth TSRMLS_CC);
+ php_handle_auth_data(auth);
}
SG(sapi_headers).http_response_code = 200;
- if (FAILURE == php_request_startup(TSRMLS_C)) {
+ if (FAILURE == php_request_startup()) {
/* should never be happen */
destroy_request_info(&SG(request_info));
return FAILURE;
@@ -2059,9 +2059,9 @@ static int php_cli_server_request_startup(php_cli_server *server, php_cli_server
}
/* }}} */
-static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */
+static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_server_client *client) { /* {{{ */
php_request_shutdown(0);
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ php_cli_server_close_connection(server, client);
destroy_request_info(&SG(request_info));
SG(server_context) = NULL;
SG(rfc1867_uploaded_files) = NULL;
@@ -2069,7 +2069,7 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve
}
/* }}} */
-static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
int decline = 0;
zend_file_handle zfd;
@@ -2088,7 +2088,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
zend_try {
zval retval;
- if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) {
+ if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE, &retval, 1, &zfd)) {
if (Z_TYPE(retval) != IS_UNDEF) {
decline = Z_TYPE(retval) == IS_FALSE;
zval_ptr_dtor(&retval);
@@ -2108,7 +2108,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
}
/* }}} */
-static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
int is_static_file = 0;
@@ -2118,30 +2118,30 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
}
if (server->router || !is_static_file) {
- if (FAILURE == php_cli_server_request_startup(server, client TSRMLS_CC)) {
+ if (FAILURE == php_cli_server_request_startup(server, client)) {
SG(server_context) = NULL;
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ php_cli_server_close_connection(server, client);
destroy_request_info(&SG(request_info));
return SUCCESS;
}
}
if (server->router) {
- if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) {
- php_cli_server_request_shutdown(server, client TSRMLS_CC);
+ if (!php_cli_server_dispatch_router(server, client)) {
+ php_cli_server_request_shutdown(server, client);
return SUCCESS;
}
}
if (!is_static_file) {
- if (SUCCESS == php_cli_server_dispatch_script(server, client TSRMLS_CC)
- || SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) {
- php_cli_server_request_shutdown(server, client TSRMLS_CC);
+ if (SUCCESS == php_cli_server_dispatch_script(server, client)
+ || SUCCESS != php_cli_server_send_error_page(server, client, 500)) {
+ php_cli_server_request_shutdown(server, client);
return SUCCESS;
}
} else {
if (server->router) {
- static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC);
+ static int (*send_header_func)(sapi_headers_struct *);
send_header_func = sapi_module.send_headers;
/* do not generate default content type header */
SG(sapi_headers).send_default_content_type = 0;
@@ -2152,8 +2152,8 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
SG(sapi_headers).send_default_content_type = 1;
SG(rfc1867_uploaded_files) = NULL;
}
- if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) {
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ if (SUCCESS != php_cli_server_begin_send_static(server, client)) {
+ php_cli_server_close_connection(server, client);
}
SG(server_context) = NULL;
return SUCCESS;
@@ -2183,7 +2183,7 @@ static int php_cli_server_mime_type_ctor(php_cli_server *server, const php_cli_s
return SUCCESS;
} /* }}} */
-static void php_cli_server_dtor(php_cli_server *server TSRMLS_DC) /* {{{ */
+static void php_cli_server_dtor(php_cli_server *server) /* {{{ */
{
zend_hash_destroy(&server->clients);
zend_hash_destroy(&server->extension_mime_types);
@@ -2211,7 +2211,7 @@ static void php_cli_server_client_dtor_wrapper(zval *zv) /* {{{ */
pefree(p, 1);
} /* }}} */
-static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router TSRMLS_DC) /* {{{ */
+static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router) /* {{{ */
{
int retval = SUCCESS;
char *host = NULL;
@@ -2260,9 +2260,9 @@ static int php_cli_server_ctor(php_cli_server *server, const char *addr, const c
goto out;
}
- server_sock = php_network_listen_socket(host, &port, SOCK_STREAM, &server->address_family, &server->socklen, &errstr TSRMLS_CC);
+ server_sock = php_network_listen_socket(host, &port, SOCK_STREAM, &server->address_family, &server->socklen, &errstr);
if (server_sock == SOCK_ERR) {
- php_cli_server_logf("Failed to listen on %s:%d (reason: %s)" TSRMLS_CC, host, port, errstr ? errstr->val : "?");
+ php_cli_server_logf("Failed to listen on %s:%d (reason: %s)", host, port, errstr ? errstr->val : "?");
if (errstr) {
zend_string_release(errstr);
}
@@ -2332,20 +2332,20 @@ out:
return retval;
} /* }}} */
-static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
char *errstr = NULL;
- int status = php_cli_server_client_read_request(client, &errstr TSRMLS_CC);
+ int status = php_cli_server_client_read_request(client, &errstr);
if (status < 0) {
- php_cli_server_logf("%s Invalid request (%s)" TSRMLS_CC, client->addr_str, errstr);
+ php_cli_server_logf("%s Invalid request (%s)", client->addr_str, errstr);
efree(errstr);
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ php_cli_server_close_connection(server, client);
return FAILURE;
} else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) {
- return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC);
+ return php_cli_server_send_error_page(server, client, 501);
} else if (status == 1) {
php_cli_server_poller_remove(&server->poller, POLLIN, client->sock);
- php_cli_server_dispatch(server, client TSRMLS_CC);
+ php_cli_server_dispatch(server, client);
} else {
php_cli_server_poller_add(&server->poller, POLLIN, client->sock);
}
@@ -2353,13 +2353,13 @@ static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cl
return SUCCESS;
} /* }}} */
-static int php_cli_server_send_event(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
+static int php_cli_server_send_event(php_cli_server *server, php_cli_server_client *client) /* {{{ */
{
if (client->content_sender_initialized) {
if (client->file_fd >= 0 && !client->content_sender.buffer.first) {
size_t nbytes_read;
- if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read TSRMLS_CC)) {
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) {
+ php_cli_server_close_connection(server, client);
return FAILURE;
}
if (nbytes_read == 0) {
@@ -2371,12 +2371,12 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie
size_t nbytes_sent;
int err = php_cli_server_content_sender_send(&client->content_sender, client->sock, &nbytes_sent);
if (err && err != SOCK_EAGAIN) {
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ php_cli_server_close_connection(server, client);
return FAILURE;
}
}
if (!client->content_sender.buffer.first && client->file_fd < 0) {
- php_cli_server_close_connection(server, client TSRMLS_CC);
+ php_cli_server_close_connection(server, client);
}
}
return SUCCESS;
@@ -2384,20 +2384,14 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie
/* }}} */
typedef struct php_cli_server_do_event_for_each_fd_callback_params {
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
php_cli_server *server;
- int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC);
- int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC);
+ int(*rhandler)(php_cli_server*, php_cli_server_client*);
+ int(*whandler)(php_cli_server*, php_cli_server_client*);
} php_cli_server_do_event_for_each_fd_callback_params;
static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socket_t fd, int event) /* {{{ */
{
php_cli_server_do_event_for_each_fd_callback_params *params = _params;
-#ifdef ZTS
- void ***tsrm_ls = params->tsrm_ls;
-#endif
php_cli_server *server = params->server;
if (server->server_sock == fd) {
php_cli_server_client *client = NULL;
@@ -2411,47 +2405,44 @@ static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socke
if (!ZEND_VALID_SOCKET(client_sock)) {
char *errstr;
errstr = php_socket_strerror(php_socket_errno(), NULL, 0);
- php_cli_server_logf("Failed to accept a client (reason: %s)" TSRMLS_CC, errstr);
+ php_cli_server_logf("Failed to accept a client (reason: %s)", errstr);
efree(errstr);
pefree(sa, 1);
return SUCCESS;
}
- if (SUCCESS != php_set_sock_blocking(client_sock, 0 TSRMLS_CC)) {
+ if (SUCCESS != php_set_sock_blocking(client_sock, 0)) {
pefree(sa, 1);
closesocket(client_sock);
return SUCCESS;
}
- if (!(client = pemalloc(sizeof(php_cli_server_client), 1)) || FAILURE == php_cli_server_client_ctor(client, server, client_sock, sa, socklen TSRMLS_CC)) {
- php_cli_server_logf("Failed to create a new request object" TSRMLS_CC);
+ if (!(client = pemalloc(sizeof(php_cli_server_client), 1)) || FAILURE == php_cli_server_client_ctor(client, server, client_sock, sa, socklen)) {
+ php_cli_server_logf("Failed to create a new request object");
pefree(sa, 1);
closesocket(client_sock);
return SUCCESS;
}
#ifdef DEBUG
- php_cli_server_logf("%s Accepted" TSRMLS_CC, client->addr_str);
+ php_cli_server_logf("%s Accepted", client->addr_str);
#endif
zend_hash_index_update_ptr(&server->clients, client_sock, client);
- php_cli_server_recv_event_read_request(server, client TSRMLS_CC);
+ php_cli_server_recv_event_read_request(server, client);
} else {
php_cli_server_client *client;
if (NULL != (client = zend_hash_index_find_ptr(&server->clients, fd))) {
if (event & POLLIN) {
- params->rhandler(server, client TSRMLS_CC);
+ params->rhandler(server, client);
}
if (event & POLLOUT) {
- params->whandler(server, client TSRMLS_CC);
+ params->whandler(server, client);
}
}
}
return SUCCESS;
} /* }}} */
-static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC), int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC) TSRMLS_DC) /* {{{ */
+static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rhandler)(php_cli_server*, php_cli_server_client*), int(*whandler)(php_cli_server*, php_cli_server_client*)) /* {{{ */
{
php_cli_server_do_event_for_each_fd_callback_params params = {
-#ifdef ZTS
- tsrm_ls,
-#endif
server,
rhandler,
whandler
@@ -2460,7 +2451,7 @@ static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rha
php_cli_server_poller_iter_on_active(&server->poller, &params, php_cli_server_do_event_for_each_fd_callback);
} /* }}} */
-static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */
+static int php_cli_server_do_event_loop(php_cli_server *server) /* {{{ */
{
int retval = SUCCESS;
while (server->is_running) {
@@ -2469,14 +2460,14 @@ static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{
if (n > 0) {
php_cli_server_do_event_for_each_fd(server,
php_cli_server_recv_event_read_request,
- php_cli_server_send_event TSRMLS_CC);
+ php_cli_server_send_event);
} else if (n == 0) {
/* do nothing */
} else {
int err = php_socket_errno();
if (err != SOCK_EINTR) {
char *errstr = php_socket_strerror(err, NULL, 0);
- php_cli_server_logf("%s" TSRMLS_CC, errstr);
+ php_cli_server_logf("%s", errstr);
efree(errstr);
retval = FAILURE;
goto out;
@@ -2495,7 +2486,7 @@ static void php_cli_server_sigint_handler(int sig) /* {{{ */
}
/* }}} */
-int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
+int do_cli_server(int argc, char **argv) /* {{{ */
{
char *php_optarg = NULL;
int php_optind = 1;
@@ -2546,7 +2537,7 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
router = argv[php_optind];
}
- if (FAILURE == php_cli_server_ctor(&server, server_bind_address, document_root, router TSRMLS_CC)) {
+ if (FAILURE == php_cli_server_ctor(&server, server_bind_address, document_root, router)) {
return 1;
}
sapi_module.phpinfo_as_text = 0;
@@ -2568,8 +2559,8 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
#if defined(HAVE_SIGNAL_H) && defined(SIGINT)
signal(SIGINT, php_cli_server_sigint_handler);
#endif
- php_cli_server_do_event_loop(&server TSRMLS_CC);
- php_cli_server_dtor(&server TSRMLS_CC);
+ php_cli_server_do_event_loop(&server);
+ php_cli_server_dtor(&server);
return 0;
} /* }}} */
diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h
index 476ee2919c..583a22c7b9 100644
--- a/sapi/cli/php_cli_server.h
+++ b/sapi/cli/php_cli_server.h
@@ -25,14 +25,15 @@
extern const zend_function_entry server_additional_functions[];
extern sapi_module_struct cli_server_sapi_module;
-extern int do_cli_server(int argc, char **argv TSRMLS_DC);
+extern int do_cli_server(int argc, char **argv);
ZEND_BEGIN_MODULE_GLOBALS(cli_server)
short color;
ZEND_END_MODULE_GLOBALS(cli_server)
#ifdef ZTS
-#define CLI_SERVER_G(v) TSRMG(cli_server_globals_id, zend_cli_server_globals *, v)
+#define CLI_SERVER_G(v) ZEND_TSRMG(cli_server_globals_id, zend_cli_server_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define CLI_SERVER_G(v) (cli_server_globals.v)
#endif
diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c
index aebfb9f671..c92d8838d3 100644
--- a/sapi/continuity/capi.c
+++ b/sapi/continuity/capi.c
@@ -127,7 +127,7 @@ PHP_MINFO_FUNCTION(continuity)
/*
* sapi_capi_ub_write: Write len bytes to the connection output.
*/
-static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
+static int sapi_capi_ub_write(const char *str, unsigned int str_length)
{
int retval;
capi_request_context *rc;
@@ -143,7 +143,7 @@ static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC
* sapi_capi_header_handler: Add/update response headers with those provided
* by the PHP engine.
*/
-static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC)
+static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers)
{
char *header_name, *header_content, *p;
capi_request_context *rc = (capi_request_context *) SG(server_context);
@@ -174,7 +174,7 @@ static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_heade
* sapi_capi_send_headers: Transmit the headers to the client. This has the
* effect of starting the response under Continuity.
*/
-static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC)
+static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers)
{
int retval;
capi_request_context *rc = (capi_request_context *) SG(server_context);
@@ -195,7 +195,7 @@ static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC)
}
-static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_capi_read_post(char *buffer, uint count_bytes)
{
unsigned int max_read, total_read = 0;
capi_request_context *rc = (capi_request_context *) SG(server_context);
@@ -221,7 +221,7 @@ static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/*
* sapi_capi_read_cookies: Return cookie information into PHP.
*/
-static char *sapi_capi_read_cookies(TSRMLS_D)
+static char *sapi_capi_read_cookies(void)
{
char *cookie_string;
capi_request_context *rc = (capi_request_context *) SG(server_context);
@@ -230,7 +230,7 @@ static char *sapi_capi_read_cookies(TSRMLS_D)
return cookie_string;
}
-static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_DC)
+static void sapi_capi_register_server_variables(zval * track_vars_array)
{
capi_request_context *rc = (capi_request_context *) SG(server_context);
size_t i;
@@ -240,101 +240,101 @@ static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_D
/* PHP_SELF and REQUEST_URI */
value = lstFset_get(rc->t->vars, "uri");
if (value != NULL) {
- php_register_variable("PHP_SELF", value, track_vars_array TSRMLS_CC);
- php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", value, track_vars_array);
+ php_register_variable("REQUEST_URI", value, track_vars_array);
}
/* COUNTRY CODE */
value = lstFset_get(rc->t->vars, "ccode");
if(value!=NULL)
- php_register_variable("COUNTRY_CODE", value, track_vars_array TSRMLS_CC);
+ php_register_variable("COUNTRY_CODE", value, track_vars_array);
/* argv */
value = lstFset_get(rc->t->vars, "query");
if (value != NULL)
- php_register_variable("argv", value, track_vars_array TSRMLS_CC);
+ php_register_variable("argv", value, track_vars_array);
/* GATEWAY_INTERFACE */
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array);
/* SERVER_NAME and HTTP_HOST */
value = lstFset_get(rc->t->req_hdrs, "host");
if (value != NULL) {
- php_register_variable("HTTP_HOST", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_HOST", value, track_vars_array);
/* TODO: This should probably scrub the port value if one is present. */
- php_register_variable("SERVER_NAME", value, track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_NAME", value, track_vars_array);
}
/* SERVER_SOFTWARE */
value = lstFset_get(rc->t->res_hdrs, "Server");
if (value != NULL)
- php_register_variable("SERVER_SOFTWARE", value, track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_SOFTWARE", value, track_vars_array);
/* SERVER_PROTOCOL */
value = lstFset_get(rc->t->vars, "protocol");
if (value != NULL)
- php_register_variable("SERVER_PROTOCOL", value, track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_PROTOCOL", value, track_vars_array);
/* REQUEST_METHOD */
value = lstFset_get(rc->t->vars, "method");
if (value != NULL)
- php_register_variable("REQUEST_METHOD", value, track_vars_array TSRMLS_CC);
+ php_register_variable("REQUEST_METHOD", value, track_vars_array);
/* QUERY_STRING */
value = lstFset_get(rc->t->vars, "query");
if (value != NULL)
- php_register_variable("QUERY_STRING", value, track_vars_array TSRMLS_CC);
+ php_register_variable("QUERY_STRING", value, track_vars_array);
/* DOCUMENT_ROOT */
value = lstFset_get(rc->t->vars, "docroot");
if (value != NULL)
- php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC);
+ php_register_variable("DOCUMENT_ROOT", value, track_vars_array);
/* HTTP_ACCEPT */
value = lstFset_get(rc->t->req_hdrs, "accept");
if (value != NULL)
- php_register_variable("HTTP_ACCEPT", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_ACCEPT", value, track_vars_array);
/* HTTP_ACCEPT_CHARSET */
value = lstFset_get(rc->t->req_hdrs, "accept-charset");
if (value != NULL)
- php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array);
/* HTTP_ACCEPT_ENCODING */
value = lstFset_get(rc->t->req_hdrs, "accept-encoding");
if (value != NULL)
- php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array);
/* HTTP_ACCEPT_LANGUAGE */
value = lstFset_get(rc->t->req_hdrs, "accept-language");
if (value != NULL)
- php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array);
/* HTTP_CONNECTION */
value = lstFset_get(rc->t->req_hdrs, "connection");
if (value != NULL)
- php_register_variable("HTTP_CONNECTION", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_CONNECTION", value, track_vars_array);
/* HTTP_REFERER */
value = lstFset_get(rc->t->req_hdrs, "referer");
if (value != NULL)
- php_register_variable("HTTP_REFERER", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_REFERER", value, track_vars_array);
/* HTTP_USER_AGENT */
value = lstFset_get(rc->t->req_hdrs, "user-agent");
if (value != NULL)
- php_register_variable("HTTP_USER_AGENT", value, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_USER_AGENT", value, track_vars_array);
/* REMOTE_ADDR */
utlFip_to_str(rc->t->cli_ipv4_addr, buf, sizeof(buf));
- php_register_variable("REMOTE_ADDR", buf, track_vars_array TSRMLS_CC);
+ php_register_variable("REMOTE_ADDR", buf, track_vars_array);
/* REMOTE_PORT */
/* SCRIPT_FILENAME and PATH_TRANSLATED */
value = lstFset_get(rc->t->vars, "path");
if (value != NULL) {
- php_register_variable("SCRIPT_FILENAME", value, track_vars_array TSRMLS_CC);
- php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC);
+ php_register_variable("SCRIPT_FILENAME", value, track_vars_array);
+ php_register_variable("PATH_TRANSLATED", value, track_vars_array);
}
/* SERVER_ADMIN */
/* Not applicable */
@@ -343,7 +343,7 @@ static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_D
}
-static void capi_log_message(char *message TSRMLS_DC)
+static void capi_log_message(char *message)
{
capi_request_context *rc = (capi_request_context *) SG(server_context);
logFmsg(0, "mod/php: %s", message);
@@ -408,7 +408,7 @@ static void capi_free(void *addr)
free(addr);
}
-static void capi_request_ctor(NSLS_D TSRMLS_DC)
+static void capi_request_ctor(NSLS_D)
{
char *query_string = lstFset_get(NSG(t->vars), "query");
char *uri = lstFset_get(NSG(t->vars), "uri");
@@ -427,7 +427,7 @@ static void capi_request_ctor(NSLS_D TSRMLS_DC)
SG(sapi_headers).http_response_code = 200;
}
-static void capi_request_dtor(NSLS_D TSRMLS_DC)
+static void capi_request_dtor(NSLS_D)
{
capi_free(SG(request_info).query_string);
capi_free(SG(request_info).request_uri);
@@ -436,11 +436,11 @@ static void capi_request_dtor(NSLS_D TSRMLS_DC)
capi_free(SG(request_info).content_type);
}
-int capi_module_main(NSLS_D TSRMLS_DC)
+int capi_module_main(NSLS_D)
{
zend_file_handle file_handle;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return FAILURE;
}
file_handle.type = ZEND_HANDLE_FILENAME;
@@ -448,7 +448,7 @@ int capi_module_main(NSLS_D TSRMLS_DC)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
return SUCCESS;
@@ -475,17 +475,16 @@ int phpFservice(httpTtrans * t, lstTset * opts)
int retval;
capi_request_context *request_context;
- TSRMLS_FETCH();
-
+
request_context = (capi_request_context *) malloc(sizeof(capi_request_context));
request_context->t = t;
request_context->read_post_bytes = -1;
SG(server_context) = request_context;
- capi_request_ctor(NSLS_C TSRMLS_CC);
- retval = capi_module_main(NSLS_C TSRMLS_CC);
- capi_request_dtor(NSLS_C TSRMLS_CC);
+ capi_request_ctor(NSLS_C);
+ retval = capi_module_main(NSLS_C);
+ capi_request_dtor(NSLS_C);
free(request_context);
diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4
index 5ffb9b39bd..5be7af48f4 100644
--- a/sapi/embed/config.m4
+++ b/sapi/embed/config.m4
@@ -23,7 +23,7 @@ if test "$PHP_EMBED" != "no"; then
;;
esac
if test "$PHP_EMBED_TYPE" != "no"; then
- PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c)
+ PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
fi
AC_MSG_RESULT([$PHP_EMBED_TYPE])
diff --git a/sapi/embed/config.w32 b/sapi/embed/config.w32
index 64e44bdd94..ce41e253f0 100644
--- a/sapi/embed/config.w32
+++ b/sapi/embed/config.w32
@@ -6,6 +6,6 @@ ARG_ENABLE('embed', 'Embedded SAPI library', 'no');
var PHP_EMBED_PGO = false;
if (PHP_EMBED != "no") {
- SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib');
+ SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
PHP_INSTALL_HEADERS("sapi/embed", "php_embed.h");
}
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index 8bfaf9f52d..f5e6129e0f 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -33,12 +33,16 @@ const char HARDCODED_INI[] =
"max_execution_time=0\n"
"max_input_time=-1\n\0";
-static char* php_embed_read_cookies(TSRMLS_D)
+#if defined(PHP_WIN32) && defined(ZTS)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
+
+static char* php_embed_read_cookies(void)
{
return NULL;
}
-static int php_embed_deactivate(TSRMLS_D)
+static int php_embed_deactivate(void)
{
fflush(stdout);
return SUCCESS;
@@ -61,7 +65,7 @@ static inline size_t php_embed_single_write(const char *str, size_t str_length)
}
-static size_t php_embed_ub_write(const char *str, size_t str_length TSRMLS_DC)
+static size_t php_embed_ub_write(const char *str, size_t str_length)
{
const char *ptr = str;
size_t remaining = str_length;
@@ -79,25 +83,25 @@ static size_t php_embed_ub_write(const char *str, size_t str_length TSRMLS_DC)
return str_length;
}
-static void php_embed_flush(void *server_context TSRMLS_DC)
+static void php_embed_flush(void *server_context)
{
if (fflush(stdout)==EOF) {
php_handle_aborted_connection();
}
}
-static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
+static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context)
{
}
-static void php_embed_log_message(char *message TSRMLS_DC)
+static void php_embed_log_message(char *message)
{
fprintf (stderr, "%s\n", message);
}
-static void php_embed_register_variables(zval *track_vars_array TSRMLS_DC)
+static void php_embed_register_variables(zval *track_vars_array)
{
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
}
static int php_embed_startup(sapi_module_struct *sapi_module)
@@ -152,12 +156,9 @@ static const zend_function_entry additional_functions[] = {
{NULL, NULL, NULL}
};
-EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
+EMBED_SAPI_API int php_embed_init(int argc, char **argv)
{
zend_llist global_vars;
-#ifdef ZTS
- void ***tsrm_ls = NULL;
-#endif
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
@@ -172,8 +173,8 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- tsrm_ls = ts_resource(0);
- *ptsrm_ls = tsrm_ls;
+ (void)ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
#endif
sapi_startup(&php_embed_module);
@@ -205,22 +206,22 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
SG(request_info).argc=argc;
SG(request_info).argv=argv;
- if (php_request_startup(TSRMLS_C)==FAILURE) {
- php_module_shutdown(TSRMLS_C);
+ if (php_request_startup()==FAILURE) {
+ php_module_shutdown();
return FAILURE;
}
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
- php_register_variable("PHP_SELF", "-", NULL TSRMLS_CC);
+ php_register_variable("PHP_SELF", "-", NULL);
return SUCCESS;
}
-EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D)
+EMBED_SAPI_API void php_embed_shutdown(void)
{
php_request_shutdown((void *) 0);
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
sapi_shutdown();
#ifdef ZTS
tsrm_shutdown();
diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h
index b62fd9fe24..82afa686d2 100644
--- a/sapi/embed/php_embed.h
+++ b/sapi/embed/php_embed.h
@@ -27,34 +27,15 @@
#include <main/php_ini.h>
#include <zend_ini.h>
-#ifdef ZTS
-#define PTSRMLS_D void ****ptsrm_ls
-#define PTSRMLS_DC , PTSRMLS_D
-#define PTSRMLS_C &tsrm_ls
-#define PTSRMLS_CC , PTSRMLS_C
-
-#define PHP_EMBED_START_BLOCK(x,y) { \
- void ***tsrm_ls; \
- php_embed_init(x, y PTSRMLS_CC); \
- zend_first_try {
-
-#else
-#define PTSRMLS_D
-#define PTSRMLS_DC
-#define PTSRMLS_C
-#define PTSRMLS_CC
-
#define PHP_EMBED_START_BLOCK(x,y) { \
php_embed_init(x, y); \
zend_first_try {
-#endif
-
#define PHP_EMBED_END_BLOCK() \
} zend_catch { \
/* int exit_status = EG(exit_status); */ \
} zend_end_try(); \
- php_embed_shutdown(TSRMLS_C); \
+ php_embed_shutdown(); \
}
#ifndef PHP_WIN32
@@ -63,9 +44,13 @@
#define EMBED_SAPI_API
#endif
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
+
BEGIN_EXTERN_C()
-EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
-EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D);
+EMBED_SAPI_API int php_embed_init(int argc, char **argv);
+EMBED_SAPI_API void php_embed_shutdown(void);
extern EMBED_SAPI_API sapi_module_struct php_embed_module;
END_EXTERN_C()
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 80bc27c7a7..9997446028 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -55,7 +55,7 @@
#define GO(field) offsetof(struct fpm_global_config_s, field)
#define WPO(field) offsetof(struct fpm_worker_pool_config_s, field)
-static int fpm_conf_load_ini_file(char *filename TSRMLS_DC);
+static int fpm_conf_load_ini_file(char *filename);
static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset);
#if 0 /* not used for now */
static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset);
@@ -1149,7 +1149,7 @@ int fpm_conf_write_pid() /* {{{ */
}
/* }}} */
-static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
+static int fpm_conf_post_process(int force_daemon) /* {{{ */
{
struct fpm_worker_pool_s *wp;
@@ -1220,7 +1220,7 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
if (!wp->config->access_log || !*wp->config->access_log) {
continue;
}
- if (0 > fpm_log_write(wp->config->access_format TSRMLS_CC)) {
+ if (0 > fpm_log_write(wp->config->access_format)) {
zlog(ZLOG_ERROR, "[pool %s] wrong format for access.format '%s'", wp->config->name, wp->config->access_format);
return -1;
}
@@ -1245,7 +1245,7 @@ static void fpm_conf_cleanup(int which, void *arg) /* {{{ */
}
/* }}} */
-static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ */
+static void fpm_conf_ini_parser_include(char *inc, void *arg) /* {{{ */
{
char *filename;
int *error = (int *)arg;;
@@ -1279,7 +1279,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ *
int len = strlen(g.gl_pathv[i]);
if (len < 1) continue;
if (g.gl_pathv[i][len - 1] == '/') continue; /* don't parse directories */
- if (0 > fpm_conf_load_ini_file(g.gl_pathv[i] TSRMLS_CC)) {
+ if (0 > fpm_conf_load_ini_file(g.gl_pathv[i])) {
zlog(ZLOG_ERROR, "Unable to include %s from %s at line %d", g.gl_pathv[i], filename, ini_lineno);
*error = 1;
efree(filename);
@@ -1289,7 +1289,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ *
globfree(&g);
}
#else /* HAVE_GLOB */
- if (0 > fpm_conf_load_ini_file(inc TSRMLS_CC)) {
+ if (0 > fpm_conf_load_ini_file(inc)) {
zlog(ZLOG_ERROR, "Unable to include %s from %s at line %d", inc, filename, ini_lineno);
*error = 1;
efree(filename);
@@ -1301,7 +1301,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ *
}
/* }}} */
-static void fpm_conf_ini_parser_section(zval *section, void *arg TSRMLS_DC) /* {{{ */
+static void fpm_conf_ini_parser_section(zval *section, void *arg) /* {{{ */
{
struct fpm_worker_pool_s *wp;
struct fpm_worker_pool_config_s *config;
@@ -1339,7 +1339,7 @@ static void fpm_conf_ini_parser_section(zval *section, void *arg TSRMLS_DC) /* {
}
/* }}} */
-static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg TSRMLS_DC) /* {{{ */
+static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg) /* {{{ */
{
struct ini_value_parser_s *parser;
void *config = NULL;
@@ -1396,7 +1396,7 @@ static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg TSRMLS_
}
/* }}} */
-static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *arg TSRMLS_DC) /* {{{ */
+static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *arg) /* {{{ */
{
int *error = (int *)arg;
char *err = NULL;
@@ -1452,7 +1452,7 @@ static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *
}
/* }}} */
-static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
+static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */
{
int *error;
@@ -1462,13 +1462,13 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback
switch(callback_type) {
case ZEND_INI_PARSER_ENTRY:
- fpm_conf_ini_parser_entry(arg1, arg2, error TSRMLS_CC);
+ fpm_conf_ini_parser_entry(arg1, arg2, error);
break;;
case ZEND_INI_PARSER_SECTION:
- fpm_conf_ini_parser_section(arg1, error TSRMLS_CC);
+ fpm_conf_ini_parser_section(arg1, error);
break;;
case ZEND_INI_PARSER_POP_ENTRY:
- fpm_conf_ini_parser_array(arg1, arg3, arg2, error TSRMLS_CC);
+ fpm_conf_ini_parser_array(arg1, arg3, arg2, error);
break;;
default:
zlog(ZLOG_ERROR, "[%s:%d] Unknown INI syntax", ini_filename, ini_lineno);
@@ -1478,7 +1478,7 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback
}
/* }}} */
-int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
+int fpm_conf_load_ini_file(char *filename) /* {{{ */
{
int error = 0;
char *buf = NULL, *newbuf = NULL;
@@ -1532,7 +1532,7 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
/* always append newline and null terminate */
buf[n++] = '\n';
buf[n] = '\0';
- tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error TSRMLS_CC);
+ tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error);
ini_filename = filename;
if (error || tmp == FAILURE) {
if (ini_include) free(ini_include);
@@ -1545,7 +1545,7 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */
char *tmp = ini_include;
ini_include = NULL;
fpm_evaluate_full_path(&tmp, NULL, NULL, 0);
- fpm_conf_ini_parser_include(tmp, &error TSRMLS_CC);
+ fpm_conf_ini_parser_include(tmp, &error);
if (error) {
free(tmp);
ini_recursion--;
@@ -1661,7 +1661,6 @@ static void fpm_conf_dump() /* {{{ */
int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */
{
int ret;
- TSRMLS_FETCH();
if (fpm_globals.prefix && *fpm_globals.prefix) {
if (!fpm_conf_is_dir(fpm_globals.prefix)) {
@@ -1697,14 +1696,14 @@ int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */
}
}
- ret = fpm_conf_load_ini_file(fpm_globals.config TSRMLS_CC);
+ ret = fpm_conf_load_ini_file(fpm_globals.config);
if (0 > ret) {
zlog(ZLOG_ERROR, "failed to load configuration file '%s'", fpm_globals.config);
return -1;
}
- if (0 > fpm_conf_post_process(force_daemon TSRMLS_CC)) {
+ if (0 > fpm_conf_post_process(force_daemon)) {
zlog(ZLOG_ERROR, "failed to post process the configuration");
return -1;
}
diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c
index b0bf32ac16..94e8b29d64 100644
--- a/sapi/fpm/fpm/fpm_log.c
+++ b/sapi/fpm/fpm/fpm_log.c
@@ -97,7 +97,7 @@ int fpm_log_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
}
/* }}} */
-int fpm_log_write(char *log_format TSRMLS_DC) /* {{{ */
+int fpm_log_write(char *log_format) /* {{{ */
{
char *s, *b;
char buffer[FPM_LOG_BUFFER+1];
diff --git a/sapi/fpm/fpm/fpm_log.h b/sapi/fpm/fpm/fpm_log.h
index f0199d9cb6..d85d368da5 100644
--- a/sapi/fpm/fpm/fpm_log.h
+++ b/sapi/fpm/fpm/fpm_log.h
@@ -7,7 +7,7 @@
#include "fpm_worker_pool.h"
int fpm_log_init_child(struct fpm_worker_pool_s *wp);
-int fpm_log_write(char *log_format TSRMLS_DC);
+int fpm_log_write(char *log_format);
int fpm_log_open(int reopen);
#endif
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 2552f9afe0..62846b6ba9 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -113,7 +113,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS;
struct sigaction act, old_term, old_quit, old_int;
#endif
-static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC);
+static void (*php_php_import_environment_variables)(zval *array_ptr);
#ifndef PHP_WIN32
/* these globals used for forking children on unix systems */
@@ -127,8 +127,8 @@ static int parent = 1;
static int request_body_fd;
static int fpm_is_running = 0;
-static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC);
-static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC);
+static char *sapi_cgibin_getenv(char *name, size_t name_len);
+static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg);
#define PHP_MODE_STANDARD 1
#define PHP_MODE_HIGHLIGHT 2
@@ -218,14 +218,14 @@ static php_cgi_globals_struct php_cgi_globals;
#define TRANSLATE_SLASHES(path)
#endif
-static int print_module_info(zval *zv TSRMLS_DC)
+static int print_module_info(zval *zv)
{
zend_module_entry *module = Z_PTR_P(zv);
php_printf("%s\n", module->name);
return 0;
}
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
+static int module_name_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -234,37 +234,37 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
((zend_module_entry *) Z_PTR(s->val))->name);
}
-static void print_modules(TSRMLS_D)
+static void print_modules(void)
{
HashTable sorted_registry;
zend_hash_init(&sorted_registry, 50, NULL, NULL, 1);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
- zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
- zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC);
+ zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0);
+ zend_hash_apply(&sorted_registry, print_module_info);
zend_hash_destroy(&sorted_registry);
}
-static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC)
+static int print_extension_info(zend_extension *ext, void *arg)
{
php_printf("%s\n", ext->name);
return 0;
}
-static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC)
+static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s)
{
return strcmp( ((zend_extension *)(*f)->data)->name,
((zend_extension *)(*s)->data)->name);
}
-static void print_extensions(TSRMLS_D)
+static void print_extensions(void)
{
zend_llist sorted_exts;
zend_llist_copy(&sorted_exts, &zend_extensions);
sorted_exts.dtor = NULL;
- zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC);
- zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC);
+ zend_llist_sort(&sorted_exts, extension_name_cmp);
+ zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL);
zend_llist_destroy(&sorted_exts);
}
@@ -272,7 +272,7 @@ static void print_extensions(TSRMLS_D)
#define STDOUT_FILENO 1
#endif
-static inline size_t sapi_cgibin_single_write(const char *str, uint str_length TSRMLS_DC)
+static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
{
ssize_t ret;
@@ -298,14 +298,14 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T
#endif
}
-static size_t sapi_cgibin_ub_write(const char *str, size_t str_length TSRMLS_DC)
+static size_t sapi_cgibin_ub_write(const char *str, size_t str_length)
{
const char *ptr = str;
uint remaining = str_length;
size_t ret;
while (remaining > 0) {
- ret = sapi_cgibin_single_write(ptr, remaining TSRMLS_CC);
+ ret = sapi_cgibin_single_write(ptr, remaining);
if (!ret) {
php_handle_aborted_connection();
return str_length - remaining;
@@ -318,7 +318,7 @@ static size_t sapi_cgibin_ub_write(const char *str, size_t str_length TSRMLS_DC)
}
-static void sapi_cgibin_flush(void *server_context TSRMLS_DC)
+static void sapi_cgibin_flush(void *server_context)
{
/* fpm has started, let use fcgi instead of stdout */
if (fpm_is_running) {
@@ -391,7 +391,7 @@ static const http_error http_error_codes[] = {
{0, NULL}
};
-static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers)
{
char buf[SAPI_CGI_MAX_HEADER_LENGTH];
sapi_header_struct *h;
@@ -497,7 +497,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
# define STDIN_FILENO 0
#endif
-static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
+static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes)
{
uint read_bytes = 0;
int tmp_read_bytes;
@@ -510,7 +510,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
fcgi_request *request = (fcgi_request*) SG(server_context);
if (request_body_fd == -1) {
char *request_body_filename = sapi_cgibin_getenv((char *) "REQUEST_BODY_FILE",
- sizeof("REQUEST_BODY_FILE") - 1 TSRMLS_CC);
+ sizeof("REQUEST_BODY_FILE") - 1);
if (request_body_filename && *request_body_filename) {
request_body_fd = open(request_body_filename, O_RDONLY);
@@ -537,7 +537,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
return read_bytes;
}
-static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *sapi_cgibin_getenv(char *name, size_t name_len)
{
/* if fpm has started, use fcgi env */
if (fpm_is_running) {
@@ -549,7 +549,7 @@ static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC)
return getenv(name);
}
-static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC)
+static char *_sapi_cgibin_putenv(char *name, char *value)
{
int name_len;
@@ -562,12 +562,12 @@ static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC)
return fcgi_putenv(request, name, name_len, value);
}
-static char *sapi_cgi_read_cookies(TSRMLS_D)
+static char *sapi_cgi_read_cookies(void)
{
- return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE") - 1 TSRMLS_CC);
+ return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE") - 1);
}
-void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
+void cgi_php_import_environment_variables(zval *array_ptr)
{
fcgi_request *request;
zend_string *var;
@@ -591,7 +591,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
}
/* call php's original import as a catch-all */
- php_php_import_environment_variables(array_ptr TSRMLS_CC);
+ php_php_import_environment_variables(array_ptr);
request = (fcgi_request*) SG(server_context);
filter_arg = Z_ARR_P(array_ptr) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])
@@ -600,13 +600,13 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(request->env, var, val) {
size_t new_val_len;
- if (var && sapi_module.input_filter(filter_arg, var->val, &val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var->val, val, new_val_len, array_ptr TSRMLS_CC);
+ if (var && sapi_module.input_filter(filter_arg, var->val, &val, strlen(val), &new_val_len)) {
+ php_register_variable_safe(var->val, val, new_val_len, array_ptr);
}
} ZEND_HASH_FOREACH_END();
}
-static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_cgi_register_variables(zval *track_vars_array)
{
size_t php_self_len;
char *php_self;
@@ -614,12 +614,12 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
/* In CGI mode, we consider the environment to be a part of the server
* variables
*/
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
if (CGIG(fix_pathinfo)) {
char *script_name = SG(request_info).request_uri;
unsigned int script_name_len = script_name ? strlen(script_name) : 0;
- char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1 TSRMLS_CC);
+ char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1);
unsigned int path_info_len = path_info ? strlen(path_info) : 0;
php_self_len = script_name_len + path_info_len;
@@ -634,15 +634,15 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
}
/* Build the special-case PHP_SELF variable for the CGI version */
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) {
+ php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array);
}
efree(php_self);
} else {
php_self = SG(request_info).request_uri ? SG(request_info).request_uri : "";
php_self_len = strlen(php_self);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) {
+ php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array);
}
}
}
@@ -653,7 +653,6 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
*/
void sapi_cgi_log_fastcgi(int level, char *message, size_t len)
{
- TSRMLS_FETCH();
fcgi_request *request = (fcgi_request*) SG(server_context);
@@ -682,10 +681,10 @@ static void sapi_cgi_log_message(char *message)
/* {{{ php_cgi_ini_activate_user_config
*/
-static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start TSRMLS_DC)
+static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start)
{
char *ptr;
- time_t request_time = sapi_get_request_time(TSRMLS_C);
+ time_t request_time = sapi_get_request_time();
user_config_cache_entry *entry = zend_hash_str_find_ptr(&CGIG(user_config_cache), path, path_len);
/* Find cached config entry: If not found, create one */
@@ -708,7 +707,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
zend_hash_clean(entry->user_config);
if (!IS_ABSOLUTE_PATH(path, path_len)) {
- real_path = tsrm_realpath(path, NULL TSRMLS_CC);
+ real_path = tsrm_realpath(path, NULL);
if (real_path == NULL) {
return;
}
@@ -739,23 +738,23 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
ptr = s2 + start; /* start is the point where doc_root ends! */
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
*ptr = 0;
- php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
+ php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
*ptr = '/';
ptr++;
}
} else {
- php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
+ php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
}
entry->expires = request_time + PG(user_ini_cache_ttl);
}
/* Activate ini entries with values from the user config hash */
- php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS TSRMLS_CC);
+ php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS);
}
/* }}} */
-static int sapi_cgi_activate(TSRMLS_D)
+static int sapi_cgi_activate(void)
{
char *path, *doc_root, *server_name;
uint path_len, doc_root_len, server_name_len;
@@ -767,13 +766,13 @@ static int sapi_cgi_activate(TSRMLS_D)
if (php_ini_has_per_host_config()) {
/* Activate per-host-system-configuration defined in php.ini and stored into configuration_hash during startup */
- server_name = sapi_cgibin_getenv("SERVER_NAME", sizeof("SERVER_NAME") - 1 TSRMLS_CC);
+ server_name = sapi_cgibin_getenv("SERVER_NAME", sizeof("SERVER_NAME") - 1);
/* SERVER_NAME should also be defined at this stage..but better check it anyway */
if (server_name) {
server_name_len = strlen(server_name);
server_name = estrndup(server_name, server_name_len);
zend_str_tolower(server_name, server_name_len);
- php_ini_activate_per_host_config(server_name, server_name_len TSRMLS_CC);
+ php_ini_activate_per_host_config(server_name, server_name_len);
efree(server_name);
}
}
@@ -797,11 +796,11 @@ static int sapi_cgi_activate(TSRMLS_D)
path[path_len] = 0;
/* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */
- php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */
+ php_ini_activate_per_dir_config(path, path_len); /* Note: for global settings sake we check from root to path */
/* Load and activate user ini files in path starting from DOCUMENT_ROOT */
if (PG(user_ini_filename) && *PG(user_ini_filename)) {
- doc_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1 TSRMLS_CC);
+ doc_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1);
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) {
doc_root_len = strlen(doc_root);
@@ -813,7 +812,7 @@ static int sapi_cgi_activate(TSRMLS_D)
doc_root = estrndup(doc_root, doc_root_len);
zend_str_tolower(doc_root, doc_root_len);
#endif
- php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC);
+ php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1);
}
}
@@ -826,7 +825,7 @@ static int sapi_cgi_activate(TSRMLS_D)
return SUCCESS;
}
-static int sapi_cgi_deactivate(TSRMLS_D)
+static int sapi_cgi_deactivate(void)
{
/* flush only when SAPI was started. The reasons are:
1. SAPI Deactivate is called from two places: module init and request shutdown
@@ -1039,10 +1038,10 @@ static int is_valid_path(const char *path)
Comments in the code below refer to using the above URL in a request
*/
-static void init_request_info(TSRMLS_D)
+static void init_request_info(void)
{
- char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME") - 1 TSRMLS_CC);
- char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED") - 1 TSRMLS_CC);
+ char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME") - 1);
+ char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED") - 1);
char *script_path_translated = env_script_filename;
char *ini;
int apache_was_here = 0;
@@ -1070,25 +1069,25 @@ static void init_request_info(TSRMLS_D)
* of the script will be retreived later via argc/argv */
if (script_path_translated) {
const char *auth;
- char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH") - 1 TSRMLS_CC);
- char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE") - 1 TSRMLS_CC);
- char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1 TSRMLS_CC);
- char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME") - 1 TSRMLS_CC);
+ char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH") - 1);
+ char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE") - 1);
+ char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1);
+ char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME") - 1);
/* Hack for buggy IIS that sets incorrect PATH_INFO */
- char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE") - 1 TSRMLS_CC);
+ char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE") - 1);
if (env_server_software &&
env_script_name &&
env_path_info &&
strncmp(env_server_software, "Microsoft-IIS", sizeof("Microsoft-IIS") - 1) == 0 &&
strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0
) {
- env_path_info = _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info TSRMLS_CC);
+ env_path_info = _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info);
env_path_info += strlen(env_script_name);
if (*env_path_info == 0) {
env_path_info = NULL;
}
- env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info TSRMLS_CC);
+ env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info);
}
#define APACHE_PROXY_FCGI_PREFIX "proxy:fcgi://"
@@ -1123,8 +1122,8 @@ static void init_request_info(TSRMLS_D)
if (CGIG(fix_pathinfo)) {
struct stat st;
char *real_path = NULL;
- char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL") - 1 TSRMLS_CC);
- char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1 TSRMLS_CC);
+ char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL") - 1);
+ char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1);
char *orig_path_translated = env_path_translated;
char *orig_path_info = env_path_info;
char *orig_script_name = env_script_name;
@@ -1132,7 +1131,7 @@ static void init_request_info(TSRMLS_D)
int script_path_translated_len;
if (!env_document_root && PG(doc_root)) {
- env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root) TSRMLS_CC);
+ env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root));
/* fix docroot */
TRANSLATE_SLASHES(env_document_root);
}
@@ -1170,7 +1169,7 @@ static void init_request_info(TSRMLS_D)
#ifdef PHP_WIN32
script_path_translated[script_path_translated_len-1] == '\\' ||
#endif
- (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)
+ (real_path = tsrm_realpath(script_path_translated, NULL)) == NULL)
) {
char *pt = estrndup(script_path_translated, script_path_translated_len);
int len = script_path_translated_len;
@@ -1213,15 +1212,15 @@ static void init_request_info(TSRMLS_D)
if (orig_path_info) {
char old;
- _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info);
old = path_info[0];
path_info[0] = 0;
if (!orig_script_name ||
strcmp(orig_script_name, env_path_info) != 0) {
if (orig_script_name) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name);
}
- SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_path_info TSRMLS_CC);
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_path_info);
} else {
SG(request_info).request_uri = orig_script_name;
}
@@ -1233,19 +1232,19 @@ static void init_request_info(TSRMLS_D)
*/
int snlen = strlen(env_script_name);
if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name);
env_script_name[snlen-slen] = 0;
- SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name);
}
}
- env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
+ env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info);
}
if (!orig_script_filename ||
strcmp(orig_script_filename, pt) != 0) {
if (orig_script_filename) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename);
}
- script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt TSRMLS_CC);
+ script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt);
}
TRANSLATE_SLASHES(pt);
@@ -1275,9 +1274,9 @@ static void init_request_info(TSRMLS_D)
}
path_translated[path_translated_len] = '\0';
if (orig_path_translated) {
- _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated);
}
- env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC);
+ env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated);
efree(path_translated);
} else if ( env_script_name &&
strstr(pt, env_script_name)
@@ -1294,9 +1293,9 @@ static void init_request_info(TSRMLS_D)
}
path_translated[path_translated_len] = '\0';
if (orig_path_translated) {
- _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated);
}
- env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC);
+ env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated);
efree(path_translated);
}
break;
@@ -1312,18 +1311,18 @@ static void init_request_info(TSRMLS_D)
* have failed anyway... we output 'no input file' now.
*/
if (orig_script_filename) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename);
}
- script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL TSRMLS_CC);
+ script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL);
SG(sapi_headers).http_response_code = 404;
}
if (!SG(request_info).request_uri) {
if (!orig_script_name ||
strcmp(orig_script_name, env_script_name) != 0) {
if (orig_script_name) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name);
}
- SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name);
} else {
SG(request_info).request_uri = orig_script_name;
}
@@ -1337,27 +1336,27 @@ static void init_request_info(TSRMLS_D)
(script_path_translated != orig_script_filename &&
strcmp(script_path_translated, orig_script_filename) != 0)) {
if (orig_script_filename) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename);
}
- script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
+ script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated);
}
if (!apache_was_here && env_redirect_url) {
/* if we used PATH_TRANSLATED to work around Apache mod_fastcgi (but not mod_proxy_fcgi,
* hence !apache_was_here) weirdness, strip info accordingly */
if (orig_path_info) {
- _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
- _sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info);
+ _sapi_cgibin_putenv("PATH_INFO", NULL);
}
if (orig_path_translated) {
- _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
- _sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated);
+ _sapi_cgibin_putenv("PATH_TRANSLATED", NULL);
}
}
if (env_script_name != orig_script_name) {
if (orig_script_name) {
- _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name);
}
- SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name);
} else {
SG(request_info).request_uri = env_script_name;
}
@@ -1379,39 +1378,39 @@ static void init_request_info(TSRMLS_D)
SG(request_info).path_translated = estrdup(script_path_translated);
}
- SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD") - 1 TSRMLS_CC);
+ SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD") - 1);
/* FIXME - Work out proto_num here */
- SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1 TSRMLS_CC);
+ SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1);
SG(request_info).content_type = (content_type ? content_type : "" );
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
- auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1 TSRMLS_CC);
- php_handle_auth_data(auth TSRMLS_CC);
+ auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1);
+ php_handle_auth_data(auth);
}
/* INI stuff */
- ini = sapi_cgibin_getenv("PHP_VALUE", sizeof("PHP_VALUE") - 1 TSRMLS_CC);
+ ini = sapi_cgibin_getenv("PHP_VALUE", sizeof("PHP_VALUE") - 1);
if (ini) {
int mode = ZEND_INI_USER;
char *tmp;
spprintf(&tmp, 0, "%s\n", ini);
- zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
+ zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode);
efree(tmp);
}
- ini = sapi_cgibin_getenv("PHP_ADMIN_VALUE", sizeof("PHP_ADMIN_VALUE") - 1 TSRMLS_CC);
+ ini = sapi_cgibin_getenv("PHP_ADMIN_VALUE", sizeof("PHP_ADMIN_VALUE") - 1);
if (ini) {
int mode = ZEND_INI_SYSTEM;
char *tmp;
spprintf(&tmp, 0, "%s\n", ini);
- zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
+ zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode);
efree(tmp);
}
}
/* }}} */
-static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
+static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */
{
int *mode = (int *)arg;
char *key;
@@ -1464,7 +1463,7 @@ PHP_INI_END()
/* {{{ php_cgi_globals_ctor
*/
-static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC)
+static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals)
{
php_cgi_globals->rfc2616_headers = 0;
php_cgi_globals->nph = 0;
@@ -1486,7 +1485,7 @@ static PHP_MINIT_FUNCTION(cgi)
#ifdef ZTS
ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
#else
- php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC);
+ php_cgi_globals_ctor(&php_cgi_globals);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
@@ -1522,8 +1521,8 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
if (request->fd >= 0) {
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
fcgi_flush(request, 1);
fcgi_close(request, 0, 0);
@@ -1680,15 +1679,15 @@ int main(int argc, char *argv[])
case 'm': /* list compiled in modules */
cgi_sapi_module.startup(&cgi_sapi_module);
- php_output_activate(TSRMLS_C);
+ php_output_activate();
SG(headers_sent) = 1;
php_printf("[PHP Modules]\n");
- print_modules(TSRMLS_C);
+ print_modules();
php_printf("\n[Zend Modules]\n");
- print_extensions(TSRMLS_C);
+ print_extensions();
php_printf("\n");
- php_output_end_all(TSRMLS_C);
- php_output_deactivate(TSRMLS_C);
+ php_output_end_all();
+ php_output_deactivate();
fcgi_shutdown();
exit_status = FPM_EXIT_OK;
goto out;
@@ -1717,20 +1716,20 @@ int main(int argc, char *argv[])
case 'h':
case '?':
cgi_sapi_module.startup(&cgi_sapi_module);
- php_output_activate(TSRMLS_C);
+ php_output_activate();
SG(headers_sent) = 1;
php_cgi_usage(argv[0]);
- php_output_end_all(TSRMLS_C);
- php_output_deactivate(TSRMLS_C);
+ php_output_end_all();
+ php_output_deactivate();
fcgi_shutdown();
exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE;
goto out;
case 'v': /* show php version & quit */
cgi_sapi_module.startup(&cgi_sapi_module);
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FPM_EXIT_SOFTWARE;
}
SG(headers_sent) = 1;
@@ -1751,14 +1750,14 @@ int main(int argc, char *argv[])
if (php_information) {
cgi_sapi_module.phpinfo_as_text = 1;
cgi_sapi_module.startup(&cgi_sapi_module);
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FPM_EXIT_SOFTWARE;
}
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
- php_print_info(0xFFFFFFFF TSRMLS_CC);
+ php_print_info(0xFFFFFFFF);
php_request_shutdown((void *) 0);
fcgi_shutdown();
exit_status = FPM_EXIT_OK;
@@ -1768,11 +1767,11 @@ int main(int argc, char *argv[])
/* No other args are permitted here as there is no interactive mode */
if (argc != php_optind) {
cgi_sapi_module.startup(&cgi_sapi_module);
- php_output_activate(TSRMLS_C);
+ php_output_activate();
SG(headers_sent) = 1;
php_cgi_usage(argv[0]);
- php_output_end_all(TSRMLS_C);
- php_output_deactivate(TSRMLS_C);
+ php_output_end_all();
+ php_output_deactivate();
fcgi_shutdown();
exit_status = FPM_EXIT_USAGE;
goto out;
@@ -1876,17 +1875,17 @@ consult the installation file that came with this distribution, or visit \n\
while (fcgi_accept_request(&request) >= 0) {
request_body_fd = -1;
SG(server_context) = (void *) &request;
- init_request_info(TSRMLS_C);
+ init_request_info();
char *primary_script = NULL;
fpm_request_info();
/* request startup only after we've done all we can to
* get path_translated */
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
fcgi_finish_request(&request, 1);
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
return FPM_EXIT_SOFTWARE;
}
@@ -1896,7 +1895,7 @@ consult the installation file that came with this distribution, or visit \n\
goto fastcgi_request_done;
}
- if (fpm_status_handle_request(TSRMLS_C)) {
+ if (fpm_status_handle_request()) {
goto fastcgi_request_done;
}
@@ -1924,7 +1923,7 @@ consult the installation file that came with this distribution, or visit \n\
primary_script = estrdup(SG(request_info).path_translated);
/* path_translated exists, we can continue ! */
- if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) {
+ if (php_fopen_primary_script(&file_handle) == FAILURE) {
zend_try {
zlog(ZLOG_ERROR, "Unable to open primary script: %s (%s)", primary_script, strerror(errno));
if (errno == EACCES) {
@@ -1945,7 +1944,7 @@ consult the installation file that came with this distribution, or visit \n\
fpm_request_executing();
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
fastcgi_request_done:
if (primary_script) {
@@ -1963,12 +1962,12 @@ fastcgi_request_done:
ctr.line = CGIG(error_header);
ctr.line_len = strlen(CGIG(error_header));
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
}
- fpm_request_end(TSRMLS_C);
- fpm_log_write(NULL TSRMLS_CC);
+ fpm_request_end();
+ fpm_log_write(NULL);
efree(SG(request_info).path_translated);
SG(request_info).path_translated = NULL;
@@ -1997,7 +1996,7 @@ fastcgi_request_done:
out:
SG(server_context) = NULL;
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
if (parent) {
sapi_shutdown();
diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c
index e0de217c00..0910e2a030 100644
--- a/sapi/fpm/fpm/fpm_php.c
+++ b/sapi/fpm/fpm/fpm_php.c
@@ -23,7 +23,7 @@
static char **limit_extensions = NULL;
-static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */
+static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage) /* {{{ */
{
zend_ini_entry *ini_entry;
zend_string *duplicate;
@@ -36,7 +36,7 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_
if (!ini_entry->on_modify
|| ini_entry->on_modify(ini_entry, duplicate,
- ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
+ ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) {
ini_entry->value = duplicate;
ini_entry->modifiable = mode;
} else {
@@ -47,7 +47,7 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_
}
/* }}} */
-static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC) /* {{{ */
+static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint)) /* {{{ */
{
char *s = 0, *e = value;
@@ -57,7 +57,7 @@ static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS
case ',':
if (s) {
*e = '\0';
- zend_disable(s, e - s TSRMLS_CC);
+ zend_disable(s, e - s);
s = 0;
}
break;
@@ -71,14 +71,13 @@ static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS
}
if (s) {
- zend_disable(s, e - s TSRMLS_CC);
+ zend_disable(s, e - s);
}
}
/* }}} */
int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */
{
- TSRMLS_FETCH();
char *name = kv->key;
char *value = kv->value;
@@ -87,25 +86,25 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */
if (!strcmp(name, "extension") && *value) {
zval zv;
- php_dl(value, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
+ php_dl(value, MODULE_PERSISTENT, &zv, 1);
return Z_TYPE(zv) == IS_TRUE;
}
- if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE TSRMLS_CC) == FAILURE) {
+ if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
return -1;
}
if (!strcmp(name, "disable_functions") && *value) {
char *v = strdup(value);
PG(disable_functions) = v;
- fpm_php_disable(v, zend_disable_function TSRMLS_CC);
+ fpm_php_disable(v, zend_disable_function);
return 1;
}
if (!strcmp(name, "disable_classes") && *value) {
char *v = strdup(value);
PG(disable_classes) = v;
- fpm_php_disable(v, zend_disable_class TSRMLS_CC);
+ fpm_php_disable(v, zend_disable_class);
return 1;
}
@@ -156,37 +155,37 @@ static int fpm_php_set_fcgi_mgmt_vars(struct fpm_worker_pool_s *wp) /* {{{ */
/* }}} */
#endif
-char *fpm_php_script_filename(TSRMLS_D) /* {{{ */
+char *fpm_php_script_filename(void) /* {{{ */
{
return SG(request_info).path_translated;
}
/* }}} */
-char *fpm_php_request_uri(TSRMLS_D) /* {{{ */
+char *fpm_php_request_uri(void) /* {{{ */
{
return (char *) SG(request_info).request_uri;
}
/* }}} */
-char *fpm_php_request_method(TSRMLS_D) /* {{{ */
+char *fpm_php_request_method(void) /* {{{ */
{
return (char *) SG(request_info).request_method;
}
/* }}} */
-char *fpm_php_query_string(TSRMLS_D) /* {{{ */
+char *fpm_php_query_string(void) /* {{{ */
{
return SG(request_info).query_string;
}
/* }}} */
-char *fpm_php_auth_user(TSRMLS_D) /* {{{ */
+char *fpm_php_auth_user(void) /* {{{ */
{
return SG(request_info).auth_user;
}
/* }}} */
-size_t fpm_php_content_length(TSRMLS_D) /* {{{ */
+size_t fpm_php_content_length(void) /* {{{ */
{
return SG(request_info).content_length;
}
@@ -194,8 +193,7 @@ size_t fpm_php_content_length(TSRMLS_D) /* {{{ */
static void fpm_php_cleanup(int which, void *arg) /* {{{ */
{
- TSRMLS_FETCH();
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
sapi_shutdown();
}
/* }}} */
@@ -257,7 +255,7 @@ int fpm_php_limit_extensions(char *path) /* {{{ */
}
/* }}} */
-char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC) /* {{{ */
+char* fpm_php_get_string_from_table(zend_string *table, char *key) /* {{{ */
{
zval *data, *tmp;
zend_string *str;
@@ -267,7 +265,7 @@ char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC) /*
/* inspired from ext/standard/info.c */
- zend_is_auto_global(table TSRMLS_CC);
+ zend_is_auto_global(table);
/* find the table and ensure it's an array */
data = zend_hash_find(&EG(symbol_table).ht, table);
diff --git a/sapi/fpm/fpm/fpm_php.h b/sapi/fpm/fpm/fpm_php.h
index 20f5a9454b..a2f2138d23 100644
--- a/sapi/fpm/fpm/fpm_php.h
+++ b/sapi/fpm/fpm/fpm_php.h
@@ -34,17 +34,17 @@
struct fpm_worker_pool_s;
int fpm_php_init_child(struct fpm_worker_pool_s *wp);
-char *fpm_php_script_filename(TSRMLS_D);
-char *fpm_php_request_uri(TSRMLS_D);
-char *fpm_php_request_method(TSRMLS_D);
-char *fpm_php_query_string(TSRMLS_D);
-char *fpm_php_auth_user(TSRMLS_D);
-size_t fpm_php_content_length(TSRMLS_D);
+char *fpm_php_script_filename(void);
+char *fpm_php_request_uri(void);
+char *fpm_php_request_method(void);
+char *fpm_php_query_string(void);
+char *fpm_php_auth_user(void);
+size_t fpm_php_content_length(void);
void fpm_php_soft_quit();
int fpm_php_init_main();
int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode);
int fpm_php_limit_extensions(char *path);
-char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC);
+char* fpm_php_get_string_from_table(zend_string *table, char *key);
#endif
diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c
index d5b4242fc3..91394a0b47 100644
--- a/sapi/fpm/fpm/fpm_php_trace.c
+++ b/sapi/fpm/fpm/fpm_php_trace.c
@@ -40,7 +40,7 @@
#endif
-static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC) /* {{{ */
+static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ */
{
// TODO: fpm_php_trace_dump() has to be reimplemented ???
#if 0
@@ -140,7 +140,6 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC
void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
{
- TSRMLS_FETCH();
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard);
FILE *slowlog;
@@ -157,7 +156,7 @@ void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
goto done1;
}
- if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) {
+ if (0 > fpm_php_trace_dump(child, slowlog)) {
fprintf(slowlog, "+++ dump failed\n");
}
diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c
index bf431a08d0..6335559b48 100644
--- a/sapi/fpm/fpm/fpm_request.c
+++ b/sapi/fpm/fpm/fpm_request.c
@@ -104,14 +104,13 @@ void fpm_request_reading_headers() /* {{{ */
void fpm_request_info() /* {{{ */
{
- TSRMLS_FETCH();
struct fpm_scoreboard_proc_s *proc;
- char *request_uri = fpm_php_request_uri(TSRMLS_C);
- char *request_method = fpm_php_request_method(TSRMLS_C);
- char *script_filename = fpm_php_script_filename(TSRMLS_C);
- char *query_string = fpm_php_query_string(TSRMLS_C);
- char *auth_user = fpm_php_auth_user(TSRMLS_C);
- size_t content_length = fpm_php_content_length(TSRMLS_C);
+ char *request_uri = fpm_php_request_uri();
+ char *request_method = fpm_php_request_method();
+ char *script_filename = fpm_php_script_filename();
+ char *query_string = fpm_php_query_string();
+ char *auth_user = fpm_php_auth_user();
+ size_t content_length = fpm_php_content_length();
struct timeval now;
fpm_clock_get(&now);
@@ -172,14 +171,14 @@ void fpm_request_executing() /* {{{ */
}
/* }}} */
-void fpm_request_end(TSRMLS_D) /* {{{ */
+void fpm_request_end(void) /* {{{ */
{
struct fpm_scoreboard_proc_s *proc;
struct timeval now;
#ifdef HAVE_TIMES
struct tms cpu;
#endif
- size_t memory = zend_memory_peak_usage(1 TSRMLS_CC);
+ size_t memory = zend_memory_peak_usage(1);
fpm_clock_get(&now);
#ifdef HAVE_TIMES
diff --git a/sapi/fpm/fpm/fpm_request.h b/sapi/fpm/fpm/fpm_request.h
index aebd36cff4..d9e831d100 100644
--- a/sapi/fpm/fpm/fpm_request.h
+++ b/sapi/fpm/fpm/fpm_request.h
@@ -9,7 +9,7 @@ void fpm_request_accepting(); /* hanging in accept() */
void fpm_request_reading_headers(); /* start reading fastcgi request from very first byte */
void fpm_request_info(); /* not a stage really but a point in the php code, where all request params have become known to sapi */
void fpm_request_executing(); /* the script is executing */
-void fpm_request_end(TSRMLS_D); /* request ended: script response have been sent to web server */
+void fpm_request_end(void); /* request ended: script response have been sent to web server */
void fpm_request_finished(); /* request processed: cleaning current request */
struct fpm_child_s;
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index fa3fc763a5..9d8b8fcc7c 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -46,7 +46,7 @@ int fpm_status_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
}
/* }}} */
-int fpm_status_handle_request(TSRMLS_D) /* {{{ */
+int fpm_status_handle_request(void) /* {{{ */
{
struct fpm_scoreboard_s scoreboard, *scoreboard_p;
struct fpm_scoreboard_proc_s proc;
@@ -64,9 +64,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
/* PING */
if (fpm_status_ping_uri && fpm_status_ping_response && !strcmp(fpm_status_ping_uri, SG(request_info).request_uri)) {
fpm_request_executing();
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1);
SG(sapi_headers).http_response_code = 200;
/* handle HEAD */
@@ -86,9 +86,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
if (!scoreboard_p) {
zlog(ZLOG_ERROR, "status: unable to find or access status shared memory");
SG(sapi_headers).http_response_code = 500;
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1);
PUTS("Internal error. Please review log file for errors.");
return 1;
}
@@ -96,9 +96,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
if (!fpm_spinlock(&scoreboard_p->lock, 1)) {
zlog(ZLOG_NOTICE, "[pool %s] status: scoreboard already in used.", scoreboard_p->pool);
SG(sapi_headers).http_response_code = 503;
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1);
PUTS("Server busy. Please try again later.");
return 1;
}
@@ -109,16 +109,16 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
if (scoreboard.idle < 0 || scoreboard.active < 0) {
zlog(ZLOG_ERROR, "[pool %s] invalid status values", scoreboard.pool);
SG(sapi_headers).http_response_code = 500;
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1);
PUTS("Internal error. Please review log file for errors.");
return 1;
}
/* send common headers */
- sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC);
- sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1);
+ sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1);
SG(sapi_headers).http_response_code = 200;
/* handle HEAD */
@@ -128,14 +128,14 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
/* full status ? */
_GET_str = zend_string_init("_GET", sizeof("_GET")-1, 0);
- full = (fpm_php_get_string_from_table(_GET_str, "full" TSRMLS_CC) != NULL);
+ full = (fpm_php_get_string_from_table(_GET_str, "full") != NULL);
short_syntax = short_post = NULL;
full_separator = full_pre = full_syntax = full_post = NULL;
encode = 0;
/* HTML */
- if (fpm_php_get_string_from_table(_GET_str, "html" TSRMLS_CC)) {
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC);
+ if (fpm_php_get_string_from_table(_GET_str, "html")) {
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1);
time_format = "%d/%b/%Y:%H:%M:%S %z";
encode = 1;
@@ -209,8 +209,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
}
/* XML */
- } else if (fpm_php_get_string_from_table(_GET_str, "xml" TSRMLS_CC)) {
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC);
+ } else if (fpm_php_get_string_from_table(_GET_str, "xml")) {
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1);
time_format = "%s";
encode = 1;
@@ -261,8 +261,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
}
/* JSON */
- } else if (fpm_php_get_string_from_table(_GET_str, "json" TSRMLS_CC)) {
- sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC);
+ } else if (fpm_php_get_string_from_table(_GET_str, "json")) {
+ sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1);
time_format = "%s";
short_syntax =
@@ -313,7 +313,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
/* TEXT */
} else {
- sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1);
time_format = "%d/%b/%Y:%H:%M:%S %z";
short_syntax =
@@ -421,7 +421,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
if (!encode) {
query_string = proc.query_string;
} else {
- tmp_query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1 TSRMLS_CC);
+ tmp_query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1);
query_string = tmp_query_string->val;
}
}
diff --git a/sapi/fpm/fpm/fpm_status.h b/sapi/fpm/fpm/fpm_status.h
index 8f3daf9c72..c6c27cd031 100644
--- a/sapi/fpm/fpm/fpm_status.h
+++ b/sapi/fpm/fpm/fpm_status.h
@@ -28,7 +28,7 @@ void fpm_status_increment_accepted_conn(struct fpm_shm_s *shm);
void fpm_status_set_pm(struct fpm_shm_s *shm, int pm);
void fpm_status_update_max_children_reached(struct fpm_shm_s *shm, unsigned int max_children_reached);
void fpm_status_increment_max_children_reached(struct fpm_shm_s *shm);
-int fpm_status_handle_request(TSRMLS_D);
+int fpm_status_handle_request(void);
extern struct fpm_shm_s *fpm_status_shm;
diff --git a/sapi/isapi/php7isapi.c b/sapi/isapi/php7isapi.c
index 27eb1c9353..fc97af9c34 100644
--- a/sapi/isapi/php7isapi.c
+++ b/sapi/isapi/php7isapi.c
@@ -202,7 +202,7 @@ static zend_module_entry php_isapi_module = {
};
-static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_isapi_ub_write(const char *str, uint str_length)
{
DWORD num_bytes = str_length;
LPEXTENSION_CONTROL_BLOCK ecb;
@@ -215,20 +215,20 @@ static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC)
}
-static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
return SAPI_HEADER_ADD;
}
-static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC)
+static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length)
{
*total_length += sapi_header->header_len+2;
}
-static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC)
+static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr)
{
memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len);
*combined_headers_ptr += sapi_header->header_len;
@@ -239,7 +239,7 @@ static void concat_header(sapi_header_struct *sapi_header, char **combined_heade
}
-static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers)
{
uint total_length = 2; /* account for the trailing \r\n */
char *combined_headers, *combined_headers_ptr;
@@ -250,19 +250,19 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* Obtain headers length */
if (SG(sapi_headers).send_default_content_type) {
- sapi_get_default_content_type_header(&default_content_type TSRMLS_CC);
- accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC);
+ sapi_get_default_content_type_header(&default_content_type);
+ accumulate_header_length(&default_content_type, (void *) &total_length);
}
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length);
/* Generate headers */
combined_headers = (char *) emalloc(total_length+1);
combined_headers_ptr = combined_headers;
if (SG(sapi_headers).send_default_content_type) {
- concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC);
+ concat_header(&default_content_type, (void *) &combined_headers_ptr);
sapi_free_header(&default_content_type); /* we no longer need it */
}
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr);
*combined_headers_ptr++ = '\r';
*combined_headers_ptr++ = '\n';
*combined_headers_ptr = 0;
@@ -324,7 +324,7 @@ static int php_isapi_startup(sapi_module_struct *sapi_module)
}
-static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_isapi_read_post(char *buffer, uint count_bytes)
{
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
DWORD read_from_buf=0;
@@ -354,7 +354,7 @@ static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
}
-static char *sapi_isapi_read_cookies(TSRMLS_D)
+static char *sapi_isapi_read_cookies(void)
{
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
@@ -378,7 +378,7 @@ static char *sapi_isapi_read_cookies(TSRMLS_D)
#ifdef WITH_ZEUS
-static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC)
+static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array)
{
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -396,7 +396,7 @@ static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpE
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE );
}
- php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array );
strcpy( static_cons_buf, "/C=" );
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -408,10 +408,10 @@ static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpE
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE );
}
- php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array );
}
-static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC)
+static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array)
{
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -430,11 +430,11 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB,
if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
/* PHP_SELF is just PATH_INFO */
- php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array );
/* Chop off filename to get just the 'real' PATH_INFO' */
pathinfo_len = variable_len - scriptname_len;
- php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array TSRMLS_CC );
+ php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array );
/* append query string to give url... extra byte for '?' */
if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) {
/* append query string only if it is present... */
@@ -442,8 +442,8 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB,
static_variable_buf[ variable_len - 1 ] = '?';
strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString );
}
- php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC );
- php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "URL", static_variable_buf, track_vars_array );
+ php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array );
}
}
@@ -451,37 +451,37 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB,
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
static_variable_buf[ variable_len - pathinfo_len - 1 ] = '\0';
- php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array );
}
/* Bring in the AUTHENTICATION stuff as needed */
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_USER", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array );
}
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_PASSWORD", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array );
}
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_TYPE", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array );
}
/* And now, for the SSL variables (if applicable) */
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "CERT_COOKIE", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array TSRMLS_CC );
+ sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array );
}
/* Copy some of the variables we need to meet Apache specs */
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "SERVER_SOFTWARE", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array );
}
}
#else
-static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC)
+static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array)
{
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
char path_info_buf[ISAPI_SERVER_VAR_BUF_SIZE];
@@ -494,7 +494,7 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
* belongs in PHP's version of PATH_INFO. SCRIPT_NAME also becomes PHP_SELF.
*/
lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len);
- php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC);
+ php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array);
/* Adjust IIS' version of PATH_INFO, set PHP_SELF,
* and generate REQUEST_URI
@@ -503,10 +503,10 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
/* Chop off filename to get just the 'real' PATH_INFO' */
- php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array );
pathinfo_len = variable_len - scriptname_len;
strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf)-1);
- php_register_variable( "PATH_INFO", path_info_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "PATH_INFO", path_info_buf, track_vars_array );
/* append query string to give url... extra byte for '?' */
if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) {
/* append query string only if it is present... */
@@ -514,19 +514,19 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
static_variable_buf[ variable_len - 1 ] = '?';
strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString );
}
- php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC );
- php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "URL", static_variable_buf, track_vars_array );
+ php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array );
}
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) {
- php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC );
+ php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array );
}
if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, path_info_buf, &pathinfo_len, (LPDWORD) &humi)) {
/* Remove trailing \ */
if (humi.lpszPath[variable_len-2] == '\\') {
humi.lpszPath[variable_len-2] = 0;
}
- php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array);
}
}
@@ -538,7 +538,7 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
if (humi.lpszPath[variable_len-2] == '\\') {
humi.lpszPath[variable_len-2] = 0;
}
- php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC);
+ php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array);
}
if (!SG(request_info).auth_user || !SG(request_info).auth_password ||
@@ -546,20 +546,20 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_AUTHORIZATION", static_variable_buf, &variable_len)
&& static_variable_buf[0]) {
- php_handle_auth_data(static_variable_buf TSRMLS_CC);
+ php_handle_auth_data(static_variable_buf);
}
}
if (SG(request_info).auth_user) {
- php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array TSRMLS_CC );
+ php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array );
}
if (SG(request_info).auth_password) {
- php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array TSRMLS_CC );
+ php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array );
}
}
#endif
-static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values TSRMLS_DC)
+static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values)
{
char **p=server_variables;
DWORD variable_len;
@@ -570,7 +570,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if (lpECB->GetServerVariable(lpECB->ConnID, *p, static_variable_buf, &variable_len)
&& static_variable_buf[0]) {
- php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC);
+ php_register_variable(*p, static_variable_buf, track_vars_array);
if (recorded_values) {
recorded_values[p-server_variables] = estrndup(static_variable_buf, variable_len);
}
@@ -578,7 +578,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT
variable_buf = (char *) emalloc(variable_len+1);
if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len)
&& variable_buf[0]) {
- php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC);
+ php_register_variable(*p, variable_buf, track_vars_array);
}
if (recorded_values) {
recorded_values[p-server_variables] = variable_buf;
@@ -586,14 +586,14 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT
efree(variable_buf);
}
} else { /* for compatibility with Apache SAPIs */
- php_register_variable(*p, "", track_vars_array TSRMLS_CC);
+ php_register_variable(*p, "", track_vars_array);
}
p++;
}
}
-static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_isapi_register_server_variables(zval *track_vars_array)
{
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
char *variable;
@@ -605,20 +605,20 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D
/* Register the special ISAPI variables */
memset(isapi_special_server_variables, 0, sizeof(isapi_special_server_variables));
- sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables TSRMLS_CC);
+ sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables);
if (SG(request_info).cookie_data) {
- php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array TSRMLS_CC);
+ php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array);
}
/* Register the standard ISAPI variables */
- sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC);
+ sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL);
if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]
&& (atoi(isapi_special_server_variables[SPECIAL_VAR_HTTPS])
|| !strcasecmp(isapi_special_server_variables[SPECIAL_VAR_HTTPS], "on"))
) {
/* Register SSL ISAPI variables */
- sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC);
+ sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL);
}
if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]) {
@@ -627,14 +627,14 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D
#ifdef WITH_ZEUS
- sapi_isapi_register_zeus_variables(lpECB, track_vars_array TSRMLS_CC);
+ sapi_isapi_register_zeus_variables(lpECB, track_vars_array);
#else
- sapi_isapi_register_iis_variables(lpECB, track_vars_array TSRMLS_CC);
+ sapi_isapi_register_iis_variables(lpECB, track_vars_array);
#endif
/* PHP_SELF support */
if (isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]) {
- php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array);
efree(isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]);
}
@@ -651,7 +651,7 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D
value++;
}
*colon = 0;
- php_register_variable(variable, value, track_vars_array TSRMLS_CC);
+ php_register_variable(variable, value, track_vars_array);
*colon = ':';
}
variable = php_strtok_r(NULL, "\r\n", &strtok_buf);
@@ -706,7 +706,6 @@ BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pFilterVersion)
DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification)
{
- TSRMLS_FETCH();
switch (notificationType) {
case SF_NOTIFY_PREPROC_HEADERS:
@@ -732,7 +731,7 @@ DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LP
}
-static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC)
+static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB)
{
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
@@ -779,7 +778,7 @@ static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC)
}
-static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC)
+static void php_isapi_report_exception(char *message, int message_len)
{
if (!SG(headers_sent)) {
HSE_SEND_HEADER_EX_INFO header_info;
@@ -794,7 +793,7 @@ static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC)
lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL);
SG(headers_sent)=1;
}
- sapi_isapi_ub_write(message, message_len TSRMLS_CC);
+ sapi_isapi_ub_write(message, message_len);
}
@@ -838,16 +837,15 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
#ifdef PHP_ENABLE_SEH
LPEXCEPTION_POINTERS e;
#endif
- TSRMLS_FETCH();
zend_first_try {
#ifdef PHP_ENABLE_SEH
__try {
#endif
- init_request_info(lpECB TSRMLS_CC);
+ init_request_info(lpECB);
SG(server_context) = lpECB;
- php_request_startup(TSRMLS_C);
+ php_request_startup();
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
@@ -856,13 +854,13 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
/* open the script here so we can 404 if it fails */
if (file_handle.filename)
- retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
+ retval = php_fopen_primary_script(&file_handle);
if (!file_handle.filename || retval == FAILURE) {
SG(sapi_headers).http_response_code = 404;
PUTS("No input file specified.\n");
} else {
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
}
if (SG(request_info).cookie_data) {
@@ -902,14 +900,14 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
CG(unclean_shutdown)=1;
_snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow");
- php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
+ php_isapi_report_exception(buf, strlen(buf));
} else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) {
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress);
- php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
+ php_isapi_report_exception(buf, strlen(buf));
my_endthread();
} else {
_snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress);
- php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
+ php_isapi_report_exception(buf, strlen(buf));
my_endthread();
}
}
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 54b7ef9166..05e8a52afe 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -126,7 +126,7 @@ static void sapi_lsapi_ini_defaults(HashTable *configuration_hash)
/* {{{ sapi_lsapi_ub_write
*/
-static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_lsapi_ub_write(const char *str, uint str_length)
{
int ret;
int remain;
@@ -155,7 +155,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_lsapi_flush
*/
-static void sapi_lsapi_flush( void * server_context TSRMLS_DC )
+static void sapi_lsapi_flush( void * server_context )
{
if ( lsapi_mode ) {
if ( LSAPI_Flush() == -1) {
@@ -168,7 +168,7 @@ static void sapi_lsapi_flush( void * server_context TSRMLS_DC )
/* {{{ sapi_lsapi_deactivate
*/
-static int sapi_lsapi_deactivate(TSRMLS_D)
+static int sapi_lsapi_deactivate(void)
{
if ( SG(request_info).path_translated )
{
@@ -184,7 +184,7 @@ static int sapi_lsapi_deactivate(TSRMLS_D)
/* {{{ sapi_lsapi_getenv
*/
-static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC )
+static char *sapi_lsapi_getenv( char * name, size_t name_len )
{
if ( lsapi_mode ) {
return LSAPI_GetEnv( name );
@@ -209,7 +209,7 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int
char * new_val = (char *) pValue;
unsigned int new_val_len;
- if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len)) {
php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg );
}
return 1;
@@ -236,7 +236,7 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int
}
*/
-static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
+static void litespeed_php_import_environment_variables(zval *array_ptr)
{
char buf[128];
char **env, *p, *t = buf;
@@ -295,7 +295,7 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC
}
memcpy(t, *env, nlen);
t[nlen] = '\0';
- add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr TSRMLS_CC);
+ add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr);
}
if (t != buf && t != NULL) {
efree(t);
@@ -327,14 +327,14 @@ static int add_variable_magic_quote( const char * pKey, int keyLen, const char *
/* {{{ sapi_lsapi_register_variables
*/
-static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_lsapi_register_variables(zval *track_vars_array)
{
char * php_self = "";
if ( lsapi_mode ) {
if ( (SG(request_info).request_uri ) )
php_self = (SG(request_info).request_uri );
- litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC);
+ litespeed_php_import_environment_variables(track_vars_array);
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
if (!PG(magic_quotes_gpc)) {
@@ -350,13 +350,13 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
}
#endif
} else {
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
- php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC);
- php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC);
- php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC);
- php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC);
- php_register_variable("DOCUMENT_ROOT", "", track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", php_self, track_vars_array);
+ php_register_variable("SCRIPT_NAME", php_self, track_vars_array);
+ php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array);
+ php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array);
+ php_register_variable("DOCUMENT_ROOT", "", track_vars_array);
}
}
@@ -365,7 +365,7 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
/* {{{ sapi_lsapi_read_post
*/
-static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_lsapi_read_post(char *buffer, uint count_bytes)
{
if ( lsapi_mode ) {
return LSAPI_ReadReqBody( buffer, (unsigned long long)count_bytes );
@@ -380,7 +380,7 @@ static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/* {{{ sapi_lsapi_read_cookies
*/
-static char *sapi_lsapi_read_cookies(TSRMLS_D)
+static char *sapi_lsapi_read_cookies(void)
{
if ( lsapi_mode ) {
return LSAPI_GetHeader( H_COOKIE );
@@ -393,7 +393,7 @@ static char *sapi_lsapi_read_cookies(TSRMLS_D)
/* {{{ sapi_lsapi_send_headers
*/
-static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers)
{
sapi_header_struct *h;
zend_llist_position pos;
@@ -412,7 +412,7 @@ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
int len;
char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH];
- hd = sapi_get_default_content_type(TSRMLS_C);
+ hd = sapi_get_default_content_type();
len = snprintf( headerBuf, SAPI_LSAPI_MAX_HEADER_LENGTH - 1,
"Content-type: %s", hd );
efree(hd);
@@ -430,7 +430,7 @@ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* {{{ sapi_lsapi_send_headers
*/
-static void sapi_lsapi_log_message(char *message TSRMLS_DC)
+static void sapi_lsapi_log_message(char *message)
{
char buf[8192];
int len = strlen( message );
@@ -489,7 +489,7 @@ static sapi_module_struct lsapi_sapi_module =
};
/* }}} */
-static int init_request_info( TSRMLS_D )
+static int init_request_info( void )
{
char * pContentType = LSAPI_GetHeader( H_CONTENT_TYPE );
char * pAuth;
@@ -505,7 +505,7 @@ static int init_request_info( TSRMLS_D )
SG(sapi_headers).http_response_code = 200;
pAuth = LSAPI_GetHeader( H_AUTHORIZATION );
- php_handle_auth_data(pAuth TSRMLS_CC);
+ php_handle_auth_data(pAuth);
}
static char s_cur_chdir[4096] = "";
@@ -564,7 +564,7 @@ static int lsapi_fopen_primary_script( zend_file_handle * file_handle )
return 0;
}
-static int lsapi_execute_script( zend_file_handle * file_handle TSRMLS_DC)
+static int lsapi_execute_script( zend_file_handle * file_handle)
{
char *p;
int len;
@@ -583,26 +583,26 @@ static int lsapi_execute_script( zend_file_handle * file_handle TSRMLS_DC)
len = 0;
memccpy( p, SG(request_info).path_translated + len, 0, 46 );
- php_execute_script(file_handle TSRMLS_CC);
+ php_execute_script(file_handle);
return 0;
}
-static int lsapi_module_main(int show_source TSRMLS_DC)
+static int lsapi_module_main(int show_source)
{
zend_file_handle file_handle = {0};
- if (php_request_startup(TSRMLS_C) == FAILURE ) {
+ if (php_request_startup() == FAILURE ) {
return -1;
}
if (show_source) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else {
- lsapi_execute_script( &file_handle TSRMLS_CC);
+ lsapi_execute_script( &file_handle);
}
zend_try {
php_request_shutdown(NULL);
@@ -658,7 +658,7 @@ static void override_ini()
}
-static int processReq( TSRMLS_D )
+static int processReq( void )
{
int ret = 0;
zend_first_try {
@@ -670,9 +670,9 @@ static int processReq( TSRMLS_D )
override_ini();
if ( engine ) {
- init_request_info( TSRMLS_C );
+ init_request_info( );
- if ( lsapi_module_main( source_highlight TSRMLS_CC ) == -1 ) {
+ if ( lsapi_module_main( source_highlight ) == -1 ) {
ret = -1;
}
} else {
@@ -684,7 +684,7 @@ static int processReq( TSRMLS_D )
return ret;
}
-static void cli_usage( TSRMLS_D )
+static void cli_usage( void )
{
static const char * usage =
"Usage: php\n"
@@ -705,12 +705,12 @@ static void cli_usage( TSRMLS_D )
"\n"
" args... Arguments passed to script.\n";
php_output_startup();
- php_output_activate(TSRMLS_C);
+ php_output_activate();
php_printf( "%s", usage );
#ifdef PHP_OUTPUT_NEWAPI
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
#else
- php_end_ob_buffers(1 TSRMLS_CC);
+ php_end_ob_buffers(1);
#endif
}
@@ -826,28 +826,28 @@ static int cli_main( int argc, char * argv[] )
case 'q':
break;
case 'i':
- if (php_request_startup(TSRMLS_C) != FAILURE) {
- php_print_info(0xFFFFFFFF TSRMLS_CC);
+ if (php_request_startup() != FAILURE) {
+ php_print_info(0xFFFFFFFF);
#ifdef PHP_OUTPUT_NEWAPI
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
#else
- php_end_ob_buffers(1 TSRMLS_CC);
+ php_end_ob_buffers(1);
#endif
php_request_shutdown( NULL );
ret = 0;
}
break;
case 'v':
- if (php_request_startup(TSRMLS_C) != FAILURE) {
+ if (php_request_startup() != FAILURE) {
#if ZEND_DEBUG
php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#else
php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#endif
#ifdef PHP_OUTPUT_NEWAPI
- php_output_end_all(TSRMLS_C);
+ php_output_end_all();
#else
- php_end_ob_buffers(1 TSRMLS_CC);
+ php_end_ob_buffers(1);
#endif
php_request_shutdown( NULL );
ret = 0;
@@ -864,7 +864,7 @@ static int cli_main( int argc, char * argv[] )
case 'h':
case '?':
default:
- cli_usage(TSRMLS_C);
+ cli_usage();
ret = 0;
break;
@@ -885,7 +885,7 @@ static int cli_main( int argc, char * argv[] )
SG(request_info).argc = argc - (p - argv);
SG(request_info).argv = p;
- if (php_request_startup(TSRMLS_C) == FAILURE ) {
+ if (php_request_startup() == FAILURE ) {
fclose( file_handle.handle.fp );
ret = 2;
} else {
@@ -893,12 +893,12 @@ static int cli_main( int argc, char * argv[] )
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else if (source_highlight == 2) {
file_handle.filename = *p;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- ret = php_lint_script(&file_handle TSRMLS_CC);
+ ret = php_lint_script(&file_handle);
if (ret==SUCCESS) {
zend_printf("No syntax errors detected in %s\n", file_handle.filename);
} else {
@@ -910,7 +910,7 @@ static int cli_main( int argc, char * argv[] )
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
ret = EG(exit_status);
}
@@ -920,13 +920,13 @@ static int cli_main( int argc, char * argv[] )
php_printf("Could not open input file: %s.\n", *p);
}
} else {
- cli_usage(TSRMLS_C);
+ cli_usage();
}
}
}zend_end_try();
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
#ifdef ZTS
tsrm_shutdown();
@@ -1115,7 +1115,7 @@ int main( int argc, char * argv[] )
if ( slow_script_msec ) {
gettimeofday( &tv_req_begin, NULL );
}
- ret = processReq(TSRMLS_C);
+ ret = processReq();
if ( slow_script_msec ) {
gettimeofday( &tv_req_end, NULL );
n = ((long) tv_req_end.tv_sec - tv_req_begin.tv_sec ) * 1000
@@ -1135,7 +1135,7 @@ int main( int argc, char * argv[] )
break;
}
}
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
#ifdef ZTS
tsrm_shutdown();
diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c
index d82089ca1f..87df7898a1 100644
--- a/sapi/milter/php_milter.c
+++ b/sapi/milter/php_milter.c
@@ -113,10 +113,9 @@ static int mlfi_init()
zend_file_handle file_handle;
zval function_name, retval;
int status;
- TSRMLS_FETCH();
/* request startup */
- if (php_request_startup(TSRMLS_C)==FAILURE) {
+ if (php_request_startup()==FAILURE) {
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
php_request_shutdown((void *) 0);
@@ -143,7 +142,7 @@ static int mlfi_init()
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
/* call userland */
INIT_ZVAL(function_name);
@@ -153,7 +152,7 @@ static int mlfi_init()
/* set the milter context for possible use in API functions */
MG(state) = MLFI_INIT;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL);
MG(state) = MLFI_NONE;
MG(initialized) = 1;
@@ -179,10 +178,9 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
zend_file_handle file_handle;
zval function_name, retval, *param[1];
int status;
- TSRMLS_FETCH();
/* request startup */
- if (php_request_startup(TSRMLS_C)==FAILURE) {
+ if (php_request_startup()==FAILURE) {
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
php_request_shutdown((void *) 0);
@@ -209,7 +207,7 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
/* call userland */
INIT_ZVAL(function_name);
@@ -224,7 +222,7 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
MG(ctx) = ctx;
MG(state) = MLFI_CONNECT;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param);
MG(state) = MLFI_NONE;
zval_ptr_dtor(param);
@@ -243,7 +241,6 @@ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost)
{
zval function_name, retval, *param[1];
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -258,7 +255,7 @@ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost)
MG(ctx) = ctx;
MG(state) = MLFI_HELO;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param);
MG(state) = MLFI_NONE;
zval_ptr_dtor(param);
@@ -278,7 +275,6 @@ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv)
{
zval function_name, retval, *param[1];
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -298,7 +294,7 @@ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv)
MG(ctx) = ctx;
MG(state) = MLFI_ENVFROM;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param);
MG(state) = MLFI_NONE;
zval_ptr_dtor(param);
@@ -318,7 +314,6 @@ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv)
{
zval function_name, retval, *param[1];
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -338,7 +333,7 @@ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv)
MG(ctx) = ctx;
MG(state) = MLFI_ENVRCPT;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param);
MG(state) = MLFI_NONE;
@@ -359,7 +354,6 @@ static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv)
{
zval function_name, retval, *param[2];
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -377,7 +371,7 @@ static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv)
MG(ctx) = ctx;
MG(state) = MLFI_HEADER;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param);
MG(state) = MLFI_NONE;
@@ -399,7 +393,6 @@ static sfsistat mlfi_eoh(SMFICTX *ctx)
{
zval function_name, retval;
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -409,7 +402,7 @@ static sfsistat mlfi_eoh(SMFICTX *ctx)
MG(ctx) = ctx;
MG(state) = MLFI_EOH;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL);
MG(state) = MLFI_NONE;
@@ -428,7 +421,6 @@ static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len)
{
zval function_name, retval, *param[1];
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -443,7 +435,7 @@ static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len)
MG(ctx) = ctx;
MG(state) = MLFI_BODY;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param);
MG(state) = MLFI_NONE;
@@ -464,7 +456,6 @@ static sfsistat mlfi_eom(SMFICTX *ctx)
{
zval function_name, retval;
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -474,7 +465,7 @@ static sfsistat mlfi_eom(SMFICTX *ctx)
MG(ctx) = ctx;
MG(state) = MLFI_EOM;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL);
MG(state) = MLFI_NONE;
@@ -493,7 +484,6 @@ static sfsistat mlfi_abort(SMFICTX *ctx)
{
zval function_name, retval;
int status;
- TSRMLS_FETCH();
/* call userland */
INIT_ZVAL(function_name);
@@ -503,7 +493,7 @@ static sfsistat mlfi_abort(SMFICTX *ctx)
MG(ctx) = ctx;
MG(state) = MLFI_ABORT;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL);
MG(state) = MLFI_NONE;
@@ -523,9 +513,8 @@ static sfsistat mlfi_close(SMFICTX *ctx)
int ret = SMFIS_CONTINUE;
zval function_name, retval;
int status;
- TSRMLS_FETCH();
- if (!SG(sapi_started) && SUCCESS != php_request_startup(TSRMLS_C)) {
+ if (!SG(sapi_started) && SUCCESS != php_request_startup()) {
return ret;
}
@@ -537,7 +526,7 @@ static sfsistat mlfi_close(SMFICTX *ctx)
MG(ctx) = ctx;
MG(state) = MLFI_CLOSE;
- status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC);
+ status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL);
MG(state) = MLFI_NONE;
@@ -582,8 +571,8 @@ PHP_FUNCTION(smfi_setflags)
/* valid only in the init callback */
if (MG(state) != MLFI_INIT) {
- php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &flags) == SUCCESS) {
+ php_error(E_WARNING, NOT_INIT, get_active_function_name());
+ } else if (zend_parse_parameters(1, "l", &flags) == SUCCESS) {
flags = flags & (SMFIF_ADDHDRS|SMFIF_CHGHDRS|SMFIF_CHGBODY|SMFIF_ADDRCPT|SMFIF_DELRCPT);
smfilter.xxfi_flags = flags;
}
@@ -598,8 +587,8 @@ PHP_FUNCTION(smfi_settimeout)
/* valid only in the init callback */
if (MG(state) != MLFI_INIT) {
- php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &timeout) == SUCCESS) {
+ php_error(E_WARNING, NOT_INIT, get_active_function_name());
+ } else if (zend_parse_parameters(1, "l", &timeout) == SUCCESS) {
smfi_settimeout(timeout);
}
}
@@ -614,8 +603,8 @@ PHP_FUNCTION(smfi_getsymval)
/* valid in any callback */
if (MG(state) == MLFI_NONE) {
- php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &symname, &len) == SUCCESS) {
+ php_error(E_WARNING, IS_NONE, get_active_function_name());
+ } else if (zend_parse_parameters(1, "s", &symname, &len) == SUCCESS) {
if ((ret = smfi_getsymval(MG(ctx), symname)) != NULL) {
RETURN_STRING(ret, 1);
}
@@ -635,8 +624,8 @@ PHP_FUNCTION(smfi_setreply)
/* valid in any callback */
if (MG(state) == MLFI_NONE) {
- php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(3 TSRMLS_CC, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) {
+ php_error(E_WARNING, IS_NONE, get_active_function_name());
+ } else if (zend_parse_parameters(3, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) {
if (smfi_setreply(MG(ctx), rcode, xcode, message) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -655,8 +644,8 @@ PHP_FUNCTION(smfi_addheader)
/* valid only in milter_eom */
if (MG(state) != MLFI_EOM) {
- php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(2 TSRMLS_CC, "ss", &f, &len, &v, &len) == SUCCESS) {
+ php_error(E_WARNING, NOT_EOM, get_active_function_name());
+ } else if (zend_parse_parameters(2, "ss", &f, &len, &v, &len) == SUCCESS) {
if (smfi_addheader(MG(ctx), f, v) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -676,8 +665,8 @@ PHP_FUNCTION(smfi_chgheader)
/* valid only in milter_eom */
if (MG(state) != MLFI_EOM) {
- php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(3 TSRMLS_CC, "sls", &f, &len, &idx, &v, &len) == SUCCESS) {
+ php_error(E_WARNING, NOT_EOM, get_active_function_name());
+ } else if (zend_parse_parameters(3, "sls", &f, &len, &idx, &v, &len) == SUCCESS) {
if (smfi_chgheader(MG(ctx), f, idx, v) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -696,8 +685,8 @@ PHP_FUNCTION(smfi_addrcpt)
/* valid only in milter_eom */
if (MG(state) != MLFI_EOM) {
- php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) {
+ php_error(E_WARNING, NOT_EOM, get_active_function_name());
+ } else if (zend_parse_parameters(1, "s", &rcpt, &len) == SUCCESS) {
if (smfi_addrcpt(MG(ctx), rcpt) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -716,8 +705,8 @@ PHP_FUNCTION(smfi_delrcpt)
/* valid only in milter_eom */
if (MG(state) != MLFI_EOM) {
- php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) {
+ php_error(E_WARNING, NOT_EOM, get_active_function_name());
+ } else if (zend_parse_parameters(1, "s", &rcpt, &len) == SUCCESS) {
if (smfi_delrcpt(MG(ctx), rcpt) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -737,8 +726,8 @@ PHP_FUNCTION(smfi_replacebody)
/* valid only in milter_eom */
if (MG(state) != MLFI_EOM) {
- php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C));
- } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &body, &len) == SUCCESS) {
+ php_error(E_WARNING, NOT_EOM, get_active_function_name());
+ } else if (zend_parse_parameters(1, "s", &body, &len) == SUCCESS) {
if (smfi_replacebody(MG(ctx), (u_char*)body, len) == MI_SUCCESS) {
RETURN_TRUE;
}
@@ -859,27 +848,27 @@ static zend_module_entry php_milter_module = {
/* {{{ Milter SAPI
*/
-static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_milter_ub_write(const char *str, uint str_length)
{
return str_length;
}
-static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_milter_register_variables(zval *track_vars_array)
{
- php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC);
+ php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array);
}
-static int sapi_milter_post_read(char *buf, uint count_bytes TSRMLS_DC)
+static int sapi_milter_post_read(char *buf, uint count_bytes)
{
return 0;
}
-static char* sapi_milter_read_cookies(TSRMLS_D)
+static char* sapi_milter_read_cookies(void)
{
return NULL;
}
-static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers)
{
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
@@ -1099,9 +1088,9 @@ int main(int argc, char *argv[])
break;
case 'v': /* show php version & quit */
- if (php_request_startup(TSRMLS_C)==FAILURE) {
- zend_ini_deactivate(TSRMLS_C);
- php_module_shutdown(TSRMLS_C);
+ if (php_request_startup()==FAILURE) {
+ zend_ini_deactivate();
+ php_module_shutdown();
sapi_shutdown();
tsrm_shutdown();
@@ -1119,7 +1108,7 @@ int main(int argc, char *argv[])
break;
case 'z': /* load extension file */
- zend_load_extension(ap_php_optarg TSRMLS_CC);
+ zend_load_extension(ap_php_optarg);
break;
default:
@@ -1189,7 +1178,7 @@ int main(int argc, char *argv[])
} zend_end_try();
err:
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
sapi_shutdown();
tsrm_shutdown();
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index bb99c31652..c89d581a33 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -336,24 +336,24 @@ PHP_FUNCTION(nsapi_virtual)
Request *rq;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &uri, &uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) {
return;
}
if (!nsapi_servact_service) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", uri);
+ php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", uri);
RETURN_FALSE;
} else if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", uri);
+ php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", uri);
RETURN_FALSE;
} else {
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
/* do the sub-request */
/* thanks to Chris Elving from Sun for this code sniplet */
if ((rq = request_restart_internal(uri, NULL)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", uri);
+ php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", uri);
RETURN_FALSE;
}
@@ -385,7 +385,7 @@ PHP_FUNCTION(nsapi_virtual)
} while (rv == REQ_RESTART);
if (rq->status_num != 200) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", uri, rq->status_num);
+ php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", uri, rq->status_num);
request_free(rq);
RETURN_FALSE;
}
@@ -450,13 +450,13 @@ PHP_FUNCTION(nsapi_response_headers)
/* SAPI part */
/*************/
-static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
+static int sapi_nsapi_ub_write(const char *str, unsigned int str_length)
{
int retval;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
if (!SG(headers_sent)) {
- sapi_send_headers(TSRMLS_C);
+ sapi_send_headers();
}
retval = net_write(rc->sn->csd, (char *)str, str_length);
@@ -467,7 +467,7 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D
}
/* modified version of apache2 */
-static void sapi_nsapi_flush(void *server_context TSRMLS_DC)
+static void sapi_nsapi_flush(void *server_context)
{
nsapi_request_context *rc = (nsapi_request_context *)server_context;
@@ -477,7 +477,7 @@ static void sapi_nsapi_flush(void *server_context TSRMLS_DC)
}
if (!SG(headers_sent)) {
- sapi_send_headers(TSRMLS_C);
+ sapi_send_headers();
}
/* flushing is only supported in iPlanet servers from version 6.1 on, make it conditional */
@@ -489,7 +489,7 @@ static void sapi_nsapi_flush(void *server_context TSRMLS_DC)
}
/* callback for zend_llist_apply on SAPI_HEADER_DELETE_ALL operation */
-static int php_nsapi_remove_header(sapi_header_struct *sapi_header TSRMLS_DC)
+static int php_nsapi_remove_header(sapi_header_struct *sapi_header)
{
char *header_name, *p;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
@@ -514,7 +514,7 @@ static int php_nsapi_remove_header(sapi_header_struct *sapi_header TSRMLS_DC)
return ZEND_HASH_APPLY_KEEP;
}
-static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
@@ -522,12 +522,12 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade
switch(op) {
case SAPI_HEADER_DELETE_ALL:
/* this only deletes headers set or overwritten by PHP, headers previously set by NSAPI are left intact */
- zend_llist_apply(&sapi_headers->headers, (llist_apply_func_t) php_nsapi_remove_header TSRMLS_CC);
+ zend_llist_apply(&sapi_headers->headers, (llist_apply_func_t) php_nsapi_remove_header);
return 0;
case SAPI_HEADER_DELETE:
/* reuse the zend_llist_apply callback function for this, too */
- php_nsapi_remove_header(sapi_header TSRMLS_CC);
+ php_nsapi_remove_header(sapi_header);
return 0;
case SAPI_HEADER_ADD:
@@ -564,7 +564,7 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade
}
}
-static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers)
{
int retval;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
@@ -572,7 +572,7 @@ static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
if (SG(sapi_headers).send_default_content_type) {
char *hd;
param_free(pblock_remove("content-type", rc->rq->srvhdrs));
- hd = sapi_get_default_content_type(TSRMLS_C);
+ hd = sapi_get_default_content_type();
pblock_nvinsert("content-type", hd, rc->rq->srvhdrs);
efree(hd);
}
@@ -587,7 +587,7 @@ static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
}
-static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_nsapi_read_post(char *buffer, uint count_bytes)
{
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
char *read_ptr = buffer, *content_length_str = NULL;
@@ -645,7 +645,7 @@ static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
return bytes_read;
}
-static char *sapi_nsapi_read_cookies(TSRMLS_D)
+static char *sapi_nsapi_read_cookies(void)
{
char *cookie_string;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
@@ -654,7 +654,7 @@ static char *sapi_nsapi_read_cookies(TSRMLS_D)
return cookie_string;
}
-static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_nsapi_register_server_variables(zval *track_vars_array)
{
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
register size_t i;
@@ -666,7 +666,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
for (i = 0; i < nsapi_reqpb_size; i++) {
value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb);
if (value) {
- php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array TSRMLS_CC);
+ php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array);
}
}
@@ -687,7 +687,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
*p = '_';
}
}
- php_register_variable(value, entry->param->value, track_vars_array TSRMLS_CC);
+ php_register_variable(value, entry->param->value, track_vars_array);
efree(value);
}
entry=entry->next;
@@ -697,50 +697,50 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
for (i = 0; i < nsapi_vars_size; i++) {
value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars);
if (value) {
- php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array TSRMLS_CC);
+ php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array);
}
}
for (i = 0; i < nsapi_client_size; i++) {
value = pblock_findval(nsapi_client[i].nsapi_eq, rc->sn->client);
if (value) {
- php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array TSRMLS_CC);
+ php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array);
}
}
if (value = session_dns(rc->sn)) {
- php_register_variable("REMOTE_HOST", value, track_vars_array TSRMLS_CC);
+ php_register_variable("REMOTE_HOST", value, track_vars_array);
nsapi_free(value);
}
slprintf(buf, sizeof(buf), "%d", conf_getglobals()->Vport);
- php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC);
- php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_PORT", buf, track_vars_array);
+ php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array);
value = http_uri2url_dynamic("", "", rc->sn, rc->rq);
- php_register_variable("SERVER_URL", value, track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_URL", value, track_vars_array);
nsapi_free(value);
- php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array);
if (security_active) {
- php_register_variable("HTTPS", "ON", track_vars_array TSRMLS_CC);
+ php_register_variable("HTTPS", "ON", track_vars_array);
}
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array);
/* DOCUMENT_ROOT */
if (value = request_translate_uri("/", rc->sn)) {
pos = strlen(value);
- php_register_variable_safe("DOCUMENT_ROOT", value, pos-1, track_vars_array TSRMLS_CC);
+ php_register_variable_safe("DOCUMENT_ROOT", value, pos-1, track_vars_array);
nsapi_free(value);
}
/* PATH_INFO / PATH_TRANSLATED */
if (rc->path_info) {
if (value = request_translate_uri(rc->path_info, rc->sn)) {
- php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_TRANSLATED", value, track_vars_array);
nsapi_free(value);
}
- php_register_variable("PATH_INFO", rc->path_info, track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_INFO", rc->path_info, track_vars_array);
}
/* Create full Request-URI & Script-Name */
@@ -750,11 +750,11 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
if (SG(request_info).query_string) {
spprintf(&value, 0, "%s?%s", SG(request_info).request_uri, SG(request_info).query_string);
if (value) {
- php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC);
+ php_register_variable("REQUEST_URI", value, track_vars_array);
efree(value);
}
} else {
- php_register_variable_safe("REQUEST_URI", SG(request_info).request_uri, pos, track_vars_array TSRMLS_CC);
+ php_register_variable_safe("REQUEST_URI", SG(request_info).request_uri, pos, track_vars_array);
}
if (rc->path_info) {
@@ -763,18 +763,18 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
pos = 0;
}
}
- php_register_variable_safe("SCRIPT_NAME", SG(request_info).request_uri, pos, track_vars_array TSRMLS_CC);
+ php_register_variable_safe("SCRIPT_NAME", SG(request_info).request_uri, pos, track_vars_array);
}
- php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC);
+ php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array);
/* special variables in error mode */
if (rc->http_error) {
slprintf(buf, sizeof(buf), "%d", rc->http_error);
- php_register_variable("ERROR_TYPE", buf, track_vars_array TSRMLS_CC);
+ php_register_variable("ERROR_TYPE", buf, track_vars_array);
}
}
-static void nsapi_log_message(char *message TSRMLS_DC)
+static void nsapi_log_message(char *message)
{
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
@@ -785,7 +785,7 @@ static void nsapi_log_message(char *message TSRMLS_DC)
}
}
-static double sapi_nsapi_get_request_time(TSRMLS_D)
+static double sapi_nsapi_get_request_time(void)
{
return REQ_TIME( ((nsapi_request_context *)SG(server_context))->rq );
}
@@ -798,7 +798,7 @@ static int php_nsapi_startup(sapi_module_struct *sapi_module)
return SUCCESS;
}
-static struct stat* sapi_nsapi_get_stat(TSRMLS_D)
+static struct stat* sapi_nsapi_get_stat(void)
{
return request_stat_path(
SG(request_info).path_translated,
@@ -841,7 +841,7 @@ static sapi_module_struct nsapi_sapi_module = {
STANDARD_SAPI_MODULE_PROPERTIES
};
-static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC)
+static void nsapi_php_ini_entries(NSLS_D)
{
struct pb_entry *entry;
register int i,j,ok;
@@ -975,7 +975,6 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq)
/* try to use script parameter -> Error or Service for directory listing */
char *path_translated = pblock_findval("script", pb);
- TSRMLS_FETCH();
/* if script parameter is missing: normal use as Service SAF */
if (!path_translated) {
@@ -1027,9 +1026,9 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq)
SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0);
SG(sapi_headers).http_response_code = (error_directive) ? rq->status_num : 200;
- nsapi_php_ini_entries(NSLS_C TSRMLS_CC);
+ nsapi_php_ini_entries(NSLS_C);
- php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC);
+ php_handle_auth_data(pblock_findval("authorization", rq->headers));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
@@ -1038,8 +1037,8 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq)
fst = request_stat_path(SG(request_info).path_translated, rq);
if (fst && S_ISREG(fst->st_mode)) {
- if (php_request_startup(TSRMLS_C) == SUCCESS) {
- php_execute_script(&file_handle TSRMLS_CC);
+ if (php_request_startup() == SUCCESS) {
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
retval=REQ_PROCEED;
} else {
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index c624669785..70b3371341 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -53,7 +53,7 @@ static PHP_INI_MH(OnUpdateEol)
return FAILURE;
}
- return phpdbg_eol_global_update(new_value->val TSRMLS_CC);
+ return phpdbg_eol_global_update(new_value->val);
}
PHP_INI_BEGIN()
@@ -64,9 +64,9 @@ PHP_INI_END()
static zend_bool phpdbg_booted = 0;
#if PHP_VERSION_ID >= 50500
-void (*zend_execute_old)(zend_execute_data *execute_data TSRMLS_DC);
+void (*zend_execute_old)(zend_execute_data *execute_data);
#else
-void (*zend_execute_old)(zend_op_array *op_array TSRMLS_DC);
+void (*zend_execute_old)(zend_op_array *op_array);
#endif
static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */
@@ -164,9 +164,8 @@ static void php_phpdbg_destroy_bp_condition(zval *data) /* {{{ */
if (brake) {
if (brake->ops) {
- TSRMLS_FETCH();
-
- destroy_op_array(brake->ops TSRMLS_CC);
+
+ destroy_op_array(brake->ops);
efree(brake->ops);
}
efree((char*) brake->code);
@@ -177,9 +176,8 @@ static void php_phpdbg_destroy_registered(zval *data) /* {{{ */
{
zend_function *function = (zend_function *) Z_PTR_P(data);
- TSRMLS_FETCH();
- destroy_zend_function(function TSRMLS_CC);
+ destroy_zend_function(function);
} /* }}} */
@@ -248,7 +246,7 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
}
if (PHPDBG_G(ops)) {
- destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
+ destroy_op_array(PHPDBG_G(ops));
efree(PHPDBG_G(ops));
PHPDBG_G(ops) = NULL;
}
@@ -265,7 +263,7 @@ static PHP_FUNCTION(phpdbg_exec)
{
zend_string *exec;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &exec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &exec) == FAILURE) {
return;
}
@@ -307,7 +305,7 @@ static PHP_FUNCTION(phpdbg_break_next)
return;
}
- phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1 TSRMLS_CC);
+ phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1);
} /* }}} */
/* {{{ proto void phpdbg_break_file(string file, integer line) */
@@ -317,11 +315,11 @@ static PHP_FUNCTION(phpdbg_break_file)
size_t flen = 0;
long line;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &file, &flen, &line) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &file, &flen, &line) == FAILURE) {
return;
}
- phpdbg_set_breakpoint_file(file, line TSRMLS_CC);
+ phpdbg_set_breakpoint_file(file, line);
} /* }}} */
/* {{{ proto void phpdbg_break_method(string class, string method) */
@@ -330,11 +328,11 @@ static PHP_FUNCTION(phpdbg_break_method)
char *class = NULL, *method = NULL;
size_t clen = 0, mlen = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &class, &clen, &method, &mlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &class, &clen, &method, &mlen) == FAILURE) {
return;
}
- phpdbg_set_breakpoint_method(class, method TSRMLS_CC);
+ phpdbg_set_breakpoint_method(class, method);
} /* }}} */
/* {{{ proto void phpdbg_break_function(string function) */
@@ -343,11 +341,11 @@ static PHP_FUNCTION(phpdbg_break_function)
char *function = NULL;
size_t function_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &function, &function_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &function, &function_len) == FAILURE) {
return;
}
- phpdbg_set_breakpoint_symbol(function, function_len TSRMLS_CC);
+ phpdbg_set_breakpoint_symbol(function, function_len);
} /* }}} */
/* {{{ proto void phpdbg_clear(void)
@@ -372,7 +370,7 @@ static PHP_FUNCTION(phpdbg_color)
char *color = NULL;
size_t color_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element, &color, &color_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element, &color, &color_len) == FAILURE) {
return;
}
@@ -380,7 +378,7 @@ static PHP_FUNCTION(phpdbg_color)
case PHPDBG_COLOR_NOTICE:
case PHPDBG_COLOR_ERROR:
case PHPDBG_COLOR_PROMPT:
- phpdbg_set_color_ex(element, color, color_len TSRMLS_CC);
+ phpdbg_set_color_ex(element, color, color_len);
break;
default: zend_error(E_ERROR, "phpdbg detected an incorrect color constant");
@@ -393,11 +391,11 @@ static PHP_FUNCTION(phpdbg_prompt)
char *prompt = NULL;
size_t prompt_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &prompt, &prompt_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &prompt, &prompt_len) == FAILURE) {
return;
}
- phpdbg_set_prompt(prompt TSRMLS_CC);
+ phpdbg_set_prompt(prompt);
} /* }}} */
ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_next_arginfo, 0, 0, 0)
@@ -473,18 +471,18 @@ static inline int php_sapi_phpdbg_module_startup(sapi_module_struct *module) /*
return SUCCESS;
} /* }}} */
-static char* php_sapi_phpdbg_read_cookies(TSRMLS_D) /* {{{ */
+static char* php_sapi_phpdbg_read_cookies(void) /* {{{ */
{
return NULL;
} /* }}} */
-static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */
+static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s) /* {{{ */
{
return 0;
}
/* }}} */
-static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */
+static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */
{
/* We do nothing here, this function is needed to prevent that the fallback
* header handling is called. */
@@ -492,12 +490,12 @@ static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS
}
/* }}} */
-static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */
+static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context) /* {{{ */
{
}
/* }}} */
-static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */
+static void php_sapi_phpdbg_log_message(char *message) /* {{{ */
{
/*
* We must not request TSRM before being boot
@@ -517,13 +515,13 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */
case E_USER_ERROR:
case E_PARSE:
case E_RECOVERABLE_ERROR: {
- const char *file_char = zend_get_executed_filename(TSRMLS_C);
+ const char *file_char = zend_get_executed_filename();
zend_string *file = zend_string_init(file_char, strlen(file_char), 0);
- phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
+ phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno());
efree(file);
do {
- switch (phpdbg_interactive(1 TSRMLS_CC)) {
+ switch (phpdbg_interactive(1)) {
case PHPDBG_LEAVE:
case PHPDBG_FINISH:
case PHPDBG_UNTIL:
@@ -539,7 +537,7 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */
+static int php_sapi_phpdbg_deactivate(void) /* {{{ */
{
if ((PHPDBG_G(flags) & PHPDBG_IS_STOPPING) == PHPDBG_IS_CLEANING) {
zend_phpdbg_globals *pg = PHPDBG_G(backup) = calloc(1, sizeof(zend_phpdbg_globals));
@@ -566,41 +564,41 @@ static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* {{{ */
+static void php_sapi_phpdbg_register_vars(zval *track_vars_array) /* {{{ */
{
size_t len;
char *docroot = "";
/* In phpdbg mode, we consider the environment to be a part of the server variables
*/
- php_import_environment_variables(track_vars_array TSRMLS_CC);
+ php_import_environment_variables(track_vars_array);
if (PHPDBG_G(exec)) {
len = PHPDBG_G(exec_len);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) {
- php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) {
+ php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) {
- php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) {
+ php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) {
- php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) {
+ php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array);
}
- if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) {
- php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) {
+ php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array);
}
}
/* any old docroot will do */
len = 0;
- if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) {
- php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) {
+ php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array);
}
}
/* }}} */
-static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length TSRMLS_DC) /* {{{ */
+static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length) /* {{{ */
{
if (PHPDBG_G(socket_fd) != -1 && !(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) {
send(PHPDBG_G(socket_fd), message, length, 0);
@@ -614,7 +612,7 @@ typedef struct {
int fd;
} php_stdio_stream_data;
-static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) {
+static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count) {
php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract;
while (data->fd >= 0) {
@@ -635,25 +633,24 @@ static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t co
break;
}
- return PHPDBG_G(php_stdiop_write)(stream, buf, count TSRMLS_CC);
+ return PHPDBG_G(php_stdiop_write)(stream, buf, count);
}
#if PHP_VERSION_ID >= 50700
-static inline void php_sapi_phpdbg_flush(void *context TSRMLS_DC) /* {{{ */
+static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */
{
#else
static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */
{
- TSRMLS_FETCH();
#endif
- if (!phpdbg_active_sigsafe_mem(TSRMLS_C)) {
+ if (!phpdbg_active_sigsafe_mem()) {
fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr);
}
} /* }}} */
/* copied from sapi/cli/php_cli.c cli_register_file_handles */
-static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */
+static void phpdbg_register_file_handles(void) /* {{{ */
{
zval zin, zout, zerr;
php_stream *s_in, *s_out, *s_err;
@@ -685,19 +682,19 @@ static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */
ic.flags = CONST_CS;
ic.name = zend_string_init(ZEND_STRL("STDIN"), 0);
ic.module_number = 0;
- zend_register_constant(&ic TSRMLS_CC);
+ zend_register_constant(&ic);
oc.value = zout;
oc.flags = CONST_CS;
oc.name = zend_string_init(ZEND_STRL("STDOUT"), 0);
oc.module_number = 0;
- zend_register_constant(&oc TSRMLS_CC);
+ zend_register_constant(&oc);
ec.value = zerr;
ec.flags = CONST_CS;
ec.name = zend_string_init(ZEND_STRL("STDERR"), 0);
ec.module_number = 0;
- zend_register_constant(&ec TSRMLS_CC);
+ zend_register_constant(&ec);
}
/* }}} */
@@ -783,7 +780,7 @@ void phpdbg_ini_defaults(HashTable *configuration_hash) /* {{{ */
INI_DEFAULT("report_zend_debug", "0");
} /* }}} */
-static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */
+static void phpdbg_welcome(zend_bool cleaning) /* {{{ */
{
/* print blurb */
if (!cleaning) {
@@ -811,7 +808,6 @@ static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */
static inline void phpdbg_sigint_handler(int signo) /* {{{ */
{
- TSRMLS_FETCH();
if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) {
/* we quit remote consoles on recv SIGINT */
@@ -825,11 +821,11 @@ static inline void phpdbg_sigint_handler(int signo) /* {{{ */
if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
char mem[PHPDBG_SIGSAFE_MEM_SIZE + 1];
- phpdbg_set_sigsafe_mem(mem TSRMLS_CC);
+ phpdbg_set_sigsafe_mem(mem);
zend_try {
- phpdbg_force_interruption(TSRMLS_C);
+ phpdbg_force_interruption();
} zend_end_try()
- phpdbg_clear_sigsafe_mem(TSRMLS_C);
+ phpdbg_clear_sigsafe_mem();
return;
}
PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED;
@@ -848,7 +844,7 @@ static void phpdbg_remote_close(int socket, FILE *stream) {
}
/* don't inline this, want to debug it easily, will inline when done */
-static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream TSRMLS_DC) {
+static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream) {
phpdbg_remote_close(*socket, *stream);
if (server < 0) {
@@ -890,7 +886,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */
int flags;
size_t newlen;
size_t i/*, last_nl*/;
- TSRMLS_FETCH();
// if (!(info->si_band & POLLIN)) {
// return; /* Not interested in writeablility etc., just interested in incoming data */
@@ -914,11 +909,11 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */
break; /* or quit ??? */
}
if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
- phpdbg_set_sigsafe_mem(mem TSRMLS_CC);
+ phpdbg_set_sigsafe_mem(mem);
zend_try {
- phpdbg_force_interruption(TSRMLS_C);
+ phpdbg_force_interruption();
} zend_end_try();
- phpdbg_clear_sigsafe_mem(TSRMLS_C);
+ phpdbg_clear_sigsafe_mem();
break;
}
if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) {
@@ -941,7 +936,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */
void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */
{
int is_handled = FAILURE;
- TSRMLS_FETCH();
switch (sig) {
case SIGBUS:
@@ -949,10 +943,10 @@ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */
if (PHPDBG_G(sigsegv_bailout)) {
LONGJMP(*PHPDBG_G(sigsegv_bailout), FAILURE);
}
- is_handled = phpdbg_watchpoint_segfault_handler(info, context TSRMLS_CC);
+ is_handled = phpdbg_watchpoint_segfault_handler(info, context);
if (is_handled == FAILURE) {
#ifdef ZEND_SIGNALS
- zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL TSRMLS_CC);
+ zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL);
#else
sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL);
#endif
@@ -967,10 +961,9 @@ static inline zend_mm_heap *phpdbg_mm_get_heap() /* {{{ */
{
zend_mm_heap *mm_heap;
- TSRMLS_FETCH();
- mm_heap = zend_mm_set_heap(NULL TSRMLS_CC);
- zend_mm_set_heap(mm_heap TSRMLS_CC);
+ mm_heap = zend_mm_set_heap(NULL);
+ zend_mm_set_heap(mm_heap);
return mm_heap;
} /* }}} */
@@ -1205,7 +1198,7 @@ phpdbg_main:
PHP_VERSION,
get_zend_version()
);
- sapi_deactivate(TSRMLS_C);
+ sapi_deactivate();
sapi_shutdown();
return 0;
} break;
@@ -1295,8 +1288,8 @@ phpdbg_main:
/* setup remote server if necessary */
if (cleaning <= 0 && listen > 0) {
- server = phpdbg_open_socket(address, listen TSRMLS_CC);
- if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC) == FAILURE) {
+ server = phpdbg_open_socket(address, listen);
+ if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream) == FAILURE) {
exit(0);
}
@@ -1321,26 +1314,26 @@ phpdbg_main:
_free = phpdbg_free_wrapper;
}
- zend_activate(TSRMLS_C);
+ zend_activate();
- phpdbg_init_list(TSRMLS_C);
+ phpdbg_init_list();
PHPDBG_G(original_free_function) = _free;
_free = phpdbg_watch_efree;
zend_mm_set_custom_handlers(mm_heap, _malloc, _free, _realloc);
- phpdbg_setup_watchpoints(TSRMLS_C);
+ phpdbg_setup_watchpoints();
#if defined(ZEND_SIGNALS) && !defined(_WIN32)
zend_try {
- zend_signal_activate(TSRMLS_C);
+ zend_signal_activate();
} zend_end_try();
#endif
#if defined(ZEND_SIGNALS) && !defined(_WIN32)
- zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try();
- zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try();
+ zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
+ zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try();
#elif !defined(_WIN32)
sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal));
@@ -1348,12 +1341,12 @@ phpdbg_main:
PHPDBG_G(sapi_name_ptr) = sapi_name;
- php_output_activate(TSRMLS_C);
- php_output_deactivate(TSRMLS_C);
+ php_output_activate();
+ php_output_deactivate();
- php_output_activate(TSRMLS_C);
+ php_output_activate();
- if (php_request_startup(TSRMLS_C) == SUCCESS) {
+ if (php_request_startup() == SUCCESS) {
int i;
SG(request_info).argc = argc - php_optind + 1;
@@ -1363,7 +1356,7 @@ phpdbg_main:
}
SG(request_info).argv[i] = exec ? estrdup(exec) : estrdup("");
- php_hash_environment(TSRMLS_C);
+ php_hash_environment();
}
/* do not install sigint handlers for remote consoles */
@@ -1372,7 +1365,7 @@ phpdbg_main:
if (listen < 0) {
#endif
#if defined(ZEND_SIGNALS) && !defined(_WIN32)
- zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try();
+ zend_try { zend_signal(SIGINT, phpdbg_sigint_handler); } zend_end_try();
#else
signal(SIGINT, phpdbg_sigint_handler);
#endif
@@ -1423,7 +1416,7 @@ phpdbg_main:
#endif
if (exec) { /* set execution context */
- PHPDBG_G(exec) = phpdbg_resolve_path(exec TSRMLS_CC);
+ PHPDBG_G(exec) = phpdbg_resolve_path(exec);
PHPDBG_G(exec_len) = PHPDBG_G(exec) ? strlen(PHPDBG_G(exec)) : 0;
free(exec);
@@ -1439,19 +1432,19 @@ phpdbg_main:
}
/* set default colors */
- phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold") TSRMLS_CC);
- phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold") TSRMLS_CC);
- phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green") TSRMLS_CC);
+ phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold"));
+ phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold"));
+ phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green"));
/* set default prompt */
- phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT TSRMLS_CC);
+ phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
/* Make stdin, stdout and stderr accessible from PHP scripts */
- phpdbg_register_file_handles(TSRMLS_C);
+ phpdbg_register_file_handles();
if (show_banner && cleaning < 2) {
/* print blurb */
- phpdbg_welcome(cleaning == 1 TSRMLS_CC);
+ phpdbg_welcome(cleaning == 1);
}
cleaning = -1;
@@ -1459,10 +1452,10 @@ phpdbg_main:
/* initialize from file */
PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING;
zend_try {
- phpdbg_init(init_file, init_file_len, init_file_default TSRMLS_CC);
+ phpdbg_init(init_file, init_file_len, init_file_default);
if (bp_tmp) {
PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT;
- phpdbg_string_init(bp_tmp TSRMLS_CC);
+ phpdbg_string_init(bp_tmp);
free(bp_tmp);
bp_tmp = NULL;
PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT;
@@ -1480,7 +1473,7 @@ phpdbg_main:
if (settings) {
PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT;
}
- phpdbg_compile(TSRMLS_C);
+ phpdbg_compile();
PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT;
}
@@ -1500,7 +1493,7 @@ phpdbg_interact:
if (phpdbg_startup_run) {
zend_bool quit_immediately = phpdbg_startup_run > 1;
phpdbg_startup_run = 0;
- PHPDBG_COMMAND_HANDLER(run)(NULL TSRMLS_CC);
+ PHPDBG_COMMAND_HANDLER(run)(NULL);
if (quit_immediately) {
/* if -r is on the command line more than once just quit */
EG(bailout) = __orig_bailout; /* reset zend_try */
@@ -1508,12 +1501,12 @@ phpdbg_interact:
}
}
- phpdbg_interactive(1 TSRMLS_CC);
+ phpdbg_interactive(1);
} zend_catch {
if ((PHPDBG_G(flags) & PHPDBG_IS_CLEANING)) {
char *bp_tmp_str;
PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT;
- phpdbg_export_breakpoints_to_string(&bp_tmp_str TSRMLS_CC);
+ phpdbg_export_breakpoints_to_string(&bp_tmp_str);
PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT;
if (bp_tmp_str) {
bp_tmp = strdup(bp_tmp_str);
@@ -1531,7 +1524,7 @@ phpdbg_interact:
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
/* renegociate connections */
- phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC);
+ phpdbg_remote_init(address, listen, server, &socket, &stream);
/* set streams */
if (stream) {
@@ -1615,8 +1608,8 @@ phpdbg_out:
PG(report_memleaks) = 0;
if ((PHPDBG_G(flags) & (PHPDBG_IS_CLEANING | PHPDBG_IS_RUNNING)) == PHPDBG_IS_CLEANING) {
- php_free_shutdown_functions(TSRMLS_C);
- zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
+ php_free_shutdown_functions();
+ zend_objects_store_mark_destructed(&EG(objects_store));
}
/* sapi_module.deactivate is where to backup things, last chance before mm_shutdown... */
@@ -1634,10 +1627,10 @@ phpdbg_out:
settings = PHPDBG_G(backup);
}
- php_output_deactivate(TSRMLS_C);
+ php_output_deactivate();
zend_try {
- php_module_shutdown(TSRMLS_C);
+ php_module_shutdown();
} zend_end_try();
sapi_shutdown();
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index a6d4935d45..672e75f814 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -134,7 +134,7 @@
# include "phpdbg_sigio_win32.h"
#endif
-int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC);
+int phpdbg_do_parse(phpdbg_param_t *stack, char *input);
#define PHPDBG_NEXT 2
#define PHPDBG_UNTIL 3
@@ -257,7 +257,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
int vmret; /* return from last opcode handler execution */
zend_bool in_execution; /* in execution? */
- zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
+ zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type);
HashTable file_sources;
FILE *oplog; /* opline log */
@@ -266,7 +266,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
int fd;
} io[PHPDBG_IO_FDS]; /* io */
int eol; /* type of line ending to use */
- size_t (*php_stdiop_write)(php_stream *, const char *, size_t TSRMLS_DC);
+ size_t (*php_stdiop_write)(php_stream *, const char *, size_t);
int in_script_xml; /* in <stream> output mode */
struct {
zend_bool active;
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index cd40510c79..ac5ba34714 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -29,24 +29,24 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
/* {{{ private api functions */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array* TSRMLS_DC);
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function* TSRMLS_DC);
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array* TSRMLS_DC);
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t TSRMLS_DC);
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar TSRMLS_DC);
-static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC); /* }}} */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array*);
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function*);
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array*);
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t);
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar);
+static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data); /* }}} */
/*
* Note:
* A break point must always set the correct id and type
* A set breakpoint function must always map new points
*/
-static inline void _phpdbg_break_mapping(int id, HashTable *table TSRMLS_DC)
+static inline void _phpdbg_break_mapping(int id, HashTable *table)
{
zend_hash_index_update_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id, table);
}
-#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table TSRMLS_CC)
+#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table)
#define PHPDBG_BREAK_UNMAPPING(id) \
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id))
@@ -89,7 +89,7 @@ static void phpdbg_opline_breaks_dtor(zval *data) /* {{{ */
}
} /* }}} */
-PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */
+PHPDBG_API void phpdbg_reset_breakpoints(void) /* {{{ */
{
HashTable *table;
@@ -102,14 +102,14 @@ PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */
} ZEND_HASH_FOREACH_END();
} /* }}} */
-PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_export_breakpoints(FILE *handle) /* {{{ */
{
char *string;
- phpdbg_export_breakpoints_to_string(&string TSRMLS_CC);
+ phpdbg_export_breakpoints_to_string(&string);
fputs(string, handle);
}
-PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */
{
HashTable *table;
zend_ulong id = 0L;
@@ -222,7 +222,7 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{
}
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num) /* {{{ */
{
php_stream_statbuf ssb;
char realpath[MAXPATHLEN];
@@ -282,7 +282,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML
phpdbg_debug("Compare against loaded %s\n", file);
- if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken TSRMLS_CC)) == NULL))) {
+ if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken)) == NULL))) {
new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(broken, line_num);
break;
}
@@ -304,7 +304,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML
}
} /* }}} */
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC) /* {{{ */
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */
{
phpdbg_debug("file: %s, filelen: %u, cur: %s, curlen %u, pos: %c, memcmp: %d\n", file, filelen, cur, curlen, filelen > curlen ? file[filelen - curlen - 1] : '?', filelen > curlen ? memcmp(file + filelen - curlen, cur, curlen) : 0);
@@ -345,7 +345,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin
return NULL;
} /* }}} */
-PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */
{
HashTable *fileht;
uint filelen = strlen(file);
@@ -356,11 +356,11 @@ PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /*
ZEND_HASH_FOREACH_STR_KEY_PTR(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING], cur, fileht) {
phpdbg_debug("check bp: %s\n", cur);
- phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht TSRMLS_CC);
+ phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht);
} ZEND_HASH_FOREACH_END();
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len) /* {{{ */
{
if (!zend_hash_str_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], name, name_len)) {
phpdbg_breaksymbol_t new_break;
@@ -380,7 +380,7 @@ PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len T
}
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name) /* {{{ */
{
HashTable class_breaks, *class_table;
size_t class_len = strlen(class_name);
@@ -415,7 +415,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char
efree(lcname);
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline) /* {{{ */
{
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], opline)) {
phpdbg_breakline_t new_break;
@@ -436,7 +436,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{
}
} /* }}} */
-PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC) /* {{{ */
+PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array) /* {{{ */
{
phpdbg_breakline_t opline_break;
if (op_array->last <= brake->opline_num) {
@@ -472,7 +472,7 @@ PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_o
return SUCCESS;
} /* }}} */
-PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array) /* {{{ */
{
HashTable *func_table = &PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE];
HashTable *oplines_table;
@@ -491,7 +491,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC
}
ZEND_HASH_FOREACH_PTR(oplines_table, brake) {
- if (phpdbg_resolve_op_array_break(brake, op_array TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_resolve_op_array_break(brake, op_array) == SUCCESS) {
phpdbg_breakline_t *opline_break;
zend_hash_internal_pointer_end(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
@@ -508,7 +508,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC
} ZEND_HASH_FOREACH_END();
} /* }}} */
-PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC) /* {{{ */
+PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break) /* {{{ */
{
HashTable *func_table = EG(function_table);
zend_function *func;
@@ -516,7 +516,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML
if (new_break->func_name == NULL) {
if (EG(current_execute_data) == NULL) {
if (PHPDBG_G(ops) != NULL && !memcmp(PHPDBG_G(ops)->filename, new_break->class_name, new_break->class_len)) {
- if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops) TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops)) == SUCCESS) {
return SUCCESS;
} else {
return 2;
@@ -528,7 +528,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML
do {
zend_op_array *op_array = &execute_data->func->op_array;
if (op_array->function_name == NULL && op_array->scope == NULL && new_break->class_len == op_array->filename->len && !memcmp(op_array->filename->val, new_break->class_name, new_break->class_len)) {
- if (phpdbg_resolve_op_array_break(new_break, op_array TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_resolve_op_array_break(new_break, op_array) == SUCCESS) {
return SUCCESS;
} else {
return 2;
@@ -564,14 +564,14 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML
return 2;
}
- if (phpdbg_resolve_op_array_break(new_break, &func->op_array TSRMLS_CC) == FAILURE) {
+ if (phpdbg_resolve_op_array_break(new_break, &func->op_array) == FAILURE) {
return 2;
}
return SUCCESS;
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline) /* {{{ */
{
phpdbg_breakopline_t new_break;
HashTable class_breaks, *class_table;
@@ -585,7 +585,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha
new_break.opline_num = opline;
new_break.opline = 0;
- switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) {
+ switch (phpdbg_resolve_opline_break(&new_break)) {
case FAILURE:
phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" method=\"%::%s\" num=\"%ld\"", "Pending breakpoint #%d at %s::%s#%ld", new_break.id, new_break.class_name, new_break.func_name, opline);
break;
@@ -623,7 +623,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha
zend_hash_index_update_mem(method_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
-PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline) /* {{{ */
{
phpdbg_breakopline_t new_break;
HashTable func_breaks, *func_table;
@@ -636,7 +636,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend
new_break.opline_num = opline;
new_break.opline = 0;
- switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) {
+ switch (phpdbg_resolve_opline_break(&new_break)) {
case FAILURE:
phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" function=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s#%ld", new_break.id, new_break.func_name, opline);
break;
@@ -668,7 +668,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend
zend_hash_index_update_mem(func_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
-PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline) /* {{{ */
{
phpdbg_breakopline_t new_break;
HashTable file_breaks, *file_table;
@@ -681,7 +681,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o
new_break.opline_num = opline;
new_break.opline = 0;
- switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) {
+ switch (phpdbg_resolve_opline_break(&new_break)) {
case FAILURE:
phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" file=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s:%ld", new_break.id, new_break.class_name, opline);
break;
@@ -713,7 +713,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o
zend_hash_index_update_mem(file_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
-PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len) /* {{{ */
{
phpdbg_breakop_t new_break;
zend_ulong hash = zend_hash_func(name, name_len);
@@ -735,7 +735,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T
PHPDBG_BREAK_MAPPING(new_break.id, &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]);
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* {{{ */
{
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) {
phpdbg_breakline_t new_break;
@@ -754,7 +754,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRML
}
} /* }}} */
-static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash TSRMLS_DC) /* {{{ */
+static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash) /* {{{ */
{
phpdbg_breakcond_t new_break;
uint32_t cops = CG(compiler_options);
@@ -766,7 +766,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
if (param) {
new_break.paramed = 1;
phpdbg_copy_param(
- param, &new_break.param TSRMLS_CC);
+ param, &new_break.param);
} else {
new_break.paramed = 0;
}
@@ -785,7 +785,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0';
Z_TYPE_INFO(pv) = IS_STRING;
- new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code" TSRMLS_CC);
+ new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code");
zval_dtor(&pv);
@@ -805,20 +805,20 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
CG(compiler_options) = cops;
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len) /* {{{ */
{
zend_ulong expr_hash = zend_inline_hash_func(expr, expr_len);
phpdbg_breakcond_t new_break;
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], expr_hash)) {
phpdbg_create_conditional_break(
- &new_break, NULL, expr, expr_len, expr_hash TSRMLS_CC);
+ &new_break, NULL, expr, expr_len, expr_hash);
} else {
phpdbg_error("breakpoint", "type=\"exists\" expression=\"%s\"", "Conditional break %s exists", expr);
}
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param) /* {{{ */
{
phpdbg_breakcond_t new_break;
phpdbg_param_t *condition;
@@ -829,7 +829,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC)
hash = zend_inline_hash_func(condition->str, condition->len);
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], hash)) {
- phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash TSRMLS_CC);
+ phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash);
} else {
phpdbg_notice("breakpoint", "type=\"exists\" arg=\"%s\"", "Conditional break %s exists at the specified location", condition->str);
}
@@ -837,7 +837,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC)
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array) /* {{{ */
{
HashTable *breaks;
phpdbg_breakbase_t *brake;
@@ -866,7 +866,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_
return NULL;
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc) /* {{{ */
{
const char *fname;
size_t flen;
@@ -880,7 +880,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f
if (ops->scope) {
/* find method breaks here */
- return phpdbg_find_breakpoint_method(ops TSRMLS_CC);
+ return phpdbg_find_breakpoint_method(ops);
}
if (ops->function_name) {
@@ -894,7 +894,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f
return zend_hash_str_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], fname, flen);
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops) /* {{{ */
{
HashTable *class_table;
phpdbg_breakbase_t *brake = NULL;
@@ -911,7 +911,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *o
return brake;
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline) /* {{{ */
{
phpdbg_breakline_t *brake;
@@ -922,7 +922,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt
return (phpdbg_breakbase_t *) brake;
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode) /* {{{ */
{
const char *opname = phpdbg_decode_opcode(opcode);
@@ -933,7 +933,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcod
return zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], zend_hash_func(opname, strlen(opname)));
} /* }}} */
-static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data) /* {{{ */
{
zend_function *function = execute_data->func;
@@ -960,8 +960,8 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
} break;
case FILE_PARAM: {
- if (param->file.line == zend_get_executed_lineno(TSRMLS_C)) {
- const char *str = zend_get_executed_filename(TSRMLS_C);
+ if (param->file.line == zend_get_executed_lineno()) {
+ const char *str = zend_get_executed_filename();
size_t lengths[2] = {strlen(param->file.name), strlen(str)};
if (lengths[0] == lengths[1]) {
@@ -1005,7 +1005,7 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
return 0;
} /* }}} */
-static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data) /* {{{ */
{
phpdbg_breakcond_t *bp;
int breakpoint = FAILURE;
@@ -1021,20 +1021,20 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut
}
if (bp->paramed) {
- if (!phpdbg_find_breakpoint_param(&bp->param, execute_data TSRMLS_CC)) {
+ if (!phpdbg_find_breakpoint_param(&bp->param, execute_data)) {
continue;
}
}
EG(no_extensions) = 1;
- zend_rebuild_symbol_table(TSRMLS_C);
+ zend_rebuild_symbol_table();
zend_try {
PHPDBG_G(flags) |= PHPDBG_IN_COND_BP;
- zend_execute(bp->ops, &retval TSRMLS_CC);
+ zend_execute(bp->ops, &retval);
#if PHP_VERSION_ID >= 50700
- if (zend_is_true(&retval TSRMLS_CC)) {
+ if (zend_is_true(&retval)) {
#else
if (zend_is_true(&retval)) {
#endif
@@ -1056,7 +1056,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut
return (breakpoint == SUCCESS) ? ((phpdbg_breakbase_t *) bp) : NULL;
} /* }}} */
-PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data) /* {{{ */
{
phpdbg_breakbase_t *base = NULL;
@@ -1067,28 +1067,28 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute
/* conditions cannot be executed by eval()'d code */
if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL) &&
(PHPDBG_G(flags) & PHPDBG_HAS_COND_BP) &&
- (base = phpdbg_find_conditional_breakpoint(execute_data TSRMLS_CC))) {
+ (base = phpdbg_find_conditional_breakpoint(execute_data))) {
goto result;
}
- if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array TSRMLS_CC))) {
+ if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array))) {
goto result;
}
if (PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP)) {
/* check we are at the beginning of the stack */
if (execute_data->opline == execute_data->func->op_array.opcodes) {
- if ((base = phpdbg_find_breakpoint_symbol(execute_data->func TSRMLS_CC))) {
+ if ((base = phpdbg_find_breakpoint_symbol(execute_data->func))) {
goto result;
}
}
}
- if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline TSRMLS_CC))) {
+ if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline))) {
goto result;
}
- if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode TSRMLS_CC))) {
+ if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode))) {
goto result;
}
@@ -1103,14 +1103,14 @@ result:
return base;
} /* }}} */
-PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num) /* {{{ */
{
HashTable *table;
phpdbg_breakbase_t *brake;
zend_string *strkey;
zend_ulong numkey;
- if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey TSRMLS_CC))) {
+ if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey))) {
int type = brake->type;
char *name = NULL;
size_t name_len = 0L;
@@ -1167,7 +1167,7 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */
}
} /* }}} */
-PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */
+PHPDBG_API void phpdbg_clear_breakpoints(void) /* {{{ */
{
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]);
@@ -1186,16 +1186,16 @@ PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */
PHPDBG_G(bp_count) = 0;
} /* }}} */
-PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output) /* {{{ */
{
brake->hits++;
if (output) {
- phpdbg_print_breakpoint(brake TSRMLS_CC);
+ phpdbg_print_breakpoint(brake);
}
} /* }}} */
-PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake) /* {{{ */
{
if (!brake)
goto unknown;
@@ -1213,8 +1213,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
phpdbg_notice("breakpoint", "id=\"%d\" function=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s() at %s:%u, hits: %lu",
((phpdbg_breaksymbol_t*)brake)->id,
((phpdbg_breaksymbol_t*)brake)->symbol,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakfile_t*)brake)->hits);
} break;
@@ -1222,8 +1222,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
phpdbg_notice("breakpoint", "id=\"%d\" opline=\"%#lx\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %#lx at %s:%u, hits: %lu",
((phpdbg_breakline_t*)brake)->id,
((phpdbg_breakline_t*)brake)->opline,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakline_t*)brake)->hits);
} break;
@@ -1233,8 +1233,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
((phpdbg_breakopline_t*)brake)->class_name,
((phpdbg_breakopline_t*)brake)->func_name,
((phpdbg_breakopline_t*)brake)->opline_num,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakopline_t*)brake)->hits);
} break;
@@ -1243,8 +1243,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
((phpdbg_breakopline_t*)brake)->id,
((phpdbg_breakopline_t*)brake)->func_name,
((phpdbg_breakopline_t*)brake)->opline_num,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakopline_t*)brake)->hits);
} break;
@@ -1252,8 +1252,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
phpdbg_notice("breakpoint", "id=\"%d\" num=\"%lu\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in #%lu at %s:%u, hits: %lu",
((phpdbg_breakopline_t*)brake)->id,
((phpdbg_breakopline_t*)brake)->opline_num,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakopline_t*)brake)->hits);
} break;
@@ -1261,8 +1261,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
phpdbg_notice("breakpoint", "id=\"%d\" opcode=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s at %s:%u, hits: %lu",
((phpdbg_breakop_t*)brake)->id,
((phpdbg_breakop_t*)brake)->name,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakop_t*)brake)->hits);
} break;
@@ -1271,8 +1271,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
((phpdbg_breakmethod_t*)brake)->id,
((phpdbg_breakmethod_t*)brake)->class_name,
((phpdbg_breakmethod_t*)brake)->func_name,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakmethod_t*)brake)->hits);
} break;
@@ -1281,10 +1281,10 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
char *param;
phpdbg_notice("breakpoint", "id=\"%d\" location=\"%s\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: at %s if %s at %s:%u, hits: %lu",
((phpdbg_breakcond_t*)brake)->id,
- phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, &param TSRMLS_CC),
+ phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, &param),
((phpdbg_breakcond_t*)brake)->code,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakcond_t*)brake)->hits);
if (param)
free(param);
@@ -1292,8 +1292,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
phpdbg_notice("breakpoint", "id=\"%d\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: on %s == true at %s:%u, hits: %lu",
((phpdbg_breakcond_t*)brake)->id,
((phpdbg_breakcond_t*)brake)->code,
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C),
+ zend_get_executed_filename(),
+ zend_get_executed_lineno(),
((phpdbg_breakcond_t*)brake)->hits);
}
@@ -1302,49 +1302,49 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /*
default: {
unknown:
phpdbg_notice("breakpoint", "id=\"\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Unknown breakpoint at %s:%u",
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C));
+ zend_get_executed_filename(),
+ zend_get_executed_lineno());
}
}
} /* }}} */
-PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id) /* {{{ */
{
- phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC);
+ phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id);
if (brake) {
brake->disabled = 0;
}
} /* }}} */
-PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id) /* {{{ */
{
- phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC);
+ phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id);
if (brake) {
brake->disabled = 1;
}
} /* }}} */
-PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D) /* {{{ */
+PHPDBG_API void phpdbg_enable_breakpoints(void) /* {{{ */
{
PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED;
} /* }}} */
-PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D) { /* {{{ */
+PHPDBG_API void phpdbg_disable_breakpoints(void) { /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IS_BP_ENABLED;
} /* }}} */
-PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC) /* {{{ */
+PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id) /* {{{ */
{
HashTable *table;
zend_string *strkey;
zend_ulong numkey;
- return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey TSRMLS_CC);
+ return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey);
} /* }}} */
-PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC) /* {{{ */
+PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey) /* {{{ */
{
if ((*table = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id))) {
phpdbg_breakbase_t *brake;
@@ -1359,7 +1359,7 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable
return NULL;
} /* }}} */
-PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type) /* {{{ */
{
phpdbg_xml("<breakpoints %r>");
diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h
index 99c4eb6011..a1fafbab7b 100644
--- a/sapi/phpdbg/phpdbg_bp.h
+++ b/sapi/phpdbg/phpdbg_bp.h
@@ -118,46 +118,46 @@ typedef struct _phpdbg_breakcond_t {
} phpdbg_breakcond_t;
/* {{{ Resolving breaks API */
-PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC);
-PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC);
-PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC);
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC);
-PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC); /* }}} */
+PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array);
+PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array);
+PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break);
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht);
+PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */
/* {{{ Breakpoint Creation API */
-PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len TSRMLS_DC);
-PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC); /* }}} */
+PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno);
+PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len);
+PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name);
+PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len);
+PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline);
+PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline);
+PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline);
+PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline);
+PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline);
+PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len);
+PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param); /* }}} */
/* {{{ Breakpoint Detection API */
-PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC); /* }}} */
+PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data*); /* }}} */
/* {{{ Misc Breakpoint API */
-PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output TSRMLS_DC);
-PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC);
-PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake TSRMLS_DC);
-PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D);
-PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D);
-PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC);
-PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D);
-PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC);
-PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC);
-PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D); /* }}} */
+PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output);
+PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type);
+PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake);
+PHPDBG_API void phpdbg_reset_breakpoints(void);
+PHPDBG_API void phpdbg_clear_breakpoints(void);
+PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num);
+PHPDBG_API void phpdbg_enable_breakpoints(void);
+PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id);
+PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id);
+PHPDBG_API void phpdbg_disable_breakpoints(void); /* }}} */
/* {{{ Breakbase API */
-PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC);
-PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC); /* }}} */
+PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id);
+PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey); /* }}} */
/* {{{ Breakpoint Exportation API */
-PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC);
-PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC); /* }}} */
+PHPDBG_API void phpdbg_export_breakpoints(FILE *handle);
+PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str); /* }}} */
#endif /* PHPDBG_BP_H */
diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c
index 386d4d9562..258c492155 100644
--- a/sapi/phpdbg/phpdbg_break.c
+++ b/sapi/phpdbg/phpdbg_break.c
@@ -42,14 +42,14 @@ const phpdbg_command_t phpdbg_break_commands[] = {
PHPDBG_BREAK(at) /* {{{ */
{
- phpdbg_set_breakpoint_at(param TSRMLS_CC);
+ phpdbg_set_breakpoint_at(param);
return SUCCESS;
} /* }}} */
PHPDBG_BREAK(del) /* {{{ */
{
- phpdbg_delete_breakpoint(param->num TSRMLS_CC);
+ phpdbg_delete_breakpoint(param->num);
return SUCCESS;
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 5c74adfdcd..d2196040db 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -44,7 +44,7 @@ static inline const char *phpdbg_command_name(const phpdbg_command_t *command, c
return buffer;
}
-PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */
+PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param) /* {{{ */
{
switch (param->type) {
case STACK_PARAM:
@@ -70,7 +70,7 @@ PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_
}
}
-PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param) /* {{{ */
{
if (param) {
switch (param->type) {
@@ -91,7 +91,7 @@ PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */
} /* }}} */
-PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC) /* {{{ */
+PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer) /* {{{ */
{
switch (param->type) {
case STR_PARAM:
@@ -133,7 +133,7 @@ PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **point
return *pointer;
} /* }}} */
-PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest) /* {{{ */
{
switch ((dest->type = src->type)) {
case STACK_PARAM:
@@ -191,7 +191,7 @@ PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* des
}
} /* }}} */
-PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */
+PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param) /* {{{ */
{
zend_ulong hash = param->type;
@@ -246,7 +246,7 @@ PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) /
return hash;
} /* }}} */
-PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r TSRMLS_DC) /* {{{ */
+PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r) /* {{{ */
{
if (l && r) {
if (l->type == r->type) {
@@ -446,7 +446,7 @@ PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param)
stack->len++;
} /* }}} */
-PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC) {
+PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack) {
if (command) {
char buffer[128] = {0,};
const phpdbg_param_t *top = (stack != NULL) ? *stack : NULL;
@@ -492,7 +492,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param
phpdbg_error("command", "type=\"wrongarg\" command=\"%s\" expected=\"%s\" got=\"%s\" num=\"%lu\"", "The command \"%s\" expected %s and got %s at parameter %lu", \
phpdbg_command_name(command, buffer), \
(e),\
- phpdbg_get_param_type((a) TSRMLS_CC), \
+ phpdbg_get_param_type((a)), \
current); \
return FAILURE; \
}
@@ -544,7 +544,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param
}
/* {{{ */
-PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC) {
+PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top) {
const phpdbg_command_t *command = commands;
phpdbg_param_t *name = *top;
const phpdbg_command_t *matched[3] = {NULL, NULL, NULL};
@@ -628,7 +628,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *
}
if (command->subs && (*top) && ((*top)->type == STR_PARAM)) {
- return phpdbg_stack_resolve(command->subs, command, top TSRMLS_CC);
+ return phpdbg_stack_resolve(command->subs, command, top);
} else {
return command;
}
@@ -637,7 +637,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *
} /* }}} */
/* {{{ */
-PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC) {
+PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe) {
phpdbg_param_t *top = NULL;
const phpdbg_command_t *handler = NULL;
@@ -655,29 +655,29 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async
switch (top->type) {
case EVAL_PARAM:
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
- return PHPDBG_COMMAND_HANDLER(ev)(top TSRMLS_CC);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
+ return PHPDBG_COMMAND_HANDLER(ev)(top);
case RUN_PARAM:
if (!allow_async_unsafe) {
phpdbg_error("signalsegv", "command=\"run\"", "run command is disallowed during hard interrupt");
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
- return PHPDBG_COMMAND_HANDLER(run)(top TSRMLS_CC);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
+ return PHPDBG_COMMAND_HANDLER(run)(top);
case SHELL_PARAM:
if (!allow_async_unsafe) {
phpdbg_error("signalsegv", "command=\"sh\"", "sh command is disallowed during hard interrupt");
return FAILURE;
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
- return PHPDBG_COMMAND_HANDLER(sh)(top TSRMLS_CC);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
+ return PHPDBG_COMMAND_HANDLER(sh)(top);
case STR_PARAM: {
- handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top TSRMLS_CC);
+ handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top);
if (handler) {
if (!allow_async_unsafe && !(handler->flags & PHPDBG_ASYNC_SAFE)) {
@@ -685,10 +685,10 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async
return FAILURE;
}
- if (phpdbg_stack_verify(handler, &top TSRMLS_CC) == SUCCESS) {
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
- return handler->handler(top TSRMLS_CC);
+ if (phpdbg_stack_verify(handler, &top) == SUCCESS) {
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
+ return handler->handler(top);
}
}
} return FAILURE;
@@ -701,14 +701,14 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async
return SUCCESS;
} /* }}} */
-PHPDBG_API char *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */
+PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */
{
char buf[PHPDBG_MAX_CMD];
char *cmd = NULL;
char *buffer = NULL;
if ((PHPDBG_G(flags) & (PHPDBG_IS_STOPPING | PHPDBG_IS_RUNNING)) != PHPDBG_IS_STOPPING) {
- if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem(TSRMLS_C)) {
+ if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem()) {
fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr);
}
@@ -720,12 +720,12 @@ readline:
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE)
#endif
{
- phpdbg_write("prompt", "", "%s", phpdbg_get_prompt(TSRMLS_C));
- phpdbg_consume_stdin_line(cmd = buf TSRMLS_CC);
+ phpdbg_write("prompt", "", "%s", phpdbg_get_prompt());
+ phpdbg_consume_stdin_line(cmd = buf);
}
#if USE_LIB_STAR
else {
- cmd = readline(phpdbg_get_prompt(TSRMLS_C));
+ cmd = readline(phpdbg_get_prompt());
PHPDBG_G(last_was_newline) = 1;
}
@@ -774,19 +774,19 @@ readline:
return buffer;
} /* }}} */
-PHPDBG_API void phpdbg_destroy_input(char **input TSRMLS_DC) /*{{{ */
+PHPDBG_API void phpdbg_destroy_input(char **input) /*{{{ */
{
efree(*input);
} /* }}} */
-PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC) {
+PHPDBG_API int phpdbg_ask_user_permission(const char *question) {
if (!(PHPDBG_G(flags) & PHPDBG_WRITE_XML)) {
char buf[PHPDBG_MAX_CMD];
phpdbg_out("%s", question);
phpdbg_out(" (type y or n): ");
while (1) {
- phpdbg_consume_stdin_line(buf TSRMLS_CC);
+ phpdbg_consume_stdin_line(buf);
if (buf[1] == '\n' && (buf[0] == 'y' || buf[0] == 'n')) {
if (buf[0] == 'y') {
return SUCCESS;
diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h
index a79641c080..41b0c671d1 100644
--- a/sapi/phpdbg/phpdbg_cmd.h
+++ b/sapi/phpdbg/phpdbg_cmd.h
@@ -88,7 +88,7 @@ struct _phpdbg_param {
#define PHPDBG_ASYNC_SAFE 1
-typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t* TSRMLS_DC);
+typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t*);
typedef struct _phpdbg_command_t phpdbg_command_t;
struct _phpdbg_command_t {
@@ -129,28 +129,28 @@ typedef struct {
/*
* Input Management
*/
-PHPDBG_API char* phpdbg_read_input(char *buffered TSRMLS_DC);
-PHPDBG_API void phpdbg_destroy_input(char** TSRMLS_DC);
-PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC);
+PHPDBG_API char* phpdbg_read_input(char *buffered);
+PHPDBG_API void phpdbg_destroy_input(char**);
+PHPDBG_API int phpdbg_ask_user_permission(const char *question);
/**
* Stack Management
*/
PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param);
-PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC);
-PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC);
-PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC);
+PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top);
+PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack);
+PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe);
PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack);
/*
* Parameter Management
*/
-PHPDBG_API void phpdbg_clear_param(phpdbg_param_t* TSRMLS_DC);
-PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t* TSRMLS_DC);
-PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t * TSRMLS_DC);
-PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t * TSRMLS_DC);
-PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t* TSRMLS_DC);
-PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC);
+PHPDBG_API void phpdbg_clear_param(phpdbg_param_t*);
+PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t*);
+PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t *);
+PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *);
+PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t*);
+PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer);
PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg);
/**
@@ -167,9 +167,9 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg)
#define PHPDBG_COMMAND_D(name, tip, alias, children, args, flags) \
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##name, children, args, NULL, flags}
-#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param TSRMLS_DC)
+#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param)
-#define PHPDBG_COMMAND_ARGS param TSRMLS_CC
+#define PHPDBG_COMMAND_ARGS param
#define PHPDBG_END_COMMAND {NULL, 0, NULL, 0, '\0', NULL, NULL, NULL, NULL, 0}
@@ -178,7 +178,7 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg)
*/
#define phpdbg_default_switch_case() \
default: \
- phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param TSRMLS_CC)); \
+ phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param)); \
break
#endif /* PHPDBG_CMD_H */
diff --git a/sapi/phpdbg/phpdbg_eol.c b/sapi/phpdbg/phpdbg_eol.c
index fc20d567bc..47643aae8d 100644
--- a/sapi/phpdbg/phpdbg_eol.c
+++ b/sapi/phpdbg/phpdbg_eol.c
@@ -33,7 +33,7 @@ struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = {
{"CR", "\r", PHPDBG_EOL_CR},
};
-int phpdbg_eol_global_update(char *name TSRMLS_DC)
+int phpdbg_eol_global_update(char *name)
{
if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) {
@@ -83,7 +83,7 @@ char *phpdbg_eol_rep(int id)
/* Inspired by https://ccrma.stanford.edu/~craig/utility/flip/flip.cpp */
-void phpdbg_eol_convert(char **str, int *len TSRMLS_DC)
+void phpdbg_eol_convert(char **str, int *len)
{
char *in = *str, *out ;
int in_len = *len, out_len, cursor, i;
diff --git a/sapi/phpdbg/phpdbg_eol.h b/sapi/phpdbg/phpdbg_eol.h
index 68b54cbe34..0b041b3fdf 100644
--- a/sapi/phpdbg/phpdbg_eol.h
+++ b/sapi/phpdbg/phpdbg_eol.h
@@ -34,13 +34,13 @@ enum {
PHPDBG_EOL_CR /* MAC */
};
-int phpdbg_eol_global_update(char *name TSRMLS_DC);
+int phpdbg_eol_global_update(char *name);
char *phpdbg_eol_name(int id);
char *phpdbg_eol_rep(int id);
-void phpdbg_eol_convert(char **str, int *len TSRMLS_DC);
+void phpdbg_eol_convert(char **str, int *len);
#endif /* PHPDBG_EOL_H */
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index c9ba377d95..08e5874eb8 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -26,7 +26,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-void phpdbg_restore_frame(TSRMLS_D) /* {{{ */
+void phpdbg_restore_frame(void) /* {{{ */
{
if (PHPDBG_FRAME(num) == 0) {
return;
@@ -40,7 +40,7 @@ void phpdbg_restore_frame(TSRMLS_D) /* {{{ */
EG(scope) = PHPDBG_EX(func)->op_array.scope;
} /* }}} */
-void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */
+void phpdbg_switch_frame(int frame) /* {{{ */
{
zend_execute_data *execute_data = PHPDBG_FRAME(num)?PHPDBG_FRAME(execute_data):EG(current_execute_data);
int i = 0;
@@ -70,7 +70,7 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */
return;
}
- phpdbg_restore_frame(TSRMLS_C);
+ phpdbg_restore_frame();
if (frame > 0) {
PHPDBG_FRAME(num) = frame;
@@ -85,14 +85,14 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */
phpdbg_notice("frame", "id=\"%d\"", "Switched to frame #%d", frame);
{
- const char *file_chr = zend_get_executed_filename(TSRMLS_C);
+ const char *file_chr = zend_get_executed_filename();
zend_string *file = zend_string_init(file_chr, strlen(file_chr), 0);
- phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
+ phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno());
efree(file);
}
} /* }}} */
-static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */
+static void phpdbg_dump_prototype(zval *tmp) /* {{{ */
{
zval *funcname, *class, class_zv, *type, *args, *argstmp;
@@ -129,7 +129,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */
phpdbg_try_access {
/* assuming no autoloader call is necessary, class should have been loaded if it's in backtrace ... */
- if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL TSRMLS_CC))) {
+ if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL))) {
arginfo = func->common.arg_info;
}
} phpdbg_end_try_access();
@@ -153,7 +153,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */
}
++j;
- zend_print_flat_zval_r(argstmp TSRMLS_CC);
+ zend_print_flat_zval_r(argstmp);
phpdbg_xml("</arg>");
} ZEND_HASH_FOREACH_END();
@@ -166,7 +166,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */
phpdbg_out(")");
}
-void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */
+void phpdbg_dump_backtrace(size_t num) /* {{{ */
{
HashPosition position;
zval zbacktrace;
@@ -184,7 +184,7 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */
}
phpdbg_try_access {
- zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit TSRMLS_CC);
+ zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit);
} phpdbg_catch_access {
phpdbg_error("signalsegv", "", "Couldn't fetch backtrace, invalid data source");
return;
@@ -207,13 +207,13 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */
if (file) { /* userland */
phpdbg_out("frame #%d: ", i);
phpdbg_xml("<frame %r id=\"%d\" file=\"%s\" line=\"%d\"", i, Z_STRVAL_P(file), Z_LVAL_P(line));
- phpdbg_dump_prototype(tmp TSRMLS_CC);
+ phpdbg_dump_prototype(tmp);
phpdbg_out(" at %s:%ld\n", Z_STRVAL_P(file), Z_LVAL_P(line));
i++;
} else {
phpdbg_out(" => ");
phpdbg_xml("<frame %r id=\"%d\" internal=\"internal\"", i);
- phpdbg_dump_prototype(tmp TSRMLS_CC);
+ phpdbg_dump_prototype(tmp);
phpdbg_out(" (internal function)\n");
}
}
diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h
index 7c4574ed28..63c838fb91 100644
--- a/sapi/phpdbg/phpdbg_frame.h
+++ b/sapi/phpdbg/phpdbg_frame.h
@@ -23,8 +23,8 @@
#include "TSRM.h"
-void phpdbg_restore_frame(TSRMLS_D);
-void phpdbg_switch_frame(int TSRMLS_DC);
-void phpdbg_dump_backtrace(size_t TSRMLS_DC);
+void phpdbg_restore_frame(void);
+void phpdbg_switch_frame(int);
+void phpdbg_dump_backtrace(size_t);
#endif /* PHPDBG_FRAME_H */
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index 652e170694..fefde149e3 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -41,11 +41,11 @@ const phpdbg_command_t phpdbg_help_commands[] = {
}; /* }}} */
/* {{{ pretty_print. Formatting escapes and wrapping text in a string before printing it. */
-void pretty_print(char *text TSRMLS_DC)
+void pretty_print(char *text)
{
char *new, *p, *q;
- const char *prompt_escape = phpdbg_get_prompt(TSRMLS_C);
+ const char *prompt_escape = phpdbg_get_prompt();
unsigned int prompt_escape_len = strlen(prompt_escape);
unsigned int prompt_len = strlen(PHPDBG_G(prompt)[0]);
@@ -53,7 +53,7 @@ void pretty_print(char *text TSRMLS_DC)
const char *bold_off_escape = PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "\033[0m" : "";
unsigned int bold_escape_len = strlen(bold_on_escape);
- unsigned int term_width = phpdbg_get_terminal_width(TSRMLS_C);
+ unsigned int term_width = phpdbg_get_terminal_width();
unsigned int size = 0;
int in_bold = 0;
@@ -142,16 +142,16 @@ void pretty_print(char *text TSRMLS_DC)
} /* }}} */
/* {{{ summary_print. Print a summary line giving, the command, its alias and tip */
-void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC)
+void summary_print(phpdbg_command_t const * const cmd)
{
char *summary;
spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip);
- pretty_print(summary TSRMLS_CC);
+ pretty_print(summary);
efree(summary);
}
/* {{{ get_help. Retries and formats text from the phpdbg help text table */
-static char *get_help(const char * const key TSRMLS_DC)
+static char *get_help(const char * const key)
{
phpdbg_help_text_t *p;
@@ -180,7 +180,7 @@ static int get_command(
const char *key, size_t len, /* pointer and length of key */
phpdbg_command_t const **command, /* address of first matching command */
phpdbg_command_t const * commands /* command table to be scanned */
- TSRMLS_DC)
+ )
{
const phpdbg_command_t *c;
unsigned int num_matches = 0;
@@ -215,26 +215,26 @@ PHPDBG_COMMAND(help) /* {{{ */
int n;
if (!param || param->type == EMPTY_PARAM) {
- pretty_print(get_help("overview!" TSRMLS_CC) TSRMLS_CC);
+ pretty_print(get_help("overview!"));
return SUCCESS;
}
if (param && param->type == STR_PARAM) {
- n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands TSRMLS_CC);
+ n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands);
if (n==1) {
- summary_print(cmd TSRMLS_CC);
- pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC);
+ summary_print(cmd);
+ pretty_print(get_help(cmd->name));
return SUCCESS;
} else if (n>1) {
if (param->len > 1) {
for (cmd=phpdbg_prompt_commands; cmd->name; cmd++) {
if (!strncmp(cmd->name, param->str, param->len)) {
- summary_print(cmd TSRMLS_CC);
+ summary_print(cmd);
}
}
- pretty_print(get_help("duplicate!" TSRMLS_CC) TSRMLS_CC);
+ pretty_print(get_help("duplicate!"));
return SUCCESS;
} else {
phpdbg_error("help", "type=\"ambiguousalias\" alias=\"%s\"", "Internal help error, non-unique alias \"%c\"", param->str[0]);
@@ -242,13 +242,13 @@ PHPDBG_COMMAND(help) /* {{{ */
}
} else { /* no prompt command found so try help topic */
- n = get_command( param->str, param->len, &cmd, phpdbg_help_commands TSRMLS_CC);
+ n = get_command( param->str, param->len, &cmd, phpdbg_help_commands);
if (n>0) {
if (cmd->alias == 'a') { /* help aliases executes a canned routine */
- return cmd->handler(param TSRMLS_CC);
+ return cmd->handler(param);
} else {
- pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC);
+ pretty_print(get_help(cmd->name));
return SUCCESS;
}
}
@@ -285,7 +285,7 @@ PHPDBG_HELP(aliases) /* {{{ */
phpdbg_xml("</helpcommands>");
/* Print out aliases for help as this one comes last, with the added text on how aliases are used */
- get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC);
+ get_command("h", 1, &c, phpdbg_prompt_commands);
phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s\n", c->alias, c->name, c->tip);
phpdbg_xml("<helpaliases>");
@@ -300,7 +300,7 @@ PHPDBG_HELP(aliases) /* {{{ */
phpdbg_xml("</helpaliases>");
- pretty_print(get_help("aliases!" TSRMLS_CC) TSRMLS_CC);
+ pretty_print(get_help("aliases!"));
return SUCCESS;
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index 7963ff35e2..2c52b45686 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -46,15 +46,15 @@ const phpdbg_command_t phpdbg_info_commands[] = {
PHPDBG_INFO(break) /* {{{ */
{
- phpdbg_print_breakpoints(PHPDBG_BREAK_FILE TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_SYM TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_COND TSRMLS_CC);
- phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE TSRMLS_CC);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_FILE);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_SYM);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_COND);
+ phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE);
return SUCCESS;
} /* }}} */
@@ -153,19 +153,19 @@ PHPDBG_INFO(constants) /* {{{ */
return SUCCESS;
} /* }}} */
-static int phpdbg_arm_auto_global(zend_auto_global *auto_global TSRMLS_DC) {
+static int phpdbg_arm_auto_global(zend_auto_global *auto_global) {
if (auto_global->armed) {
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
phpdbg_notice("variableinfo", "unreachable=\"%.*s\"", "Cannot show information about superglobal variable %.*s", auto_global->name->len, auto_global->name->val);
} else {
- auto_global->armed = auto_global->auto_global_callback(auto_global->name TSRMLS_CC);
+ auto_global->armed = auto_global->auto_global_callback(auto_global->name);
}
}
return 0;
}
-static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
+static int phpdbg_print_symbols(zend_bool show_globals) {
HashTable vars;
zend_array *symtable;
zend_string *var;
@@ -178,9 +178,9 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
if (show_globals) {
/* that array should only be manipulated during init, so safe for async access during execution */
- zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global TSRMLS_CC);
+ zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global);
symtable = &EG(symbol_table);
- } else if (!(symtable = zend_rebuild_symbol_table(TSRMLS_C))) {
+ } else if (!(symtable = zend_rebuild_symbol_table())) {
phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!");
return SUCCESS;
}
@@ -189,7 +189,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
phpdbg_try_access {
ZEND_HASH_FOREACH_STR_KEY_VAL(&symtable->ht, var, data) {
- if (zend_is_auto_global(var TSRMLS_CC) ^ !show_globals) {
+ if (zend_is_auto_global(var) ^ !show_globals) {
zend_hash_update(&vars, var, data);
}
} ZEND_HASH_FOREACH_END();
@@ -226,7 +226,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
phpdbg_try_access {
- const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data) TSRMLS_CC);
+ const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data));
VARIABLEINFO("type=\"%s\"", "\n|-------(typeof)------> (%s)\n", type ? type : "unknown");
} phpdbg_catch_access {
VARIABLEINFO("type=\"unknown\"", "\n|-------(typeof)------> (unknown)\n");
@@ -276,12 +276,12 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
PHPDBG_INFO(vars) /* {{{ */
{
- return phpdbg_print_symbols(0 TSRMLS_CC);
+ return phpdbg_print_symbols(0);
}
PHPDBG_INFO(globals) /* {{{ */
{
- return phpdbg_print_symbols(1 TSRMLS_CC);
+ return phpdbg_print_symbols(1);
}
PHPDBG_INFO(literal) /* {{{ */
@@ -309,7 +309,7 @@ PHPDBG_INFO(literal) /* {{{ */
while (literal < ops->last_literal) {
if (Z_TYPE(ops->literals[literal]) != IS_NULL) {
phpdbg_write("literal", "id=\"%u\"", "|-------- C%u -------> [", literal);
- zend_print_zval(&ops->literals[literal], 0 TSRMLS_CC);
+ zend_print_zval(&ops->literals[literal], 0);
phpdbg_out("]\n");
}
literal++;
@@ -328,16 +328,16 @@ PHPDBG_INFO(memory) /* {{{ */
zend_bool is_mm;
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
- heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC);
+ heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem());
}
- if ((is_mm = is_zend_mm(TSRMLS_C))) {
- used = zend_memory_usage(0 TSRMLS_CC);
- real = zend_memory_usage(1 TSRMLS_CC);
- peak_used = zend_memory_peak_usage(0 TSRMLS_CC);
- peak_real = zend_memory_peak_usage(1 TSRMLS_CC);
+ if ((is_mm = is_zend_mm())) {
+ used = zend_memory_usage(0);
+ real = zend_memory_usage(1);
+ peak_used = zend_memory_peak_usage(0);
+ peak_real = zend_memory_peak_usage(1);
}
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
- zend_mm_set_heap(heap TSRMLS_CC);
+ zend_mm_set_heap(heap);
}
if (is_mm) {
@@ -354,7 +354,7 @@ PHPDBG_INFO(memory) /* {{{ */
return SUCCESS;
} /* }}} */
-static inline void phpdbg_print_class_name(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static inline void phpdbg_print_class_name(zend_class_entry *ce) /* {{{ */
{
const char *visibility = ce->type == ZEND_USER_CLASS ? "User" : "Internal";
const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class" : "Class";
@@ -383,7 +383,7 @@ PHPDBG_INFO(classes) /* {{{ */
/* once added, assume that classes are stable... until shutdown. */
ZEND_HASH_FOREACH_PTR(&classes, ce) {
- phpdbg_print_class_name(ce TSRMLS_CC);
+ phpdbg_print_class_name(ce);
if (ce->parent) {
zend_class_entry *pce;
@@ -391,7 +391,7 @@ PHPDBG_INFO(classes) /* {{{ */
pce = ce->parent;
do {
phpdbg_out("|-------- ");
- phpdbg_print_class_name(pce TSRMLS_CC);
+ phpdbg_print_class_name(pce);
} while ((pce = pce->parent));
phpdbg_xml("</parents>");
}
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index a2a5c5969f..6d74230d20 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -48,7 +48,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
/* is easy to generalize ... but not needed for now */
-PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) {
+PHPDBG_API int phpdbg_consume_stdin_line(char *buf) {
int bytes = PHPDBG_G(input_buflen), len = 0;
if (PHPDBG_G(input_buflen)) {
@@ -85,7 +85,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) {
}
len += bytes;
- } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1 TSRMLS_CC)) > 0);
+ } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1)) > 0);
if (bytes <= 0) {
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED;
@@ -96,7 +96,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) {
return bytes;
}
-PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC) {
+PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo) {
int got_now, i = len, j;
char *p = ptr;
#ifndef PHP_WIN32
@@ -177,16 +177,16 @@ PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) {
}
-PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC) {
+PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
- return phpdbg_consume_bytes(sock, ptr, len, tmo TSRMLS_CC);
+ return phpdbg_consume_bytes(sock, ptr, len, tmo);
}
return read(sock, ptr, len);
}
-PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC) {
+PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_send_bytes(sock, ptr, len);
}
@@ -195,9 +195,9 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC)
}
-PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC) {
+PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port) {
struct addrinfo res;
- int fd = phpdbg_create_listenable_socket(interface, port, &res TSRMLS_CC);
+ int fd = phpdbg_create_listenable_socket(interface, port, &res);
if (fd == -1) {
return -1;
@@ -214,7 +214,7 @@ PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSR
}
-PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res TSRMLS_DC) {
+PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res) {
int sock = -1, rc;
int reuse = 1;
struct in6_addr serveraddr;
diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h
index a5659e88c6..631b16beb1 100644
--- a/sapi/phpdbg/phpdbg_io.h
+++ b/sapi/phpdbg/phpdbg_io.h
@@ -21,15 +21,15 @@
#include "phpdbg.h"
-PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC);
+PHPDBG_API int phpdbg_consume_stdin_line(char *buf);
-PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC);
+PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo);
PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len);
-PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC);
-PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC);
+PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo);
+PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len);
-PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res TSRMLS_DC);
-PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC);
+PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res);
+PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port);
PHPDBG_API void phpdbg_close_socket(int sock);
#endif /* PHPDBG_IO_H */
diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c
index 90f3a449da..76dfc393b8 100644
--- a/sapi/phpdbg/phpdbg_lexer.c
+++ b/sapi/phpdbg/phpdbg_lexer.c
@@ -29,7 +29,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) {
+void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
PHPDBG_G(parser_stack) = stack;
YYSETCONDITION(INITIAL);
@@ -39,7 +39,6 @@ void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) {
}
int phpdbg_lex (phpdbg_param_t* yylval) {
- TSRMLS_FETCH(); /* Slow, but this is not a major problem here. TODO: Use TSRMLS_DC */
restart:
LEX(text) = YYCURSOR;
diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h
index ab51e7daa8..d9ec56d489 100644
--- a/sapi/phpdbg/phpdbg_lexer.h
+++ b/sapi/phpdbg/phpdbg_lexer.h
@@ -34,7 +34,7 @@ typedef struct {
#define yyparse phpdbg_parse
#define yylex phpdbg_lex
-void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC);
+void phpdbg_init_lexer (phpdbg_param_t *stack, char *input);
int phpdbg_lex (phpdbg_param_t* yylval);
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
index 0c27fc22ac..45d7c27fa5 100644
--- a/sapi/phpdbg/phpdbg_lexer.l
+++ b/sapi/phpdbg/phpdbg_lexer.l
@@ -27,7 +27,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) {
+void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
PHPDBG_G(parser_stack) = stack;
YYSETCONDITION(INITIAL);
@@ -37,7 +37,6 @@ void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) {
}
int phpdbg_lex (phpdbg_param_t* yylval) {
- TSRMLS_FETCH(); /* Slow, but this is not a major problem here. TODO: Use TSRMLS_DC */
restart:
LEX(text) = YYCURSOR;
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index f201be9850..7404cd139b 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -47,22 +47,22 @@ const phpdbg_command_t phpdbg_list_commands[] = {
PHPDBG_LIST(lines) /* {{{ */
{
- if (!PHPDBG_G(exec) && !zend_is_executing(TSRMLS_C)) {
+ if (!PHPDBG_G(exec) && !zend_is_executing()) {
phpdbg_error("inactive", "type=\"execution\"", "Not executing, and execution context not set");
return SUCCESS;
}
switch (param->type) {
case NUMERIC_PARAM: {
- const char *char_file = phpdbg_current_file(TSRMLS_C);
+ const char *char_file = phpdbg_current_file();
zend_string *file = zend_string_init(char_file, strlen(char_file), 0);
- phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(TSRMLS_C), 0 TSRMLS_CC);
+ phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(), 0);
efree(file);
} break;
case FILE_PARAM: {
zend_string *file = zend_string_init(param->file.name, strlen(param->file.name), 0);
- phpdbg_list_file(file, param->file.line, 0, 0 TSRMLS_CC);
+ phpdbg_list_file(file, param->file.line, 0, 0);
efree(file);
} break;
@@ -74,7 +74,7 @@ PHPDBG_LIST(lines) /* {{{ */
PHPDBG_LIST(func) /* {{{ */
{
- phpdbg_list_function_byname(param->str, param->len TSRMLS_CC);
+ phpdbg_list_function_byname(param->str, param->len);
return SUCCESS;
} /* }}} */
@@ -83,12 +83,12 @@ PHPDBG_LIST(method) /* {{{ */
{
zend_class_entry *ce;
- if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) {
zend_function *function;
char *lcname = zend_str_tolower_dup(param->method.name, strlen(param->method.name));
if ((function = zend_hash_str_find_ptr(&ce->function_table, lcname, strlen(lcname)))) {
- phpdbg_list_function(function TSRMLS_CC);
+ phpdbg_list_function(function);
} else {
phpdbg_error("list", "type=\"notfound\" method=\"%s::%s\"", "Could not find %s::%s", param->method.class, param->method.name);
}
@@ -105,10 +105,10 @@ PHPDBG_LIST(class) /* {{{ */
{
zend_class_entry *ce;
- if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) {
if (ce->type == ZEND_USER_CLASS) {
if (ce->info.user.filename) {
- phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0 TSRMLS_CC);
+ phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0);
} else {
phpdbg_error("list", "type=\"nosource\" class=\"%s\"", "The source of the requested class (%s) cannot be found", ce->name);
}
@@ -122,7 +122,7 @@ PHPDBG_LIST(class) /* {{{ */
return SUCCESS;
} /* }}} */
-void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight TSRMLS_DC) /* {{{ */
+void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */
{
uint line, lastline;
phpdbg_file_source *data;
@@ -176,7 +176,7 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli
phpdbg_xml("</list>");
} /* }}} */
-void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */
+void phpdbg_list_function(const zend_function *fbc) /* {{{ */
{
const zend_op_array *ops;
@@ -187,10 +187,10 @@ void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */
ops = (zend_op_array *) fbc;
- phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0 TSRMLS_CC);
+ phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0);
} /* }}} */
-void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ */
+void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */
{
HashTable *func_table = EG(function_table);
zend_function* fbc;
@@ -220,7 +220,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ *
phpdbg_try_access {
if ((fbc = zend_hash_str_find_ptr(func_table, func_name, func_name_len))) {
- phpdbg_list_function(fbc TSRMLS_CC);
+ phpdbg_list_function(fbc);
} else {
phpdbg_error("list", "type=\"nofunction\" function=\"%s\"", "Function %s not found", func_name);
}
@@ -231,7 +231,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ *
efree(func_name);
} /* }}} */
-zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
+zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
phpdbg_file_source data, *dataptr;
zend_file_handle fake = {{0}};
zend_op_array *ret;
@@ -240,7 +240,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
char *bufptr, *endptr;
char resolved_path_buf[MAXPATHLEN];
- zend_stream_fixup(file, &data.buf, &data.len TSRMLS_CC);
+ zend_stream_fixup(file, &data.buf, &data.len);
data.filename = filename;
data.line[0] = 0;
@@ -279,12 +279,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
zend_hash_str_add_ptr(&PHPDBG_G(file_sources), filename, strlen(filename), dataptr);
- phpdbg_resolve_pending_file_break(filename TSRMLS_CC);
+ phpdbg_resolve_pending_file_break(filename);
- ret = PHPDBG_G(compile_file)(&fake, type TSRMLS_CC);
+ ret = PHPDBG_G(compile_file)(&fake, type);
fake.opened_path = NULL;
- zend_file_handle_dtor(&fake TSRMLS_CC);
+ zend_file_handle_dtor(&fake);
return ret;
}
@@ -302,7 +302,7 @@ void phpdbg_free_file_source(phpdbg_file_source *data) {
efree(data);
}
-void phpdbg_init_list(TSRMLS_D) {
+void phpdbg_init_list(void) {
PHPDBG_G(compile_file) = zend_compile_file;
zend_hash_init(&PHPDBG_G(file_sources), 1, NULL, (dtor_func_t) phpdbg_free_file_source, 0);
zend_compile_file = phpdbg_compile_file;
diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h
index 43a2d474d5..03d8754769 100644
--- a/sapi/phpdbg/phpdbg_list.h
+++ b/sapi/phpdbg/phpdbg_list.h
@@ -32,13 +32,13 @@ PHPDBG_LIST(class);
PHPDBG_LIST(method);
PHPDBG_LIST(func);
-void phpdbg_list_function_byname(const char *, size_t TSRMLS_DC);
-void phpdbg_list_function(const zend_function * TSRMLS_DC);
-void phpdbg_list_file(zend_string *, uint, int, uint TSRMLS_DC);
+void phpdbg_list_function_byname(const char *, size_t);
+void phpdbg_list_function(const zend_function *);
+void phpdbg_list_file(zend_string *, uint, int, uint);
extern const phpdbg_command_t phpdbg_list_commands[];
-void phpdbg_init_list(TSRMLS_D);
+void phpdbg_init_list(void);
typedef struct {
char *filename;
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 20841cbc42..daf6453b4c 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -26,7 +26,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal TSRMLS_DC) /* {{{ */
+static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal) /* {{{ */
{
int iter = 0;
@@ -40,7 +40,7 @@ static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal T
return 0;
} /* }}} */
-static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars TSRMLS_DC) /* {{{ */
+static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars) /* {{{ */
{
char *decode = NULL;
@@ -64,7 +64,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t
} break;
case IS_CONST:
- asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op) TSRMLS_CC));
+ asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op)));
break;
case IS_UNUSED:
@@ -74,7 +74,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t
return decode;
} /* }}} */
-char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC) /*{{{ */
+char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars) /*{{{ */
{
char *decode[4] = {NULL, NULL, NULL, NULL};
@@ -90,7 +90,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM
goto format;
case ZEND_JMPZNZ:
- decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC);
+ decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars);
asprintf(&decode[2], "J%u or J%llu", op->op2.opline_num, op->extended_value);
goto result;
@@ -102,7 +102,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM
#ifdef ZEND_JMP_SET
case ZEND_JMP_SET:
#endif
- decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC);
+ decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars);
asprintf(&decode[2], "J%ld", OP_JMP_ADDR(op, op->op2) - ops->opcodes);
goto result;
@@ -110,10 +110,10 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM
goto result;
default: {
- decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC);
- decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars TSRMLS_CC);
+ decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars);
+ decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars);
result:
- decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars TSRMLS_CC);
+ decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars);
format:
asprintf(&decode[0],
"%-20s %-20s %-20s",
@@ -133,7 +133,7 @@ format:
return decode[0];
} /* }}} */
-void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC) /* {{{ */
+void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags) /* {{{ */
{
/* force out a line while stepping so the user knows what is happening */
if (ignore_flags ||
@@ -142,7 +142,7 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze
(PHPDBG_G(oplog)))) {
zend_op *opline = (zend_op *) execute_data->opline;
- char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars TSRMLS_CC);
+ char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars);
if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) {
/* output line info */
@@ -169,9 +169,9 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze
}
} /* }}} */
-void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC) /* {{{ */
+void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */
{
- phpdbg_print_opline_ex(execute_data, NULL, ignore_flags TSRMLS_CC);
+ phpdbg_print_opline_ex(execute_data, NULL, ignore_flags);
} /* }}} */
const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h
index 144442981d..abcfda360f 100644
--- a/sapi/phpdbg/phpdbg_opcode.h
+++ b/sapi/phpdbg/phpdbg_opcode.h
@@ -24,8 +24,8 @@
#include "zend_types.h"
const char *phpdbg_decode_opcode(zend_uchar);
-char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC);
-void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC);
-void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC);
+char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars);
+void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags);
+void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags);
#endif /* PHPDBG_OPCODE_H */
diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c
index a9edd19ad9..d32d252e1a 100644
--- a/sapi/phpdbg/phpdbg_out.c
+++ b/sapi/phpdbg/phpdbg_out.c
@@ -129,7 +129,7 @@ typedef struct buf_area buffy;
/*
* Do format conversion placing the output in buffer
*/
-static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap TSRMLS_DC) {
+static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap) {
char *sp;
char *bep;
int cc = 0;
@@ -333,7 +333,7 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca
switch (*fmt) {
case 'Z':
zvp = (zval *) va_arg(ap, zval *);
- free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC);
+ free_zcopy = zend_make_printable_zval(zvp, &zcopy);
if (free_zcopy) {
zvp = &zcopy;
}
@@ -814,7 +814,7 @@ skip_output:
return (cc);
}
-static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) {
+static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) {
buffy od;
int cc;
@@ -834,7 +834,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen
/*
* Do the conversion
*/
- cc = format_converter(&od, format, escape_xml, ap TSRMLS_CC);
+ cc = format_converter(&od, format, escape_xml, ap);
if (len != 0 && od.nextb <= od.buf_end) {
*(od.nextb) = '\0';
}
@@ -843,26 +843,26 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen
}
}
-static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) {
+static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) {
int cc;
- strx_printv(&cc, buf, len, format, escape_xml, ap TSRMLS_CC);
+ strx_printv(&cc, buf, len, format, escape_xml, ap);
return (cc);
}
-PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) {
+PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap) {
va_list ap2;
int cc;
va_copy(ap2, ap);
- cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2 TSRMLS_CC);
+ cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2);
va_end(ap2);
*buf = NULL;
if (cc >= 0) {
if ((*buf = emalloc(++cc)) != NULL) {
- if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap TSRMLS_CC)) < 0) {
+ if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap)) < 0) {
efree(*buf);
*buf = NULL;
}
@@ -873,23 +873,23 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es
}
/* copy end */
-PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...) {
+PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) {
int ret;
va_list va;
va_start(va, escape_xml);
- ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va TSRMLS_CC);
+ ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va);
va_end(va);
return ret;
}
-PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...) {
+PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) {
int ret;
va_list va;
va_start(va, format);
- ret = phpdbg_xml_vasprintf(buf, format, 0, va TSRMLS_CC);
+ ret = phpdbg_xml_vasprintf(buf, format, 0, va);
va_end(va);
return ret;
@@ -949,13 +949,13 @@ static void phpdbg_encode_ctrl_chars(char **buf, int *buflen) {
*buflen = len;
}
-static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen TSRMLS_DC) {
+static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen) {
char *msgout = NULL, *buf;
int msgoutlen, xmloutlen, buflen;
const char *severity;
if ((PHPDBG_G(flags) & PHPDBG_WRITE_XML) && PHPDBG_G(in_script_xml) && PHPDBG_G(in_script_xml) != type) {
- phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("</stream>"));
PHPDBG_G(in_script_xml) = 0;
}
@@ -964,9 +964,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
severity = "error";
if (!PHPDBG_G(last_was_newline)) {
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
- phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>"));
} else {
- phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("\n"));
}
PHPDBG_G(last_was_newline) = 1;
}
@@ -981,9 +981,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
severity = "notice";
if (!PHPDBG_G(last_was_newline)) {
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
- phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>"));
} else {
- phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("\n"));
}
PHPDBG_G(last_was_newline) = 1;
}
@@ -1027,18 +1027,18 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
if (PHPDBG_G(in_script_xml) != type) {
char *stream_buf;
int stream_buflen = phpdbg_asprintf(&stream_buf, "<stream type=\"%s\">", type == P_STDERR ? "stderr" : "stdout");
- phpdbg_mixed_write(fd, stream_buf, stream_buflen TSRMLS_CC);
+ phpdbg_mixed_write(fd, stream_buf, stream_buflen);
efree(stream_buf);
PHPDBG_G(in_script_xml) = type;
}
- encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8") TSRMLS_CC);
+ encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8"));
buflen = encoded->len;
memcpy(buf = emalloc(buflen + 1), encoded->val, buflen);
phpdbg_encode_ctrl_chars(&buf, &buflen);
- phpdbg_mixed_write(fd, buf, buflen TSRMLS_CC);
+ phpdbg_mixed_write(fd, buf, buflen);
efree(buf);
} else {
- phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC);
+ phpdbg_mixed_write(fd, msg, msglen);
}
return msglen;
}
@@ -1076,12 +1076,12 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
}
phpdbg_encode_ctrl_chars(&xmlout, &xmloutlen);
- phpdbg_eol_convert(&xmlout, &xmloutlen TSRMLS_CC);
- phpdbg_mixed_write(fd, xmlout, xmloutlen TSRMLS_CC);
+ phpdbg_eol_convert(&xmlout, &xmloutlen);
+ phpdbg_mixed_write(fd, xmlout, xmloutlen);
efree(xmlout);
} else if (msgout) {
- phpdbg_eol_convert(&msgout, &msgoutlen TSRMLS_CC);
- phpdbg_mixed_write(fd, msgout, msgoutlen TSRMLS_CC);
+ phpdbg_eol_convert(&msgout, &msgoutlen);
+ phpdbg_mixed_write(fd, msgout, msgoutlen);
}
if (PHPDBG_G(req_id) && (PHPDBG_G(flags) & PHPDBG_WRITE_XML)) {
@@ -1095,7 +1095,7 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
return msgout ? msgoutlen : xmloutlen;
} /* }}} */
-PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) {
+PHPDBG_API int phpdbg_vprint(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) {
char *msg = NULL, *xml = NULL;
int msglen = 0, xmllen = 0;
int len;
@@ -1103,14 +1103,14 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const
if (strfmt != NULL && strlen(strfmt) > 0L) {
va_copy(argcpy, args);
- msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy TSRMLS_CC);
+ msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy);
va_end(argcpy);
}
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
if (xmlfmt != NULL && strlen(xmlfmt) > 0L) {
va_copy(argcpy, args);
- xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy TSRMLS_CC);
+ xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy);
va_end(argcpy);
} else {
xml = estrdup("");
@@ -1118,7 +1118,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const
}
if (PHPDBG_G(err_buf).active && type != P_STDOUT && type != P_STDERR) {
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_free_err_buf();
PHPDBG_G(err_buf).type = type;
PHPDBG_G(err_buf).fd = fd;
@@ -1133,7 +1133,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const
return msglen;
}
- len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen TSRMLS_CC);
+ len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen);
if (msg) {
efree(msg);
@@ -1146,7 +1146,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const
return len;
}
-PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) {
+PHPDBG_API void phpdbg_free_err_buf(void) {
if (PHPDBG_G(err_buf).type == 0) {
return;
}
@@ -1160,11 +1160,11 @@ PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) {
}
}
-PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC) {
+PHPDBG_API void phpdbg_activate_err_buf(zend_bool active) {
PHPDBG_G(err_buf).active = active;
}
-PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...) {
+PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...) {
int len;
va_list args;
int errbuf_active = PHPDBG_G(err_buf).active;
@@ -1175,21 +1175,17 @@ PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const
PHPDBG_G(err_buf).active = 0;
-#ifdef ZTS
- va_start(args, tsrm_ls);
-#else
va_start(args, strfmt);
-#endif
- len = phpdbg_vprint(PHPDBG_G(err_buf).type TSRMLS_CC, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args);
+ len = phpdbg_vprint(PHPDBG_G(err_buf).type, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args);
va_end(args);
PHPDBG_G(err_buf).active = errbuf_active;
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_free_err_buf();
return len;
}
-PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) {
+PHPDBG_API int phpdbg_print(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) {
va_list args;
int len;
@@ -1198,13 +1194,13 @@ PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const c
}
va_start(args, strfmt);
- len = phpdbg_vprint(type TSRMLS_CC, fd, tag, xmlfmt, strfmt, args);
+ len = phpdbg_vprint(type, fd, tag, xmlfmt, strfmt, args);
va_end(args);
return len;
}
-PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) {
+PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) {
int len = 0;
if (PHPDBG_G(flags) & PHPDBG_DISCARD_OUTPUT) {
@@ -1217,40 +1213,40 @@ PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) {
int buflen;
va_start(args, fmt);
- buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args TSRMLS_CC);
+ buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args);
va_end(args);
phpdbg_encode_ctrl_chars(&buffer, &buflen);
if (PHPDBG_G(in_script_xml)) {
- phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("</stream>"));
PHPDBG_G(in_script_xml) = 0;
}
- len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC);
+ len = phpdbg_mixed_write(fd, buffer, buflen);
efree(buffer);
}
return len;
}
-PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) {
+PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) {
va_list args;
char *buffer;
int buflen;
int len = 0;
va_start(args, fmt);
- buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC);
+ buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args);
va_end(args);
- len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC);
+ len = phpdbg_mixed_write(fd, buffer, buflen);
efree(buffer);
return len;
}
-PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) {
+PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) {
va_list args;
char *buffer;
int buflen;
@@ -1261,7 +1257,7 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) {
}
va_start(args, fmt);
- buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC);
+ buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args);
va_end(args);
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
@@ -1270,26 +1266,26 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) {
msglen = phpdbg_encode_xml(&msg, buffer, buflen, 256, NULL);
phpdbg_encode_ctrl_chars(&msg, &msglen);
- phpdbg_eol_convert(&msg, &msglen TSRMLS_CC);
+ phpdbg_eol_convert(&msg, &msglen);
if (PHPDBG_G(in_script_xml)) {
- phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("</stream>"));
PHPDBG_G(in_script_xml) = 0;
}
- phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>") TSRMLS_CC);
- len = phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC);
- phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>") TSRMLS_CC);
+ phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>"));
+ len = phpdbg_mixed_write(fd, msg, msglen);
+ phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>"));
} else {
- phpdbg_eol_convert(&buffer, &buflen TSRMLS_CC);
- len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC);
+ phpdbg_eol_convert(&buffer, &buflen);
+ len = phpdbg_mixed_write(fd, buffer, buflen);
}
return len;
}
-PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /* {{{ */
+PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) { /* {{{ */
int rc = 0;
va_list args;
@@ -1308,10 +1304,10 @@ PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /*
#endif
phpdbg_asprintf(&buffer, friendly, tp.tv_usec/1000);
phpdbg_asprintf(&format, "[%s]: %s\n", buffer, fmt);
- rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args TSRMLS_CC);
+ rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args);
if (outbuf) {
- rc = phpdbg_mixed_write(fd, outbuf, rc TSRMLS_CC);
+ rc = phpdbg_mixed_write(fd, outbuf, rc);
efree(outbuf);
}
diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h
index ea25b04279..871ea4dfeb 100644
--- a/sapi/phpdbg/phpdbg_out.h
+++ b/sapi/phpdbg/phpdbg_out.h
@@ -35,11 +35,11 @@ enum {
};
#ifdef ZTS
-PHPDBG_API int phpdbg_print(int severity TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7);
-PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7);
+PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 5, 6);
PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
@@ -49,42 +49,42 @@ PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_
#endif
-#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_script(type, fmt, ...) phpdbg_print(type TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__)
-#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_script(type, fmt, ...) phpdbg_print(type , PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__)
+#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
+#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
+#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
-#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
-#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type TSRMLS_CC, out, NULL, NULL, fmt, ##__VA_ARGS__)
-#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__)
+#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type , out, NULL, NULL, fmt, ##__VA_ARGS__)
+#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
+#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
+#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__)
-#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd, fmt, ##__VA_ARGS__)
-#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf TSRMLS_CC, ##__VA_ARGS__)
-PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...);
+#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf, ##__VA_ARGS__)
+PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...);
-#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf TSRMLS_CC, ##__VA_ARGS__)
-PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...);
+#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf, ##__VA_ARGS__)
+PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...);
#if PHPDBG_DEBUG
-# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd TSRMLS_CC, fmt, ##__VA_ARGS__)
+# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd, fmt, ##__VA_ARGS__)
#else
# define phpdbg_debug(fmt, ...)
#endif
-PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D);
-PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC);
-PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...);
+PHPDBG_API void phpdbg_free_err_buf(void);
+PHPDBG_API void phpdbg_activate_err_buf(zend_bool active);
+PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...);
/* {{{ For separation */
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c
index b4da3ed593..61f98b0cb6 100644
--- a/sapi/phpdbg/phpdbg_parser.c
+++ b/sapi/phpdbg/phpdbg_parser.c
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
-/* Bison implementation for Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +46,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.7.12-4996"
+#define YYBISON_VERSION "2.4.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -58,6 +60,8 @@
/* Pull parsers. */
#define YYPULL 1
+/* Using locations. */
+#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
#define yyparse phpdbg_parse
@@ -68,9 +72,11 @@
#define yydebug phpdbg_debug
#define yynerrs phpdbg_nerrs
+
/* Copy the first part of user declarations. */
-/* Line 371 of yacc.c */
-#line 1 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 189 of yacc.c */
+#line 1 "sapi/phpdbg/phpdbg_parser.y"
/*
@@ -92,21 +98,19 @@
#include "phpdbg_lexer.h"
#undef yyerror
-static int yyerror(void ***tsrm_ls, const char *msg);
+static int yyerror(const char *msg);
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-/* Line 371 of yacc.c */
-#line 102 "sapi/phpdbg/phpdbg_parser.c"
-# ifndef YY_NULL
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
-# else
-# define YY_NULL 0
-# endif
-# endif
+/* Line 189 of yacc.c */
+#line 109 "sapi/phpdbg/phpdbg_parser.c"
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@@ -116,20 +120,15 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
# define YYERROR_VERBOSE 1
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "phpdbg_parser.h". */
-#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int phpdbg_debug;
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
#endif
+
/* "%code requires" blocks. */
-/* Line 387 of yacc.c */
-#line 31 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 209 of yacc.c */
+#line 31 "sapi/phpdbg/phpdbg_parser.y"
#include "phpdbg.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -138,7 +137,8 @@ typedef void* yyscan_t;
#endif
-/* Line 387 of yacc.c */
+
+/* Line 209 of yacc.c */
#line 143 "sapi/phpdbg/phpdbg_parser.c"
/* Tokens. */
@@ -168,26 +168,6 @@ typedef void* yyscan_t;
T_REQ_ID = 276
};
#endif
-/* Tokens. */
-#define T_EVAL 258
-#define T_RUN 259
-#define T_SHELL 260
-#define T_IF 261
-#define T_TRUTHY 262
-#define T_FALSY 263
-#define T_STRING 264
-#define T_COLON 265
-#define T_DCOLON 266
-#define T_POUND 267
-#define T_PROTO 268
-#define T_DIGITS 269
-#define T_LITERAL 270
-#define T_ADDR 271
-#define T_OPCODE 272
-#define T_ID 273
-#define T_INPUT 274
-#define T_UNEXPECTED 275
-#define T_REQ_ID 276
@@ -199,26 +179,11 @@ typedef int YYSTYPE;
#endif
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *YYPARSE_PARAM);
-#else
-int phpdbg_parse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *tsrm_ls);
-#else
-int phpdbg_parse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */
-
/* Copy the second part of user declarations. */
-/* Line 390 of yacc.c */
-#line 222 "sapi/phpdbg/phpdbg_parser.c"
+
+/* Line 264 of yacc.c */
+#line 187 "sapi/phpdbg/phpdbg_parser.c"
#ifdef short
# undef short
@@ -268,36 +233,27 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
+# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
-# define YY_(Msgid) Msgid
-# endif
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
- || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-# define __attribute__(Spec) /* empty */
+# define YY_(msgid) msgid
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
+# define YYUSE(e) ((void) (e))
#else
-# define YYUSE(E) /* empty */
+# define YYUSE(e) /* empty */
#endif
-
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
-# define YYID(N) (N)
+# define YYID(n) (n)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@@ -330,12 +286,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
- /* Use EXIT_SUCCESS as a witness for stdlib.h. */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# endif
@@ -358,24 +313,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -404,7 +359,23 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-# define YYCOPY_NEEDED 1
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (YYID (0))
+# endif
+# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -424,26 +395,6 @@ union yyalloc
#endif
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
-# else
-# define YYCOPY(Dst, Src, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (Dst)[yyi] = (Src)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 26
/* YYLAST -- Last index in YYTABLE. */
@@ -525,13 +476,13 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 67, 67, 68, 69, 73, 74, 75, 79, 84,
- 89, 99, 109, 114, 120, 126, 131, 132, 133, 134,
- 135, 136, 137, 141, 142, 146, 151, 156, 160
+ 0, 65, 65, 66, 67, 71, 72, 73, 77, 82,
+ 87, 97, 107, 112, 118, 124, 129, 130, 131, 132,
+ 133, 134, 135, 139, 140, 144, 149, 154, 158
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || 1
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -545,7 +496,7 @@ static const char *const yytname[] =
"\"opcode\"", "\"identifier (command or function name)\"",
"\"input (input string or data)\"", "\"input\"",
"\"request id (-r %d)\"", "$accept", "input", "parameters", "parameter",
- "req_id", "full_expression", YY_NULL
+ "req_id", "full_expression", 0
};
#endif
@@ -576,8 +527,8 @@ static const yytype_uint8 yyr2[] =
1, 1, 1, 1, 0, 3, 3, 2, 3
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -614,7 +565,8 @@ static const yytype_int8 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
@@ -625,12 +577,6 @@ static const yytype_uint8 yytable[] =
32, 36, 39, 40, 0, 0, 41, 42, 27
};
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-16)))
-
-#define yytable_value_is_error(Yytable_value) \
- YYID (0)
-
static const yytype_int8 yycheck[] =
{
3, 4, 5, 6, 7, 8, 21, 2, 3, 19,
@@ -663,50 +609,78 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (tsrm_ls, YY_("syntax error: cannot back up")); \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK (1); \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
-/* Error token number */
+
#define YYTERROR 1
#define YYERRCODE 256
-/* This macro is provided for backward compatibility. */
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
+
#ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, YYLEX_PARAM)
#else
@@ -733,7 +707,7 @@ do { \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value, tsrm_ls); \
+ Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
@@ -747,28 +721,28 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *tsrm_ls)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls)
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
- void *tsrm_ls;
#endif
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
if (!yyvaluep)
return;
- YYUSE (tsrm_ls);
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
- YYUSE (yytype);
+ switch (yytype)
+ {
+ default:
+ break;
+ }
}
@@ -779,14 +753,13 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *tsrm_ls)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls)
+yy_symbol_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
- void *tsrm_ls;
#endif
{
if (yytype < YYNTOKENS)
@@ -794,7 +767,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls)
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls);
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
}
@@ -837,13 +810,12 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *tsrm_ls)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
-yy_reduce_print (yyvsp, yyrule, tsrm_ls)
+yy_reduce_print (yyvsp, yyrule)
YYSTYPE *yyvsp;
int yyrule;
- void *tsrm_ls;
#endif
{
int yynrhs = yyr2[yyrule];
@@ -857,7 +829,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls)
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
- , tsrm_ls);
+ );
YYFPRINTF (stderr, "\n");
}
}
@@ -865,7 +837,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls)
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (yyvsp, Rule, tsrm_ls); \
+ yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
@@ -895,6 +867,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -997,145 +970,115 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULL;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- {
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
- }
+ int yyn = yypact[yystate];
- switch (yycount)
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
{
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
- {
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
+ }
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1145,32 +1088,51 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *tsrm_ls)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
-yydestruct (yymsg, yytype, yyvaluep, tsrm_ls)
+yydestruct (yymsg, yytype, yyvaluep)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
- void *tsrm_ls;
#endif
{
YYUSE (yyvaluep);
- YYUSE (tsrm_ls);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- YYUSE (yytype);
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
}
+/* Prevent warnings from -Wmissing-prototypes. */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
-/*----------.
-| yyparse. |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1186,42 +1148,19 @@ yyparse (YYPARSE_PARAM)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
-yyparse (void *tsrm_ls)
+yyparse (void)
#else
int
-yyparse (tsrm_ls)
- void *tsrm_ls;
+yyparse ()
+
#endif
#endif
{
/* The lookahead symbol. */
int yychar;
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
- _Pragma ("GCC diagnostic pop")
-#else
-/* Default value used for initialization, for pacifying older GCCs
- or non-GCC compilers. */
-static YYSTYPE yyval_default;
-# define YY_INITIAL_VALUE(Value) = Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
+YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
@@ -1234,7 +1173,7 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
`yyss': related to states.
`yyvs': related to semantic values.
- Refer to the stacks through separate pointers, to allow yyoverflow
+ Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@@ -1252,7 +1191,7 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
+ int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1270,8 +1209,9 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yyssp = yyss = yyssa;
- yyvsp = yyvs = yyvsa;
+ yytoken = 0;
+ yyss = yyssa;
+ yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1280,6 +1220,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+ yyssp = yyss;
+ yyvsp = yyvs;
+
goto yysetstate;
/*------------------------------------------------------------.
@@ -1371,7 +1319,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
+ if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1402,8 +1350,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1420,9 +1368,7 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
- YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1459,52 +1405,59 @@ yyreduce:
switch (yyn)
{
case 3:
-/* Line 1802 of yacc.c */
-#line 68 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
+
+/* Line 1455 of yacc.c */
+#line 66 "sapi/phpdbg/phpdbg_parser.y"
+ { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;}
break;
case 5:
-/* Line 1802 of yacc.c */
-#line 73 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); }
+
+/* Line 1455 of yacc.c */
+#line 71 "sapi/phpdbg/phpdbg_parser.y"
+ { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;}
break;
case 6:
-/* Line 1802 of yacc.c */
-#line 74 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); }
+
+/* Line 1455 of yacc.c */
+#line 72 "sapi/phpdbg/phpdbg_parser.y"
+ { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); ;}
break;
case 7:
-/* Line 1802 of yacc.c */
-#line 75 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (2)]); }
+
+/* Line 1455 of yacc.c */
+#line 73 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (2)]); ;}
break;
case 8:
-/* Line 1802 of yacc.c */
-#line 79 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 77 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = FILE_PARAM;
(yyval).file.name = (yyvsp[(2) - (3)]).str;
(yyval).file.line = (yyvsp[(3) - (3)]).num;
- }
+ ;}
break;
case 9:
-/* Line 1802 of yacc.c */
-#line 84 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 82 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FILE_PARAM;
(yyval).file.name = (yyvsp[(1) - (4)]).str;
(yyval).file.line = (yyvsp[(4) - (4)]).num;
- }
+ ;}
break;
case 10:
-/* Line 1802 of yacc.c */
-#line 89 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 87 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = FILE_PARAM;
(yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1);
@@ -1514,12 +1467,13 @@ yyreduce:
(yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0';
}
(yyval).file.line = (yyvsp[(4) - (4)]).num;
- }
+ ;}
break;
case 11:
-/* Line 1802 of yacc.c */
-#line 99 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 97 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FILE_PARAM;
(yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1);
@@ -1529,154 +1483,160 @@ yyreduce:
(yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0';
}
(yyval).file.line = (yyvsp[(5) - (5)]).num;
- }
+ ;}
break;
case 12:
-/* Line 1802 of yacc.c */
-#line 109 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 107 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = METHOD_PARAM;
(yyval).method.class = (yyvsp[(1) - (3)]).str;
(yyval).method.name = (yyvsp[(3) - (3)]).str;
- }
+ ;}
break;
case 13:
-/* Line 1802 of yacc.c */
-#line 114 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 112 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_METHOD_PARAM;
(yyval).method.class = (yyvsp[(1) - (5)]).str;
(yyval).method.name = (yyvsp[(3) - (5)]).str;
(yyval).num = (yyvsp[(5) - (5)]).num;
- }
+ ;}
break;
case 14:
-/* Line 1802 of yacc.c */
-#line 120 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 118 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = NUMERIC_FUNCTION_PARAM;
(yyval).str = (yyvsp[(1) - (3)]).str;
(yyval).len = (yyvsp[(1) - (3)]).len;
(yyval).num = (yyvsp[(3) - (3)]).num;
- }
+ ;}
break;
case 15:
-/* Line 1802 of yacc.c */
-#line 126 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 124 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = COND_PARAM;
(yyval).str = (yyvsp[(2) - (2)]).str;
(yyval).len = (yyvsp[(2) - (2)]).len;
- }
+ ;}
break;
case 16:
-/* Line 1802 of yacc.c */
-#line 131 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 129 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 17:
-/* Line 1802 of yacc.c */
-#line 132 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 130 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 18:
-/* Line 1802 of yacc.c */
-#line 133 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 131 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 19:
-/* Line 1802 of yacc.c */
-#line 134 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 132 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 20:
-/* Line 1802 of yacc.c */
-#line 135 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 133 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 21:
-/* Line 1802 of yacc.c */
-#line 136 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 134 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 22:
-/* Line 1802 of yacc.c */
-#line 137 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
+
+/* Line 1455 of yacc.c */
+#line 135 "sapi/phpdbg/phpdbg_parser.y"
+ { (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 23:
-/* Line 1802 of yacc.c */
-#line 141 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
- { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; }
+
+/* Line 1455 of yacc.c */
+#line 139 "sapi/phpdbg/phpdbg_parser.y"
+ { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; ;}
break;
case 25:
-/* Line 1802 of yacc.c */
-#line 146 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 144 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = EVAL_PARAM;
(yyval).str = (yyvsp[(3) - (3)]).str;
(yyval).len = (yyvsp[(3) - (3)]).len;
- }
+ ;}
break;
case 26:
-/* Line 1802 of yacc.c */
-#line 151 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 149 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = SHELL_PARAM;
(yyval).str = (yyvsp[(3) - (3)]).str;
(yyval).len = (yyvsp[(3) - (3)]).len;
- }
+ ;}
break;
case 27:
-/* Line 1802 of yacc.c */
-#line 156 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 154 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = RUN_PARAM;
(yyval).len = 0;
- }
+ ;}
break;
case 28:
-/* Line 1802 of yacc.c */
-#line 160 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1455 of yacc.c */
+#line 158 "sapi/phpdbg/phpdbg_parser.y"
{
(yyval).type = RUN_PARAM;
(yyval).str = (yyvsp[(3) - (3)]).str;
(yyval).len = (yyvsp[(3) - (3)]).len;
- }
+ ;}
break;
-/* Line 1802 of yacc.c */
-#line 1667 "sapi/phpdbg/phpdbg_parser.c"
+
+/* Line 1455 of yacc.c */
+#line 1638 "sapi/phpdbg/phpdbg_parser.c"
default: break;
}
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action invokes
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
- incorrect destructor might then be invoked immediately. In the
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
- to an incorrect destructor call or verbose syntax error message
- before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -1704,47 +1664,44 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
- yyerror (tsrm_ls, YY_("syntax error"));
+ yyerror (YY_("syntax error"));
#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (tsrm_ls, yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
}
-# undef YYSYNTAX_ERROR
#endif
}
@@ -1764,7 +1721,7 @@ yyerrlab:
else
{
yydestruct ("Error: discarding",
- yytoken, &yylval, tsrm_ls);
+ yytoken, &yylval);
yychar = YYEMPTY;
}
}
@@ -1803,7 +1760,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
+ if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -1820,15 +1777,13 @@ yyerrlab1:
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, tsrm_ls);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
- YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -1852,25 +1807,20 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined yyoverflow || YYERROR_VERBOSE
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
- yyerror (tsrm_ls, YY_("memory exhausted"));
+ yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
if (yychar != YYEMPTY)
- {
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = YYTRANSLATE (yychar);
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, tsrm_ls);
- }
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -1878,7 +1828,7 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, tsrm_ls);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -1894,11 +1844,12 @@ yyreturn:
}
-/* Line 2050 of yacc.c */
-#line 167 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1675 of yacc.c */
+#line 165 "sapi/phpdbg/phpdbg_parser.y"
-static int yyerror(void ***tsrm_ls, const char *msg) {
+static int yyerror(const char *msg) {
phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg);
{
@@ -1912,12 +1863,9 @@ static int yyerror(void ***tsrm_ls, const char *msg) {
return 0;
}
-int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) {
- phpdbg_init_lexer(stack, input TSRMLS_CC);
+int phpdbg_do_parse(phpdbg_param_t *stack, char *input) {
+ phpdbg_init_lexer(stack, input);
-#ifdef ZTS
- return yyparse(TSRMLS_C);
-#else
- return yyparse(NULL);
-#endif
+ return yyparse();
}
+
diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h
index 8d4aeacc31..be201fef96 100644
--- a/sapi/phpdbg/phpdbg_parser.h
+++ b/sapi/phpdbg/phpdbg_parser.h
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
-/* Bison interface for Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,18 +32,10 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int phpdbg_debug;
-#endif
/* "%code requires" blocks. */
-/* Line 2060 of yacc.c */
-#line 31 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y"
+
+/* Line 1676 of yacc.c */
+#line 31 "sapi/phpdbg/phpdbg_parser.y"
#include "phpdbg.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -50,8 +44,9 @@ typedef void* yyscan_t;
#endif
-/* Line 2060 of yacc.c */
-#line 55 "sapi/phpdbg/phpdbg_parser.h"
+
+/* Line 1676 of yacc.c */
+#line 50 "sapi/phpdbg/phpdbg_parser.h"
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -80,26 +75,6 @@ typedef void* yyscan_t;
T_REQ_ID = 276
};
#endif
-/* Tokens. */
-#define T_EVAL 258
-#define T_RUN 259
-#define T_SHELL 260
-#define T_IF 261
-#define T_TRUTHY 262
-#define T_FALSY 263
-#define T_STRING 264
-#define T_COLON 265
-#define T_DCOLON 266
-#define T_POUND 267
-#define T_PROTO 268
-#define T_DIGITS 269
-#define T_LITERAL 270
-#define T_ADDR 271
-#define T_OPCODE 272
-#define T_ID 273
-#define T_INPUT 274
-#define T_UNEXPECTED 275
-#define T_REQ_ID 276
@@ -111,18 +86,5 @@ typedef int YYSTYPE;
#endif
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *YYPARSE_PARAM);
-#else
-int phpdbg_parse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *tsrm_ls);
-#else
-int phpdbg_parse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */
+
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index e4353976f3..18d23b834f 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -19,7 +19,7 @@
#include "phpdbg_lexer.h"
#undef yyerror
-static int yyerror(void ***tsrm_ls, const char *msg);
+static int yyerror(const char *msg);
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -36,8 +36,6 @@ typedef void* yyscan_t;
#endif
}
-%parse-param { void *tsrm_ls }
-
%output "sapi/phpdbg/phpdbg_parser.c"
%defines "sapi/phpdbg/phpdbg_parser.h"
@@ -166,7 +164,7 @@ full_expression
%%
-static int yyerror(void ***tsrm_ls, const char *msg) {
+static int yyerror(const char *msg) {
phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg);
{
@@ -180,12 +178,8 @@ static int yyerror(void ***tsrm_ls, const char *msg) {
return 0;
}
-int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) {
- phpdbg_init_lexer(stack, input TSRMLS_CC);
+int phpdbg_do_parse(phpdbg_param_t *stack, char *input) {
+ phpdbg_init_lexer(stack, input);
-#ifdef ZTS
- return yyparse(TSRMLS_C);
-#else
- return yyparse(NULL);
-#endif
+ return yyparse();
}
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 62a614281d..52bb6629eb 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -42,7 +42,7 @@ const phpdbg_command_t phpdbg_print_commands[] = {
PHPDBG_PRINT(opline) /* {{{ */
{
if (PHPDBG_G(in_execution) && EG(current_execute_data)) {
- phpdbg_print_opline(EG(current_execute_data), 1 TSRMLS_CC);
+ phpdbg_print_opline(EG(current_execute_data), 1);
} else {
phpdbg_error("inactive", "type=\"execution\"", "Not Executing!");
}
@@ -50,7 +50,7 @@ PHPDBG_PRINT(opline) /* {{{ */
return SUCCESS;
} /* }}} */
-static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) /* {{{ */
+static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */
{
switch (method->type) {
case ZEND_USER_FUNCTION: {
@@ -79,7 +79,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC)
zend_hash_init(&vars, op_array->last, NULL, NULL, 0);
do {
- char *decode = phpdbg_decode_opline(op_array, opline, &vars TSRMLS_CC);
+ char *decode = phpdbg_decode_opline(op_array, opline, &vars);
if (decode != NULL) {
phpdbg_writeln("print", "line=\"%u\" opline=\"%p\" opcode=\"%s\" op=\"%s\"", "\t\tL%u\t%p %-30s %s",
opline->lineno,
@@ -110,13 +110,13 @@ PHPDBG_PRINT(exec) /* {{{ */
{
if (PHPDBG_G(exec)) {
if (!PHPDBG_G(ops) && !(PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER)) {
- phpdbg_compile(TSRMLS_C);
+ phpdbg_compile();
}
if (PHPDBG_G(ops)) {
phpdbg_notice("printinfo", "file=\"%s\" num=\"%d\"", "Context %s (%d ops)", PHPDBG_G(exec), PHPDBG_G(ops)->last);
- phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops) TSRMLS_CC);
+ phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops));
}
} else {
phpdbg_error("inactive", "type=\"nocontext\"", "No execution context set");
@@ -142,7 +142,7 @@ PHPDBG_PRINT(stack) /* {{{ */
phpdbg_notice("printinfo", "opline=\"%p\" num=\"%d\"", "Stack @ %p (%d ops)", ops, ops->last);
}
}
- phpdbg_print_function_helper((zend_function*) ops TSRMLS_CC);
+ phpdbg_print_function_helper((zend_function*) ops);
} else {
phpdbg_error("inactive", "type=\"execution\"", "Not Executing!");
}
@@ -154,7 +154,7 @@ PHPDBG_PRINT(class) /* {{{ */
{
zend_class_entry *ce;
- if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) {
phpdbg_notice("printinfo", "type=\"%s\" flag=\"%s\" class=\"%s\" num=\"%d\"", "%s %s: %s (%d methods)",
(ce->type == ZEND_USER_CLASS) ?
"User" : "Internal",
@@ -172,7 +172,7 @@ PHPDBG_PRINT(class) /* {{{ */
zend_function *method;
ZEND_HASH_FOREACH_PTR(&ce->function_table, method) {
- phpdbg_print_function_helper(method TSRMLS_CC);
+ phpdbg_print_function_helper(method);
} ZEND_HASH_FOREACH_END();
}
@@ -188,7 +188,7 @@ PHPDBG_PRINT(method) /* {{{ */
{
zend_class_entry *ce;
- if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) {
zend_function *fbc;
zend_string *lcname = zend_string_alloc(strlen(param->method.name), 0);
zend_str_tolower_copy(lcname->val, param->method.name, lcname->len);
@@ -199,7 +199,7 @@ PHPDBG_PRINT(method) /* {{{ */
fbc->common.function_name->val,
(fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0);
- phpdbg_print_function_helper(fbc TSRMLS_CC);
+ phpdbg_print_function_helper(fbc);
} else {
phpdbg_error("print", "type=\"nomethod\" method=\"%s::%s\"", "The method %s::%s could not be found", param->method.class, param->method.name);
}
@@ -248,7 +248,7 @@ PHPDBG_PRINT(func) /* {{{ */
fbc->common.function_name->val,
(fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0);
- phpdbg_print_function_helper(fbc TSRMLS_CC);
+ phpdbg_print_function_helper(fbc);
} else {
phpdbg_error("print", "type=\"nofunction\" function=\"%s\"", "The function %s could not be found", func_name);
}
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 0ab5b4d230..b49049969e 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -89,7 +89,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_END_COMMAND
}; /* }}} */
-static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ */
+static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
{
phpdbg_param_t *name = NULL;
@@ -113,7 +113,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ *
ZVAL_STRINGL(&fci.function_name, lc_name, name->len);
fci.size = sizeof(zend_fcall_info);
fci.function_table = &PHPDBG_G(registered);
- fci.symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ fci.symbol_table = zend_rebuild_symbol_table();
fci.object = NULL;
fci.retval = &fretval;
fci.no_separation = 1;
@@ -171,19 +171,19 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ *
next = next->next;
}
- zend_fcall_info_args(&fci, &params TSRMLS_CC);
+ zend_fcall_info_args(&fci, &params);
} else {
fci.params = NULL;
fci.param_count = 0;
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
phpdbg_debug("created %d params from arguments", fci.param_count);
- if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) {
- zend_print_zval_r(&fretval, 0 TSRMLS_CC);
+ if (zend_call_function(&fci, NULL) == SUCCESS) {
+ zend_print_zval_r(&fretval, 0);
phpdbg_out("\n");
zval_ptr_dtor(&fretval);
}
@@ -208,7 +208,7 @@ struct phpdbg_init_state {
const char *init_file;
};
-static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_DC) {
+static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state) {
size_t cmd_len = strlen(cmd);
state->line++;
@@ -228,7 +228,7 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
if (memcmp(cmd, ":>", sizeof(":>")-1) == SUCCESS) {
state->in_code = 0;
state->code[state->code_len] = '\0';
- zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code" TSRMLS_CC);
+ zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code");
free(state->code);
state->code = NULL;
return;
@@ -252,33 +252,33 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
}
zend_try {
- char *input = phpdbg_read_input(cmd TSRMLS_CC);
+ char *input = phpdbg_read_input(cmd);
phpdbg_param_t stack;
phpdbg_init_param(&stack, STACK_PARAM);
- phpdbg_activate_err_buf(1 TSRMLS_CC);
+ phpdbg_activate_err_buf(1);
- if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) {
- switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */ TSRMLS_CC)) {
+ if (phpdbg_do_parse(&stack, input) <= 0) {
+ switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */)) {
case FAILURE:
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- if (phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) {
+ phpdbg_activate_err_buf(0);
+ if (phpdbg_call_register(&stack) == FAILURE) {
if (state->init_file) {
- phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!" TSRMLS_CC, state->init_file, state->line, input);
+ phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!", state->init_file, state->line, input);
} else {
- phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!" TSRMLS_CC, state->line, input);
+ phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!", state->line, input);
}
}
break;
}
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
} zend_catch {
PHPDBG_G(flags) &= ~(PHPDBG_IS_RUNNING | PHPDBG_IS_CLEANING);
if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) {
@@ -289,12 +289,12 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D
}
-void phpdbg_string_init(char *buffer TSRMLS_DC) {
+void phpdbg_string_init(char *buffer) {
struct phpdbg_init_state state = {0};
char *str = strtok(buffer, "\n");
while (str) {
- phpdbg_line_init(str, &state TSRMLS_CC);
+ phpdbg_line_init(str, &state);
str = strtok(NULL, "\n");
}
@@ -304,7 +304,7 @@ void phpdbg_string_init(char *buffer TSRMLS_DC) {
}
}
-void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC) /* {{{ */
+void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init) /* {{{ */
{
zend_stat_t sb;
@@ -317,7 +317,7 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
state.init_file = init_file;
while (fgets(cmd, PHPDBG_MAX_CMD, fp) != NULL) {
- phpdbg_line_init(cmd, &state TSRMLS_CC);
+ phpdbg_line_init(cmd, &state);
}
if (state.code) {
@@ -335,13 +335,13 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
}
} /* }}} */
-void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC) /* {{{ */
+void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */
{
if (!init_file && use_default) {
char *scan_dir = getenv("PHP_INI_SCAN_DIR");
int i;
- phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0 TSRMLS_CC);
+ phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0);
if (!scan_dir) {
scan_dir = PHP_CONFIG_FILE_SCAN_DIR;
@@ -359,16 +359,16 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
}
asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME);
- phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC);
+ phpdbg_try_file_init(init_file, strlen(init_file), 1);
if (i == -1) {
break;
}
scan_dir += i + 1;
}
- phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0 TSRMLS_CC);
+ phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0);
} else {
- phpdbg_try_file_init(init_file, init_file_len, 1 TSRMLS_CC);
+ phpdbg_try_file_init(init_file, init_file_len, 1);
}
}
@@ -378,12 +378,12 @@ PHPDBG_COMMAND(exec) /* {{{ */
if (VCWD_STAT(param->str, &sb) != FAILURE) {
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
- char *res = phpdbg_resolve_path(param->str TSRMLS_CC);
+ char *res = phpdbg_resolve_path(param->str);
size_t res_len = strlen(res);
if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) {
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?" TSRMLS_CC) == FAILURE) {
+ if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?") == FAILURE) {
return FAILURE;
}
}
@@ -397,7 +397,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
if (PHPDBG_G(ops)) {
phpdbg_notice("exec", "type=\"unsetops\"", "Destroying compiled opcodes");
- phpdbg_clean(0 TSRMLS_CC);
+ phpdbg_clean(0);
}
PHPDBG_G(exec) = res;
@@ -406,15 +406,15 @@ PHPDBG_COMMAND(exec) /* {{{ */
VCWD_CHDIR_FILE(res);
*SG(request_info).argv = PHPDBG_G(exec);
- php_hash_environment(TSRMLS_C);
+ php_hash_environment();
phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec));
if (PHPDBG_G(in_execution)) {
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
}
- phpdbg_compile(TSRMLS_C);
+ phpdbg_compile();
} else {
phpdbg_notice("exec", "type=\"unchanged\"", "Execution context not changed");
}
@@ -427,7 +427,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
return SUCCESS;
} /* }}} */
-int phpdbg_compile(TSRMLS_D) /* {{{ */
+int phpdbg_compile(void) /* {{{ */
{
zend_file_handle fh;
@@ -436,9 +436,9 @@ int phpdbg_compile(TSRMLS_D) /* {{{ */
return FAILURE;
}
- if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) {
- PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE TSRMLS_CC);
- zend_destroy_file_handle(&fh TSRMLS_CC);
+ if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS) {
+ PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE);
+ zend_destroy_file_handle(&fh);
phpdbg_notice("compile", "context=\"%s\"", "Successful compilation of %s", PHPDBG_G(exec));
@@ -487,7 +487,7 @@ PHPDBG_COMMAND(until) /* {{{ */
return PHPDBG_UNTIL;
} /* }}} */
-static void phpdbg_seek_to_end(TSRMLS_D) {
+static void phpdbg_seek_to_end(void) {
const zend_op *opline = EG(current_execute_data)->opline;
const zend_op_array *op_array = &EG(current_execute_data)->func->op_array - 1;
@@ -513,7 +513,7 @@ PHPDBG_COMMAND(finish) /* {{{ */
}
PHPDBG_G(flags) |= PHPDBG_IN_FINISH;
- phpdbg_seek_to_end(TSRMLS_C);
+ phpdbg_seek_to_end();
return PHPDBG_FINISH;
} /* }}} */
@@ -526,7 +526,7 @@ PHPDBG_COMMAND(leave) /* {{{ */
}
PHPDBG_G(flags) |= PHPDBG_IN_LEAVE;
- phpdbg_seek_to_end(TSRMLS_C);
+ phpdbg_seek_to_end();
return PHPDBG_LEAVE;
} /* }}} */
@@ -536,20 +536,20 @@ PHPDBG_COMMAND(frame) /* {{{ */
if (!param) {
phpdbg_notice("frame", "id=\"%d\"", "Currently in frame #%d", PHPDBG_G(frame).num);
} else {
- phpdbg_switch_frame(param->num TSRMLS_CC);
+ phpdbg_switch_frame(param->num);
}
return SUCCESS;
} /* }}} */
-static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
+static inline void phpdbg_handle_exception(void) /* }}} */
{
zend_fcall_info fci;
zval trace;
/* get filename and linenumber before unsetting exception */
- const char *filename = zend_get_executed_filename(TSRMLS_C);
- uint32_t lineno = zend_get_executed_lineno(TSRMLS_C);
+ const char *filename = zend_get_executed_filename();
+ uint32_t lineno = zend_get_executed_lineno();
/* call __toString */
ZVAL_STRINGL(&fci.function_name, "__tostring", sizeof("__tostring") - 1);
@@ -561,7 +561,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
fci.param_count = 0;
fci.params = NULL;
fci.no_separation = 1;
- if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&fci, NULL) == SUCCESS) {
phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", EG(exception)->ce->name->val, Z_STRLEN(trace), Z_STRVAL(trace));
zval_ptr_dtor(&trace);
@@ -573,7 +573,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */
phpdbg_writeln("exception", "opline=\"%p\" file=\"%s\" line=\"%u\"", "Stack entered at %p in %s on line %u", EG(current_execute_data)->func->op_array.opcodes, filename, lineno);
zval_dtor(&fci.function_name);
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} /* }}} */
PHPDBG_COMMAND(run) /* {{{ */
@@ -583,15 +583,15 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_bool restore = 1;
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to restart execution?" TSRMLS_CC) == SUCCESS) {
+ if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) {
phpdbg_startup_run++;
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
}
return SUCCESS;
}
if (!PHPDBG_G(ops)) {
- if (phpdbg_compile(TSRMLS_C) == FAILURE) {
+ if (phpdbg_compile() == FAILURE) {
phpdbg_error("compile", "type=\"compilefailure\" context=\"%s\"", "Failed to compile %s, cannot run", PHPDBG_G(exec));
goto out;
}
@@ -601,7 +601,7 @@ PHPDBG_COMMAND(run) /* {{{ */
if (ex && ex->symbol_table) {
zend_hash_clean(&ex->symbol_table->ht);
} else {
- zend_rebuild_symbol_table(TSRMLS_C);
+ zend_rebuild_symbol_table();
}
/* clean seek state */
@@ -609,7 +609,7 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_hash_clean(&PHPDBG_G(seek));
/* reset hit counters */
- phpdbg_reset_breakpoints(TSRMLS_C);
+ phpdbg_reset_breakpoints();
if (param && param->type != EMPTY_PARAM && param->len != 0) {
char **argv = emalloc(5 * sizeof(char *));
@@ -633,13 +633,13 @@ PHPDBG_COMMAND(run) /* {{{ */
SG(request_info).argv = erealloc(argv, ++argc * sizeof(char *));
SG(request_info).argc = argc;
- php_hash_environment(TSRMLS_C);
+ php_hash_environment();
}
zend_try {
PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE;
PHPDBG_G(flags) |= PHPDBG_IS_RUNNING;
- zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval) TSRMLS_CC);
+ zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval));
PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE;
} zend_catch {
PHPDBG_G(in_execution) = 0;
@@ -661,11 +661,11 @@ PHPDBG_COMMAND(run) /* {{{ */
if (restore) {
if (EG(exception)) {
- phpdbg_handle_exception(TSRMLS_C);
+ phpdbg_handle_exception();
}
}
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;
} else {
@@ -677,10 +677,10 @@ out:
return SUCCESS;
} /* }}} */
-int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC) {
+int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) {
phpdbg_notice("eval", "variable=\"%.*s\"", "Printing variable %.*s", (int) len, name);
phpdbg_xml("<eval %r>");
- zend_print_zval_r(zv, 0 TSRMLS_CC);
+ zend_print_zval_r(zv, 0);
phpdbg_xml("</eval>");
phpdbg_out("\n");
@@ -705,7 +705,7 @@ PHPDBG_COMMAND(ev) /* {{{ */
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
phpdbg_try_access {
- phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0 TSRMLS_CC);
+ phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0);
} phpdbg_catch_access {
phpdbg_error("signalsegv", "", "Could not fetch data, invalid data source");
} phpdbg_end_try_access();
@@ -721,13 +721,13 @@ PHPDBG_COMMAND(ev) /* {{{ */
/* disable stepping while eval() in progress */
PHPDBG_G(flags) |= PHPDBG_IN_EVAL;
zend_try {
- if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code" TSRMLS_CC) == SUCCESS) {
+ if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code") == SUCCESS) {
phpdbg_xml("<eval %r>");
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
zval *zvp = &retval;
- phpdbg_xml_var_dump(zvp TSRMLS_CC);
+ phpdbg_xml_var_dump(zvp);
}
- zend_print_zval_r(&retval, 0 TSRMLS_CC);
+ zend_print_zval_r(&retval, 0);
phpdbg_xml("</eval>");
phpdbg_out("\n");
zval_ptr_dtor(&retval);
@@ -761,9 +761,9 @@ PHPDBG_COMMAND(back) /* {{{ */
}
if (!param) {
- phpdbg_dump_backtrace(0 TSRMLS_CC);
+ phpdbg_dump_backtrace(0);
} else {
- phpdbg_dump_backtrace(param->num TSRMLS_CC);
+ phpdbg_dump_backtrace(param->num);
}
return SUCCESS;
@@ -827,42 +827,42 @@ PHPDBG_COMMAND(break) /* {{{ */
{
if (!param) {
phpdbg_set_breakpoint_file(
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
+ zend_get_executed_filename(),
+ zend_get_executed_lineno());
} else switch (param->type) {
case ADDR_PARAM:
- phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC);
+ phpdbg_set_breakpoint_opline(param->addr);
break;
case NUMERIC_PARAM:
if (PHPDBG_G(exec)) {
- phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_file(phpdbg_current_file(), param->num);
} else {
phpdbg_error("inactive", "type=\"noexec\"", "Execution context not set!");
}
break;
case METHOD_PARAM:
- phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC);
+ phpdbg_set_breakpoint_method(param->method.class, param->method.name);
break;
case NUMERIC_METHOD_PARAM:
- phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num);
break;
case NUMERIC_FUNCTION_PARAM:
- phpdbg_set_breakpoint_function_opline(param->str, param->num TSRMLS_CC);
+ phpdbg_set_breakpoint_function_opline(param->str, param->num);
break;
case FILE_PARAM:
- phpdbg_set_breakpoint_file(param->file.name, param->file.line TSRMLS_CC);
+ phpdbg_set_breakpoint_file(param->file.name, param->file.line);
break;
case NUMERIC_FILE_PARAM:
- phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line TSRMLS_CC);
+ phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line);
break;
case COND_PARAM:
- phpdbg_set_breakpoint_expression(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_expression(param->str, param->len);
break;
case STR_PARAM:
- phpdbg_set_breakpoint_symbol(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_symbol(param->str, param->len);
break;
case OP_PARAM:
- phpdbg_set_breakpoint_opcode(param->str, param->len TSRMLS_CC);
+ phpdbg_set_breakpoint_opcode(param->str, param->len);
break;
phpdbg_default_switch_case();
@@ -884,17 +884,17 @@ PHPDBG_COMMAND(sh) /* {{{ */
return SUCCESS;
} /* }}} */
-static int add_module_info(zend_module_entry *module TSRMLS_DC) {
+static int add_module_info(zend_module_entry *module) {
phpdbg_write("module", "name=\"%s\"", "%s\n", module->name);
return 0;
}
-static int add_zendext_info(zend_extension *ext TSRMLS_DC) {
+static int add_zendext_info(zend_extension *ext) {
phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name);
return 0;
}
-PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name TSRMLS_DC) {
+PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) {
DL_HANDLE handle;
char *extension_dir;
@@ -963,7 +963,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name
*name = new_extension->name;
- zend_register_extension(new_extension, handle TSRMLS_CC);
+ zend_register_extension(new_extension, handle);
if (new_extension->startup) {
if (new_extension->startup(new_extension) != SUCCESS) {
@@ -1004,20 +1004,20 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name
module_entry->module_number = zend_next_free_module();
module_entry->handle = handle;
- if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) {
+ if ((module_entry = zend_register_module_ex(module_entry)) == NULL) {
phpdbg_error("dl", "type=\"registerfailure\" module=\"%s\"", "Unable to register module %s", module_entry->name);
goto quit;
}
- if (zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+ if (zend_startup_module_ex(module_entry) == FAILURE) {
phpdbg_error("dl", "type=\"startupfailure\" module=\"%s\"", "Unable to startup module %s", module_entry->name);
goto quit;
}
if (module_entry->request_startup_func) {
- if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number TSRMLS_CC) == FAILURE) {
+ if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number) == FAILURE) {
phpdbg_error("dl", "type=\"initfailure\" module=\"%s\"", "Unable to initialize module %s", module_entry->name);
goto quit;
@@ -1041,24 +1041,24 @@ PHPDBG_COMMAND(dl) /* {{{ */
if (!param || param->type == EMPTY_PARAM) {
phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions");
- zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info TSRMLS_CC);
+ zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info);
phpdbg_out("\n");
phpdbg_notice("dl", "extensiontype=\"module\"", "Modules");
- zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC);
+ zend_hash_apply(&module_registry, (apply_func_t) add_module_info);
} else switch (param->type) {
case STR_PARAM:
#ifdef HAVE_LIBDL
path = estrndup(param->str, param->len);
- phpdbg_activate_err_buf(1 TSRMLS_CC);
- if ((type = phpdbg_load_module_or_extension(&path, &name TSRMLS_CC)) == NULL) {
+ phpdbg_activate_err_buf(1);
+ if ((type = phpdbg_load_module_or_extension(&path, &name)) == NULL) {
phpdbg_error("dl", "path=\"%s\" %b", "Could not load %s, not found or invalid zend extension / module: %b", path);
efree(name);
} else {
phpdbg_notice("dl", "extensiontype=\"%s\" name=\"%s\" path=\"%s\"", "Successfully loaded the %s %s at path %s", type, name, path);
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
efree(path);
#else
phpdbg_error("dl", "type=\"unsupported\" path=\"%.*s\"", "Cannot dynamically load %.*s - dynamic modules are not supported", (int) param->len, param->str);
@@ -1076,7 +1076,7 @@ PHPDBG_COMMAND(source) /* {{{ */
zend_stat_t sb;
if (VCWD_STAT(param->str, &sb) != -1) {
- phpdbg_try_file_init(param->str, param->len, 0 TSRMLS_CC);
+ phpdbg_try_file_init(param->str, param->len, 0);
} else {
phpdbg_error("source", "type=\"notfound\" file=\"%s\"", "Failed to stat %s, file does not exist", param->str);
}
@@ -1089,7 +1089,7 @@ PHPDBG_COMMAND(export) /* {{{ */
FILE *handle = VCWD_FOPEN(param->str, "w+");
if (handle) {
- phpdbg_export_breakpoints(handle TSRMLS_CC);
+ phpdbg_export_breakpoints(handle);
fclose(handle);
} else {
phpdbg_error("export", "type=\"openfailure\" file=\"%s\"", "Failed to open or create %s, check path and permissions", param->str);
@@ -1136,7 +1136,7 @@ PHPDBG_COMMAND(quit) /* {{{ */
PHPDBG_COMMAND(clean) /* {{{ */
{
if (PHPDBG_G(in_execution)) {
- if (phpdbg_ask_user_permission("Do you really want to clean your current environment?" TSRMLS_CC) == FAILURE) {
+ if (phpdbg_ask_user_permission("Do you really want to clean your current environment?") == FAILURE) {
return SUCCESS;
}
}
@@ -1151,7 +1151,7 @@ PHPDBG_COMMAND(clean) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;
- phpdbg_clean(1 TSRMLS_CC);
+ phpdbg_clean(1);
phpdbg_xml("</cleaninfo>");
@@ -1172,7 +1172,7 @@ PHPDBG_COMMAND(clear) /* {{{ */
phpdbg_writeln("clear", "methodoplines=\"%d\"", "Method oplines %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]));
phpdbg_writeln("clear", "eval=\"%d\"", "Conditionals %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]));
- phpdbg_clear_breakpoints(TSRMLS_C);
+ phpdbg_clear_breakpoints();
phpdbg_xml("</clearinfo>");
@@ -1191,7 +1191,7 @@ PHPDBG_COMMAND(list) /* {{{ */
return PHPDBG_LIST_HANDLER(lines)(PHPDBG_COMMAND_ARGS);
case STR_PARAM:
- phpdbg_list_function_byname(param->str, param->len TSRMLS_CC);
+ phpdbg_list_function_byname(param->str, param->len);
break;
case METHOD_PARAM:
@@ -1206,10 +1206,10 @@ PHPDBG_COMMAND(list) /* {{{ */
PHPDBG_COMMAND(watch) /* {{{ */
{
if (!param || param->type == EMPTY_PARAM) {
- phpdbg_list_watchpoints(TSRMLS_C);
+ phpdbg_list_watchpoints();
} else switch (param->type) {
case STR_PARAM:
- if (phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC) != FAILURE) {
+ if (phpdbg_create_var_watchpoint(param->str, param->len) != FAILURE) {
phpdbg_notice("watch", "variable=\"%.*s\"", "Set watchpoint on %.*s", (int) param->len, param->str);
}
break;
@@ -1220,7 +1220,7 @@ PHPDBG_COMMAND(watch) /* {{{ */
return SUCCESS;
} /* }}} */
-int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
+int phpdbg_interactive(zend_bool allow_async_unsafe) /* {{{ */
{
int ret = SUCCESS;
char *input = NULL;
@@ -1233,15 +1233,15 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
zend_bailout();
}
- if (!(input = phpdbg_read_input(NULL TSRMLS_CC))) {
+ if (!(input = phpdbg_read_input(NULL))) {
break;
}
phpdbg_init_param(&stack, STACK_PARAM);
- if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) {
- phpdbg_activate_err_buf(1 TSRMLS_CC);
+ if (phpdbg_do_parse(&stack, input) <= 0) {
+ phpdbg_activate_err_buf(1);
#ifdef PHP_WIN32
#define PARA ((phpdbg_param_t *)stack.next)->type
@@ -1249,11 +1249,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
sigio_watcher_start();
}
#endif
- switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe TSRMLS_CC)) {
+ switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
- if (!allow_async_unsafe || phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) {
- phpdbg_output_err_buf(NULL, "%b", "%b" TSRMLS_CC);
+ if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {
+ phpdbg_output_err_buf(NULL, "%b", "%b");
}
}
break;
@@ -1262,8 +1262,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
case PHPDBG_FINISH:
case PHPDBG_UNTIL:
case PHPDBG_NEXT: {
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
if (!PHPDBG_G(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
phpdbg_error("command", "type=\"noexec\"", "Not running");
}
@@ -1271,8 +1271,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
}
}
- phpdbg_activate_err_buf(0 TSRMLS_CC);
- phpdbg_free_err_buf(TSRMLS_C);
+ phpdbg_activate_err_buf(0);
+ phpdbg_free_err_buf();
#ifdef PHP_WIN32
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA)) {
sigio_watcher_stop();
@@ -1282,33 +1282,33 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
}
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
PHPDBG_G(req_id) = 0;
input = NULL;
}
if (input) {
phpdbg_stack_free(&stack);
- phpdbg_destroy_input(&input TSRMLS_CC);
+ phpdbg_destroy_input(&input);
PHPDBG_G(req_id) = 0;
}
if (PHPDBG_G(in_execution)) {
- phpdbg_restore_frame(TSRMLS_C);
+ phpdbg_restore_frame();
}
PHPDBG_G(flags) &= ~PHPDBG_IS_INTERACTIVE;
- phpdbg_print_changed_zvals(TSRMLS_C);
+ phpdbg_print_changed_zvals();
return ret;
} /* }}} */
-void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
+void phpdbg_clean(zend_bool full) /* {{{ */
{
/* this is implicitly required */
if (PHPDBG_G(ops)) {
- destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
+ destroy_op_array(PHPDBG_G(ops));
efree(PHPDBG_G(ops));
PHPDBG_G(ops) = NULL;
}
@@ -1322,13 +1322,13 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
#define DO_INTERACTIVE(allow_async_unsafe) do { \
if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \
- const char *file_char = zend_get_executed_filename(TSRMLS_C); \
+ const char *file_char = zend_get_executed_filename(); \
zend_string *file = zend_string_init(file_char, strlen(file_char), 0); \
- phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C)-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); \
+ phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno()); \
efree(file); \
} \
\
- switch (phpdbg_interactive(allow_async_unsafe TSRMLS_CC)) { \
+ switch (phpdbg_interactive(allow_async_unsafe)) { \
case PHPDBG_LEAVE: \
case PHPDBG_FINISH: \
case PHPDBG_UNTIL: \
@@ -1338,7 +1338,7 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
} \
} while (0)
-void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
+void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
{
zend_bool original_in_execution = PHPDBG_G(in_execution);
HashTable vars;
@@ -1354,7 +1354,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
while (1) {
if ((PHPDBG_G(flags) & PHPDBG_BP_RESOLVE_MASK)) {
/* resolve nth opline breakpoints */
- phpdbg_resolve_op_array_breaks(&execute_data->func->op_array TSRMLS_CC);
+ phpdbg_resolve_op_array_breaks(&execute_data->func->op_array);
}
#ifdef ZEND_WIN32
@@ -1403,8 +1403,8 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IN_LEAVE;
zend_hash_clean(&PHPDBG_G(seek));
phpdbg_notice("breakpoint", "id=\"leave\" file=\"%s\" line=\"%u\"", "Breaking for leave at %s:%u",
- zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C)
+ zend_get_executed_filename(),
+ zend_get_executed_lineno()
);
DO_INTERACTIVE(1);
} else {
@@ -1415,7 +1415,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
}
/* not while in conditionals */
- phpdbg_print_opline_ex(execute_data, &vars, 0 TSRMLS_CC);
+ phpdbg_print_opline_ex(execute_data, &vars, 0);
if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING;
@@ -1424,7 +1424,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
/* check if some watchpoint was hit */
{
- if (phpdbg_print_changed_zvals(TSRMLS_C) == SUCCESS) {
+ if (phpdbg_print_changed_zvals() == SUCCESS) {
DO_INTERACTIVE(1);
}
}
@@ -1434,9 +1434,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */
phpdbg_breakbase_t *brake;
if ((PHPDBG_G(flags) & PHPDBG_BP_MASK)
- && (brake = phpdbg_find_breakpoint(execute_data TSRMLS_CC))
+ && (brake = phpdbg_find_breakpoint(execute_data))
&& (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) {
- phpdbg_hit_breakpoint(brake, 1 TSRMLS_CC);
+ phpdbg_hit_breakpoint(brake, 1);
DO_INTERACTIVE(1);
}
}
@@ -1457,7 +1457,7 @@ next:
if (execute_data->opline->opcode == ZEND_DO_FCALL && execute_data->func->type == ZEND_USER_FUNCTION) {
zend_execute_ex = execute_ex;
}
- PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC);
+ PHPDBG_G(vmret) = execute_data->opline->handler(execute_data);
zend_execute_ex = phpdbg_execute_ex;
if (PHPDBG_G(vmret) != 0) {
@@ -1474,7 +1474,7 @@ next:
} /* }}} */
/* only if *not* interactive and while executing */
-void phpdbg_force_interruption(TSRMLS_D) {
+void phpdbg_force_interruption(void) {
zend_execute_data *data = EG(current_execute_data); /* should be always readable if not NULL */
PHPDBG_G(flags) |= PHPDBG_IN_SIGNAL_HANDLER;
@@ -1505,7 +1505,7 @@ PHPDBG_COMMAND(eol) /* {{{ */
phpdbg_notice("eol", "argument required", "argument required");
} else switch (param->type) {
case STR_PARAM:
- if (FAILURE == phpdbg_eol_global_update(param->str TSRMLS_CC)) {
+ if (FAILURE == phpdbg_eol_global_update(param->str)) {
phpdbg_notice("eol", "unknown EOL name '%s', give crlf, lf, cr", "unknown EOL name '%s', give crlf, lf, cr", param->str);
}
break;
diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h
index f583f2cdcd..3bd30c6279 100644
--- a/sapi/phpdbg/phpdbg_prompt.h
+++ b/sapi/phpdbg/phpdbg_prompt.h
@@ -22,13 +22,13 @@
#define PHPDBG_PROMPT_H
/* {{{ */
-void phpdbg_string_init(char *buffer TSRMLS_DC);
-void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC);
-void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC);
-int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC);
-int phpdbg_compile(TSRMLS_D);
-void phpdbg_clean(zend_bool full TSRMLS_DC);
-void phpdbg_force_interruption(TSRMLS_D);
+void phpdbg_string_init(char *buffer);
+void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default);
+void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init);
+int phpdbg_interactive(zend_bool allow_async_unsafe);
+int phpdbg_compile(void);
+void phpdbg_clean(zend_bool full);
+void phpdbg_force_interruption(void);
/* }}} */
/* {{{ phpdbg command handlers */
@@ -65,9 +65,9 @@ extern const phpdbg_command_t phpdbg_prompt_commands[]; /* }}} */
/* {{{ */
#if PHP_VERSION_ID >= 50500
-void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC);
+void phpdbg_execute_ex(zend_execute_data *execute_data);
#else
-void phpdbg_execute_ex(zend_op_array *op_array TSRMLS_DC);
+void phpdbg_execute_ex(zend_op_array *op_array);
#endif /* }}} */
#endif /* PHPDBG_PROMPT_H */
diff --git a/sapi/phpdbg/phpdbg_rinit_hook.c b/sapi/phpdbg/phpdbg_rinit_hook.c
index ab976c4ddb..d6d136b466 100644
--- a/sapi/phpdbg/phpdbg_rinit_hook.c
+++ b/sapi/phpdbg/phpdbg_rinit_hook.c
@@ -68,18 +68,18 @@ static PHP_RINIT_FUNCTION(phpdbg_webhelper) /* {{{ */
char *msg = NULL;
char msglen[5] = {0};
- phpdbg_webdata_compress(&msg, (int *)msglen TSRMLS_CC);
+ phpdbg_webdata_compress(&msg, (int *)msglen);
send(s, msglen, 4, 0);
send(s, msg, *(int *) msglen, 0);
while ((buflen = recv(s, buf, sizeof(buf) - 1, 0)) > 0) {
- php_write(buf, buflen TSRMLS_CC);
+ php_write(buf, buflen);
}
close(s);
- php_output_flush_all(TSRMLS_C);
+ php_output_flush_all();
zend_bailout();
}
#endif
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index 82b9f69f7a..2428f2b735 100644
--- a/sapi/phpdbg/phpdbg_set.c
+++ b/sapi/phpdbg/phpdbg_set.c
@@ -48,9 +48,9 @@ const phpdbg_command_t phpdbg_set_commands[] = {
PHPDBG_SET(prompt) /* {{{ */
{
if (!param || param->type == EMPTY_PARAM) {
- phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt(TSRMLS_C));
+ phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt());
} else {
- phpdbg_set_prompt(param->str TSRMLS_CC);
+ phpdbg_set_prompt(param->str);
}
return SUCCESS;
@@ -62,12 +62,12 @@ PHPDBG_SET(break) /* {{{ */
case NUMERIC_PARAM: {
if (param->next) {
if (param->next->num) {
- phpdbg_enable_breakpoint(param->num TSRMLS_CC);
+ phpdbg_enable_breakpoint(param->num);
} else {
- phpdbg_disable_breakpoint(param->num TSRMLS_CC);
+ phpdbg_disable_breakpoint(param->num);
}
} else {
- phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num TSRMLS_CC);
+ phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num);
if (brake) {
phpdbg_writeln("setbreak", "id=\"%ld\" active=\"%s\"", "Breakpoint #%ld %s", param->num, brake->disabled ? "off" : "on");
} else {
@@ -90,9 +90,9 @@ PHPDBG_SET(breaks) /* {{{ */
} else switch (param->type) {
case NUMERIC_PARAM: {
if (param->num) {
- phpdbg_enable_breakpoints(TSRMLS_C);
+ phpdbg_enable_breakpoints();
} else {
- phpdbg_disable_breakpoints(TSRMLS_C);
+ phpdbg_disable_breakpoints();
}
} break;
@@ -106,31 +106,31 @@ PHPDBG_SET(breaks) /* {{{ */
#ifndef _WIN32
PHPDBG_SET(color) /* {{{ */
{
- const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len TSRMLS_CC);
+ const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len);
if (!color) {
phpdbg_error("setcolor", "type=\"nocolor\"", "Failed to find the requested color (%s)", param->next->str);
return SUCCESS;
}
- switch (phpdbg_get_element(param->str, param->len TSRMLS_CC)) {
+ switch (phpdbg_get_element(param->str, param->len)) {
case PHPDBG_COLOR_PROMPT:
phpdbg_notice("setcolor", "type=\"prompt\" color=\"%s\" code=\"%s\"", "setting prompt color to %s (%s)", color->name, color->code);
if (PHPDBG_G(prompt)[1]) {
free(PHPDBG_G(prompt)[1]);
PHPDBG_G(prompt)[1]=NULL;
}
- phpdbg_set_color(PHPDBG_COLOR_PROMPT, color TSRMLS_CC);
+ phpdbg_set_color(PHPDBG_COLOR_PROMPT, color);
break;
case PHPDBG_COLOR_ERROR:
phpdbg_notice("setcolor", "type=\"error\" color=\"%s\" code=\"%s\"", "setting error color to %s (%s)", color->name, color->code);
- phpdbg_set_color(PHPDBG_COLOR_ERROR, color TSRMLS_CC);
+ phpdbg_set_color(PHPDBG_COLOR_ERROR, color);
break;
case PHPDBG_COLOR_NOTICE:
phpdbg_notice("setcolor", "type=\"notice\" color=\"%s\" code=\"%s\"", "setting notice color to %s (%s)", color->name, color->code);
- phpdbg_set_color(PHPDBG_COLOR_NOTICE, color TSRMLS_CC);
+ phpdbg_set_color(PHPDBG_COLOR_NOTICE, color);
break;
default:
diff --git a/sapi/phpdbg/phpdbg_sigio_win32.c b/sapi/phpdbg/phpdbg_sigio_win32.c
index 158e034872..7b99a66478 100644
--- a/sapi/phpdbg/phpdbg_sigio_win32.c
+++ b/sapi/phpdbg/phpdbg_sigio_win32.c
@@ -31,31 +31,28 @@ SigIoWatcherThread(VOID *p)
{
zend_uchar sig;
struct win32_sigio_watcher_data *swd = (struct win32_sigio_watcher_data *)p;
-#ifdef ZTS
- void ***tsrm_ls = swd->tsrm_ls;
-#endif
top:
- (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1 TSRMLS_CC);
+ (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1);
if (3 == sig) {
/* XXX completely not sure it is done right here */
- if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) {
+ if (*swd->flags & PHPDBG_IS_INTERACTIVE) {
if (raise(sig)) {
goto top;
}
}
- if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
- phpdbg_set_sigsafe_mem(&sig TSRMLS_CC);
+ if (*swd->flags & PHPDBG_IS_SIGNALED) {
+ phpdbg_set_sigsafe_mem(&sig);
zend_try {
- phpdbg_force_interruption(TSRMLS_C);
+ phpdbg_force_interruption();
} zend_end_try();
- phpdbg_clear_sigsafe_mem(TSRMLS_C);
+ phpdbg_clear_sigsafe_mem();
goto end;
}
- if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) {
- PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED;
+ if (!(*swd->flags & PHPDBG_IS_INTERACTIVE)) {
+ *swd->flags |= PHPDBG_IS_SIGNALED;
}
end:
/* XXX set signaled flag to the caller thread, question is - whether it's needed */
@@ -72,11 +69,10 @@ session. */
void
sigio_watcher_start(void)
{
- TSRMLS_FETCH();
PHPDBG_G(swd).fd = PHPDBG_G(io)[PHPDBG_STDIN].fd;
#ifdef ZTS
- PHPDBG_G(swd).tsrm_ls = tsrm_ls;
+ PHPDBG_G(swd).flags = &PHPDBG_G(flags);
#endif
PHPDBG_G(sigio_watcher_thread) = CreateThread(
@@ -92,7 +88,6 @@ void
sigio_watcher_stop(void)
{
DWORD waited;
- TSRMLS_FETCH();
if (INVALID_HANDLE_VALUE == PHPDBG_G(sigio_watcher_thread)) {
/* it probably did bail out already */
diff --git a/sapi/phpdbg/phpdbg_sigio_win32.h b/sapi/phpdbg/phpdbg_sigio_win32.h
index 8c8a381d64..beb27f979f 100644
--- a/sapi/phpdbg/phpdbg_sigio_win32.h
+++ b/sapi/phpdbg/phpdbg_sigio_win32.h
@@ -25,9 +25,7 @@
#include "phpdbg_io.h"
struct win32_sigio_watcher_data {
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
+ uint64_t *flags;
int fd;
};
diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c
index 1ca7bf230c..ce321595b1 100644
--- a/sapi/phpdbg/phpdbg_sigsafe.c
+++ b/sapi/phpdbg/phpdbg_sigsafe.c
@@ -7,7 +7,6 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
#define EXP_STR(x) STR(x)
static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t alignment) {
- TSRMLS_FETCH();
if (EXPECTED(size == PHPDBG_SIGSAFE_MEM_SIZE && !PHPDBG_G(sigsafe_mem).allocated)) {
PHPDBG_G(sigsafe_mem).allocated = 1;
@@ -28,7 +27,7 @@ static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t ali
static void zend_mm_mem_free(zend_mm_storage *storage, void *ptr, size_t size) {
}
-void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) {
+void phpdbg_set_sigsafe_mem(char *buffer) {
phpdbg_signal_safe_mem *mem = &PHPDBG_G(sigsafe_mem);
mem->mem = buffer;
mem->allocated = 0;
@@ -38,19 +37,19 @@ void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) {
mem->heap = zend_mm_startup_ex(&mem->storage);
- mem->old_heap = zend_mm_set_heap(mem->heap TSRMLS_CC);
+ mem->old_heap = zend_mm_set_heap(mem->heap);
}
-zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D) {
+zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void) {
return PHPDBG_G(sigsafe_mem).old_heap;
}
-void phpdbg_clear_sigsafe_mem(TSRMLS_D) {
- zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC);
+void phpdbg_clear_sigsafe_mem(void) {
+ zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem());
PHPDBG_G(sigsafe_mem).mem = NULL;
}
-zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D) {
+zend_bool phpdbg_active_sigsafe_mem(void) {
return !!PHPDBG_G(sigsafe_mem).mem;
}
diff --git a/sapi/phpdbg/phpdbg_sigsafe.h b/sapi/phpdbg/phpdbg_sigsafe.h
index 9ef723fdca..d8a195f266 100644
--- a/sapi/phpdbg/phpdbg_sigsafe.h
+++ b/sapi/phpdbg/phpdbg_sigsafe.h
@@ -18,11 +18,11 @@ typedef struct {
#include "phpdbg.h"
-zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D);
+zend_bool phpdbg_active_sigsafe_mem(void);
-void phpdbg_set_sigsafe_mem(char *mem TSRMLS_DC);
-void phpdbg_clear_sigsafe_mem(TSRMLS_D);
+void phpdbg_set_sigsafe_mem(char *mem);
+void phpdbg_clear_sigsafe_mem(void);
-zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D);
+zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void);
#endif
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index bff971d4cf..ee938f5c0d 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -140,20 +140,20 @@ PHPDBG_API int phpdbg_is_class_method(const char *str, size_t len, char **class,
return 1;
} /* }}} */
-PHPDBG_API char *phpdbg_resolve_path(const char *path TSRMLS_DC) /* {{{ */
+PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */
{
char resolved_name[MAXPATHLEN];
- if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) {
+ if (expand_filepath(path, resolved_name) == NULL) {
return NULL;
}
return estrdup(resolved_name);
} /* }}} */
-PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */
+PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */
{
- const char *file = zend_get_executed_filename(TSRMLS_C);
+ const char *file = zend_get_executed_filename();
if (memcmp(file, "[no active file]", sizeof("[no active file]")) == 0) {
return PHPDBG_G(exec);
@@ -162,7 +162,7 @@ PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */
return file;
} /* }}} */
-PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname TSRMLS_DC) /* {{{ */
+PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname) /* {{{ */
{
zend_function *func = NULL;
zend_string *lfname = zend_string_alloc(strlen(fname), 0);
@@ -172,7 +172,7 @@ PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const cha
zend_class_entry *ce;
zend_string *lcname = zend_string_alloc(strlen(cname), 0);
memcpy(lcname->val, zend_str_tolower_dup(cname, lcname->len), lcname->len + 1);
- ce = zend_lookup_class(lcname TSRMLS_CC);
+ ce = zend_lookup_class(lcname);
efree(lcname);
@@ -217,7 +217,7 @@ PHPDBG_API char *phpdbg_trim(const char *str, size_t len, size_t *new_len) /* {{
} /* }}} */
-PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC) /* {{{ */
+PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length) /* {{{ */
{
const phpdbg_color_t *color = colors;
@@ -235,26 +235,26 @@ PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_
return NULL;
} /* }}} */
-PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color) /* {{{ */
{
PHPDBG_G(colors)[element] = color;
} /* }}} */
-PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length) /* {{{ */
{
- const phpdbg_color_t *color = phpdbg_get_color(name, name_length TSRMLS_CC);
+ const phpdbg_color_t *color = phpdbg_get_color(name, name_length);
if (color) {
- phpdbg_set_color(element, color TSRMLS_CC);
+ phpdbg_set_color(element, color);
} else PHPDBG_G(colors)[element] = colors;
} /* }}} */
-PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */
+PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(void) /* {{{ */
{
return colors;
} /* }}} */
-PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) {
+PHPDBG_API int phpdbg_get_element(const char *name, size_t len) {
const phpdbg_element_t *element = elements;
while (element && element->name) {
@@ -269,7 +269,7 @@ PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) {
return PHPDBG_COLOR_INVALID;
}
-PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */
+PHPDBG_API void phpdbg_set_prompt(const char *prompt) /* {{{ */
{
/* free formatted prompt */
if (PHPDBG_G(prompt)[1]) {
@@ -286,7 +286,7 @@ PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */
PHPDBG_G(prompt)[0] = strdup(prompt);
} /* }}} */
-PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
+PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */
{
/* find cached prompt */
if (PHPDBG_G(prompt)[1]) {
@@ -312,13 +312,13 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
return PHPDBG_G(prompt)[1];
} /* }}} */
-int phpdbg_rebuild_symtable(TSRMLS_D) {
+int phpdbg_rebuild_symtable(void) {
if (!EG(current_execute_data) || !EG(current_execute_data)->func) {
phpdbg_error("inactive", "type=\"op_array\"", "No active op array!");
return FAILURE;
}
- if (!zend_rebuild_symbol_table(TSRMLS_C)) {
+ if (!zend_rebuild_symbol_table()) {
phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!");
return FAILURE;
}
@@ -326,7 +326,7 @@ int phpdbg_rebuild_symtable(TSRMLS_D) {
return SUCCESS;
}
-PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
+PHPDBG_API int phpdbg_get_terminal_width(void) /* {{{ */
{
int columns;
#ifdef _WIN32
@@ -353,7 +353,7 @@ PHPDBG_API void phpdbg_set_async_io(int fd) {
#endif
}
-int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC) {
+int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce) {
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
char *lc_name, *lc_free;
int lc_length;
@@ -380,7 +380,7 @@ int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry
efree(lc_free);
} else {
zend_string *str_name = zend_string_init(name, name_length, 0);
- *ce = zend_lookup_class(str_name TSRMLS_CC);
+ *ce = zend_lookup_class(str_name);
efree(str_name);
}
@@ -394,15 +394,15 @@ char *phpdbg_get_property_key(char *key) {
return strchr(key + 1, 0) + 1;
}
-static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback TSRMLS_DC) {
- return callback(name, len, keyname, keylen, parent, zv TSRMLS_CC);
+static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback) {
+ return callback(name, len, keyname, keylen, parent, zv);
}
-PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC) {
- return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback TSRMLS_CC);
+PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent) {
+ return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback);
}
-PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg TSRMLS_DC) {
+PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg) {
int ret = FAILURE;
zend_bool new_index = 1;
char *last_index;
@@ -468,11 +468,11 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable
efree(key);
}
- ret = callback(name, namelen, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE;
+ ret = callback(name, namelen, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE;
} else if (Z_TYPE_P(zv) == IS_OBJECT) {
- phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg TSRMLS_CC);
+ phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg);
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
- phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg TSRMLS_CC);
+ phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg);
} else {
/* Ignore silently */
}
@@ -496,7 +496,7 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable
char *name = estrndup(input, len);
char *keyname = estrndup(last_index, index_len);
- ret = callback(name, len, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE;
+ ret = callback(name, len, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE;
} else if (Z_TYPE_P(zv) == IS_OBJECT) {
parent = Z_OBJPROP_P(zv);
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
@@ -515,15 +515,15 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable
return FAILURE;
}
-int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) {
+int phpdbg_is_auto_global(char *name, int len) {
int ret;
zend_string *str = zend_string_init(name, len, 0);
- ret = zend_is_auto_global(str TSRMLS_CC);
+ ret = zend_is_auto_global(str);
efree(str);
return ret;
}
-static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) {
+static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num) {
phpdbg_xml("<element");
phpdbg_try_access {
@@ -539,14 +539,14 @@ static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong
phpdbg_xml(">");
- phpdbg_xml_var_dump(zv TSRMLS_CC);
+ phpdbg_xml_var_dump(zv);
phpdbg_xml("</element>");
return 0;
}
-static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) {
+static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num) {
phpdbg_xml("<property");
phpdbg_try_access {
@@ -574,7 +574,7 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon
phpdbg_xml(">");
- phpdbg_xml_var_dump(zv TSRMLS_CC);
+ phpdbg_xml_var_dump(zv);
phpdbg_xml("</property>");
@@ -583,12 +583,12 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon
#define COMMON (is_ref ? "&" : "")
-PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) {
+PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
HashTable *myht;
zend_string *class_name, *key;
zend_ulong num;
zval *val;
- int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC);
+ int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num);
zend_bool is_ref = 0;
int is_temp;
@@ -635,7 +635,7 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) {
break;
}
- class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv) TSRMLS_CC);
+ class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv));
phpdbg_xml("<object refstatus=\"%s\" class=\"%.*s\" id=\"%d\" num=\"%d\">", COMMON, class_name->len, class_name->val, Z_OBJ_HANDLE_P(zv), myht ? zend_hash_num_elements(myht) : 0);
zend_string_release(class_name);
@@ -643,9 +643,9 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) {
head_done:
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
- element_dump_func(val, key, num TSRMLS_CC);
+ element_dump_func(val, key, num);
} ZEND_HASH_FOREACH_END();
- zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) element_dump_func, 0);
+ zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0);
--myht->u.v.nApplyCount;
if (is_temp) {
zend_hash_destroy(myht);
@@ -659,7 +659,7 @@ head_done:
}
break;
case IS_RESOURCE: {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv));
phpdbg_xml("<resource refstatus=\"%s\" id=\"%pd\" type=\"%ld\" />", COMMON, Z_RES_P(zv)->handle, type_name ? type_name : "unknown");
break;
}
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h
index feb5470b69..4219af5713 100644
--- a/sapi/phpdbg/phpdbg_utils.h
+++ b/sapi/phpdbg/phpdbg_utils.h
@@ -28,10 +28,10 @@ PHPDBG_API int phpdbg_is_numeric(const char*);
PHPDBG_API int phpdbg_is_empty(const char*);
PHPDBG_API int phpdbg_is_addr(const char*);
PHPDBG_API int phpdbg_is_class_method(const char*, size_t, char**, char**);
-PHPDBG_API const char *phpdbg_current_file(TSRMLS_D);
-PHPDBG_API char *phpdbg_resolve_path(const char* TSRMLS_DC);
+PHPDBG_API const char *phpdbg_current_file(void);
+PHPDBG_API char *phpdbg_resolve_path(const char*);
PHPDBG_API char *phpdbg_trim(const char*, size_t, size_t*);
-PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char* TSRMLS_DC);
+PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char*);
/* {{{ Color Management */
#define PHPDBG_COLOR_LEN 12
@@ -63,42 +63,42 @@ typedef struct _phpdbg_element_t {
int id;
} phpdbg_element_t;
-PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC);
-PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC);
-PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC);
-PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(TSRMLS_D);
-PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC); /* }}} */
+PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length);
+PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color);
+PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length);
+PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(void);
+PHPDBG_API int phpdbg_get_element(const char *name, size_t len); /* }}} */
/* {{{ Prompt Management */
-PHPDBG_API void phpdbg_set_prompt(const char* TSRMLS_DC);
-PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D); /* }}} */
+PHPDBG_API void phpdbg_set_prompt(const char*);
+PHPDBG_API const char *phpdbg_get_prompt(void); /* }}} */
/* {{{ Console Width */
-PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D); /* }}} */
+PHPDBG_API int phpdbg_get_terminal_width(void); /* }}} */
PHPDBG_API void phpdbg_set_async_io(int fd);
-int phpdbg_rebuild_symtable(TSRMLS_D);
+int phpdbg_rebuild_symtable(void);
-int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC);
+int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce);
char *phpdbg_get_property_key(char *key);
-typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC);
-typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg TSRMLS_DC);
+typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv);
+typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg);
-PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC);
-PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg TSRMLS_DC);
+PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent);
+PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg);
-int phpdbg_is_auto_global(char *name, int len TSRMLS_DC);
+int phpdbg_is_auto_global(char *name, int len);
-PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC);
+PHPDBG_API void phpdbg_xml_var_dump(zval *zv);
#ifdef ZTS
#define PHPDBG_OUTPUT_BACKUP_DEFINES() \
zend_output_globals *output_globals_ptr; \
zend_output_globals original_output_globals; \
- output_globals_ptr = (zend_output_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)];
+ output_globals_ptr = (zend_output_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)];
#else
#define PHPDBG_OUTPUT_BACKUP_DEFINES() \
zend_output_globals *output_globals_ptr; \
@@ -109,14 +109,14 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC);
#define PHPDBG_OUTPUT_BACKUP_SWAP() \
original_output_globals = *output_globals_ptr; \
memset(output_globals_ptr, 0, sizeof(zend_output_globals)); \
- php_output_activate(TSRMLS_C);
+ php_output_activate();
#define PHPDBG_OUTPUT_BACKUP() \
PHPDBG_OUTPUT_BACKUP_DEFINES() \
PHPDBG_OUTPUT_BACKUP_SWAP()
#define PHPDBG_OUTPUT_BACKUP_RESTORE() \
- php_output_deactivate(TSRMLS_C); \
+ php_output_deactivate(); \
*output_globals_ptr = original_output_globals;
#endif /* PHPDBG_UTILS_H */
diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c
index a76dda88e4..62105d882d 100644
--- a/sapi/phpdbg/phpdbg_wait.c
+++ b/sapi/phpdbg/phpdbg_wait.c
@@ -23,7 +23,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_DC) {
+static void phpdbg_rebuild_http_globals_array(int type, const char *name) {
zval *zvp;
if (Z_TYPE(PG(http_globals)[type]) != IS_UNDEF) {
zval_dtor(&PG(http_globals)[type]);
@@ -35,7 +35,7 @@ static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_
}
-static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global TSRMLS_DC) {
+static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global) {
if (auto_global->name->len != sizeof("GLOBALS") - 1 || memcmp(auto_global->name->val, "GLOBALS", sizeof("GLOBALS") - 1)) {
auto_global->armed = 0;
}
@@ -48,7 +48,7 @@ typedef struct {
HashPosition pos[2];
} phpdbg_intersect_ptr;
-static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) {
+static int phpdbg_array_data_compare(const void *a, const void *b) {
Bucket *f, *s;
zval result;
zval *first, *second;
@@ -59,7 +59,7 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) {
first = &f->val;
second = &s->val;
- if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) {
+ if (string_compare_function(&result, first, second) == FAILURE) {
return 0;
}
@@ -72,12 +72,12 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) {
return 0;
}
-static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2 TSRMLS_DC) {
+static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2) {
info->ht[0] = ht1;
info->ht[1] = ht2;
- zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC);
- zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC);
+ zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0);
+ zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0);
zend_hash_internal_pointer_reset_ex(info->ht[0], &info->pos[0]);
zend_hash_internal_pointer_reset_ex(info->ht[1], &info->pos[1]);
@@ -124,14 +124,14 @@ static int phpdbg_array_intersect(phpdbg_intersect_ptr *info, zval **ptr) {
return ret;
}
-void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
+void phpdbg_webdata_decompress(char *msg, int len) {
zval *free_zv = NULL;
zval zv, *zvp;
HashTable *ht;
php_unserialize_data_t var_hash;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, arborting");
return;
@@ -149,24 +149,24 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
if ((script = zend_hash_str_find(Z_ARRVAL_P(srv), ZEND_STRL("SCRIPT_FILENAME"))) && Z_TYPE_P(script) == IS_STRING) {
phpdbg_param_t param;
param.str = Z_STRVAL_P(script);
- PHPDBG_COMMAND_HANDLER(exec)(&param TSRMLS_CC);
+ PHPDBG_COMMAND_HANDLER(exec)(&param);
}
}
}
PG(auto_globals_jit) = 0;
- zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals TSRMLS_CC);
+ zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals);
zend_hash_clean(&EG(symbol_table).ht);
EG(symbol_table) = *Z_ARR_P(zvp);
/* Rebuild cookies, env vars etc. from GLOBALS (PG(http_globals)) */
- phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST" TSRMLS_CC);
- phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET" TSRMLS_CC);
- phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE" TSRMLS_CC);
- phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER" TSRMLS_CC);
- phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV" TSRMLS_CC);
- phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES" TSRMLS_CC);
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST");
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET");
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE");
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER");
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV");
+ phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES");
Z_ADDREF_P(zvp);
free_zv = zvp;
@@ -222,7 +222,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
}
} ZEND_HASH_FOREACH_END();
- phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp) TSRMLS_CC);
+ phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp));
do {
int mode = phpdbg_array_intersect(&pos, &module);
if (mode < 0) {
@@ -299,7 +299,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
} ZEND_HASH_FOREACH_END();
}
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
if ((zvp = zend_hash_str_find(ht, ZEND_STRL("systemini"))) && Z_TYPE_P(zvp) == IS_ARRAY) {
zval *ini_entry;
@@ -309,7 +309,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) {
if (key && Z_TYPE_P(ini_entry) == IS_STRING) {
if ((original_ini = zend_hash_find_ptr(EG(ini_directives), key))) {
- if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE TSRMLS_CC) == SUCCESS) {
+ if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE) == SUCCESS) {
if (original_ini->modified && original_ini->orig_value != original_ini->value) {
efree(original_ini->value);
}
@@ -327,7 +327,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) {
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) {
if (key && Z_TYPE_P(ini_entry) == IS_STRING) {
- zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1);
}
} ZEND_HASH_FOREACH_END();
}
@@ -384,7 +384,7 @@ PHPDBG_COMMAND(wait) /* {{{ */
recvd -= recv(sr, &(data[(*(int *) msglen) - recvd]), recvd, 0);
} while (recvd > 0);
- phpdbg_webdata_decompress(data, *(int *) msglen TSRMLS_CC);
+ phpdbg_webdata_decompress(data, *(int *) msglen);
if (PHPDBG_G(socket_fd) != -1) {
close(PHPDBG_G(socket_fd));
diff --git a/sapi/phpdbg/phpdbg_wait.h b/sapi/phpdbg/phpdbg_wait.h
index 7cf95919cc..c5a6bb95eb 100644
--- a/sapi/phpdbg/phpdbg_wait.h
+++ b/sapi/phpdbg/phpdbg_wait.h
@@ -24,6 +24,6 @@
PHPDBG_COMMAND(wait);
-void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC);
+void phpdbg_webdata_decompress(char *msg, int len);
#endif /* PHPDBG_WAIT_H */
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index 7a39d3ee1a..adb01f6d54 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -37,7 +37,7 @@ const phpdbg_command_t phpdbg_watch_commands[] = {
PHPDBG_END_COMMAND
};
-//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv TSRMLS_CC) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL)
+//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL)
#define HT_FROM_ZVP(zvp) (Z_TYPE_P(zvp) == IS_OBJECT ? Z_OBJPROP_P(zvp) : Z_TYPE_P(zvp) == IS_ARRAY ? Z_ARRVAL_P(zvp) : NULL)
typedef struct {
@@ -51,7 +51,7 @@ typedef struct {
#define MEMDUMP_SIZE(size) (sizeof(phpdbg_watch_memdump) - sizeof(void *) + (size))
-static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) {
+static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr) {
phpdbg_watchpoint_t *watch;
phpdbg_btree_result *result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong)phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1);
@@ -70,24 +70,24 @@ static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) {
return watch;
}
-static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access TSRMLS_DC) {
+static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access) {
/* pagesize is assumed to be in the range of 2^x */
mprotect(phpdbg_get_page_boundary(watch->addr.ptr), phpdbg_get_total_page_size(watch->addr.ptr, watch->size), access);
}
-static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
- phpdbg_change_watchpoint_access(watch, PROT_READ TSRMLS_CC);
+static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch) {
+ phpdbg_change_watchpoint_access(watch, PROT_READ);
}
-static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
- phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE TSRMLS_CC);
+static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch) {
+ phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE);
}
-static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch) {
phpdbg_btree_insert(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr, watch);
}
-static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch) {
phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr);
}
@@ -108,10 +108,10 @@ void phpdbg_create_ht_watchpoint(HashTable *ht, phpdbg_watchpoint_t *watch) {
void phpdbg_watch_HashTable_dtor(zval *ptr);
-static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC);
-static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC);
-static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC);
-static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC);
+static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch);
+static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch);
+static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch);
+static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch);
/* TODO: Store all the possible watches the refcounted may refer to (for displaying & deleting by identifier) */
@@ -125,7 +125,7 @@ static phpdbg_watchpoint_t *phpdbg_create_refcounted_watchpoint(phpdbg_watchpoin
return watch;
}
-static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch) {
phpdbg_watch_collision *cur;
if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref))) {
cur->num++;
@@ -139,43 +139,43 @@ static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) {
coll.watch = *watch;
zend_hash_init(&coll.watches, 8, NULL, NULL, 0);
cur = zend_hash_index_add_mem(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref, &coll, sizeof(phpdbg_watch_collision));
- phpdbg_store_watchpoint(&cur->watch TSRMLS_CC);
- phpdbg_activate_watchpoint(&cur->watch TSRMLS_CC);
+ phpdbg_store_watchpoint(&cur->watch);
+ phpdbg_activate_watchpoint(&cur->watch);
}
zend_hash_str_add_ptr(&cur->watches, watch->parent->str, watch->parent->str_len, watch->parent);
}
-static void phpdbg_remove_watch_collision(zend_refcounted *ref TSRMLS_DC) {
+static void phpdbg_remove_watch_collision(zend_refcounted *ref) {
phpdbg_watch_collision *cur;
if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) ref))) {
phpdbg_watchpoint_t *watch = cur->watch.parent;
if (watch->flags == PHPDBG_WATCH_RECURSIVE && !--cur->refs) {
- phpdbg_delete_watchpoints_recursive(watch TSRMLS_CC);
+ phpdbg_delete_watchpoints_recursive(watch);
}
zend_hash_str_del(&cur->watches, watch->str, watch->str_len);
if (!--cur->num) {
- phpdbg_deactivate_watchpoint(&cur->watch TSRMLS_CC);
- phpdbg_remove_watchpoint(&cur->watch TSRMLS_CC);
+ phpdbg_deactivate_watchpoint(&cur->watch);
+ phpdbg_remove_watchpoint(&cur->watch);
- phpdbg_delete_watchpoint(watch TSRMLS_CC);
+ phpdbg_delete_watchpoint(watch);
zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) ref);
}
}
}
-static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch) {
watch->flags |= PHPDBG_WATCH_SIMPLE;
- phpdbg_store_watchpoint(watch TSRMLS_CC);
+ phpdbg_store_watchpoint(watch);
zend_hash_str_add_ptr(&PHPDBG_G(watchpoints), watch->str, watch->str_len, watch);
if (watch->parent && watch->parent->type == WATCH_ON_ZVAL && Z_REFCOUNTED_P(watch->parent->addr.zv)) {
- phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv)) TSRMLS_CC);
+ phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv)));
}
if (watch->type == WATCH_ON_ZVAL) {
@@ -193,16 +193,16 @@ static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
ref->parent_container = NULL;
phpdbg_create_zval_watchpoint(Z_REFVAL_P(watch->addr.zv), ref);
- phpdbg_create_watchpoint(ref TSRMLS_CC);
+ phpdbg_create_watchpoint(ref);
}
}
- phpdbg_activate_watchpoint(watch TSRMLS_CC);
+ phpdbg_activate_watchpoint(watch);
return SUCCESS;
}
-static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_DC) {
+static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch) {
zval *zv = zv_watch->addr.zv;
phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t));
HashTable *ht = HT_FROM_ZVP(zv);
@@ -215,7 +215,7 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D
phpdbg_create_ht_watchpoint(ht, watch);
- phpdbg_create_watchpoint(watch TSRMLS_CC);
+ phpdbg_create_watchpoint(watch);
if (Z_TYPE_P(zv) == IS_ARRAY) {
watch->flags |= PHPDBG_WATCH_ARRAY;
@@ -223,12 +223,12 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D
watch->flags |= PHPDBG_WATCH_OBJECT;
}
- phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv)) TSRMLS_CC);
+ phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv)));
return SUCCESS;
}
-static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch) {
HashTable *ht;
zval *zvp = watch->addr.zv;
@@ -237,7 +237,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_
}
watch->flags |= PHPDBG_WATCH_RECURSIVE;
- phpdbg_create_watchpoint(watch TSRMLS_CC);
+ phpdbg_create_watchpoint(watch);
ZVAL_DEREF(zvp);
@@ -272,7 +272,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_
}
phpdbg_create_zval_watchpoint(zv, new_watch);
- phpdbg_create_recursive_watchpoint(new_watch TSRMLS_CC);
+ phpdbg_create_recursive_watchpoint(new_watch);
} ZEND_HASH_FOREACH_END();
}
@@ -294,34 +294,34 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_
}
phpdbg_create_ht_watchpoint(ht, new_watch);
- phpdbg_create_watchpoint(new_watch TSRMLS_CC);
+ phpdbg_create_watchpoint(new_watch);
}
return SUCCESS;
}
-static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request TSRMLS_DC) {
+static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request) {
if (watch->type == WATCH_ON_HASHTABLE) {
HashTable *ht;
phpdbg_btree_result *result;
if (watch->type == WATCH_ON_HASHTABLE && user_request) {
- phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC);
+ phpdbg_delete_ht_watchpoints_recursive(watch);
} else {
ht = HT_FROM_ZVP(watch->addr.zv);
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ht))) {
- phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request);
}
}
} else if (watch->type == WATCH_ON_ZVAL) {
- phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC);
+ phpdbg_delete_zval_watchpoints_recursive(watch);
}
return zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}
-static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch) {
zend_string *strkey;
zend_long numkey;
char *str;
@@ -336,26 +336,26 @@ static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TS
}
if ((watchpoint = zend_hash_str_find_ptr(&PHPDBG_G(watchpoints), str, str_len))) {
- phpdbg_delete_watchpoint_recursive(watchpoint, 1 TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive(watchpoint, 1);
}
} ZEND_HASH_FOREACH_END();
}
-static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch) {
if (Z_REFCOUNTED_P(watch->addr.zv)) {
- phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC);
+ phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv));
}
}
-static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch) {
if (watch->type == WATCH_ON_ZVAL) {
- phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC);
+ phpdbg_delete_zval_watchpoints_recursive(watch);
} else if (watch->type == WATCH_ON_HASHTABLE) {
- phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC);
+ phpdbg_delete_ht_watchpoints_recursive(watch);
}
}
-static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) {
+static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch) {
int ret;
phpdbg_watchpoint_t *watch;
phpdbg_btree_result *result;
@@ -367,7 +367,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) {
watch = result->ptr;
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- ret = phpdbg_delete_watchpoint_recursive(watch, 1 TSRMLS_CC);
+ ret = phpdbg_delete_watchpoint_recursive(watch, 1);
} else {
ret = zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}
@@ -379,7 +379,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) {
return ret;
}
-static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) {
+static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t *)) {
int ret;
phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t));
watch->flags = 0;
@@ -390,7 +390,7 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname
watch->parent_container = parent;
phpdbg_create_zval_watchpoint(zv, watch);
- ret = callback(watch TSRMLS_CC);
+ ret = callback(watch);
if (ret != SUCCESS) {
efree(watch);
@@ -401,27 +401,27 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname
return ret;
}
-PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC), zend_bool silent TSRMLS_DC) {
- return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback TSRMLS_CC);
+PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t *), zend_bool silent) {
+ return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback);
}
-static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) {
+static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t *)) {
if (EG(scope) && len >= 5 && !memcmp("$this", input, 5)) {
zend_hash_str_add(&EG(current_execute_data)->symbol_table->ht, ZEND_STRL("this"), &EG(current_execute_data)->This);
}
- if (phpdbg_is_auto_global(input, len TSRMLS_CC) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1 TSRMLS_CC) != FAILURE) {
+ if (phpdbg_is_auto_global(input, len) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1) != FAILURE) {
return SUCCESS;
}
- return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0 TSRMLS_CC);
+ return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0);
}
PHPDBG_WATCH(delete) /* {{{ */
{
switch (param->type) {
case STR_PARAM:
- if (phpdbg_delete_var_watchpoint(param->str, param->len TSRMLS_CC) == FAILURE) {
+ if (phpdbg_delete_var_watchpoint(param->str, param->len) == FAILURE) {
phpdbg_error("watchdelete", "type=\"nowatch\"", "Nothing was deleted, no corresponding watchpoint found");
} else {
phpdbg_notice("watchdelete", "variable=\"%.*s\"", "Removed watchpoint %.*s", (int) param->len, param->str);
@@ -436,13 +436,13 @@ PHPDBG_WATCH(delete) /* {{{ */
PHPDBG_WATCH(recursive) /* {{{ */
{
- if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
+ if (phpdbg_rebuild_symtable() == FAILURE) {
return SUCCESS;
}
switch (param->type) {
case STR_PARAM:
- if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint TSRMLS_CC) != FAILURE) {
+ if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint) != FAILURE) {
phpdbg_notice("watchrecursive", "variable=\"%.*s\"", "Set recursive watchpoint on %.*s", (int)param->len, param->str);
}
break;
@@ -455,13 +455,13 @@ PHPDBG_WATCH(recursive) /* {{{ */
PHPDBG_WATCH(array) /* {{{ */
{
- if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
+ if (phpdbg_rebuild_symtable() == FAILURE) {
return SUCCESS;
}
switch (param->type) {
case STR_PARAM:
- if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint TSRMLS_CC) != FAILURE) {
+ if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint) != FAILURE) {
phpdbg_notice("watcharray", "variable=\"%.*s\"", "Set array watchpoint on %.*s", (int)param->len, param->str);
}
break;
@@ -474,7 +474,6 @@ PHPDBG_WATCH(array) /* {{{ */
void phpdbg_watch_HashTable_dtor(zval *zv) {
phpdbg_btree_result *result;
- TSRMLS_FETCH();
zval_ptr_dtor_wrapper(zv);
@@ -486,7 +485,7 @@ void phpdbg_watch_HashTable_dtor(zval *zv) {
phpdbg_notice("watchdelete", "variable=\"%.*s\" recursive=\"%s\"", "%.*s was removed, removing watchpoint%s", (int) watch->str_len, watch->str, (watch->flags & PHPDBG_WATCH_RECURSIVE) ? " recursively" : "");
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- phpdbg_delete_watchpoint_recursive(watch, 0 TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive(watch, 0);
} else {
zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}
@@ -494,26 +493,26 @@ void phpdbg_watch_HashTable_dtor(zval *zv) {
}
-int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC) {
- if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
+int phpdbg_create_var_watchpoint(char *input, size_t len) {
+ if (phpdbg_rebuild_symtable() == FAILURE) {
return FAILURE;
}
- return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint TSRMLS_CC);
+ return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint);
}
-int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC) {
- if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) {
+int phpdbg_delete_var_watchpoint(char *input, size_t len) {
+ if (phpdbg_rebuild_symtable() == FAILURE) {
return FAILURE;
}
- return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint TSRMLS_CC);
+ return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint);
}
#ifdef _WIN32
-int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC) {
+int phpdbg_watchpoint_segfault_handler(void *addr) {
#else
-int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) {
+int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context) {
#endif
void *page;
phpdbg_watch_memdump *dump;
@@ -526,7 +525,7 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC)
#else
info->si_addr
#endif
- TSRMLS_CC);
+ );
if (watch == NULL) {
return FAILURE;
@@ -549,16 +548,15 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC)
return SUCCESS;
}
-void phpdbg_watchpoints_clean(TSRMLS_D) {
+void phpdbg_watchpoints_clean(void) {
zend_hash_clean(&PHPDBG_G(watchpoints));
}
static void phpdbg_watch_dtor(zval *pDest) {
phpdbg_watchpoint_t *watch = (phpdbg_watchpoint_t *) Z_PTR_P(pDest);
- TSRMLS_FETCH();
- phpdbg_deactivate_watchpoint(watch TSRMLS_CC);
- phpdbg_remove_watchpoint(watch TSRMLS_CC);
+ phpdbg_deactivate_watchpoint(watch);
+ phpdbg_remove_watchpoint(watch);
efree(watch->str);
efree(watch->name_in_parent);
@@ -575,7 +573,7 @@ static void phpdbg_watch_mem_dtor(void *llist_data) {
free(*(void **) llist_data);
}
-void phpdbg_setup_watchpoints(TSRMLS_D) {
+void phpdbg_setup_watchpoints(void) {
#if _SC_PAGE_SIZE
phpdbg_pagesize = sysconf(_SC_PAGE_SIZE);
#elif _SC_PAGESIZE
@@ -593,7 +591,7 @@ void phpdbg_setup_watchpoints(TSRMLS_D) {
zend_hash_init(&PHPDBG_G(watch_collisions), 8, NULL, NULL, 0);
}
-static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
+static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump) {
/* fetch all changes between dump->page and dump->page + dump->size */
phpdbg_btree_position pos = phpdbg_btree_find_between(&PHPDBG_G(watchpoint_tree), (zend_ulong) dump->page, (zend_ulong) dump->page + dump->size);
phpdbg_btree_result *result;
@@ -631,11 +629,11 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
}
if (curTest != watch->addr.ptr) {
- phpdbg_deactivate_watchpoint(watch TSRMLS_CC);
- phpdbg_remove_watchpoint(watch TSRMLS_CC);
+ phpdbg_deactivate_watchpoint(watch);
+ phpdbg_remove_watchpoint(watch);
watch->addr.ptr = curTest;
- phpdbg_store_watchpoint(watch TSRMLS_CC);
- phpdbg_activate_watchpoint(watch TSRMLS_CC);
+ phpdbg_store_watchpoint(watch);
+ phpdbg_activate_watchpoint(watch);
reenable = 0;
}
@@ -680,7 +678,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
} else {
phpdbg_out("Old value: ");
phpdbg_xml("<watchvalue %r type=\"old\">");
- zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC);
+ zend_print_flat_zval_r((zval *) oldPtr);
phpdbg_xml("</watchvalue>");
phpdbg_out("\n");
}
@@ -694,7 +692,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
reenable = 0;
if (Z_REFCOUNTED_P((zval *) oldPtr)) {
- phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC);
+ phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr));
}
break;
}
@@ -702,7 +700,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
if (show_value) {
phpdbg_out("New value: ");
phpdbg_xml("<watchvalue %r type=\"new\">");
- zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC);
+ zend_print_flat_zval_r(watch->addr.zv);
phpdbg_xml("</watchvalue>");
phpdbg_out("\n");
}
@@ -710,14 +708,14 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
/* add new watchpoints if necessary */
if (Z_PTR_P(watch->addr.zv) != Z_PTR_P((zval *) oldPtr)) {
if (Z_REFCOUNTED_P((zval *) oldPtr)) {
- phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC);
+ phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr));
}
if (Z_REFCOUNTED_P(watch->addr.zv)) {
if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS) {
phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", Z_COUNTED_P(watch->addr.zv)->refcount);
}
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- phpdbg_create_recursive_watchpoint(watch TSRMLS_CC);
+ phpdbg_create_recursive_watchpoint(watch);
}
}
}
@@ -744,7 +742,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
/* add new watchpoints if necessary */
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- phpdbg_create_recursive_watchpoint(watch TSRMLS_CC);
+ phpdbg_create_recursive_watchpoint(watch);
}
}
}
@@ -774,7 +772,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
}
}
-int phpdbg_print_changed_zvals(TSRMLS_D) {
+int phpdbg_print_changed_zvals(void) {
zend_llist_position pos;
phpdbg_watch_memdump **dump;
int ret;
@@ -786,7 +784,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) {
dump = (phpdbg_watch_memdump **) zend_llist_get_last_ex(&PHPDBG_G(watchlist_mem), &pos);
do {
- phpdbg_print_changed_zval(*dump TSRMLS_CC);
+ phpdbg_print_changed_zval(*dump);
} while ((dump = (phpdbg_watch_memdump **) zend_llist_get_prev_ex(&PHPDBG_G(watchlist_mem), &pos)));
zend_llist_clean(&PHPDBG_G(watchlist_mem));
@@ -797,7 +795,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) {
return ret;
}
-void phpdbg_list_watchpoints(TSRMLS_D) {
+void phpdbg_list_watchpoints(void) {
phpdbg_watchpoint_t *watch;
phpdbg_xml("<watchlist %r>");
@@ -811,7 +809,6 @@ void phpdbg_list_watchpoints(TSRMLS_D) {
void phpdbg_watch_efree(void *ptr) {
phpdbg_btree_result *result;
- TSRMLS_FETCH();
result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong) ptr);
@@ -820,7 +817,7 @@ void phpdbg_watch_efree(void *ptr) {
if ((size_t) watch->addr.ptr + watch->size > (size_t) ptr) {
if (watch->type == WATCH_ON_ZVAL) {
- phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC);
+ phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv));
}
zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}
diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h
index 35cab10dc1..8bee00261c 100644
--- a/sapi/phpdbg/phpdbg_watch.h
+++ b/sapi/phpdbg/phpdbg_watch.h
@@ -80,23 +80,23 @@ typedef struct {
HashTable watches;
} phpdbg_watch_collision;
-void phpdbg_setup_watchpoints(TSRMLS_D);
+void phpdbg_setup_watchpoints(void);
#ifndef _WIN32
-int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC);
+int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context);
#else
-int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC);
+int phpdbg_watchpoint_segfault_handler(void *addr);
#endif
void phpdbg_create_addr_watchpoint(void *addr, size_t size, phpdbg_watchpoint_t *watch);
void phpdbg_create_zval_watchpoint(zval *zv, phpdbg_watchpoint_t *watch);
-int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC);
-int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC);
+int phpdbg_delete_var_watchpoint(char *input, size_t len);
+int phpdbg_create_var_watchpoint(char *input, size_t len);
-int phpdbg_print_changed_zvals(TSRMLS_D);
+int phpdbg_print_changed_zvals(void);
-void phpdbg_list_watchpoints(TSRMLS_D);
+void phpdbg_list_watchpoints(void);
void phpdbg_watch_efree(void *ptr);
diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.c b/sapi/phpdbg/phpdbg_webdata_transfer.c
index 5ce6759062..258c8cf09f 100644
--- a/sapi/phpdbg/phpdbg_webdata_transfer.c
+++ b/sapi/phpdbg/phpdbg_webdata_transfer.c
@@ -19,15 +19,15 @@
#include "phpdbg_webdata_transfer.h"
#include "ext/standard/php_var.h"
-static int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) {
+static int phpdbg_is_auto_global(char *name, int len) {
int ret;
zend_string *str = zend_string_init(name, len, 0);
- ret = zend_is_auto_global(str TSRMLS_CC);
+ ret = zend_is_auto_global(str);
efree(str);
return ret;
}
-PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) {
+PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len) {
zval array;
HashTable *ht;
zval zv[9] = {{{0}}};
@@ -37,11 +37,11 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) {
/* fetch superglobals */
{
- phpdbg_is_auto_global(ZEND_STRL("GLOBALS") TSRMLS_CC);
+ phpdbg_is_auto_global(ZEND_STRL("GLOBALS"));
/* might be JIT */
- phpdbg_is_auto_global(ZEND_STRL("_ENV") TSRMLS_CC);
- phpdbg_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC);
- phpdbg_is_auto_global(ZEND_STRL("_REQUEST") TSRMLS_CC);
+ phpdbg_is_auto_global(ZEND_STRL("_ENV"));
+ phpdbg_is_auto_global(ZEND_STRL("_SERVER"));
+ phpdbg_is_auto_global(ZEND_STRL("_REQUEST"));
array_init(&zv[1]);
zend_hash_copy(Z_ARRVAL(zv[1]), &EG(symbol_table).ht, NULL);
Z_ARRVAL(zv[1])->pDestructor = NULL; /* we're operating on a copy! Don't double free zvals */
@@ -165,7 +165,7 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) {
smart_str buf = {0};
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, &array, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &array, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
*msg = buf.s->val;
*len = buf.s->len;
diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.h b/sapi/phpdbg/phpdbg_webdata_transfer.h
index d70175ad99..f4edae9b3f 100644
--- a/sapi/phpdbg/phpdbg_webdata_transfer.h
+++ b/sapi/phpdbg/phpdbg_webdata_transfer.h
@@ -22,6 +22,6 @@
#include "zend.h"
#include "phpdbg.h"
-PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC);
+PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len);
#endif /* PHPDBG_WEBDATA_TRANSFER_H */
diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c
index b0cbdf267a..5ad99cb0ef 100644
--- a/sapi/phpdbg/phpdbg_win.c
+++ b/sapi/phpdbg/phpdbg_win.c
@@ -31,9 +31,8 @@ int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) {
CONTEXT *xc = xp->ContextRecord;
if(xr->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
- TSRMLS_FETCH();
-
- if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1] TSRMLS_CC) == SUCCESS) {
+
+ if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) {
return EXCEPTION_CONTINUE_EXECUTION;
}
}
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index ba8dfe3838..81c17c3c49 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -53,7 +53,7 @@ php_phttpd_startup(sapi_module_struct *sapi_module)
}
static int
-php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+php_phttpd_sapi_ub_write(const char *str, uint str_length)
{
int sent_bytes;
@@ -67,7 +67,7 @@ php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
}
static int
-php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content;
char *p;
@@ -94,7 +94,7 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
}
static int
-php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
if (SG(sapi_headers).send_default_content_type) {
fd_printf(PHG(cip)->fd,"Content-Type: text/html\n");
@@ -106,7 +106,7 @@ php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
static char *
-php_phttpd_sapi_read_cookies(TSRMLS_D)
+php_phttpd_sapi_read_cookies(void)
{
/*
@@ -126,7 +126,7 @@ php_phttpd_sapi_read_cookies(TSRMLS_D)
}
static int
-php_phttpd_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
+php_phttpd_sapi_read_post(char *buf, uint count_bytes)
{
/*
uint max_read;
@@ -181,7 +181,7 @@ static sapi_module_struct phttpd_sapi_module = {
};
static void
-php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC)
+php_phttpd_request_ctor(void)
{
memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */
@@ -232,19 +232,19 @@ php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC)
}
static void
-php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC)
+php_phttpd_request_dtor(void)
{
free(SG(request_info).path_translated);
}
-int php_doit(TSRMLS_D)
+int php_doit(void)
{
struct stat sb;
zend_file_handle file_handle;
struct httpinfo *hip = PHG(cip)->hip;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return -1;
}
@@ -253,9 +253,9 @@ int php_doit(TSRMLS_D)
file_handle.free_filename = 0;
/*
- php_phttpd_hash_environment(TSRMLS_C);
+ php_phttpd_hash_environment();
*/
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
return SG(sapi_headers).http_response_code;
@@ -281,16 +281,15 @@ int pm_request(struct connectioninfo *cip)
{
struct httpinfo *hip = cip->hip;
int status;
- TSRMLS_FETCH();
if (strcasecmp(hip->method, "GET") == 0 ||
strcasecmp(hip->method, "HEAD") == 0 ||
strcasecmp(hip->method, "POST") == 0) {
PHG(cip) = cip;
- php_phttpd_request_ctor(TSRMLS_C);
- status = php_doit(TSRMLS_C);
- php_phttpd_request_dtor(TSRMLS_C);
+ php_phttpd_request_ctor();
+ status = php_doit();
+ php_phttpd_request_dtor();
return status;
} else {
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index d92526cf5e..cabd3c19a9 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -120,7 +120,7 @@ static zend_module_entry php_pi3web_module = {
};
-static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int zend_pi3web_ub_write(const char *str, uint str_length)
{
DWORD num_bytes = str_length;
LPCONTROL_BLOCK cb;
@@ -136,19 +136,19 @@ static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC)
}
-static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers)
{
return SAPI_HEADER_ADD;
}
-static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC)
+static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length)
{
*total_length += sapi_header->header_len+2;
}
-static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC)
+static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr)
{
memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len);
*combined_headers_ptr += sapi_header->header_len;
@@ -159,7 +159,7 @@ static void concat_header(sapi_header_struct *sapi_header, char **combined_heade
}
-static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers)
{
uint total_length = 2; /* account for the trailing \r\n */
char *combined_headers, *combined_headers_ptr;
@@ -170,19 +170,19 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
if (SG(sapi_headers).send_default_content_type) {
- sapi_get_default_content_type_header(&default_content_type TSRMLS_CC);
- accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC);
+ sapi_get_default_content_type_header(&default_content_type);
+ accumulate_header_length(&default_content_type, (void *) &total_length);
}
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length);
/* Generate headers */
combined_headers = (char *) emalloc(total_length+1);
combined_headers_ptr = combined_headers;
if (SG(sapi_headers).send_default_content_type) {
- concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC);
+ concat_header(&default_content_type, (void *) &combined_headers_ptr);
sapi_free_header(&default_content_type); /* we no longer need it */
}
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr);
*combined_headers_ptr++ = '\r';
*combined_headers_ptr++ = '\n';
*combined_headers_ptr = 0;
@@ -209,7 +209,7 @@ static int php_pi3web_startup(sapi_module_struct *sapi_module)
}
-static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_pi3web_read_post(char *buffer, uint count_bytes)
{
LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context);
DWORD read_from_buf=0;
@@ -242,7 +242,7 @@ static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC)
}
-static char *sapi_pi3web_read_cookies(TSRMLS_D)
+static char *sapi_pi3web_read_cookies(void)
{
LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context);
char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE];
@@ -263,7 +263,7 @@ static char *sapi_pi3web_read_cookies(TSRMLS_D)
return NULL;
}
-static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC)
+static void init_request_info(LPCONTROL_BLOCK lpCB)
{
SG(server_context) = lpCB;
SG(request_info).request_method = lpCB->lpszMethod;
@@ -277,7 +277,7 @@ static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC)
SG(sapi_headers).http_response_code = 200;
}
-static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_pi3web_register_variables(zval *track_vars_array)
{
char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE];
char *variable_buf;
@@ -296,11 +296,11 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, static_variable_buf, &variable_len)
&& (variable_len > 1)) {
- php_register_variable(pKey, static_variable_buf, track_vars_array TSRMLS_CC);
+ php_register_variable(pKey, static_variable_buf, track_vars_array);
} else if (PIPlatform_getLastError()==PIAPI_EINVAL) {
variable_buf = (char *) emalloc(variable_len);
if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)) {
- php_register_variable(pKey, variable_buf, track_vars_array TSRMLS_CC);
+ php_register_variable(pKey, variable_buf, track_vars_array);
}
efree(variable_buf);
}
@@ -312,7 +312,7 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
variable_len = PI3WEB_SERVER_VAR_BUF_SIZE;
if (lpCB->GetServerVariable(lpCB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len)
&& (variable_len > 1)) {
- php_register_variable("PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", static_variable_buf, track_vars_array);
}
}
@@ -346,7 +346,6 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB)
{
zend_file_handle file_handle = {0};
int iRet = PIAPI_COMPLETED;
- TSRMLS_FETCH();
zend_first_try {
file_handle.filename = lpCB->lpszFileName;
@@ -354,20 +353,20 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB)
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
- init_request_info(lpCB TSRMLS_CC);
- php_request_startup(TSRMLS_C);
+ init_request_info(lpCB);
+ php_request_startup();
switch ( lpCB->dwBehavior ) {
case PHP_MODE_STANDARD:
- iRet = ( php_execute_script( &file_handle TSRMLS_CC ) ) ?
+ iRet = ( php_execute_script( &file_handle ) ) ?
PIAPI_COMPLETED : PIAPI_ERROR;
break;
case PHP_MODE_HIGHLIGHT: {
zend_syntax_highlighter_ini syntax_highlighter_ini;
- if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
+ if ( open_file_for_scanning( &file_handle ) == SUCCESS )
{
php_get_highlight_struct( &syntax_highlighter_ini );
- zend_highlight( &syntax_highlighter_ini TSRMLS_CC );
+ zend_highlight( &syntax_highlighter_ini );
}
else
{
@@ -381,11 +380,11 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB)
ctr.line = "Content-Type: text/plain";
ctr.line_len = strlen(ctr.line);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
- if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
+ if ( open_file_for_scanning( &file_handle ) == SUCCESS )
{
- zend_indent(TSRMLS_C);
+ zend_indent();
}
else
{
@@ -393,7 +392,7 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB)
};
break;
case PHP_MODE_LINT:
- iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ?
+ iRet = (php_lint_script(&file_handle) == SUCCESS) ?
PIAPI_COMPLETED : PIAPI_ERROR;
break;
default:
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index 756f7353e9..35ae0201dc 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -211,7 +211,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
*/
static int
-php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
+php_roxen_low_ub_write(const char *str, uint str_length) {
int sent_bytes = 0;
struct pike_string *to_write = NULL;
#ifdef ROXEN_USE_ZTS
@@ -242,7 +242,7 @@ php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
*/
static int
-php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
+php_roxen_sapi_ub_write(const char *str, uint str_length)
{
#ifdef ROXEN_USE_ZTS
GET_THIS();
@@ -274,7 +274,7 @@ php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
}
}
} else {
- THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC),
+ THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length),
"write");
}
return sent_bytes;
@@ -324,7 +324,7 @@ static void php_roxen_set_header(char *header_name, char *value, char *p)
*/
static int
php_roxen_sapi_header_handler(sapi_header_struct *sapi_header,
- sapi_headers_struct *sapi_headers TSRMLS_DC)
+ sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
header_name = sapi_header->header;
@@ -346,7 +346,7 @@ php_roxen_sapi_header_handler(sapi_header_struct *sapi_header,
*/
static int
-php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_roxen_low_send_headers(sapi_headers_struct *sapi_headers)
{
struct pike_string *ind;
struct svalue *s_headermap;
@@ -375,10 +375,10 @@ php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
}
static int
-php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers)
{
int res = 0;
- THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers TSRMLS_CC), "send headers");
+ THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers), "send headers");
return res;
}
@@ -387,7 +387,7 @@ php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
+INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes)
{
uint total_read = 0;
#ifdef ROXEN_USE_ZTS
@@ -413,10 +413,10 @@ INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
}
static int
-php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
+php_roxen_sapi_read_post(char *buf, uint count_bytes)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
+ THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post");
return total_read;
}
@@ -426,7 +426,7 @@ php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
*/
static char *
-php_roxen_sapi_read_cookies(TSRMLS_D)
+php_roxen_sapi_read_cookies(void)
{
char *cookies;
cookies = lookup_string_header("HTTP_COOKIE", NULL);
@@ -520,7 +520,7 @@ static sapi_module_struct roxen_sapi_module = {
&zvalue, sizeof(zval *), NULL)
static void
-php_roxen_hash_environment(TSRMLS_D)
+php_roxen_hash_environment(void)
{
int i;
char buf[512];
@@ -570,7 +570,7 @@ php_roxen_hash_environment(TSRMLS_D)
* "executes" the script
*/
-static int php_roxen_module_main(TSRMLS_D)
+static int php_roxen_module_main(void)
{
int res, len;
char *dir;
@@ -585,14 +585,14 @@ static int php_roxen_module_main(TSRMLS_D)
file_handle.opened_path = NULL;
THREADS_ALLOW();
- res = php_request_startup(TSRMLS_C);
+ res = php_request_startup();
THREADS_DISALLOW();
if(res == FAILURE) {
return 0;
}
- php_roxen_hash_environment(TSRMLS_C);
+ php_roxen_hash_environment();
THREADS_ALLOW();
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
THREADS_DISALLOW();
return 1;
@@ -613,8 +613,7 @@ void f_php_roxen_request_handler(INT32 args)
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
- TSRMLS_FETCH();
-
+
if(current_thread == th_self())
php_error(E_WARNING, "PHP7.Interpreter->run: Tried to run a PHP-script from a PHP "
"callback!");
@@ -662,7 +661,7 @@ void f_php_roxen_request_handler(INT32 args)
} else
THIS->my_fd = 0;
- status = php_roxen_module_main(TSRMLS_C);
+ status = php_roxen_module_main();
current_thread = -1;
apply_svalue(done_callback, 0);
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 7c03454f58..3d2e24b3d6 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -64,7 +64,7 @@ static php_thttpd_globals thttpd_globals;
#define TG(v) (thttpd_globals.v)
#endif
-static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_thttpd_ub_write(const char *str, uint str_length)
{
int n;
uint sent = 0;
@@ -103,7 +103,7 @@ static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC)
# endif
#endif
-static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC)
+static int do_writev(struct iovec *vec, int nvec, int len)
{
int n;
@@ -170,7 +170,7 @@ static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC)
#define KA_NO "Connection: close\r\n"
#define DEF_CT "Content-Type: text/html\r\n"
-static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers)
{
char buf[1024], *p;
VEC_BASE();
@@ -211,7 +211,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
ADD_VEC(h->header, h->header_len);
#ifndef SERIALIZE_HEADERS
if (n >= COMBINE_HEADERS - 1) {
- len = do_writev(vec, n, len TSRMLS_CC);
+ len = do_writev(vec, n, len);
n = 0;
}
#endif
@@ -230,9 +230,9 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
ADD_VEC("\r\n", 2);
#ifdef SERIALIZE_HEADERS
- sapi_thttpd_ub_write(vec_str.c, vec_str.len TSRMLS_CC);
+ sapi_thttpd_ub_write(vec_str.c, vec_str.len);
#else
- do_writev(vec, n, len TSRMLS_CC);
+ do_writev(vec, n, len);
#endif
VEC_FREE();
@@ -245,7 +245,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
#define CONSUME_BYTES(n) do { TG(hc)->checked_idx += (n); } while (0)
-static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_thttpd_read_post(char *buffer, uint count_bytes)
{
size_t read_bytes = 0;
@@ -259,32 +259,32 @@ static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC)
return read_bytes;
}
-static char *sapi_thttpd_read_cookies(TSRMLS_D)
+static char *sapi_thttpd_read_cookies(void)
{
return TG(hc)->cookie;
}
#define BUF_SIZE 512
#define ADD_STRING_EX(name,buf) \
- php_register_variable(name, buf, track_vars_array TSRMLS_CC)
+ php_register_variable(name, buf, track_vars_array)
#define ADD_STRING(name) ADD_STRING_EX((name), buf)
-static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_thttpd_register_variables(zval *track_vars_array)
{
char buf[BUF_SIZE + 1];
char *p;
- php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC);
- php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC);
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC);
- php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC);
- php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC);
- php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array);
+ php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array);
+ php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array);
+ php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array);
+ php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array);
if (TG(hc)->one_one) {
- php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array);
} else {
- php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array TSRMLS_CC);
+ php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array);
}
p = httpd_ntoa(&TG(hc)->client_addr);
@@ -306,7 +306,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
#define CONDADD(name, field) \
if (TG(hc)->field[0]) { \
- php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \
+ php_register_variable(#name, TG(hc)->field, track_vars_array); \
}
CONDADD(QUERY_STRING, query);
@@ -328,7 +328,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
}
if (TG(hc)->authorization[0])
- php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC);
+ php_register_variable("AUTH_TYPE", "Basic", track_vars_array);
}
static PHP_MINIT_FUNCTION(thttpd)
@@ -349,12 +349,12 @@ static zend_module_entry php_thttpd_module = {
STANDARD_MODULE_PROPERTIES
};
-static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC)
+static int php_thttpd_startup(sapi_module_struct *sapi_module)
{
#if PHP_API_VERSION >= 20020918
if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) {
#else
- /* No TSRMLS_CC here to zend_startup_module() as 5.6 and older does not have that parameter */
+ /* No here to zend_startup_module() as 5.6 and older does not have that parameter */
if (php_module_startup(sapi_module) == FAILURE
|| zend_startup_module(&php_thttpd_module) == FAILURE) {
#endif
@@ -363,7 +363,7 @@ static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC)
return SUCCESS;
}
-static int sapi_thttpd_get_fd(int *nfd TSRMLS_DC)
+static int sapi_thttpd_get_fd(int *nfd)
{
if (nfd) *nfd = TG(hc)->conn_fd;
return SUCCESS;
@@ -408,11 +408,11 @@ static sapi_module_struct thttpd_sapi_module = {
sapi_thttpd_get_fd
};
-static void thttpd_module_main(int show_source TSRMLS_DC)
+static void thttpd_module_main(int show_source)
{
zend_file_handle file_handle;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return;
}
@@ -420,20 +420,20 @@ static void thttpd_module_main(int show_source TSRMLS_DC)
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else {
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
}
php_request_shutdown(NULL);
}
-static void thttpd_request_ctor(TSRMLS_D)
+static void thttpd_request_ctor(void)
{
smart_str s = {0};
@@ -463,10 +463,10 @@ static void thttpd_request_ctor(TSRMLS_D)
TG(unconsumed_length) = SG(request_info).content_length;
- php_handle_auth_data(TG(hc)->authorization TSRMLS_CC);
+ php_handle_auth_data(TG(hc)->authorization);
}
-static void thttpd_request_dtor(TSRMLS_D)
+static void thttpd_request_dtor(void)
{
smart_str_free(&TG(sbuf));
if (SG(request_info).query_string)
@@ -596,7 +596,7 @@ static void queue_request(httpd_conn *hc)
tsrm_mutex_unlock(qr_lock);
}
-static off_t thttpd_real_php_request(httpd_conn *hc, int TSRMLS_DC);
+static off_t thttpd_real_php_request(httpd_conn *hc, int);
static void *worker_thread(void *dummy)
{
@@ -615,7 +615,7 @@ static void *worker_thread(void *dummy)
thread_atomic_dec(nr_free_threads);
- thttpd_real_php_request(hc, 0 TSRMLS_CC);
+ thttpd_real_php_request(hc, 0);
shutdown(hc->conn_fd, 0);
destroy_conn(hc);
free(hc);
@@ -654,7 +654,7 @@ static void remove_dead_conn(int fd)
#endif
-static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC)
+static off_t thttpd_real_php_request(httpd_conn *hc, int show_source)
{
TG(hc) = hc;
hc->bytes_sent = 0;
@@ -670,9 +670,9 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC)
return 0;
}
- thttpd_request_ctor(TSRMLS_C);
+ thttpd_request_ctor();
- thttpd_module_main(show_source TSRMLS_CC);
+ thttpd_module_main(show_source);
/* disable kl, if no content-length was seen or Connection: was set */
if (TG(seen_cl) == 0 || TG(seen_cn) == 1) {
@@ -692,7 +692,7 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC)
TG(sbuf).a = 0;
}
- thttpd_request_dtor(TSRMLS_C);
+ thttpd_request_dtor();
return 0;
}
@@ -702,32 +702,27 @@ off_t thttpd_php_request(httpd_conn *hc, int show_source)
#ifdef ZTS
queue_request(hc);
#else
- TSRMLS_FETCH();
- return thttpd_real_php_request(hc, show_source TSRMLS_CC);
+ return thttpd_real_php_request(hc, show_source);
#endif
}
void thttpd_register_on_close(void (*arg)(int))
{
- TSRMLS_FETCH();
TG(on_close) = arg;
}
void thttpd_closed_conn(int fd)
{
- TSRMLS_FETCH();
if (TG(on_close)) TG(on_close)(fd);
}
int thttpd_get_fd(void)
{
- TSRMLS_FETCH();
return TG(hc)->conn_fd;
}
void thttpd_set_dont_close(void)
{
- TSRMLS_FETCH();
#ifndef PREMIUM_THTTPD
TG(hc)->file_address = (char *) 1;
#endif
@@ -753,15 +748,13 @@ void thttpd_php_init(void)
thttpd_sapi_module.startup(&thttpd_sapi_module);
{
- TSRMLS_FETCH();
-
+
SG(server_context) = (void *) 1;
}
}
void thttpd_php_shutdown(void)
{
- TSRMLS_FETCH();
if (SG(server_context) != NULL) {
thttpd_sapi_module.shutdown(&thttpd_sapi_module);
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 783fe852bc..8af7da40fa 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -49,7 +49,7 @@ static php_tux_globals tux_globals;
#define TG(v) (tux_globals.v)
-static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_tux_ub_write(const char *str, uint str_length)
{
int n;
int m;
@@ -96,7 +96,7 @@ static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC)
return n;
}
-static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
{
char buf[1024];
struct iovec *vec;
@@ -157,7 +157,7 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
-static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_tux_read_post(char *buffer, uint count_bytes)
{
#if 0
int amount = 0;
@@ -175,16 +175,16 @@ static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC)
#endif
}
-static char *sapi_tux_read_cookies(TSRMLS_D)
+static char *sapi_tux_read_cookies(void)
{
return TG(req)->cookies;
}
#define BUF_SIZE 512
#define ADD_STRING(name) \
- php_register_variable(name, buf, track_vars_array TSRMLS_CC)
+ php_register_variable(name, buf, track_vars_array)
-static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_tux_register_variables(zval *track_vars_array)
{
char buf[BUF_SIZE + 1];
char *p;
@@ -192,16 +192,16 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC)
ctr.line = buf;
ctr.line_len = slprintf(buf, sizeof(buf), "Server: %s", TUXAPI_version);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
- php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC);
- php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC);
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC);
- php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC);
- php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array TSRMLS_CC);
- php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array TSRMLS_CC);
- php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC);
- php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array);
+ php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array);
+ php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array);
+ php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array);
+ php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array);
+ php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array);
+ php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array);
p = inet_ntoa(TG(req)->client_host);
/* string representation of IPs are never larger than 512 bytes */
@@ -224,7 +224,7 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC)
#define CONDADD(name, field) \
if (TG(req)->field[0]) { \
- php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC); \
+ php_register_variable(#name, TG(req)->field, track_vars_array); \
}
CONDADD(HTTP_REFERER, referer);
@@ -244,7 +244,7 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC)
#if 0
if (TG(hc)->authorization[0])
- php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC);
+ php_register_variable("AUTH_TYPE", "Basic", track_vars_array);
#endif
}
@@ -289,7 +289,7 @@ static sapi_module_struct tux_sapi_module = {
STANDARD_SAPI_MODULE_PROPERTIES
};
-static void tux_module_main(TSRMLS_D)
+static void tux_module_main(void)
{
zend_file_handle file_handle;
@@ -298,15 +298,15 @@ static void tux_module_main(TSRMLS_D)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return;
}
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
}
-static void tux_request_ctor(TSRMLS_D)
+static void tux_request_ctor(void)
{
char buf[1024];
int offset;
@@ -340,11 +340,11 @@ static void tux_request_ctor(TSRMLS_D)
SG(request_info).content_length = 0; /* TG(req)->contentlength; */
#if 0
- php_handle_auth_data(TG(hc)->authorization TSRMLS_CC);
+ php_handle_auth_data(TG(hc)->authorization);
#endif
}
-static void tux_request_dtor(TSRMLS_D)
+static void tux_request_dtor(void)
{
if (TG(header_vec)) {
/* free status_line */
@@ -381,7 +381,6 @@ static void *separate_thread(void *bla)
int TUXAPI_handle_events(user_req_t *req)
{
- TSRMLS_FETCH();
if (req->event == PHP_TUX_BACKGROUND_CONN) {
tux_closed_conn(req->sock);
@@ -391,11 +390,11 @@ int TUXAPI_handle_events(user_req_t *req)
TG(req) = req;
TG(tux_action) = TUX_ACTION_FINISH_CLOSE_REQ;
- tux_request_ctor(TSRMLS_C);
+ tux_request_ctor();
- tux_module_main(TSRMLS_C);
+ tux_module_main();
- tux_request_dtor(TSRMLS_C);
+ tux_request_dtor();
return tux(TG(tux_action), req);
}
@@ -407,21 +406,18 @@ void tux_register_on_close(void (*arg)(int))
void tux_closed_conn(int fd)
{
- TSRMLS_FETCH();
if (TG(on_close)) TG(on_close)(fd);
}
int tux_get_fd(void)
{
- TSRMLS_FETCH();
return TG(req)->sock;
}
void tux_set_dont_close(void)
{
- TSRMLS_FETCH();
TG(req)->event = PHP_TUX_BACKGROUND_CONN;
tux(TUX_ACTION_POSTPONE_REQ, TG(req));
diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c
index 2978131ac1..914855928a 100644
--- a/sapi/webjames/webjames.c
+++ b/sapi/webjames/webjames.c
@@ -39,7 +39,7 @@ static php_webjames_globals webjames_globals;
#define WG(v) (webjames_globals.v)
-static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_webjames_ub_write(const char *str, uint str_length)
/*unbuffered write - send data straight out to socket*/
{
int totalbytes = 0;
@@ -61,7 +61,7 @@ static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC)
return totalbytes;
}
-static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
+static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context)
/*send an HTTP header*/
{
char *header = sapi_header->header;
@@ -84,7 +84,7 @@ static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *ser
}
}
-static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_webjames_read_post(char *buffer, uint count_bytes)
/*read some of the post data*/
{
if (WG(conn)->body==NULL) return 0;
@@ -94,26 +94,26 @@ static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC)
return count_bytes;
}
-static char *sapi_webjames_read_cookies(TSRMLS_D)
+static char *sapi_webjames_read_cookies(void)
{
return WG(conn)->cookie;
}
#define BUF_SIZE 512
#define ADD_STRING(name,string)\
- php_register_variable(name, string, track_vars_array TSRMLS_CC)
+ php_register_variable(name, string, track_vars_array)
#define ADD_NUM(name,field) {\
snprintf(buf, BUF_SIZE, "%d", WG(conn)->field);\
- php_register_variable(name, buf, track_vars_array TSRMLS_CC);\
+ php_register_variable(name, buf, track_vars_array);\
}
#define ADD_FIELD(name, field) \
if (WG(conn)->field) { \
- php_register_variable(name, WG(conn)->field, track_vars_array TSRMLS_CC); \
+ php_register_variable(name, WG(conn)->field, track_vars_array); \
}
-static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_webjames_register_variables(zval *track_vars_array)
{
char buf[BUF_SIZE + 1];
char *docroot;
@@ -163,7 +163,7 @@ static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC)
ADD_FIELD("HTTP_ACCEPT_ENCODING", acceptencoding);
}
-static void webjames_module_main(TSRMLS_D)
+static void webjames_module_main(void)
{
zend_file_handle file_handle;
FILE *fp=NULL;
@@ -208,18 +208,17 @@ static void webjames_module_main(TSRMLS_D)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return;
}
- php_execute_script(&file_handle TSRMLS_CC);
+ php_execute_script(&file_handle);
php_request_shutdown(NULL);
}
static void webjames_php_close(struct connection *conn, int force)
/*called by webjames if it wants to close the connection*/
{
- TSRMLS_FETCH();
php_request_shutdown(NULL);
WG(oldclose)(conn,force);
@@ -228,14 +227,13 @@ static void webjames_php_close(struct connection *conn, int force)
void webjames_php_request(struct connection *conn)
/*called by WebJames to start handler*/
{
- TSRMLS_FETCH();
WG(conn) = conn;
WG(bodyread) = 0;
WG(oldclose) = conn->close;
conn->close=webjames_php_close;
- webjames_module_main(TSRMLS_C);
+ webjames_module_main();
WG(oldclose)(WG(conn), 0);
}
@@ -309,7 +307,6 @@ static sapi_module_struct sapi_module = {
int webjames_php_init(void)
/*called when WebJames initialises*/
{
- TSRMLS_FETCH();
if (strcmp(configuration.webjames_h_revision,WEBJAMES_H_REVISION)!=0) {
/*This file was compiled against a different revision of
webjames.h than webjames was, which could be bad news*/
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 574d8e274b..6b06cfead0 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -132,6 +132,8 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c \
zend_inheritance.c");
+ADD_FLAG("CFLAGS_BD_ZEND", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+
/* XXX inspect this for other toolsets */
if (VS_TOOLSET && VCVERS == 1200) {
AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
@@ -141,6 +143,7 @@ ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
php_open_temporary_file.c output.c internal_functions.c php_sprintf.c");
+ADD_FLAG("CFLAGS_BD_MAIN", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c");
// Newer versions have it
@@ -153,10 +156,13 @@ if (VS_TOOLSET && VCVERS >= 1400 || !VS_TOOLSET) {
ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \
userspace.c transports.c xp_socket.c mmap.c glob_wrapper.c");
+ADD_FLAG("CFLAGS_BD_MAIN_STREAMS", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("win32", "glob.c readdir.c \
registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c");
+ADD_FLAG("CFLAGS_BD_WIN32", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+
PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/");
STDOUT.WriteBlankLines(1);
diff --git a/win32/globals.c b/win32/globals.c
index ec4180db38..8eff286995 100644
--- a/win32/globals.c
+++ b/win32/globals.c
@@ -28,13 +28,13 @@ PHPAPI int php_win32_core_globals_id;
php_win32_core_globals the_php_win32_core_globals;
#endif
-void php_win32_core_globals_ctor(void *vg TSRMLS_DC)
+void php_win32_core_globals_ctor(void *vg)
{
php_win32_core_globals *wg = (php_win32_core_globals*)vg;
memset(wg, 0, sizeof(*wg));
}
-void php_win32_core_globals_dtor(void *vg TSRMLS_DC)
+void php_win32_core_globals_dtor(void *vg)
{
php_win32_core_globals *wg = (php_win32_core_globals*)vg;
diff --git a/win32/php_registry.h b/win32/php_registry.h
index 2b111dbb8b..bce2fe0978 100644
--- a/win32/php_registry.h
+++ b/win32/php_registry.h
@@ -2,7 +2,7 @@
#define PHP_REGISTRY_H
-void UpdateIniFromRegistry(char *path TSRMLS_DC);
+void UpdateIniFromRegistry(char *path);
char *GetIniPathFromRegistry();
#endif /* PHP_REGISTRY_H */
diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h
index 42f5ec9411..4341a99959 100644
--- a/win32/php_win32_globals.h
+++ b/win32/php_win32_globals.h
@@ -26,7 +26,7 @@
typedef struct _php_win32_core_globals php_win32_core_globals;
#ifdef ZTS
-# define PW32G(v) TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v)
+# define PW32G(v) ZEND_TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v)
extern PHPAPI int php_win32_core_globals_id;
#else
# define PW32G(v) (the_php_win32_core_globals.v)
@@ -43,8 +43,8 @@ struct _php_win32_core_globals {
HashTable *registry_directories;
};
-void php_win32_core_globals_ctor(void *vg TSRMLS_DC);
-void php_win32_core_globals_dtor(void *vg TSRMLS_DC);
+void php_win32_core_globals_ctor(void *vg);
+void php_win32_core_globals_dtor(void *vg);
PHP_RSHUTDOWN_FUNCTION(win32_core_globals);
#endif
diff --git a/win32/readdir.c b/win32/readdir.c
index 4e5992167c..15e145bafa 100644
--- a/win32/readdir.c
+++ b/win32/readdir.c
@@ -26,7 +26,6 @@ DIR *opendir(const char *dir)
HANDLE handle;
int index;
char resolved_path_buff[MAXPATHLEN];
- TSRMLS_FETCH();
if (!VCWD_REALPATH(dir, resolved_path_buff)) {
return NULL;
diff --git a/win32/registry.c b/win32/registry.c
index ef36c14555..da21c7d942 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -155,7 +155,7 @@ static void delete_internal_hashtable(zval *zv)
#define RegNotifyFlags (REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET)
-void UpdateIniFromRegistry(char *path TSRMLS_DC)
+void UpdateIniFromRegistry(char *path)
{
char *p, *orig_path;
int path_len;
diff --git a/win32/sendmail.c b/win32/sendmail.c
index a88323722d..db31d7d0e4 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -151,7 +151,7 @@ static char *ErrorMessages[] =
* Returns NULL on error, or the new char* buffer on success.
* You have to take care and efree() the buffer on your own.
*/
-static zend_string *php_win32_mail_trim_header(char *header TSRMLS_DC)
+static zend_string *php_win32_mail_trim_header(char *header)
{
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
@@ -167,14 +167,14 @@ static zend_string *php_win32_mail_trim_header(char *header TSRMLS_DC)
ZVAL_STRINGL(&replace, PHP_WIN32_MAIL_UNIFY_REPLACE, strlen(PHP_WIN32_MAIL_UNIFY_REPLACE));
regex = zend_string_init(PHP_WIN32_MAIL_UNIFY_REPLACE, sizeof(PHP_WIN32_MAIL_UNIFY_REPLACE)-1, 0);
-//zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
+//zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count);
result = php_pcre_replace(regex,
header, (int)strlen(header),
&replace,
0,
-1,
- NULL TSRMLS_CC);
+ NULL);
if (NULL == result) {
zval_ptr_dtor(&replace);
@@ -190,7 +190,7 @@ static zend_string *php_win32_mail_trim_header(char *header TSRMLS_DC)
&replace,
0,
-1,
- NULL TSRMLS_CC);
+ NULL);
return result;
#else
/* In case we don't have PCRE support (for whatever reason...) simply do nothing and return the unmodified header */
@@ -213,7 +213,7 @@ static zend_string *php_win32_mail_trim_header(char *header TSRMLS_DC)
//********************************************************************/
PHPAPI int TSendMail(char *host, int *error, char **error_message,
char *headers, char *Subject, char *mailTo, char *data,
- char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC)
+ char *mailCc, char *mailBcc, char *mailRPath)
{
int ret;
char *RPath = NULL;
@@ -240,7 +240,7 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
zend_string *headers_trim;
/* Use PCRE to trim the header into the right format */
- if (NULL == (headers_trim = php_win32_mail_trim_header(headers TSRMLS_CC))) {
+ if (NULL == (headers_trim = php_win32_mail_trim_header(headers))) {
*error = W32_SM_PCRE_ERROR;
return FAILURE;
}
@@ -302,7 +302,7 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port"));
return FAILURE;
} else {
- ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc->val, error_message TSRMLS_CC);
+ ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc->val, error_message);
TSMClose();
if (RPath) {
efree(RPath);
@@ -383,7 +383,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
// History:
//*******************************************************************/
static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
- char *headers, char *headers_lc, char **error_message TSRMLS_DC)
+ char *headers, char *headers_lc, char **error_message)
{
int res;
char *p;
@@ -608,9 +608,9 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
/* send message header */
if (Subject == NULL) {
- res = PostHeader(RPath, "No Subject", mailTo, stripped_header TSRMLS_CC);
+ res = PostHeader(RPath, "No Subject", mailTo, stripped_header);
} else {
- res = PostHeader(RPath, Subject, mailTo, stripped_header TSRMLS_CC);
+ res = PostHeader(RPath, Subject, mailTo, stripped_header);
}
if (stripped_header) {
efree(stripped_header);
@@ -683,7 +683,7 @@ static int addToHeader(char **header_buffer, const char *specifier, char *string
// Author/Date: jcar 20/9/96
// History:
//********************************************************************/
-static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC)
+static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
{
/* Print message header according to RFC 822 */
/* Return-path, Received, Date, From, Subject, Sender, To, cc */
@@ -706,7 +706,7 @@ static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders T
if (!xheaders || !strstr(headers_lc, "date:")) {
time_t tNow = time(NULL);
- zend_string *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC);
+ zend_string *dt = php_format_date("r", 1, tNow, 1);
snprintf(header_buffer, MAIL_BUFFER_SIZE, "Date: %s\r\n", dt->val);
zend_string_free(dt);
diff --git a/win32/sendmail.h b/win32/sendmail.h
index 6fed77ea06..77d909ab1f 100644
--- a/win32/sendmail.h
+++ b/win32/sendmail.h
@@ -36,14 +36,14 @@
PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message,
char *RPath, char *Subject, char *mailTo, char *data,
- char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC);
+ char *mailCc, char *mailBcc, char *mailRPath);
PHPAPI void TSMClose(void);
static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
- char *headers, char *headers_lc, char **error_message TSRMLS_DC);
+ char *headers, char *headers_lc, char **error_message);
PHPAPI char *GetSMErrorText(int index);
static int MailConnect();
-static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC);
+static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders);
static int Post(LPCSTR msg);
static int Ack(char **server_response);
static unsigned long GetAddr(LPSTR szHost);
diff --git a/win32/wsyslog.c b/win32/wsyslog.c
index 75c5ef58e5..ff0293fd9d 100644
--- a/win32/wsyslog.c
+++ b/win32/wsyslog.c
@@ -61,7 +61,6 @@
void closelog(void)
{
- TSRMLS_FETCH();
if (PW32G(log_source)) {
DeregisterEventSource(PW32G(log_source));
PW32G(log_source) = NULL;
@@ -85,7 +84,6 @@ void syslog(int priority, const char *message, ...)
unsigned short etype;
char *tmp = NULL;
DWORD evid;
- TSRMLS_FETCH();
/* default event source */
if (!PW32G(log_source))
@@ -123,7 +121,6 @@ void syslog(int priority, const char *message, ...)
void openlog(const char *ident, int logopt, int facility)
{
- TSRMLS_FETCH();
if (PW32G(log_source)) {
closelog();